website/slides/2025-10-10-how-rust-compiles/reveal.js-mermaid-plugin_11-6-0.js
Noratrieb 0262ef8e42
Some checks failed
test / test (push) Has been cancelled
gaming
2025-09-22 17:26:08 +02:00

47 lines
2.5 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).RevealMermaid=e()}(this,(function(){"use strict";var t="11.6.0",e=Object.create,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,o=(t,e)=>r(t,"name",{value:e,configurable:!0}),l=(t,e)=>function(){return e||(0,t[i(t)[0]])((e={exports:{}}).exports,e),e.exports},h=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},u=(t,e,a,o)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let l of i(e))s.call(t,l)||l===a||r(t,l,{get:()=>e[l],enumerable:!(o=n(e,l))||o.enumerable});return t},d=(t,e,r)=>(u(t,e,"default"),r&&u(r,e,"default")),p=(t,n,i)=>(i=null!=t?e(a(t)):{},u(!n&&t&&t.__esModule?i:r(i,"default",{value:t,enumerable:!0}),t)),g=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs=n()}(t,(function(){var t=6e4,e=36e5,r="millisecond",n="second",i="minute",a="hour",s="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:o((function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}),"ordinal")},y=o((function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t}),"m"),v={s:y,z:o((function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")}),"z"),m:o((function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,c),a=r-i<0,s=e.clone().add(n+(a?-1:1),c);return+(-(n+(r-i)/(a?i-s:s-i))||0)}),"t"),a:o((function(t){return t<0?Math.ceil(t)||0:Math.floor(t)}),"a"),p:o((function(t){return{M:c,y:u,w:l,d:s,D:d,h:a,m:i,s:n,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")}),"p"),u:o((function(t){return void 0===t}),"u")},x="en",b={};b[x]=m;var w="$isDayjsObject",k=o((function(t){return t instanceof C||!(!t||!t[w])}),"S"),T=o((function t(e,r,n){var i;if(!e)return x;if("string"==typeof e){var a=e.toLowerCase();b[a]&&(i=a),r&&(b[a]=r,i=a);var s=e.split("-");if(!i&&s.length>1)return t(s[0])}else{var o=e.name;b[o]=e,i=o}return!n&&i&&(x=i),i||!n&&x}),"t"),_=o((function(t,e){if(k(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new C(r)}),"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}o(m,"M");var y=m.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,r=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 n=e.match(g);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[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 r=_(t);return this.startOf(e)<=r&&r<=this.endOf(e)},y.isAfter=function(t,e){return _(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<_(t)},y.$g=function(t,e,r){return E.u(t)?this[e]:this.set(r,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var r=this,h=!!E.u(e)||e,p=E.p(t),g=o((function(t,e){var n=E.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return h?n:n.endOf(s)}),"l"),f=o((function(t,e){return E.w(r.toDate()[t].apply(r.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(e)),r)}),"$"),m=this.$W,y=this.$M,v=this.$D,x="set"+(this.$u?"UTC":"");switch(p){case u:return h?g(1,0):g(31,11);case c:return h?g(1,y):g(0,y+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return g(h?v-w:v+(6-w),y);case s:case d:return f(x+"Hours",0);case a:return f(x+"Minutes",1);case i:return f(x+"Seconds",2);case n:return f(x+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var o,l=E.p(t),h="set"+(this.$u?"UTC":""),p=(o={},o[s]=h+"Date",o[d]=h+"Date",o[c]=h+"Month",o[u]=h+"FullYear",o[a]=h+"Hours",o[i]=h+"Minutes",o[n]=h+"Seconds",o[r]=h+"Milliseconds",o)[l],g=l===s?this.$D+(e-this.$W):e;if(l===c||l===u){var f=this.clone().set(d,1);f.$d[p](g),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](g);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[E.p(t)]()},y.add=function(r,h){var d,p=this;r=Number(r);var g=E.p(h),f=o((function(t){var e=_(p);return E.w(e.date(e.date()+Math.round(t*r)),p)}),"y");if(g===c)return this.set(c,this.$M+r);if(g===u)return this.set(u,this.$y+r);if(g===s)return f(1);if(g===l)return f(7);var m=(d={},d[i]=t,d[a]=e,d[n]=1e3,d)[g]||1,y=this.$d.getTime()+r*m;return E.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=E.z(this),a=this.$H,s=this.$m,l=this.$M,c=r.weekdays,h=r.months,u=r.meridiem,d=o((function(t,r,i,a){return t&&(t[r]||t(e,n))||i[r].slice(0,a)}),"h"),g=o((function(t){return E.s(a%12||12,t,"0")}),"d"),m=u||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(f,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return E.s(e.$y,4,"0");case"M":return l+1;case"MM":return E.s(l+1,2,"0");case"MMM":return d(r.monthsShort,l,h,3);case"MMMM":return d(h,l);case"D":return e.$D;case"DD":return E.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return d(r.weekdaysMin,e.$W,c,2);case"ddd":return d(r.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(a);case"HH":return E.s(a,2,"0");case"h":return g(1);case"hh":return g(2);case"a":return m(a,s,!0);case"A":return m(a,s,!1);case"m":return String(s);case"mm":return E.s(s,2,"0");case"s":return String(e.$s);case"ss":return E.s(e.$s,2,"0");case"SSS":return E.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(r,d,p){var g,f=this,m=E.p(d),y=_(r),v=(y.utcOffset()-this.utcOffset())*t,x=this-y,b=o((function(){return E.m(f,y)}),"D");switch(m){case u:g=b()/12;break;case c:g=b();break;case h:g=b()/3;break;case l:g=(x-v)/6048e5;break;case s:g=(x-v)/864e5;break;case a:g=x/e;break;case i:g=x/t;break;case n:g=x/1e3;break;default:g=x}return p?g:E.a(g)},y.daysInMonth=function(){return this.endOf(c).$D},y.$locale=function(){return b[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=T(t,e,!0);return n&&(r.$L=n),r},y.clone=function(){return E.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},m}(),S=C.prototype;return _.prototype=S,[["$ms",r],["$s",n],["$m",i],["$H",a],["$W",s],["$M",c],["$y",u],["$D",d]].forEach((function(t){S[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,C,_),t.$i=!0),_},_.locale=T,_.isDayjs=k,_.unix=function(t){return _(1e3*t)},_.en=b[x],_.Ls=b,_.p={},_}))}}),f=p(g(),1),m={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},y={trace:o(((...t)=>{}),"trace"),debug:o(((...t)=>{}),"debug"),info:o(((...t)=>{}),"info"),warn:o(((...t)=>{}),"warn"),error:o(((...t)=>{}),"error"),fatal:o(((...t)=>{}),"fatal")},v=o((function(t="fatal"){let e=m.fatal;"string"==typeof t?t.toLowerCase()in m&&(e=m[t]):"number"==typeof t&&(e=t),y.trace=()=>{},y.debug=()=>{},y.info=()=>{},y.warn=()=>{},y.error=()=>{},y.fatal=()=>{},e<=m.fatal&&(y.fatal=console.error?console.error.bind(console,x("FATAL"),"color: orange"):console.log.bind(console,"",x("FATAL"))),e<=m.error&&(y.error=console.error?console.error.bind(console,x("ERROR"),"color: orange"):console.log.bind(console,"",x("ERROR"))),e<=m.warn&&(y.warn=console.warn?console.warn.bind(console,x("WARN"),"color: orange"):console.log.bind(console,"",x("WARN"))),e<=m.info&&(y.info=console.info?console.info.bind(console,x("INFO"),"color: lightblue"):console.log.bind(console,"",x("INFO"))),e<=m.debug&&(y.debug=console.debug?console.debug.bind(console,x("DEBUG"),"color: lightgreen"):console.log.bind(console,"",x("DEBUG"))),e<=m.trace&&(y.trace=console.debug?console.debug.bind(console,x("TRACE"),"color: lightgreen"):console.log.bind(console,"",x("TRACE")))}),"setLogLevel"),x=o((t=>`%c${(0,f.default)().format("ss.SSS")} : ${t} : `),"format"),b=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,w=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,k=/\s*%%.*\n/gm,T=class extends Error{static{o(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},_={},E=o((function(t,e){t=t.replace(b,"").replace(w,"").replace(k,"\n");for(const[r,{detector:n}]of Object.entries(_)){if(n(t,e))return r}throw new T(`No diagram type detected matching given configuration for text: ${t}`)}),"detectType"),C=o(((...t)=>{for(const{id:e,detector:r,loader:n}of t)S(e,r,n)}),"registerLazyLoadedDiagrams"),S=o(((t,e,r)=>{_[t]&&y.warn(`Detector with key ${t} already exists. Overwriting.`),_[t]={detector:e,loader:r},y.debug(`Detector with key ${t} added${r?" with loader":""}`)}),"addDetector"),A=o((t=>_[t].loader),"getDiagramLoader"),L=o(((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach((e=>L(t,e,i))),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach((e=>{t.includes(e)||t.push(e)})),t):void 0===t||r<=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]?(n||"object"!=typeof t[i]&&"object"!=typeof e[i])&&(t[i]=e[i]):(void 0===t[i]&&(t[i]=Array.isArray(e[i])?[]:{}),t[i]=L(t[i],e[i],{depth:r-1,clobber:n}))})),t)}),"assignWithDepth"),N=L,I={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:o((t=>t>=255?255:t<0?0:t),"r"),g:o((t=>t>=255?255:t<0?0:t),"g"),b:o((t=>t>=255?255:t<0?0:t),"b"),h:o((t=>t%360),"h"),s:o((t=>t>=100?100:t<0?0:t),"s"),l:o((t=>t>=100?100:t<0?0:t),"l"),a:o((t=>t>=1?1:t<0?0:t),"a")},toLinear:o((t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92}),"toLinear"),hue2rgb:o(((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t)),"hue2rgb"),hsl2rgb:o((({h:t,s:e,l:r},n)=>{if(!e)return 2.55*r;t/=360,e/=100;const i=(r/=100)<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return 255*I.hue2rgb(a,i,t+1/3);case"g":return 255*I.hue2rgb(a,i,t);case"b":return 255*I.hue2rgb(a,i,t-1/3)}}),"hsl2rgb"),rgb2hsl:o((({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if("l"===n)return 100*s;if(i===a)return 0;const o=i-a;if("s"===n)return 100*(s>.5?o/(2-i-a):o/(i+a));switch(i){case t:return 60*((e-r)/o+(e<r?6:0));case e:return 60*((r-t)/o+2);case r:return 60*((t-e)/o+4);default:return-1}}),"rgb2hsl")},R={channel:I,lang:{clamp:o(((t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t))),"clamp"),round:o((t=>Math.round(1e10*t)/1e10),"round")},unit:{dec2hex:o((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]=R.unit.dec2hex(t);var D,O=0,P=1,B=2,$=class{static{o(this,"Type")}constructor(){this.type=O}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=O}is(t){return this.type===t}},F=class{static{o(this,"Channels")}constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new $}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=O,this}_ensureHSL(){const t=this.data,{h:e,s:r,l:n}=t;void 0===e&&(t.h=R.channel.rgb2hsl(t,"h")),void 0===r&&(t.s=R.channel.rgb2hsl(t,"s")),void 0===n&&(t.l=R.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:r,b:n}=t;void 0===e&&(t.r=R.channel.hsl2rgb(t,"r")),void 0===r&&(t.g=R.channel.hsl2rgb(t,"g")),void 0===n&&(t.b=R.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(B)||void 0===e?(this._ensureHSL(),R.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(P)||void 0===e?(this._ensureRGB(),R.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(P),this.changed=!0,this.data.r=t}set g(t){this.type.set(P),this.changed=!0,this.data.g=t}set b(t){this.type.set(P),this.changed=!0,this.data.b=t}set h(t){this.type.set(B),this.changed=!0,this.data.h=t}set s(t){this.type.set(B),this.changed=!0,this.data.s=t}set l(t){this.type.set(B),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}},z=new F({r:0,g:0,b:0,a:0},"transparent"),U={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:o((t=>{if(35!==t.charCodeAt(0))return;const e=t.match(U.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4==0,s=i>4,o=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return z.set({r:(n>>l*(c+3)&h)*o,g:(n>>l*(c+2)&h)*o,b:(n>>l*(c+1)&h)*o,a:a?(n&h)*o/255:1},t)}),"parse"),stringify:o((t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${M[Math.round(e)]}${M[Math.round(r)]}${M[Math.round(n)]}${M[Math.round(255*i)]}`:`#${M[Math.round(e)]}${M[Math.round(r)]}${M[Math.round(n)]}`}),"stringify")},G=U,q={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:o((t=>{const e=t.match(q.hueRe);if(e){const[,t,r]=e;switch(r){case"grad":return R.channel.clamp.h(.9*parseFloat(t));case"rad":return R.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return R.channel.clamp.h(360*parseFloat(t))}}return R.channel.clamp.h(parseFloat(t))}),"_hue2deg"),parse:o((t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const r=t.match(q.re);if(!r)return;const[,n,i,a,s,o]=r;return z.set({h:q._hue2deg(n),s:R.channel.clamp.s(parseFloat(i)),l:R.channel.clamp.l(parseFloat(a)),a:s?R.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)}),"parse"),stringify:o((t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${R.lang.round(e)}, ${R.lang.round(r)}%, ${R.lang.round(n)}%, ${i})`:`hsl(${R.lang.round(e)}, ${R.lang.round(r)}%, ${R.lang.round(n)}%)`}),"stringify")},j=q,W={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:o((t=>{t=t.toLowerCase();const e=W.colors[t];if(e)return G.parse(e)}),"parse"),stringify:o((t=>{const e=G.stringify(t);for(const t in W.colors)if(W.colors[t]===e)return t}),"stringify")},Y=W,H={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:o((t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const r=t.match(H.re);if(!r)return;const[,n,i,a,s,o,l,c,h]=r;return z.set({r:R.channel.clamp.r(i?2.55*parseFloat(n):parseFloat(n)),g:R.channel.clamp.g(s?2.55*parseFloat(a):parseFloat(a)),b:R.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?R.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)}),"parse"),stringify:o((t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${R.lang.round(e)}, ${R.lang.round(r)}, ${R.lang.round(n)}, ${R.lang.round(i)})`:`rgb(${R.lang.round(e)}, ${R.lang.round(r)}, ${R.lang.round(n)})`}),"stringify")},V=H,X={format:{keyword:Y,hex:G,rgb:V,rgba:V,hsl:j,hsla:j},parse:o((t=>{if("string"!=typeof t)return t;const e=G.parse(t)||V.parse(t)||j.parse(t)||Y.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)}),"parse"),stringify:o((t=>!t.changed&&t.color?t.color:t.type.is(B)||void 0===t.data.r?j.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?V.stringify(t):G.stringify(t)),"stringify")},K=o(((t,e)=>{const r=X.parse(t);for(const t in e)r[t]=R.channel.clamp[t](e[t]);return X.stringify(r)}),"change"),Z=K,Q=o(((t,e,r=0,n=1)=>{if("number"!=typeof t)return Z(t,{a:e});const i=z.set({r:R.channel.clamp.r(t),g:R.channel.clamp.g(e),b:R.channel.clamp.b(r),a:R.channel.clamp.a(n)});return X.stringify(i)}),"rgba"),J=Q,tt=o(((t,e)=>R.lang.round(X.parse(t)[e])),"channel"),et=o((t=>{const{r:e,g:r,b:n}=X.parse(t),i=.2126*R.channel.toLinear(e)+.7152*R.channel.toLinear(r)+.0722*R.channel.toLinear(n);return R.lang.round(i)}),"luminance"),rt=et,nt=o((t=>rt(t)>=.5),"isLight"),it=o((t=>!nt(t)),"isDark"),at=o(((t,e,r)=>{const n=X.parse(t),i=n[e],a=R.channel.clamp[e](i+r);return i!==a&&(n[e]=a),X.stringify(n)}),"adjustChannel"),st=o(((t,e)=>at(t,"l",e)),"lighten"),ot=o(((t,e)=>at(t,"l",-e)),"darken"),lt=o(((t,e)=>{const r=X.parse(t),n={};for(const t in e)e[t]&&(n[t]=r[t]+e[t]);return Z(t,n)}),"adjust"),ct=lt,ht=o(((t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=X.parse(t),{r:o,g:l,b:c,a:h}=X.parse(e),u=r/100,d=2*u-1,p=s-h,g=((d*p==-1?d:(d+p)/(1+d*p))+1)/2,f=1-g;return J(n*g+o*f,i*g+l*f,a*g+c*f,s*u+h*(1-u))}),"mix"),ut=o(((t,e=100)=>{const r=X.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,ht(r,t,e)}),"invert"),dt="#ffffff",pt="#f2f2f2",gt=o(((t,e)=>ct(t,e?{s:-40,l:10}:{s:-40,l:-10})),"mkBorder"),ft=class{static{o(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||ct(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||ct(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||gt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||gt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||ut(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||ut(this.tertiaryColor),this.lineColor=this.lineColor||ut(this.background),this.arrowheadColor=this.arrowheadColor||ut(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?ot(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||ot(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||ut(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||st(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.darkMode?(this.rowOdd=this.rowOdd||ot(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.darkMode)for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=ot(this["cScale"+t],75);else for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=ot(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ut(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||ot(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||ct(this.mainBkg,{h:180,s:-15,l:t*(5+3*e)}),this["surfacePeer"+e]=this["surfacePeer"+e]||ct(this.mainBkg,{h:180,s:-15,l:t*(8+3*e)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||ct(this.primaryColor,{h:64}),this.fillType3=this.fillType3||ct(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||ct(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||ct(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||ct(this.primaryColor,{h:128}),this.fillType7=this.fillType7||ct(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||ct(this.primaryColor,{l:-10}),this.pie5=this.pie5||ct(this.secondaryColor,{l:-10}),this.pie6=this.pie6||ct(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||ct(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||ct(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||ct(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||ct(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||ct(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||ct(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ct(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ct(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ct(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ct(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ct(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ct(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||it(this.quadrant1Fill)?st(this.quadrant1Fill):ot(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ct(this.primaryColor,{h:-30}),this.git4=this.git4||ct(this.primaryColor,{h:-60}),this.git5=this.git5||ct(this.primaryColor,{h:-90}),this.git6=this.git6||ct(this.primaryColor,{h:60}),this.git7=this.git7||ct(this.primaryColor,{h:120}),this.darkMode?(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=ot(this.git0,25),this.git1=ot(this.git1,25),this.git2=ot(this.git2,25),this.git3=ot(this.git3,25),this.git4=ot(this.git4,25),this.git5=ot(this.git5,25),this.git6=ot(this.git6,25),this.git7=ot(this.git7,25)),this.gitInv0=this.gitInv0||ut(this.git0),this.gitInv1=this.gitInv1||ut(this.git1),this.gitInv2=this.gitInv2||ut(this.git2),this.gitInv3=this.gitInv3||ut(this.git3),this.gitInv4=this.gitInv4||ut(this.git4),this.gitInv5=this.gitInv5||ut(this.git5),this.gitInv6=this.gitInv6||ut(this.git6),this.gitInv7=this.gitInv7||ut(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||dt,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},mt=o((t=>{const e=new ft;return e.calculate(t),e}),"getThemeVariables"),yt=class{static{o(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.background),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(ut("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=J(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=ot("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=ot(this.sectionBkgColor,10),this.taskBorderColor=J(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=J(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.rowOdd=this.rowOdd||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||ot(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=st(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=st(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=st(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=ct(this.primaryColor,{h:64}),this.fillType3=ct(this.secondaryColor,{h:64}),this.fillType4=ct(this.primaryColor,{h:-64}),this.fillType5=ct(this.secondaryColor,{h:-64}),this.fillType6=ct(this.primaryColor,{h:128}),this.fillType7=ct(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||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ut(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||ct(this.mainBkg,{h:30,s:-30,l:-(4*t-10)}),this["surfacePeer"+t]=this["surfacePeer"+t]||ct(this.mainBkg,{h:30,s:-30,l:-(4*t-7)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ct(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ct(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ct(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ct(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ct(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ct(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||it(this.quadrant1Fill)?st(this.quadrant1Fill):ot(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?ot(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=st(this.secondaryColor,20),this.git1=st(this.pie2||this.secondaryColor,20),this.git2=st(this.pie3||this.tertiaryColor,20),this.git3=st(this.pie4||ct(this.primaryColor,{h:-30}),20),this.git4=st(this.pie5||ct(this.primaryColor,{h:-60}),20),this.git5=st(this.pie6||ct(this.primaryColor,{h:-90}),10),this.git6=st(this.pie7||ct(this.primaryColor,{h:60}),10),this.git7=st(this.pie8||ct(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||ut(this.git0),this.gitInv1=this.gitInv1||ut(this.git1),this.gitInv2=this.gitInv2||ut(this.git2),this.gitInv3=this.gitInv3||ut(this.git3),this.gitInv4=this.gitInv4||ut(this.git4),this.gitInv5=this.gitInv5||ut(this.git5),this.gitInv6=this.gitInv6||ut(this.git6),this.gitInv7=this.gitInv7||ut(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ut(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ut(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||st(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||st(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},vt=o((t=>{const e=new yt;return e.calculate(t),e}),"getThemeVariables"),xt=class{static{o(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=ct(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(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=J(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.rowOdd="calculated",this.rowEven="calculated",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||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=ot(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||ot(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ct(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||ct(this.mainBkg,{h:30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||ct(this.mainBkg,{h:30,l:-(7+5*t)});if(this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,"calculated"!==this.labelTextColor){this.cScaleLabel0=this.cScaleLabel0||ut(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||ut(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=st(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||st(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||st(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ct(this.primaryColor,{h:64}),this.fillType3=ct(this.secondaryColor,{h:64}),this.fillType4=ct(this.primaryColor,{h:-64}),this.fillType5=ct(this.secondaryColor,{h:-64}),this.fillType6=ct(this.primaryColor,{h:128}),this.fillType7=ct(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||ct(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||ct(this.primaryColor,{l:-10}),this.pie5=this.pie5||ct(this.secondaryColor,{l:-30}),this.pie6=this.pie6||ct(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||ct(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||ct(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||ct(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||ct(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||ct(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||ct(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ct(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ct(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ct(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ct(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ct(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ct(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||it(this.quadrant1Fill)?st(this.quadrant1Fill):ot(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ct(this.primaryColor,{h:-30}),this.git4=this.git4||ct(this.primaryColor,{h:-60}),this.git5=this.git5||ct(this.primaryColor,{h:-90}),this.git6=this.git6||ct(this.primaryColor,{h:60}),this.git7=this.git7||ct(this.primaryColor,{h:120}),this.darkMode?(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=ot(this.git0,25),this.git1=ot(this.git1,25),this.git2=ot(this.git2,25),this.git3=ot(this.git3,25),this.git4=ot(this.git4,25),this.git5=ot(this.git5,25),this.git6=ot(this.git6,25),this.git7=ot(this.git7,25)),this.gitInv0=this.gitInv0||ot(ut(this.git0),25),this.gitInv1=this.gitInv1||ut(this.git1),this.gitInv2=this.gitInv2||ut(this.git2),this.gitInv3=this.gitInv3||ut(this.git3),this.gitInv4=this.gitInv4||ut(this.git4),this.gitInv5=this.gitInv5||ut(this.git5),this.gitInv6=this.gitInv6||ut(this.git6),this.gitInv7=this.gitInv7||ut(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ut(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ut(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||dt,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt}calculate(t){if(Object.keys(this).forEach((t=>{"calculated"===this[t]&&(this[t]=void 0)})),"object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},bt=o((t=>{const e=new xt;return e.calculate(t),e}),"getThemeVariables"),wt=class{static{o(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=st("#cde498",10),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.primaryColor),this.lineColor=ut(this.background),this.textColor=ut(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=ot(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||ct(this.primaryColor,{h:30}),this.cScale4=this.cScale4||ct(this.primaryColor,{h:60}),this.cScale5=this.cScale5||ct(this.primaryColor,{h:90}),this.cScale6=this.cScale6||ct(this.primaryColor,{h:120}),this.cScale7=this.cScale7||ct(this.primaryColor,{h:150}),this.cScale8=this.cScale8||ct(this.primaryColor,{h:210}),this.cScale9=this.cScale9||ct(this.primaryColor,{h:270}),this.cScale10=this.cScale10||ct(this.primaryColor,{h:300}),this.cScale11=this.cScale11||ct(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||ot(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||ot(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=ot(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||ot(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ct(this["cScale"+t],{h:180});this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||ct(this.mainBkg,{h:30,s:-30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||ct(this.mainBkg,{h:30,s:-30,l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ct(this.primaryColor,{h:64}),this.fillType3=ct(this.secondaryColor,{h:64}),this.fillType4=ct(this.primaryColor,{h:-64}),this.fillType5=ct(this.secondaryColor,{h:-64}),this.fillType6=ct(this.primaryColor,{h:128}),this.fillType7=ct(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||ct(this.primaryColor,{l:-30}),this.pie5=this.pie5||ct(this.secondaryColor,{l:-30}),this.pie6=this.pie6||ct(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||ct(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||ct(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||ct(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||ct(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||ct(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||ct(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ct(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ct(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ct(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ct(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ct(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ct(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||it(this.quadrant1Fill)?st(this.quadrant1Fill):ot(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||ct(this.primaryColor,{h:-30}),this.git4=this.git4||ct(this.primaryColor,{h:-60}),this.git5=this.git5||ct(this.primaryColor,{h:-90}),this.git6=this.git6||ct(this.primaryColor,{h:60}),this.git7=this.git7||ct(this.primaryColor,{h:120}),this.darkMode?(this.git0=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=ot(this.git0,25),this.git1=ot(this.git1,25),this.git2=ot(this.git2,25),this.git3=ot(this.git3,25),this.git4=ot(this.git4,25),this.git5=ot(this.git5,25),this.git6=ot(this.git6,25),this.git7=ot(this.git7,25)),this.gitInv0=this.gitInv0||ut(this.git0),this.gitInv1=this.gitInv1||ut(this.git1),this.gitInv2=this.gitInv2||ut(this.git2),this.gitInv3=this.gitInv3||ut(this.git3),this.gitInv4=this.gitInv4||ut(this.git4),this.gitInv5=this.gitInv5||ut(this.git5),this.gitInv6=this.gitInv6||ut(this.git6),this.gitInv7=this.gitInv7||ut(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||ut(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||ut(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||dt,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},kt=o((t=>{const e=new wt;return e.calculate(t),e}),"getThemeVariables"),Tt=class{static{o(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=ct(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.primaryColor,this.darkMode),this.secondaryBorderColor=gt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=gt(this.tertiaryColor,this.darkMode),this.primaryTextColor=ut(this.primaryColor),this.secondaryTextColor=ut(this.secondaryColor),this.tertiaryTextColor=ut(this.tertiaryColor),this.lineColor=ut(this.background),this.textColor=ut(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.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(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.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||ut(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||ot(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||ct(this.mainBkg,{l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||ct(this.mainBkg,{l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=st(this.contrast,30),this.sectionBkgColor2=st(this.contrast,30),this.taskBorderColor=ot(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=st(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=ot(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",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||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=ct(this.primaryColor,{h:64}),this.fillType3=ct(this.secondaryColor,{h:64}),this.fillType4=ct(this.primaryColor,{h:-64}),this.fillType5=ct(this.secondaryColor,{h:-64}),this.fillType6=ct(this.primaryColor,{h:128}),this.fillType7=ct(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||ct(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||ct(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||ct(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||ct(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||ct(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||ct(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||it(this.quadrant1Fill)?st(this.quadrant1Fill):ot(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=ot(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||ct(this.primaryColor,{h:-30}),this.git4=this.pie5||ct(this.primaryColor,{h:-60}),this.git5=this.pie6||ct(this.primaryColor,{h:-90}),this.git6=this.pie7||ct(this.primaryColor,{h:60}),this.git7=this.pie8||ct(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||ut(this.git0),this.gitInv1=this.gitInv1||ut(this.git1),this.gitInv2=this.gitInv2||ut(this.git2),this.gitInv3=this.gitInv3||ut(this.git3),this.gitInv4=this.gitInv4||ut(this.git4),this.gitInv5=this.gitInv5||ut(this.git5),this.gitInv6=this.gitInv6||ut(this.git6),this.gitInv7=this.gitInv7||ut(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||dt,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach((e=>{this[e]=t[e]})),this.updateColors(),e.forEach((e=>{this[e]=t[e]}))}},_t={base:{getThemeVariables:mt},dark:{getThemeVariables:vt},default:{getThemeVariables:bt},forest:{getThemeVariables:kt},neutral:{getThemeVariables:o((t=>{const e=new Tt;return e.calculate(t),e}),"getThemeVariables")}},Et={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,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ct={...Et,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:_t.default.getThemeVariables(),sequence:{...Et.sequence,messageFont:o((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont"),noteFont:o((function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}}),"noteFont"),actorFont:o((function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}}),"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Et.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Et.c4,useWidth:void 0,personFont:o((function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}}),"personFont"),external_personFont:o((function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}}),"external_personFont"),systemFont:o((function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}}),"systemFont"),external_systemFont:o((function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}}),"external_systemFont"),system_dbFont:o((function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}}),"system_dbFont"),external_system_dbFont:o((function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}}),"external_system_dbFont"),system_queueFont:o((function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}}),"system_queueFont"),external_system_queueFont:o((function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}}),"external_system_queueFont"),containerFont:o((function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}}),"containerFont"),external_containerFont:o((function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}}),"external_containerFont"),container_dbFont:o((function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}}),"container_dbFont"),external_container_dbFont:o((function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}}),"external_container_dbFont"),container_queueFont:o((function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}}),"container_queueFont"),external_container_queueFont:o((function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}}),"external_container_queueFont"),componentFont:o((function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}}),"componentFont"),external_componentFont:o((function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}}),"external_componentFont"),component_dbFont:o((function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}}),"component_dbFont"),external_component_dbFont:o((function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}}),"external_component_dbFont"),component_queueFont:o((function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}}),"component_queueFont"),external_component_queueFont:o((function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}}),"external_component_queueFont"),boundaryFont:o((function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}}),"boundaryFont"),messageFont:o((function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}}),"messageFont")},pie:{...Et.pie,useWidth:984},xyChart:{...Et.xyChart,useWidth:void 0},requirement:{...Et.requirement,useWidth:void 0},packet:{...Et.packet},radar:{...Et.radar}},St=o(((t,e="")=>Object.keys(t).reduce(((r,n)=>Array.isArray(t[n])?r:"object"==typeof t[n]&&null!==t[n]?[...r,e+n,...St(t[n],"")]:[...r,e+n]),[])),"keyify"),At=new Set(St(Ct,"")),Lt=Ct,Nt=o((t=>{if(y.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach((t=>Nt(t)));else{for(const e of Object.keys(t)){if(y.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!At.has(e)||null==t[e]){y.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){y.debug("sanitizing object",e),Nt(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(y.debug("sanitizing css option",e),t[e]=It(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}y.debug("After sanitization",t)}}),"sanitizeDirective"),It=o((t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";"{"===n?e++:"}"===n&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t}),"sanitizeCss"),Rt=Object.freeze(Lt),Mt=N({},Rt),Dt=[],Ot=N({},Rt),Pt=o(((t,e)=>{let r=N({},t),n={};for(const t of e)qt(t),n=N(n,t);if(r=N(r,n),n.theme&&n.theme in _t){const t=N({},D),e=N(t.themeVariables||{},n.themeVariables);r.theme&&r.theme in _t&&(r.themeVariables=_t[r.theme].getThemeVariables(e))}return Xt(Ot=r),Ot}),"updateCurrentConfig"),Bt=o((t=>(Mt=N({},Rt),Mt=N(Mt,t),t.theme&&_t[t.theme]&&(Mt.themeVariables=_t[t.theme].getThemeVariables(t.themeVariables)),Pt(Mt,Dt),Mt)),"setSiteConfig"),$t=o((t=>{D=N({},t)}),"saveConfigFromInitialize"),Ft=o((t=>(Mt=N(Mt,t),Pt(Mt,Dt),Mt)),"updateSiteConfig"),zt=o((()=>N({},Mt)),"getSiteConfig"),Ut=o((t=>(Xt(t),N(Ot,t),Gt())),"setConfig"),Gt=o((()=>N({},Ot)),"getConfig"),qt=o((t=>{t&&(["secure",...Mt.secure??[]].forEach((e=>{Object.hasOwn(t,e)&&(y.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]&&qt(t[e])})))}),"sanitize"),jt=o((t=>{Nt(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Dt.push(t),Pt(Mt,Dt)}),"addDirective"),Wt=o(((t=Mt)=>{Pt(t,Dt=[])}),"reset"),Yt={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Ht={},Vt=o((t=>{Ht[t]||(y.warn(Yt[t]),Ht[t]=!0)}),"issueWarning"),Xt=o((t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Vt("LAZY_LOAD_DEPRECATED")}),"checkConfig"),{entries:Kt,setPrototypeOf:Zt,isFrozen:Qt,getPrototypeOf:Jt,getOwnPropertyDescriptor:te}=Object,{freeze:ee,seal:re,create:ne}=Object,{apply:ie,construct:ae}="undefined"!=typeof Reflect&&Reflect;ee||(ee=o((function(t){return t}),"freeze")),re||(re=o((function(t){return t}),"seal")),ie||(ie=o((function(t,e,r){return t.apply(e,r)}),"apply")),ae||(ae=o((function(t,e){return new t(...e)}),"construct"));var se=be(Array.prototype.forEach),oe=be(Array.prototype.lastIndexOf),le=be(Array.prototype.pop),ce=be(Array.prototype.push),he=be(Array.prototype.splice),ue=be(String.prototype.toLowerCase),de=be(String.prototype.toString),pe=be(String.prototype.match),ge=be(String.prototype.replace),fe=be(String.prototype.indexOf),me=be(String.prototype.trim),ye=be(Object.prototype.hasOwnProperty),ve=be(RegExp.prototype.test),xe=we(TypeError);function be(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return ie(t,e,n)}}function we(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return ae(t,r)}}function ke(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue;Zt&&Zt(t,null);let n=e.length;for(;n--;){let i=e[n];if("string"==typeof i){const t=r(i);t!==i&&(Qt(e)||(e[n]=t),i=t)}t[i]=!0}return t}function Te(t){for(let e=0;e<t.length;e++){ye(t,e)||(t[e]=null)}return t}function _e(t){const e=ne(null);for(const[r,n]of Kt(t)){ye(t,r)&&(Array.isArray(n)?e[r]=Te(n):n&&"object"==typeof n&&n.constructor===Object?e[r]=_e(n):e[r]=n)}return e}function Ee(t,e){for(;null!==t;){const r=te(t,e);if(r){if(r.get)return be(r.get);if("function"==typeof r.value)return be(r.value)}t=Jt(t)}function r(){return null}return o(r,"fallbackValue"),r}o(be,"unapply"),o(we,"unconstruct"),o(ke,"addToSet"),o(Te,"cleanArray"),o(_e,"clone"),o(Ee,"lookupGetter");var Ce=ee(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Se=ee(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ae=ee(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Le=ee(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ne=ee(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ie=ee(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Re=ee(["#text"]),Me=ee(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),De=ee(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Oe=ee(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pe=ee(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Be=re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$e=re(/<%[\w\W]*|[\w\W]*%>/gm),Fe=re(/\$\{[\w\W]*/gm),ze=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ue=re(/^aria-[\-\w]+$/),Ge=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qe=re(/^(?:\w+script|data):/i),je=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),We=re(/^html$/i),Ye=re(/^[a-z][.\w]*(-[.\w]+)+$/i),He=Object.freeze({__proto__:null,ARIA_ATTR:Ue,ATTR_WHITESPACE:je,CUSTOM_ELEMENT:Ye,DATA_ATTR:ze,DOCTYPE_NAME:We,ERB_EXPR:$e,IS_ALLOWED_URI:Ge,IS_SCRIPT_OR_DATA:qe,MUSTACHE_EXPR:Be,TMPLIT_EXPR:Fe}),Ve=1,Xe=3,Ke=7,Ze=8,Qe=9,Je=o((function(){return"undefined"==typeof window?null:window}),"getGlobal"),tr=o((function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let r=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(r=e.getAttribute(n));const i="dompurify"+(r?"#"+r:"");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"),er=o((function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}}),"_createHooksMap");function rr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Je();const e=o((t=>rr(t)),"DOMPurify");if(e.version="3.2.4",e.removed=[],!t||!t.document||t.document.nodeType!==Qe||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=t,f=c.prototype,m=Ee(f,"cloneNode"),y=Ee(f,"remove"),v=Ee(f,"nextSibling"),x=Ee(f,"childNodes"),b=Ee(f,"parentNode");if("function"==typeof s){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let w,k="";const{implementation:T,createNodeIterator:_,createDocumentFragment:E,getElementsByTagName:C}=r,{importNode:S}=n;let A=er();e.isSupported="function"==typeof Kt&&"function"==typeof b&&T&&void 0!==T.createHTMLDocument;const{MUSTACHE_EXPR:L,ERB_EXPR:N,TMPLIT_EXPR:I,DATA_ATTR:R,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=He;let{IS_ALLOWED_URI:B}=He,$=null;const F=ke({},[...Ce,...Se,...Ae,...Ne,...Re]);let z=null;const U=ke({},[...Me,...De,...Oe,...Pe]);let G=Object.seal(ne(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,W=!0,Y=!0,H=!1,V=!0,X=!1,K=!0,Z=!1,Q=!1,J=!1,tt=!1,et=!1,rt=!1,nt=!0,it=!1;const at="user-content-";let st=!0,ot=!1,lt={},ct=null;const ht=ke({},["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=ke({},["audio","video","img","source","image","track"]);let pt=null;const gt=ke({},["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=ke({},[ft,mt,yt],de);let kt=ke({},["mi","mo","mn","ms","mtext"]),Tt=ke({},["annotation-xml"]);const _t=ke({},["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=r.createElement("form"),It=o((function(t){return t instanceof RegExp||t instanceof Function}),"isRegexOrFunction"),Rt=o((function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt||Lt!==t){if(t&&"object"==typeof t||(t={}),t=_e(t),Et=-1===Ct.indexOf(t.PARSER_MEDIA_TYPE)?St:t.PARSER_MEDIA_TYPE,At="application/xhtml+xml"===Et?de:ue,$=ye(t,"ALLOWED_TAGS")?ke({},t.ALLOWED_TAGS,At):F,z=ye(t,"ALLOWED_ATTR")?ke({},t.ALLOWED_ATTR,At):U,bt=ye(t,"ALLOWED_NAMESPACES")?ke({},t.ALLOWED_NAMESPACES,de):wt,pt=ye(t,"ADD_URI_SAFE_ATTR")?ke(_e(gt),t.ADD_URI_SAFE_ATTR,At):gt,ut=ye(t,"ADD_DATA_URI_TAGS")?ke(_e(dt),t.ADD_DATA_URI_TAGS,At):dt,ct=ye(t,"FORBID_CONTENTS")?ke({},t.FORBID_CONTENTS,At):ht,q=ye(t,"FORBID_TAGS")?ke({},t.FORBID_TAGS,At):{},j=ye(t,"FORBID_ATTR")?ke({},t.FORBID_ATTR,At):{},lt=!!ye(t,"USE_PROFILES")&&t.USE_PROFILES,W=!1!==t.ALLOW_ARIA_ATTR,Y=!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,rt=t.RETURN_TRUSTED_TYPE||!1,J=t.FORCE_BODY||!1,nt=!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||Ge,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&&(Y=!1),et&&(tt=!0),lt&&($=ke({},Re),z=[],!0===lt.html&&(ke($,Ce),ke(z,Me)),!0===lt.svg&&(ke($,Se),ke(z,De),ke(z,Pe)),!0===lt.svgFilters&&(ke($,Ae),ke(z,De),ke(z,Pe)),!0===lt.mathMl&&(ke($,Ne),ke(z,Oe),ke(z,Pe))),t.ADD_TAGS&&($===F&&($=_e($)),ke($,t.ADD_TAGS,At)),t.ADD_ATTR&&(z===U&&(z=_e(z)),ke(z,t.ADD_ATTR,At)),t.ADD_URI_SAFE_ATTR&&ke(pt,t.ADD_URI_SAFE_ATTR,At),t.FORBID_CONTENTS&&(ct===ht&&(ct=_e(ct)),ke(ct,t.FORBID_CONTENTS,At)),st&&($["#text"]=!0),Z&&ke($,["html","head","body"]),$.table&&(ke($,["tbody"]),delete q.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw xe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=t.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else void 0===w&&(w=tr(g,i)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));ee&&ee(t),Lt=t}}),"_parseConfig"),Mt=ke({},[...Se,...Ae,...Le]),Dt=ke({},[...Ne,...Ie]),Ot=o((function(t){let e=b(t);e&&e.tagName||(e={namespaceURI:vt,tagName:"template"});const r=ue(t.tagName),n=ue(e.tagName);return!!bt[t.namespaceURI]&&(t.namespaceURI===mt?e.namespaceURI===yt?"svg"===r:e.namespaceURI===ft?"svg"===r&&("annotation-xml"===n||kt[n]):Boolean(Mt[r]):t.namespaceURI===ft?e.namespaceURI===yt?"math"===r:e.namespaceURI===mt?"math"===r&&Tt[n]:Boolean(Dt[r]):t.namespaceURI===yt?!(e.namespaceURI===mt&&!Tt[n])&&(!(e.namespaceURI===ft&&!kt[n])&&(!Dt[r]&&(_t[r]||!Mt[r]))):!("application/xhtml+xml"!==Et||!bt[t.namespaceURI]))}),"_checkValidNamespace"),Pt=o((function(t){ce(e.removed,{element:t});try{b(t).removeChild(t)}catch(e){y(t)}}),"_forceRemove"),Bt=o((function(t,r){try{ce(e.removed,{attribute:r.getAttributeNode(t),from:r})}catch(t){ce(e.removed,{attribute:null,from:r})}if(r.removeAttribute(t),"is"===t)if(tt||et)try{Pt(r)}catch(t){}else try{r.setAttribute(t,"")}catch(t){}}),"_removeAttribute"),$t=o((function(t){let e=null,n=null;if(J)t="<remove></remove>"+t;else{const e=pe(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Et&&vt===yt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");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&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),vt===yt?C.call(e,Z?"html":"body")[0]:Z?e.documentElement:a}),"_initDocument"),Ft=o((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=o((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=o((function(t){return"function"==typeof l&&t instanceof l}),"_isNode");function Gt(t,r,n){se(t,(t=>{t.call(e,r,n,Lt)}))}o(Gt,"_executeHooks");const qt=o((function(t){let r=null;if(Gt(A.beforeSanitizeElements,t,null),zt(t))return Pt(t),!0;const n=At(t.nodeName);if(Gt(A.uponSanitizeElement,t,{tagName:n,allowedTags:$}),t.hasChildNodes()&&!Ut(t.firstElementChild)&&ve(/<[/\w]/g,t.innerHTML)&&ve(/<[/\w]/g,t.textContent))return Pt(t),!0;if(t.nodeType===Ke)return Pt(t),!0;if(K&&t.nodeType===Ze&&ve(/<[/\w]/g,t.data))return Pt(t),!0;if(!$[n]||q[n]){if(!q[n]&&Wt(n)){if(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,n))return!1;if(G.tagNameCheck instanceof Function&&G.tagNameCheck(n))return!1}if(st&&!ct[n]){const e=b(t)||t.parentNode,r=x(t)||t.childNodes;if(r&&e){for(let n=r.length-1;n>=0;--n){const i=m(r[n],!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"!==n&&"noembed"!==n&&"noframes"!==n||!ve(/<\/no(script|embed|frames)/i,t.innerHTML)?(X&&t.nodeType===Xe&&(r=t.textContent,se([L,N,I],(t=>{r=ge(r,t," ")})),t.textContent!==r&&(ce(e.removed,{element:t.cloneNode()}),t.textContent=r)),Gt(A.afterSanitizeElements,t,null),!1):(Pt(t),!0)}),"_sanitizeElements"),jt=o((function(t,e,n){if(nt&&("id"===e||"name"===e)&&(n in r||n in Nt))return!1;if(Y&&!j[e]&&ve(R,e));else if(W&&ve(M,e));else if(!z[e]||j[e]){if(!(Wt(t)&&(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,t)||G.tagNameCheck instanceof Function&&G.tagNameCheck(t))&&(G.attributeNameCheck instanceof RegExp&&ve(G.attributeNameCheck,e)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(e))||"is"===e&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&ve(G.tagNameCheck,n)||G.tagNameCheck instanceof Function&&G.tagNameCheck(n))))return!1}else if(pt[e]);else if(ve(B,ge(n,O,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==fe(n,"data:")||!ut[t]){if(H&&!ve(D,ge(n,O,"")));else if(n)return!1}else;return!0}),"_isValidAttribute"),Wt=o((function(t){return"annotation-xml"!==t&&pe(t,P)}),"_isBasicCustomElement"),Yt=o((function(t){Gt(A.beforeSanitizeAttributes,t,null);const{attributes:r}=t;if(!r||zt(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let i=r.length;for(;i--;){const a=r[i],{name:s,namespaceURI:o,value:l}=a,c=At(s);let h="value"===s?l:me(l);if(n.attrName=c,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Gt(A.uponSanitizeAttribute,t,n),h=n.attrValue,!it||"id"!==c&&"name"!==c||(Bt(s,t),h=at+h),K&&ve(/((--!?|])>)|<\/(style|title)/i,h)){Bt(s,t);continue}if(n.forceKeepAttr)continue;if(Bt(s,t),!n.keepAttr)continue;if(!V&&ve(/\/>/i,h)){Bt(s,t);continue}X&&se([L,N,I],(t=>{h=ge(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):le(e.removed)}catch(t){}}}Gt(A.afterSanitizeAttributes,t,null)}),"_sanitizeAttributes"),Ht=o((function t(e){let r=null;const n=Ft(e);for(Gt(A.beforeSanitizeShadowDOM,e,null);r=n.nextNode();)Gt(A.uponSanitizeShadowNode,r,null),qt(r),Yt(r),r.content instanceof a&&t(r.content);Gt(A.afterSanitizeShadowDOM,e,null)}),"_sanitizeShadowDOM");return e.sanitize=function(t){let r=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 xe("toString is not a function");if("string"!=typeof(t=t.toString()))throw xe("dirty is not a string, aborting")}if(!e.isSupported)return t;if(Q||Rt(r),e.removed=[],"string"==typeof t&&(ot=!1),ot){if(t.nodeName){const e=At(t.nodeName);if(!$[e]||q[e])throw xe("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===Ve&&"BODY"===s.nodeName||"HTML"===s.nodeName?i=s:i.appendChild(s);else{if(!tt&&!X&&!Z&&-1===t.indexOf("<"))return w&&rt?w.createHTML(t):t;if(i=$t(t),!i)return tt?null:rt?k:""}i&&J&&Pt(i.firstChild);const h=Ft(ot?t:i);for(;o=h.nextNode();)qt(o),Yt(o),o.content instanceof a&&Ht(o.content);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(n,c,!0)),c}let u=Z?i.outerHTML:i.innerHTML;return Z&&$["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ve(We,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),X&&se([L,N,I],(t=>{u=ge(u,t," ")})),w&&rt?w.createHTML(u):u},e.setConfig=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Rt(t),Q=!0},e.clearConfig=function(){Lt=null,Q=!1},e.isValidAttribute=function(t,e,r){Lt||Rt({});const n=At(t),i=At(e);return jt(n,i,r)},e.addHook=function(t,e){"function"==typeof e&&ce(A[t],e)},e.removeHook=function(t,e){if(void 0!==e){const r=oe(A[t],e);return-1===r?void 0:he(A[t],r,1)[0]}return le(A[t])},e.removeHooks=function(t){A[t]=[]},e.removeAllHooks=function(){A=er()},e}o(rr,"createDOMPurify");var nr=rr(),ir=/<br\s*\/?>/gi,ar=o((t=>{if(!t)return[""];return fr(t).replace(/\\n/g,"#br#").split("#br#")}),"getRows"),sr=(()=>{let t=!1;return()=>{t||(or(),t=!0)}})();function or(){const t="data-temp-href-target";nr.addHook("beforeSanitizeAttributes",(e=>{e instanceof Element&&"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")})),nr.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"))}))}o(or,"setupDompurifyHooks");var lr=o((t=>{sr();return nr.sanitize(t)}),"removeScript"),cr=o(((t,e)=>{if(!1!==e.flowchart?.htmlLabels){const r=e.securityLevel;"antiscript"===r||"strict"===r?t=lr(t):"loose"!==r&&(t=(t=(t=fr(t)).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/=/g,"&equals;"),t=gr(t))}return t}),"sanitizeMore"),hr=o(((t,e)=>t?t=e.dompurifyConfig?nr.sanitize(cr(t,e),e.dompurifyConfig).toString():nr.sanitize(cr(t,e),{FORBID_TAGS:["style"]}).toString():t),"sanitizeText"),ur=o(((t,e)=>"string"==typeof t?hr(t,e):t.flat().map((t=>hr(t,e)))),"sanitizeTextOrArray"),dr=o((t=>ir.test(t)),"hasBreaks"),pr=o((t=>t.split(ir)),"splitBreaks"),gr=o((t=>t.replace(/#br#/g,"<br/>")),"placeholderToBreak"),fr=o((t=>t.replace(ir,"#br#")),"breakToPlaceholder"),mr=o((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"),yr=o((t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),vr=o((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.max(...e)}),"getMax"),xr=o((function(...t){const e=t.filter((t=>!isNaN(t)));return Math.min(...e)}),"getMin"),br=o((function(t){const e=t.split(/(,)/),r=[];for(let t=0;t<e.length;t++){let n=e[t];if(","===n&&t>0&&t+1<e.length){const i=e[t-1],a=e[t+1];kr(i,a)&&(n=i+","+a,t++,r.pop())}r.push(Tr(n))}return r.join("")}),"parseGenericTypes"),wr=o(((t,e)=>Math.max(0,t.split(e).length-1)),"countOccurrence"),kr=o(((t,e)=>{const r=wr(t,"~"),n=wr(e,"~");return 1===r&&1===n}),"shouldCombineSets"),Tr=o((t=>{const e=wr(t,"~");let r=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;-1!==i&&-1!==a&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")}),"processSet"),_r=o((()=>void 0!==window.MathMLElement),"isMathMLSupported"),Er=/\$\$(.*)\$\$/g,Cr=o((t=>(t.match(Er)?.length??0)>0),"hasKatex"),Sr=o((async(t,e)=>{t=await Ar(t,e);const r=document.createElement("div");r.innerHTML=t,r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";document.querySelector("body")?.insertAdjacentElement("beforeend",r);const n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n}),"calculateMathMLDimensions"),Ar=o((async(t,e)=>{if(!Cr(t))return t;if(!(_r()||e.legacyMathML||e.forceLegacyMathML))return t.replace(Er,"MathML is unsupported in this environment.");const{default:r}=await Promise.resolve().then((function(){return $B})),n=e.forceLegacyMathML||!_r()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(ir).map((t=>Cr(t)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${t}</div>`:`<div>${t}</div>`)).join("").replace(Er,((t,e)=>r.renderToString(e,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,"")))}),"renderKatex"),Lr={getRows:ar,sanitizeText:hr,sanitizeTextOrArray:ur,hasBreaks:dr,splitBreaks:pr,lineBreakRegex:ir,removeScript:lr,getUrl:mr,evaluate:yr,getMax:vr,getMin:xr},Nr=o((function(t,e){for(let r of e)t.attr(r[0],r[1])}),"d3Attrs"),Ir=o((function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n}),"calculateSvgSizeAttrs"),Rr=o((function(t,e,r,n){const i=Ir(e,r,n);Nr(t,i)}),"configureSvgSize"),Mr=o((function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;y.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;y.info(`Graph bounds: ${o}x${l}`,t),o=a+2*r,l=s+2*r,y.info(`Calculated bounds: ${o}x${l}`),Rr(e,l,o,n);const c=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",c)}),"setupGraphViewbox"),Dr={},Or=o(((t,e,r)=>{let n="";return t in Dr&&Dr[t]?n=Dr[t](r):y.warn(`No theme found for ${t}`),` & {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n fill: ${r.textColor}\n }\n @keyframes edge-animation-frame {\n from {\n stroke-dashoffset: 0;\n }\n }\n @keyframes dash {\n to {\n stroke-dashoffset: 0;\n }\n }\n & .edge-animation-slow {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 50s linear infinite;\n stroke-linecap: round;\n }\n & .edge-animation-fast {\n stroke-dasharray: 9,5 !important;\n stroke-dashoffset: 900;\n animation: dash 20s linear infinite;\n stroke-linecap: round;\n }\n /* Classes common for multiple diagrams */\n\n & .error-icon {\n fill: ${r.errorBkgColor};\n }\n & .error-text {\n fill: ${r.errorTextColor};\n stroke: ${r.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: ${r.lineColor};\n stroke: ${r.lineColor};\n }\n & .marker.cross {\n stroke: ${r.lineColor};\n }\n\n & svg {\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n }\n & p {\n margin: 0\n }\n\n ${n}\n\n ${e}\n`}),"getStyles"),Pr=o(((t,e)=>{void 0!==e&&(Dr[t]=e)}),"addStylesForDiagram"),Br=Or,$r={};h($r,{clear:()=>qr,getAccDescription:()=>Hr,getAccTitle:()=>Wr,getDiagramTitle:()=>Xr,setAccDescription:()=>Yr,setAccTitle:()=>jr,setDiagramTitle:()=>Vr});var Fr="",zr="",Ur="",Gr=o((t=>hr(t,Gt())),"sanitizeText"),qr=o((()=>{Fr="",Ur="",zr=""}),"clear"),jr=o((t=>{Fr=Gr(t).replace(/^\s+/g,"")}),"setAccTitle"),Wr=o((()=>Fr),"getAccTitle"),Yr=o((t=>{Ur=Gr(t).replace(/\n\s+/g,"\n")}),"setAccDescription"),Hr=o((()=>Ur),"getAccDescription"),Vr=o((t=>{zr=Gr(t)}),"setDiagramTitle"),Xr=o((()=>zr),"getDiagramTitle"),Kr=y,Zr=v,Qr=Gt,Jr=Ut,tn=Rt,en=o((t=>hr(t,Qr())),"sanitizeText"),rn=Mr,nn=o((()=>$r),"getCommonDb"),an={},sn=o(((t,e,r)=>{an[t]&&Kr.warn(`Diagram with id ${t} already registered. Overwriting.`),an[t]=e,r&&S(t,r),Pr(t,e.styles),e.injectUtils?.(Kr,Zr,Qr,en,rn,nn(),(()=>{}))}),"registerDiagram"),on=o((t=>{if(t in an)return an[t];throw new ln(t)}),"getDiagram"),ln=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}};function cn(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function hn(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function un(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function dn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function pn(t){let e,r,n;function i(t,n,i=0,a=t.length){if(i<a){if(0!==e(n,n))return a;do{const e=i+a>>>1;r(t[e],n)<0?i=e+1:a=e}while(i<a)}return i}function a(t,n,i=0,a=t.length){if(i<a){if(0!==e(n,n))return a;do{const e=i+a>>>1;r(t[e],n)<=0?i=e+1:a=e}while(i<a)}return i}function s(t,e,r=0,a=t.length){const s=i(t,e,r,a-1);return s>r&&n(t[s-1],e)>-n(t[s],e)?s-1:s}return 2!==t.length?(e=un,r=o(((e,r)=>un(t(e),r)),"compare2"),n=o(((e,r)=>t(e)-r),"delta")):(e=t===un||t===dn?t:gn,r=t,n=t),o(i,"left"),o(a,"right"),o(s,"center"),{left:i,center:s,right:a}}function gn(){return 0}function fn(t){return null===t?NaN:+t}o(cn,"max"),o(hn,"min"),o(un,"ascending"),o(dn,"descending"),o(pn,"bisector"),o(gn,"zero"),o(fn,"number");var mn=pn(un),yn=mn.right;mn.left,pn(fn).center;var vn=yn,xn=class extends Map{static{o(this,"InternMap")}constructor(t,e=Tn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,r]of t)this.set(e,r)}get(t){return super.get(bn(this,t))}has(t){return super.has(bn(this,t))}set(t,e){return super.set(wn(this,t),e)}delete(t){return super.delete(kn(this,t))}};function bn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function wn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function kn({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Tn(t){return null!==t&&"object"==typeof t?t.valueOf():t}o(bn,"intern_get"),o(wn,"intern_set"),o(kn,"intern_delete"),o(Tn,"keyof");var _n=Math.sqrt(50),En=Math.sqrt(10),Cn=Math.sqrt(2);function Sn(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=_n?10:a>=En?5:a>=Cn?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/c<t&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*s,o=Math.round(t/c),l=Math.round(e/c),o*c<t&&++o,l*c>e&&--l),l<o&&.5<=r&&r<2?Sn(t,e,2*r):[o,l,c]}function An(t,e,r){if(!((r=+r)>0))return[];if((t=+t)===(e=+e))return[t];const n=e<t,[i,a,s]=n?Sn(e,t,r):Sn(t,e,r);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let t=0;t<o;++t)l[t]=(a-t)/-s;else for(let t=0;t<o;++t)l[t]=(a-t)*s;else if(s<0)for(let t=0;t<o;++t)l[t]=(i+t)/-s;else for(let t=0;t<o;++t)l[t]=(i+t)*s;return l}function Ln(t,e,r){return Sn(t=+t,e=+e,r=+r)[2]}function Nn(t,e,r){r=+r;const n=(e=+e)<(t=+t),i=n?Ln(e,t,r):Ln(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function In(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a}function Rn(t){return t}o(Sn,"tickSpec"),o(An,"ticks"),o(Ln,"tickIncrement"),o(Nn,"tickStep"),o(In,"range"),o(Rn,"default");var Mn=1e-6;function Dn(t){return"translate("+t+",0)"}function On(t){return"translate(0,"+t+")"}function Pn(t){return e=>+t(e)}function Bn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function $n(){return!this.__axis}function Fn(t,e){var r=[],n=null,i=null,a=6,s=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?Dn:On;function p(o){var p=null==n?e.ticks?e.ticks.apply(e,r):e.domain():n,g=null==i?e.tickFormat?e.tickFormat.apply(e,r):Rn:i,f=Math.max(a,0)+l,m=e.range(),y=+m[0]+c,v=+m[m.length-1]+c,x=(e.bandwidth?Bn:Pn)(e.copy(),c),b=o.selection?o.selection():o,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")),o!==b&&(w=w.transition(o),k=k.transition(o),E=E.transition(o),C=C.transition(o),T=T.transition(o).attr("opacity",Mn).attr("transform",(function(t){return isFinite(t=x(t))?d(t+c):this.getAttribute("transform")})),_.attr("opacity",Mn).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?s?"M"+h*s+","+y+"H"+c+"V"+v+"H"+h*s:"M"+c+","+y+"V"+v:s?"M"+y+","+h*s+"V"+c+"H"+v+"V"+h*s:"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($n).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 o(p,"axis"),p.scale=function(t){return arguments.length?(e=t,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.from(t),p):r.slice()},p.tickValues=function(t){return arguments.length?(n=null==t?null:Array.from(t),p):n&&n.slice()},p.tickFormat=function(t){return arguments.length?(i=t,p):i},p.tickSize=function(t){return arguments.length?(a=s=+t,p):a},p.tickSizeInner=function(t){return arguments.length?(a=+t,p):a},p.tickSizeOuter=function(t){return arguments.length?(s=+t,p):s},p.tickPadding=function(t){return arguments.length?(l=+t,p):l},p.offset=function(t){return arguments.length?(c=+t,p):c},p}function zn(t){return Fn(1,t)}function Un(t){return Fn(3,t)}function Gn(){}function qn(t){return null==t?Gn:function(){return this.querySelector(t)}}function jn(t){"function"!=typeof t&&(t=qn(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,s,o=e[i],l=o.length,c=n[i]=new Array(l),h=0;h<l;++h)(a=o[h])&&(s=t.call(a,a.__data__,h,o))&&("__data__"in a&&(s.__data__=a.__data__),c[h]=s);return new $a(n,this._parents)}function Wn(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Yn(){return[]}function Hn(t){return null==t?Yn:function(){return this.querySelectorAll(t)}}function Vn(t){return function(){return Wn(t.apply(this,arguments))}}function Xn(t){t="function"==typeof t?Vn(t):Hn(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a<r;++a)for(var s,o=e[a],l=o.length,c=0;c<l;++c)(s=o[c])&&(n.push(t.call(s,s.__data__,c,o)),i.push(s));return new $a(n,i)}function Kn(t){return function(){return this.matches(t)}}function Zn(t){return function(e){return e.matches(t)}}o(Dn,"translateX"),o(On,"translateY"),o(Pn,"number"),o(Bn,"center"),o($n,"entering"),o(Fn,"axis"),o(zn,"axisTop"),o(Un,"axisBottom"),o(Gn,"none"),o(qn,"default"),o(jn,"default"),o(Wn,"array"),o(Yn,"empty"),o(Hn,"default"),o(Vn,"arrayAll"),o(Xn,"default"),o(Kn,"default"),o(Zn,"childMatcher");var Qn=Array.prototype.find;function Jn(t){return function(){return Qn.call(this.children,t)}}function ti(){return this.firstElementChild}function ei(t){return this.select(null==t?ti:Jn("function"==typeof t?t:Zn(t)))}o(Jn,"childFind"),o(ti,"childFirst"),o(ei,"default");var ri=Array.prototype.filter;function ni(){return Array.from(this.children)}function ii(t){return function(){return ri.call(this.children,t)}}function ai(t){return this.selectAll(null==t?ni:ii("function"==typeof t?t:Zn(t)))}function si(t){"function"!=typeof t&&(t=Kn(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,s=e[i],o=s.length,l=n[i]=[],c=0;c<o;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new $a(n,this._parents)}function oi(t){return new Array(t.length)}function li(){return new $a(this._enter||this._groups.map(oi),this._parents)}function ci(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function hi(t){return function(){return t}}function ui(t,e,r,n,i,a){for(var s,o=0,l=e.length,c=a.length;o<c;++o)(s=e[o])?(s.__data__=a[o],n[o]=s):r[o]=new ci(t,a[o]);for(;o<l;++o)(s=e[o])&&(i[o]=s)}function di(t,e,r,n,i,a,s){var o,l,c,h=new Map,u=e.length,d=a.length,p=new Array(u);for(o=0;o<u;++o)(l=e[o])&&(p[o]=c=s.call(l,l.__data__,o,e)+"",h.has(c)?i[o]=l:h.set(c,l));for(o=0;o<d;++o)c=s.call(t,a[o],o,a)+"",(l=h.get(c))?(n[o]=l,l.__data__=a[o],h.delete(c)):r[o]=new ci(t,a[o]);for(o=0;o<u;++o)(l=e[o])&&h.get(p[o])===l&&(i[o]=l)}function pi(t){return t.__data__}function gi(t,e){if(!arguments.length)return Array.from(this,pi);var r=e?di:ui,n=this._parents,i=this._groups;"function"!=typeof t&&(t=hi(t));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),c=0;c<a;++c){var h=n[c],u=i[c],d=u.length,p=fi(t.call(h,h&&h.__data__,c,n)),g=p.length,f=o[c]=new Array(g),m=s[c]=new Array(g),y=l[c]=new Array(d);r(h,u,f,m,y,p,e);for(var v,x,b=0,w=0;b<g;++b)if(v=f[b]){for(b>=w&&(w=b+1);!(x=m[w])&&++w<g;);v._next=x||null}}return(s=new $a(s,n))._enter=o,s._exit=l,s}function fi(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function mi(){return new $a(this._exit||this._groups.map(oi),this._parents)}function yi(t,e,r){var n=this.enter(),i=this,a=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==r?a.remove():r(a),n&&i?n.merge(i).order():i}function vi(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var c,h=r[l],u=n[l],d=h.length,p=o[l]=new Array(d),g=0;g<d;++g)(c=h[g]||u[g])&&(p[g]=c);for(;l<i;++l)o[l]=r[l];return new $a(o,this._parents)}function xi(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,i=t[e],a=i.length-1,s=i[a];--a>=0;)(n=i[a])&&(s&&4^n.compareDocumentPosition(s)&&s.parentNode.insertBefore(n,s),s=n);return this}function bi(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=wi),o(e,"compareNode");for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s,l=r[a],c=l.length,h=i[a]=new Array(c),u=0;u<c;++u)(s=l[u])&&(h[u]=s);h.sort(e)}return new $a(i,this._parents).order()}function wi(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ki(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ti(){return Array.from(this)}function _i(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function Ei(){let t=0;for(const e of this)++t;return t}function Ci(){return!this.node()}function Si(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i,a=e[r],s=0,o=a.length;s<o;++s)(i=a[s])&&t.call(i,i.__data__,s,a);return this}o(ni,"children"),o(ii,"childrenFilter"),o(ai,"default"),o(si,"default"),o(oi,"default"),o(li,"default"),o(ci,"EnterNode"),ci.prototype={constructor:ci,appendChild:o((function(t){return this._parent.insertBefore(t,this._next)}),"appendChild"),insertBefore:o((function(t,e){return this._parent.insertBefore(t,e)}),"insertBefore"),querySelector:o((function(t){return this._parent.querySelector(t)}),"querySelector"),querySelectorAll:o((function(t){return this._parent.querySelectorAll(t)}),"querySelectorAll")},o(hi,"default"),o(ui,"bindIndex"),o(di,"bindKey"),o(pi,"datum"),o(gi,"default"),o(fi,"arraylike"),o(mi,"default"),o(yi,"default"),o(vi,"default"),o(xi,"default"),o(bi,"default"),o(wi,"ascending"),o(ki,"default"),o(Ti,"default"),o(_i,"default"),o(Ei,"default"),o(Ci,"default"),o(Si,"default");var Ai="http://www.w3.org/1999/xhtml",Li={svg:"http://www.w3.org/2000/svg",xhtml:Ai,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ni(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),Li.hasOwnProperty(e)?{space:Li[e],local:t}:t}function Ii(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Mi(t,e){return function(){this.setAttribute(t,e)}}function Di(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Oi(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function Pi(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Bi(t,e){var r=Ni(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?Ri:Ii:"function"==typeof e?r.local?Pi:Oi:r.local?Di:Mi)(r,e))}function $i(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fi(t){return function(){this.style.removeProperty(t)}}function zi(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Ui(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Gi(t,e,r){return arguments.length>1?this.each((null==e?Fi:"function"==typeof e?Ui:zi)(t,e,null==r?"":r)):qi(this.node(),t)}function qi(t,e){return t.style.getPropertyValue(e)||$i(t).getComputedStyle(t,null).getPropertyValue(e)}function ji(t){return function(){delete this[t]}}function Wi(t,e){return function(){this[t]=e}}function Yi(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function Hi(t,e){return arguments.length>1?this.each((null==e?ji:"function"==typeof e?Yi:Wi)(t,e)):this.node()[t]}function Vi(t){return t.trim().split(/^|\s+/)}function Xi(t){return t.classList||new Ki(t)}function Ki(t){this._node=t,this._names=Vi(t.getAttribute("class")||"")}function Zi(t,e){for(var r=Xi(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function Qi(t,e){for(var r=Xi(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function Ji(t){return function(){Zi(this,t)}}function ta(t){return function(){Qi(this,t)}}function ea(t,e){return function(){(e.apply(this,arguments)?Zi:Qi)(this,t)}}function ra(t,e){var r=Vi(t+"");if(arguments.length<2){for(var n=Xi(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each(("function"==typeof e?ea:e?Ji:ta)(r,e))}function na(){this.textContent=""}function ia(t){return function(){this.textContent=t}}function aa(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function sa(t){return arguments.length?this.each(null==t?na:("function"==typeof t?aa:ia)(t)):this.node().textContent}function oa(){this.innerHTML=""}function la(t){return function(){this.innerHTML=t}}function ca(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ha(t){return arguments.length?this.each(null==t?oa:("function"==typeof t?ca:la)(t)):this.node().innerHTML}function ua(){this.nextSibling&&this.parentNode.appendChild(this)}function da(){return this.each(ua)}function pa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ga(){return this.each(pa)}function fa(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ai&&e.documentElement.namespaceURI===Ai?e.createElement(t):e.createElementNS(r,t)}}function ma(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ya(t){var e=Ni(t);return(e.local?ma:fa)(e)}function va(t){var e="function"==typeof t?t:ya(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))}function xa(){return null}function ba(t,e){var r="function"==typeof t?t:ya(t),n=null==e?xa:"function"==typeof e?e:qn(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)}))}function wa(){var t=this.parentNode;t&&t.removeChild(this)}function ka(){return this.each(wa)}function Ta(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _a(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ea(t){return this.select(t?_a:Ta)}function Ca(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Sa(t){return function(e){t.call(this,e,this.__data__)}}function Aa(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}function La(t){return function(){var e=this.__on;if(e){for(var r,n=0,i=-1,a=e.length;n<a;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++i]=r:this.removeEventListener(r.type,r.listener,r.options);++i?e.length=i:delete this.__on}}}function Na(t,e,r){return function(){var n,i=this.__on,a=Sa(e);if(i)for(var s=0,o=i.length;s<o;++s)if((n=i[s]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),void(n.value=e);this.addEventListener(t.type,a,r),n={type:t.type,name:t.name,value:e,listener:a,options:r},i?i.push(n):this.__on=[n]}}function Ia(t,e,r){var n,i,a=Aa(t+""),s=a.length;if(!(arguments.length<2)){for(o=e?Na:La,n=0;n<s;++n)this.each(o(a[n],e,r));return this}var o=this.node().__on;if(o)for(var l,c=0,h=o.length;c<h;++c)for(n=0,l=o[c];n<s;++n)if((i=a[n]).type===l.type&&i.name===l.name)return l.value}function Ra(t,e,r){var n=$i(t),i=n.CustomEvent;"function"==typeof i?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ma(t,e){return function(){return Ra(this,t,e)}}function Da(t,e){return function(){return Ra(this,t,e.apply(this,arguments))}}function Oa(t,e){return this.each(("function"==typeof e?Da:Ma)(t,e))}function*Pa(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n,i=t[e],a=0,s=i.length;a<s;++a)(n=i[a])&&(yield n)}o(Ni,"default"),o(Ii,"attrRemove"),o(Ri,"attrRemoveNS"),o(Mi,"attrConstant"),o(Di,"attrConstantNS"),o(Oi,"attrFunction"),o(Pi,"attrFunctionNS"),o(Bi,"default"),o($i,"default"),o(Fi,"styleRemove"),o(zi,"styleConstant"),o(Ui,"styleFunction"),o(Gi,"default"),o(qi,"styleValue"),o(ji,"propertyRemove"),o(Wi,"propertyConstant"),o(Yi,"propertyFunction"),o(Hi,"default"),o(Vi,"classArray"),o(Xi,"classList"),o(Ki,"ClassList"),Ki.prototype={add:o((function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))}),"add"),remove:o((function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))}),"remove"),contains:o((function(t){return this._names.indexOf(t)>=0}),"contains")},o(Zi,"classedAdd"),o(Qi,"classedRemove"),o(Ji,"classedTrue"),o(ta,"classedFalse"),o(ea,"classedFunction"),o(ra,"default"),o(na,"textRemove"),o(ia,"textConstant"),o(aa,"textFunction"),o(sa,"default"),o(oa,"htmlRemove"),o(la,"htmlConstant"),o(ca,"htmlFunction"),o(ha,"default"),o(ua,"raise"),o(da,"default"),o(pa,"lower"),o(ga,"default"),o(fa,"creatorInherit"),o(ma,"creatorFixed"),o(ya,"default"),o(va,"default"),o(xa,"constantNull"),o(ba,"default"),o(wa,"remove"),o(ka,"default"),o(Ta,"selection_cloneShallow"),o(_a,"selection_cloneDeep"),o(Ea,"default"),o(Ca,"default"),o(Sa,"contextListener"),o(Aa,"parseTypenames"),o(La,"onRemove"),o(Na,"onAdd"),o(Ia,"default"),o(Ra,"dispatchEvent"),o(Ma,"dispatchConstant"),o(Da,"dispatchFunction"),o(Oa,"default"),o(Pa,"default");var Ba=[null];function $a(t,e){this._groups=t,this._parents=e}function Fa(){return new $a([[document.documentElement]],Ba)}function za(){return this}o($a,"Selection"),o(Fa,"selection"),o(za,"selection_selection"),$a.prototype=Fa.prototype={constructor:$a,select:jn,selectAll:Xn,selectChild:ei,selectChildren:ai,filter:si,data:gi,enter:li,exit:mi,join:yi,merge:vi,selection:za,order:xi,sort:bi,call:ki,nodes:Ti,node:_i,size:Ei,empty:Ci,each:Si,attr:Bi,style:Gi,property:Hi,classed:ra,text:sa,html:ha,raise:da,lower:ga,append:va,insert:ba,remove:ka,clone:Ea,datum:Ca,on:Ia,dispatch:Oa,[Symbol.iterator]:Pa};var Ua=Fa;function Ga(t){return"string"==typeof t?new $a([[document.querySelector(t)]],[document.documentElement]):new $a([[t]],Ba)}function qa(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function ja(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Wa(){}o(Ga,"default"),o(qa,"default"),o(ja,"extend"),o(Wa,"Color");var Ya=.7,Ha=1/Ya,Va="\\s*([+-]?\\d+)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Za=/^#([0-9a-f]{3,8})$/,Qa=new RegExp(`^rgb\\(${Va},${Va},${Va}\\)$`),Ja=new RegExp(`^rgb\\(${Ka},${Ka},${Ka}\\)$`),ts=new RegExp(`^rgba\\(${Va},${Va},${Va},${Xa}\\)$`),es=new RegExp(`^rgba\\(${Ka},${Ka},${Ka},${Xa}\\)$`),rs=new RegExp(`^hsl\\(${Xa},${Ka},${Ka}\\)$`),ns=new RegExp(`^hsla\\(${Xa},${Ka},${Ka},${Xa}\\)$`),is={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 as(){return this.rgb().formatHex()}function ss(){return this.rgb().formatHex8()}function os(){return ks(this).formatHsl()}function ls(){return this.rgb().formatRgb()}function cs(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Za.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?hs(e):3===r?new gs(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?us(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?us(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=Qa.exec(t))?new gs(e[1],e[2],e[3],1):(e=Ja.exec(t))?new gs(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ts.exec(t))?us(e[1],e[2],e[3],e[4]):(e=es.exec(t))?us(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rs.exec(t))?ws(e[1],e[2]/100,e[3]/100,1):(e=ns.exec(t))?ws(e[1],e[2]/100,e[3]/100,e[4]):is.hasOwnProperty(t)?hs(is[t]):"transparent"===t?new gs(NaN,NaN,NaN,0):null}function hs(t){return new gs(t>>16&255,t>>8&255,255&t,1)}function us(t,e,r,n){return n<=0&&(t=e=r=NaN),new gs(t,e,r,n)}function ds(t){return t instanceof Wa||(t=cs(t)),t?new gs((t=t.rgb()).r,t.g,t.b,t.opacity):new gs}function ps(t,e,r,n){return 1===arguments.length?ds(t):new gs(t,e,r,null==n?1:n)}function gs(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function fs(){return`#${bs(this.r)}${bs(this.g)}${bs(this.b)}`}function ms(){return`#${bs(this.r)}${bs(this.g)}${bs(this.b)}${bs(255*(isNaN(this.opacity)?1:this.opacity))}`}function ys(){const t=vs(this.opacity);return`${1===t?"rgb(":"rgba("}${xs(this.r)}, ${xs(this.g)}, ${xs(this.b)}${1===t?")":`, ${t})`}`}function vs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bs(t){return((t=xs(t))<16?"0":"")+t.toString(16)}function ws(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _s(t,e,r,n)}function ks(t){if(t instanceof _s)return new _s(t.h,t.s,t.l,t.opacity);if(t instanceof Wa||(t=cs(t)),!t)return new _s;if(t instanceof _s)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(s=e===a?(r-n)/o+6*(r<n):r===a?(n-e)/o+2:(e-r)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new _s(s,o,l,t.opacity)}function Ts(t,e,r,n){return 1===arguments.length?ks(t):new _s(t,e,r,null==n?1:n)}function _s(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Es(t){return(t=(t||0)%360)<0?t+360:t}function Cs(t){return Math.max(0,Math.min(1,t||0))}function Ss(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}qa(Wa,cs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:as,formatHex:as,formatHex8:ss,formatHsl:os,formatRgb:ls,toString:ls}),o(as,"color_formatHex"),o(ss,"color_formatHex8"),o(os,"color_formatHsl"),o(ls,"color_formatRgb"),o(cs,"color"),o(hs,"rgbn"),o(us,"rgba"),o(ds,"rgbConvert"),o(ps,"rgb"),o(gs,"Rgb"),qa(gs,ps,ja(Wa,{brighter(t){return t=null==t?Ha:Math.pow(Ha,t),new gs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ya:Math.pow(Ya,t),new gs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new gs(xs(this.r),xs(this.g),xs(this.b),vs(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:fs,formatHex:fs,formatHex8:ms,formatRgb:ys,toString:ys})),o(fs,"rgb_formatHex"),o(ms,"rgb_formatHex8"),o(ys,"rgb_formatRgb"),o(vs,"clampa"),o(xs,"clampi"),o(bs,"hex"),o(ws,"hsla"),o(ks,"hslConvert"),o(Ts,"hsl"),o(_s,"Hsl"),qa(_s,Ts,ja(Wa,{brighter(t){return t=null==t?Ha:Math.pow(Ha,t),new _s(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ya:Math.pow(Ya,t),new _s(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,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new gs(Ss(t>=240?t-240:t+120,i,n),Ss(t,i,n),Ss(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new _s(Es(this.h),Cs(this.s),Cs(this.l),vs(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=vs(this.opacity);return`${1===t?"hsl(":"hsla("}${Es(this.h)}, ${100*Cs(this.s)}%, ${100*Cs(this.l)}%${1===t?")":`, ${t})`}`}})),o(Es,"clamph"),o(Cs,"clampt"),o(Ss,"hsl2rgb");var As=Math.PI/180,Ls=180/Math.PI,Ns=.96422,Is=.82521,Rs=4/29,Ms=6/29,Ds=3*Ms*Ms;function Os(t){if(t instanceof Bs)return new Bs(t.l,t.a,t.b,t.opacity);if(t instanceof js)return Ws(t);t instanceof gs||(t=ds(t));var e,r,n=Us(t.r),i=Us(t.g),a=Us(t.b),s=$s((.2225045*n+.7168786*i+.0606169*a)/1);return n===i&&i===a?e=r=s:(e=$s((.4360747*n+.3850649*i+.1430804*a)/Ns),r=$s((.0139322*n+.0971045*i+.7141733*a)/Is)),new Bs(116*s-16,500*(e-s),200*(s-r),t.opacity)}function Ps(t,e,r,n){return 1===arguments.length?Os(t):new Bs(t,e,r,null==n?1:n)}function Bs(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function $s(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ds+Rs}function Fs(t){return t>Ms?t*t*t:Ds*(t-Rs)}function zs(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Us(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gs(t){if(t instanceof js)return new js(t.h,t.c,t.l,t.opacity);if(t instanceof Bs||(t=Os(t)),0===t.a&&0===t.b)return new js(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ls;return new js(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function qs(t,e,r,n){return 1===arguments.length?Gs(t):new js(t,e,r,null==n?1:n)}function js(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function Ws(t){if(isNaN(t.h))return new Bs(t.l,0,0,t.opacity);var e=t.h*As;return new Bs(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}o(Os,"labConvert"),o(Ps,"lab"),o(Bs,"Lab"),qa(Bs,Ps,ja(Wa,{brighter(t){return new Bs(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Bs(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new gs(zs(3.1338561*(e=Ns*Fs(e))-1.6168667*(t=1*Fs(t))-.4906146*(r=Is*Fs(r))),zs(-.9787684*e+1.9161415*t+.033454*r),zs(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),o($s,"xyz2lab"),o(Fs,"lab2xyz"),o(zs,"lrgb2rgb"),o(Us,"rgb2lrgb"),o(Gs,"hclConvert"),o(qs,"hcl"),o(js,"Hcl"),o(Ws,"hcl2lab"),qa(js,qs,ja(Wa,{brighter(t){return new js(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new js(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Ws(this).rgb()}}));var Ys=o((t=>()=>t),"default");function Hs(t,e){return function(r){return t+r*e}}function Vs(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Xs(t,e){var r=e-t;return r?Hs(t,r>180||r<-180?r-360*Math.round(r/360):r):Ys(isNaN(t)?e:t)}function Ks(t){return 1==(t=+t)?Zs:function(e,r){return r-e?Vs(e,r,t):Ys(isNaN(e)?r:e)}}function Zs(t,e){var r=e-t;return r?Hs(t,r):Ys(isNaN(t)?e:t)}function Qs(t){return function(e,r){var n=t((e=qs(e)).h,(r=qs(r)).h),i=Zs(e.c,r.c),a=Zs(e.l,r.l),s=Zs(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=s(t),e+""}}}o(Hs,"linear"),o(Vs,"exponential"),o(Xs,"hue"),o(Ks,"gamma"),o(Zs,"nogamma"),o(Qs,"hcl");var Js=Qs(Xs);function to(t,e,r,n,i){var a=t*t,s=a*t;return((1-3*t+3*a-s)*e+(4-6*a+3*s)*r+(1+3*t+3*a-3*s)*n+s*i)/6}o(to,"basis"),o((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],s=n>0?t[n-1]:2*i-a,o=n<e-1?t[n+2]:2*a-i;return to((r-n/e)*e,s,i,a,o)}}),"default"),o((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],s=t[(n+1)%e],o=t[(n+2)%e];return to((r-n/e)*e,i,a,s,o)}}),"default");var eo=o((function t(e){var r=Ks(e);function n(t,e){var n=r((t=ps(t)).r,(e=ps(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),s=Zs(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=s(e),t+""}}return o(n,"rgb"),n.gamma=t,n}),"rgbGamma")(1);function ro(t,e){e||(e=[]);var r,n=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function no(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function io(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(i),s=new Array(n);for(r=0;r<i;++r)a[r]=go(t[r],e[r]);for(;r<n;++r)s[r]=e[r];return function(t){for(r=0;r<i;++r)s[r]=a[r](t);return s}}function ao(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function so(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function oo(t,e){var r,n={},i={};for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=go(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}o((function(t){return function(e){var r,n,i=e.length,a=new Array(i),s=new Array(i),o=new Array(i);for(r=0;r<i;++r)n=ps(e[r]),a[r]=n.r||0,s[r]=n.g||0,o[r]=n.b||0;return a=t(a),s=t(s),o=t(o),n.opacity=1,function(t){return n.r=a(t),n.g=s(t),n.b=o(t),n+""}}}),"rgbSpline"),o(ro,"default"),o(no,"isNumberArray"),o(io,"genericArray"),o(ao,"default"),o(so,"default"),o(oo,"default");var lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,co=new RegExp(lo.source,"g");function ho(t){return function(){return t}}function uo(t){return function(e){return t(e)+""}}function po(t,e){var r,n,i,a=lo.lastIndex=co.lastIndex=0,s=-1,o=[],l=[];for(t+="",e+="";(r=lo.exec(t))&&(n=co.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),o[s]?o[s]+=i:o[++s]=i),(r=r[0])===(n=n[0])?o[s]?o[s]+=n:o[++s]=n:(o[++s]=null,l.push({i:s,x:so(r,n)})),a=co.lastIndex;return a<e.length&&(i=e.slice(a),o[s]?o[s]+=i:o[++s]=i),o.length<2?l[0]?uo(l[0].x):ho(e):(e=l.length,function(t){for(var r,n=0;n<e;++n)o[(r=l[n]).i]=r.x(t);return o.join("")})}function go(t,e){var r,n=typeof e;return null==e||"boolean"===n?Ys(e):("number"===n?so:"string"===n?(r=cs(e))?(e=r,eo):po:e instanceof cs?eo:e instanceof Date?ao:no(e)?ro:Array.isArray(e)?io:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?oo:so)(t,e)}function fo(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}o(ho,"zero"),o(uo,"one"),o(po,"default"),o(go,"default"),o(fo,"default");var mo,yo=180/Math.PI,vo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xo(t,e,r,n,i,a){var s,o,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),t*n<e*r&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*yo,skewX:Math.atan(l)*yo,scaleX:s,scaleY:o}}function bo(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?vo:xo(e.a,e.b,e.c,e.d,e.e,e.f)}function wo(t){return null==t?vo:(mo||(mo=document.createElementNS("http://www.w3.org/2000/svg","g")),mo.setAttribute("transform",t),(t=mo.transform.baseVal.consolidate())?xo((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):vo)}function ko(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}function a(t,n,i,a,s,o){if(t!==i||n!==a){var l=s.push("translate(",null,e,null,r);o.push({i:l-4,x:so(t,i)},{i:l-2,x:so(n,a)})}else(i||a)&&s.push("translate("+i+e+a+r)}function s(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:so(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}function l(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:so(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}function c(t,e,r,n,a,s){if(t!==r||e!==n){var o=a.push(i(a)+"scale(",null,",",null,")");s.push({i:o-4,x:so(t,r)},{i:o-2,x:so(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}return o(i,"pop"),o(a,"translate"),o(s,"rotate"),o(l,"skewX"),o(c,"scale"),function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),s(e.rotate,r.rotate,n,i),l(e.skewX,r.skewX,n,i),c(e.scaleX,e.scaleY,r.scaleX,r.scaleY,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}}o(xo,"default"),o(bo,"parseCss"),o(wo,"parseSvg"),o(ko,"interpolateTransform");var To=ko(bo,"px, ","px)","deg)"),_o=ko(wo,", ",")",")");function Eo(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}o(Eo,"initRange");var Co=Symbol("implicit");function So(){var t=new xn,e=[],r=[],n=Co;function i(i){let a=t.get(i);if(void 0===a){if(n!==Co)return n;t.set(i,a=e.push(i)-1)}return r[a%r.length]}return o(i,"scale"),i.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new xn;for(const n of r)t.has(n)||t.set(n,e.push(n)-1);return i},i.range=function(t){return arguments.length?(r=Array.from(t),i):r.slice()},i.unknown=function(t){return arguments.length?(n=t,i):n},i.copy=function(){return So(e,r).unknown(n)},Eo.apply(i,arguments),i}function Ao(t){return function(){return t}}function Lo(t){return+t}o(So,"ordinal"),o(Ao,"constants"),o(Lo,"number");var No=[0,1];function Io(t){return t}function Ro(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:Ao(isNaN(e)?NaN:.5)}function Mo(t,e){var r;return t>e&&(r=t,t=e,e=r),function(r){return Math.max(t,Math.min(e,r))}}function Do(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i<n?(n=Ro(i,n),a=r(s,a)):(n=Ro(n,i),a=r(a,s)),function(t){return a(n(t))}}function Oo(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=Ro(t[s],t[s+1]),a[s]=r(e[s],e[s+1]);return function(e){var r=vn(t,e,1,n)-1;return a[r](i[r](e))}}function Po(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Bo(){var t,e,r,n,i,a,s=No,l=No,c=go,h=Io;function u(){var t=Math.min(s.length,l.length);return h!==Io&&(h=Mo(s[0],s[t-1])),n=t>2?Oo:Do,i=a=null,d}function d(e){return null==e||isNaN(e=+e)?r:(i||(i=n(s.map(t),l,c)))(t(h(e)))}return o(u,"rescale"),o(d,"scale"),d.invert=function(r){return h(e((a||(a=n(l,s.map(t),so)))(r)))},d.domain=function(t){return arguments.length?(s=Array.from(t,Lo),u()):s.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=fo,u()},d.clamp=function(t){return arguments.length?(h=!!t||Io,u()):h!==Io},d.interpolate=function(t){return arguments.length?(c=t,u()):c},d.unknown=function(t){return arguments.length?(r=t,d):r},function(r,n){return t=r,e=n,u()}}function $o(){return Bo()(Io,Io)}function Fo(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function zo(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Uo(t){return(t=zo(Math.abs(t)))?t[1]:NaN}function Go(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function qo(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}o(Io,"identity"),o(Ro,"normalize"),o(Mo,"clamper"),o(Do,"bimap"),o(Oo,"polymap"),o(Po,"copy"),o(Bo,"transformer"),o($o,"continuous"),o(Fo,"default"),o(zo,"formatDecimalParts"),o(Uo,"default"),o(Go,"default"),o(qo,"default");var jo,Wo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yo(t){if(!(e=Wo.exec(t)))throw new Error("invalid format: "+t);var e;return new Ho({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 Ho(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 Vo(t){t:for(var e,r=t.length,n=1,i=-1;n<r;++n)switch(t[n]){case".":i=e=n;break;case"0":0===i&&(i=n),e=n;break;default:if(!+t[n])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}function Xo(t,e){var r=zo(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(jo=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+zo(t,Math.max(0,e+a-1))[0]}function Ko(t,e){var r=zo(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}o(Yo,"formatSpecifier"),Yo.prototype=Ho.prototype,o(Ho,"FormatSpecifier"),Ho.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},o(Vo,"default"),o(Xo,"default"),o(Ko,"default");var Zo={"%":o(((t,e)=>(100*t).toFixed(e)),"%"),b:o((t=>Math.round(t).toString(2)),"b"),c:o((t=>t+""),"c"),d:Fo,e:o(((t,e)=>t.toExponential(e)),"e"),f:o(((t,e)=>t.toFixed(e)),"f"),g:o(((t,e)=>t.toPrecision(e)),"g"),o:o((t=>Math.round(t).toString(8)),"o"),p:o(((t,e)=>Ko(100*t,e)),"p"),r:Ko,s:Xo,X:o((t=>Math.round(t).toString(16).toUpperCase()),"X"),x:o((t=>Math.round(t).toString(16)),"x")};function Qo(t){return t}o(Qo,"default");var Jo,tl,el,rl=Array.prototype.map,nl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function il(t){var e=void 0===t.grouping||void 0===t.thousands?Qo:Go(rl.call(t.grouping,Number),t.thousands+""),r=void 0===t.currency?"":t.currency[0]+"",n=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Qo:qo(rl.call(t.numerals,String)),s=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=Yo(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"):Zo[x]||(void 0===y&&(y=12),v=!0,x="g"),(g||"0"===h&&"="===u)&&(g=!0,h="0",u="=");var b="$"===p?r:"#"===p&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w="$"===p?n:/[%p]/.test(x)?s:"",k=Zo[x],T=/[defgprs%]/.test(x);function _(t){var r,n,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=Vo(t)),_&&0==+t&&"+"!==d&&(_=!1),o=(_?"("===d?d:l:"-"===d||"("===d?"":d)+o,p=("s"===x?nl[8+jo/3]:"")+p+(_&&"("===d?")":""),T)for(r=-1,n=t.length;++r<n;)if(48>(s=t.charCodeAt(r))||s>57){p=(46===s?i+t.slice(r+1):t.slice(r))+p,t=t.slice(0,r);break}}m&&!g&&(t=e(t,1/0));var E=o.length+t.length+p.length,C=E<f?new Array(f-E+1).join(h):"";switch(m&&g&&(t=e(C+t,C.length?f-p.length:1/0),C=""),u){case"<":t=o+t+p+C;break;case"=":t=o+C+t+p;break;case"^":t=C.slice(0,E=C.length>>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)),o(_,"format"),_.toString=function(){return t+""},_}function u(t,e){var r=h(((t=Yo(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(Uo(e)/3))),i=Math.pow(10,-n),a=nl[8+n/3];return function(t){return r(i*t)+a}}return o(h,"newFormat"),o(u,"formatPrefix"),{format:h,formatPrefix:u}}function al(t){return Jo=il(t),tl=Jo.format,el=Jo.formatPrefix,Jo}function sl(t){return Math.max(0,-Uo(Math.abs(t)))}function ol(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Uo(e)/3)))-Uo(Math.abs(t)))}function ll(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Uo(e)-Uo(t))+1}function cl(t,e,r,n){var i,a=Nn(t,e,r);switch((n=Yo(null==n?",f":n)).type){case"s":var s=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(i=ol(a,s))||(n.precision=i),el(n,s);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=ll(a,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=sl(a))||(n.precision=i-2*("%"===n.type))}return tl(n)}function hl(t){var e=t.domain;return t.ticks=function(t){var r=e();return An(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return cl(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,i,a=e(),s=0,o=a.length-1,l=a[s],c=a[o],h=10;for(c<l&&(i=l,l=c,c=i,i=s,s=o,o=i);h-- >0;){if((i=Ln(l,c,r))===n)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}n=i}return t},t}function ul(){var t=$o();return t.copy=function(){return Po(t,ul())},Eo.apply(t,arguments),hl(t)}o(il,"default"),al({thousands:",",grouping:[3],currency:["$",""]}),o(al,"defaultLocale"),o(sl,"default"),o(ol,"default"),o(ll,"default"),o(cl,"tickFormat"),o(hl,"linearish"),o(ul,"linear");var dl=new Date,pl=new Date;function gl(t,e,r,n){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return o(i,"interval"),i.floor=e=>(t(e=new Date(+e)),e),i.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),i.round=t=>{const e=i(t),r=i.ceil(t);return t-e<r-t?e:r},i.offset=(t,r)=>(e(t=new Date(+t),null==r?1:Math.floor(r)),t),i.range=(r,n,a)=>{const s=[];if(r=i.ceil(r),a=null==a?1:Math.floor(a),!(r<n&&a>0))return s;let o;do{s.push(o=new Date(+r)),e(r,a),t(r)}while(o<r&&r<n);return s},i.filter=r=>gl((e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),((t,n)=>{if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););})),r&&(i.count=(e,n)=>(dl.setTime(+e),pl.setTime(+n),t(dl),t(pl),Math.floor(r(dl,pl))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?e=>n(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}o(gl,"timeInterval");var fl=gl((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));fl.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?gl((e=>{e.setTime(Math.floor(e/t)*t)}),((e,r)=>{e.setTime(+e+r*t)}),((e,r)=>(r-e)/t)):fl:null),fl.range;var ml=1e3,yl=6e4,vl=36e5,xl=864e5,bl=6048e5,wl=2592e6,kl=31536e6,Tl=gl((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*ml)}),((t,e)=>(e-t)/ml),(t=>t.getUTCSeconds()));Tl.range;var _l=gl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ml)}),((t,e)=>{t.setTime(+t+e*yl)}),((t,e)=>(e-t)/yl),(t=>t.getMinutes()));_l.range;var El=gl((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yl)}),((t,e)=>(e-t)/yl),(t=>t.getUTCMinutes()));El.range;var Cl=gl((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ml-t.getMinutes()*yl)}),((t,e)=>{t.setTime(+t+e*vl)}),((t,e)=>(e-t)/vl),(t=>t.getHours()));Cl.range;var Sl=gl((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*vl)}),((t,e)=>(e-t)/vl),(t=>t.getUTCHours()));Sl.range;var Al=gl((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yl)/xl),(t=>t.getDate()-1));Al.range;var Ll=gl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xl),(t=>t.getUTCDate()-1));Ll.range;var Nl=gl((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/xl),(t=>Math.floor(t/xl)));function Il(t){return gl((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-(e.getTimezoneOffset()-t.getTimezoneOffset())*yl)/bl))}Nl.range,o(Il,"timeWeekday");var Rl=Il(0),Ml=Il(1),Dl=Il(2),Ol=Il(3),Pl=Il(4),Bl=Il(5),$l=Il(6);function Fl(t){return gl((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)/bl))}Rl.range,Ml.range,Dl.range,Ol.range,Pl.range,Bl.range,$l.range,o(Fl,"utcWeekday");var zl=Fl(0),Ul=Fl(1),Gl=Fl(2),ql=Fl(3),jl=Fl(4),Wl=Fl(5),Yl=Fl(6);zl.range,Ul.range,Gl.range,ql.range,jl.range,Wl.range,Yl.range;var Hl=gl((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()));Hl.range;var Vl=gl((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()));Vl.range;var Xl=gl((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()));Xl.every=t=>isFinite(t=Math.floor(t))&&t>0?gl((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,r)=>{e.setFullYear(e.getFullYear()+r*t)})):null,Xl.range;var Kl=gl((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 Zl(t,e,r,n,i,a){const s=[[Tl,1,ml],[Tl,5,5e3],[Tl,15,15e3],[Tl,30,3e4],[a,1,yl],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,vl],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,xl],[n,2,1728e5],[r,1,bl],[e,1,wl],[e,3,7776e6],[t,1,kl]];function l(t,e,r){const n=e<t;n&&([t,e]=[e,t]);const i=r&&"function"==typeof r.range?r:c(t,e,r),a=i?i.range(t,+e+1):[];return n?a.reverse():a}function c(e,r,n){const i=Math.abs(r-e)/n,a=pn((([,,t])=>t)).right(s,i);if(a===s.length)return t.every(Nn(e/kl,r/kl,n));if(0===a)return fl.every(Math.max(Nn(e,r,n),1));const[o,l]=s[i/s[a-1][2]<s[a][2]/i?a-1:a];return o.every(l)}return o(l,"ticks"),o(c,"tickInterval"),[l,c]}Kl.every=t=>isFinite(t=Math.floor(t))&&t>0?gl((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null,Kl.range,o(Zl,"ticker"),Zl(Kl,Vl,zl,Nl,Sl,El);var[Ql,Jl]=Zl(Xl,Hl,Rl,Al,Cl,_l);function tc(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 ec(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 rc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function nc(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,c=t.shortMonths,h=dc(i),u=pc(i),d=dc(a),p=pc(a),g=dc(s),f=pc(s),m=dc(l),y=pc(l),v=dc(c),x=pc(c),b={a:D,A:O,b:P,B:B,c:null,d:Dc,e:Dc,f:Fc,g:Kc,G:Qc,H:Oc,I:Pc,j:Bc,L:$c,m:zc,M:Uc,p:$,q:F,Q:wh,s:kh,S:Gc,u:qc,U:jc,V:Yc,w:Hc,W:Vc,x:null,X:null,y:Xc,Y:Zc,Z:Jc,"%":bh},w={a:z,A:U,b:G,B:q,c:null,d:th,e:th,f:ah,g:mh,G:vh,H:eh,I:rh,j:nh,L:ih,m:sh,M:oh,p:j,q:W,Q:wh,s:kh,S:lh,u:ch,U:hh,V:dh,w:ph,W:gh,x:null,X:null,y:fh,Y:yh,Z:xh,"%":bh},k={a:S,A:A,b:L,B:N,c:I,d:_c,e:_c,f:Nc,g:bc,G:xc,H:Cc,I:Cc,j:Ec,L:Lc,m:Tc,M:Sc,p:C,q:kc,Q:Rc,s:Mc,S:Ac,u:fc,U:mc,V:yc,w:gc,W:vc,x:R,X:M,y:bc,Y:xc,Z:wc,"%":Ic};function T(t,e){return function(r){var n,i,a,s=[],o=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++o<c;)37===t.charCodeAt(o)&&(s.push(t.slice(l,o)),null!=(i=sc[n=t.charAt(++o)])?n=t.charAt(++o):i="e"===n?" ":"0",(a=e[n])&&(n=a(r,i)),s.push(n),l=o+1);return s.push(t.slice(l,o)),s.join("")}}function _(t,e){return function(r){var n,i,a=rc(1900,void 0,1);if(E(a,t,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(e&&!("Z"in a)&&(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(n=ec(rc(a.y,0,1))).getUTCDay(),n=i>4||0===i?Ul.ceil(n):Ul(n),n=Ll.offset(n,7*(a.V-1)),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(i=(n=tc(rc(a.y,0,1))).getDay(),n=i>4||0===i?Ml.ceil(n):Ml(n),n=Al.offset(n,7*(a.V-1)),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.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?ec(rc(a.y,0,1)).getUTCDay():tc(rc(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,ec(a)):tc(a)}}function E(t,e,r,n){for(var i,a,s=0,o=e.length,l=r.length;s<o;){if(n>=l)return-1;if(37===(i=e.charCodeAt(s++))){if(i=e.charAt(s++),!(a=k[i in sc?e.charAt(s++):i])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function C(t,e,r){var n=h.exec(e.slice(r));return n?(t.p=u.get(n[0].toLowerCase()),r+n[0].length):-1}function S(t,e,r){var n=g.exec(e.slice(r));return n?(t.w=f.get(n[0].toLowerCase()),r+n[0].length):-1}function A(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1}function L(t,e,r){var n=v.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1}function N(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1}function I(t,r,n){return E(t,e,r,n)}function R(t,e,n){return E(t,r,e,n)}function M(t,e,r){return E(t,n,e,r)}function D(t){return s[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 s[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 W(t){return 1+~~(t.getUTCMonth()/3)}return b.x=T(r,b),b.X=T(n,b),b.c=T(e,b),w.x=T(r,w),w.X=T(n,w),w.c=T(e,w),o(T,"newFormat"),o(_,"newParse"),o(E,"parseSpecifier"),o(C,"parsePeriod"),o(S,"parseShortWeekday"),o(A,"parseWeekday"),o(L,"parseShortMonth"),o(N,"parseMonth"),o(I,"parseLocaleDateTime"),o(R,"parseLocaleDate"),o(M,"parseLocaleTime"),o(D,"formatShortWeekday"),o(O,"formatWeekday"),o(P,"formatShortMonth"),o(B,"formatMonth"),o($,"formatPeriod"),o(F,"formatQuarter"),o(z,"formatUTCShortWeekday"),o(U,"formatUTCWeekday"),o(G,"formatUTCShortMonth"),o(q,"formatUTCMonth"),o(j,"formatUTCPeriod"),o(W,"formatUTCQuarter"),{format:o((function(t){var e=T(t+="",b);return e.toString=function(){return t},e}),"format"),parse:o((function(t){var e=_(t+="",!1);return e.toString=function(){return t},e}),"parse"),utcFormat:o((function(t){var e=T(t+="",w);return e.toString=function(){return t},e}),"utcFormat"),utcParse:o((function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}),"utcParse")}}o(tc,"localDate"),o(ec,"utcDate"),o(rc,"newDate"),o(nc,"formatLocale");var ic,ac,sc={"-":"",_:" ",0:"0"},oc=/^\s*\d+/,lc=/^%/,cc=/[\\^$*+?|[\]().{}]/g;function hc(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function uc(t){return t.replace(cc,"\\$&")}function dc(t){return new RegExp("^(?:"+t.map(uc).join("|")+")","i")}function pc(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function gc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function fc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function mc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function yc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function vc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function xc(t,e,r){var n=oc.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function bc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function wc(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function kc(t,e,r){var n=oc.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function Tc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function _c(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ec(t,e,r){var n=oc.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Cc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Sc(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Ac(t,e,r){var n=oc.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Lc(t,e,r){var n=oc.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Nc(t,e,r){var n=oc.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ic(t,e,r){var n=lc.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Rc(t,e,r){var n=oc.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Mc(t,e,r){var n=oc.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Dc(t,e){return hc(t.getDate(),e,2)}function Oc(t,e){return hc(t.getHours(),e,2)}function Pc(t,e){return hc(t.getHours()%12||12,e,2)}function Bc(t,e){return hc(1+Al.count(Xl(t),t),e,3)}function $c(t,e){return hc(t.getMilliseconds(),e,3)}function Fc(t,e){return $c(t,e)+"000"}function zc(t,e){return hc(t.getMonth()+1,e,2)}function Uc(t,e){return hc(t.getMinutes(),e,2)}function Gc(t,e){return hc(t.getSeconds(),e,2)}function qc(t){var e=t.getDay();return 0===e?7:e}function jc(t,e){return hc(Rl.count(Xl(t)-1,t),e,2)}function Wc(t){var e=t.getDay();return e>=4||0===e?Pl(t):Pl.ceil(t)}function Yc(t,e){return t=Wc(t),hc(Pl.count(Xl(t),t)+(4===Xl(t).getDay()),e,2)}function Hc(t){return t.getDay()}function Vc(t,e){return hc(Ml.count(Xl(t)-1,t),e,2)}function Xc(t,e){return hc(t.getFullYear()%100,e,2)}function Kc(t,e){return hc((t=Wc(t)).getFullYear()%100,e,2)}function Zc(t,e){return hc(t.getFullYear()%1e4,e,4)}function Qc(t,e){var r=t.getDay();return hc((t=r>=4||0===r?Pl(t):Pl.ceil(t)).getFullYear()%1e4,e,4)}function Jc(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hc(e/60|0,"0",2)+hc(e%60,"0",2)}function th(t,e){return hc(t.getUTCDate(),e,2)}function eh(t,e){return hc(t.getUTCHours(),e,2)}function rh(t,e){return hc(t.getUTCHours()%12||12,e,2)}function nh(t,e){return hc(1+Ll.count(Kl(t),t),e,3)}function ih(t,e){return hc(t.getUTCMilliseconds(),e,3)}function ah(t,e){return ih(t,e)+"000"}function sh(t,e){return hc(t.getUTCMonth()+1,e,2)}function oh(t,e){return hc(t.getUTCMinutes(),e,2)}function lh(t,e){return hc(t.getUTCSeconds(),e,2)}function ch(t){var e=t.getUTCDay();return 0===e?7:e}function hh(t,e){return hc(zl.count(Kl(t)-1,t),e,2)}function uh(t){var e=t.getUTCDay();return e>=4||0===e?jl(t):jl.ceil(t)}function dh(t,e){return t=uh(t),hc(jl.count(Kl(t),t)+(4===Kl(t).getUTCDay()),e,2)}function ph(t){return t.getUTCDay()}function gh(t,e){return hc(Ul.count(Kl(t)-1,t),e,2)}function fh(t,e){return hc(t.getUTCFullYear()%100,e,2)}function mh(t,e){return hc((t=uh(t)).getUTCFullYear()%100,e,2)}function yh(t,e){return hc(t.getUTCFullYear()%1e4,e,4)}function vh(t,e){var r=t.getUTCDay();return hc((t=r>=4||0===r?jl(t):jl.ceil(t)).getUTCFullYear()%1e4,e,4)}function xh(){return"+0000"}function bh(){return"%"}function wh(t){return+t}function kh(t){return Math.floor(+t/1e3)}function Th(t){return ic=nc(t),ac=ic.format,ic.parse,ic.utcFormat,ic.utcParse,ic}function _h(t,e){var r,n=0,i=(t=t.slice()).length-1,a=t[n],s=t[i];return s<a&&(r=n,n=i,i=r,r=a,a=s,s=r),t[n]=e.floor(a),t[i]=e.ceil(s),t}function Eh(t){return new Date(t)}function Ch(t){return t instanceof Date?+t:+new Date(+t)}function Sh(t,e,r,n,i,a,s,l,c,h){var u=$o(),d=u.invert,p=u.domain,g=h(".%L"),f=h(":%S"),m=h("%I:%M"),y=h("%I %p"),v=h("%a %d"),x=h("%b %d"),b=h("%B"),w=h("%Y");function k(t){return(c(t)<t?g:l(t)<t?f:s(t)<t?m:a(t)<t?y:n(t)<t?i(t)<t?v:x:r(t)<t?b:w)(t)}return o(k,"tickFormat"),u.invert=function(t){return new Date(d(t))},u.domain=function(t){return arguments.length?p(Array.from(t,Ch)):p().map(Eh)},u.ticks=function(e){var r=p();return t(r[0],r[r.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?k:h(e)},u.nice=function(t){var r=p();return t&&"function"==typeof t.range||(t=e(r[0],r[r.length-1],null==t?10:t)),t?p(_h(r,t)):u},u.copy=function(){return Po(u,Sh(t,e,r,n,i,a,s,l,c,h))},u}function Ah(){return Eo.apply(Sh(Ql,Jl,Xl,Hl,Rl,Al,Cl,_l,Tl,ac).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Lh(){var t,e,r=So().unknown(void 0),n=r.domain,i=r.range,a=0,s=1,l=!1,c=0,h=0,u=.5;function d(){var r=n().length,o=s<a,d=o?s:a,p=o?a:s;t=(p-d)/Math.max(1,r-c+2*h),l&&(t=Math.floor(t)),d+=(p-d-t*(r-c))*u,e=t*(1-c),l&&(d=Math.round(d),e=Math.round(e));var g=In(r).map((function(e){return d+t*e}));return i(o?g.reverse():g)}return delete r.unknown,o(d,"rescale"),r.domain=function(t){return arguments.length?(n(t),d()):n()},r.range=function(t){return arguments.length?([a,s]=t,a=+a,s=+s,d()):[a,s]},r.rangeRound=function(t){return[a,s]=t,a=+a,s=+s,l=!0,d()},r.bandwidth=function(){return e},r.step=function(){return t},r.round=function(t){return arguments.length?(l=!!t,d()):l},r.padding=function(t){return arguments.length?(c=Math.min(1,h=+t),d()):c},r.paddingInner=function(t){return arguments.length?(c=Math.min(1,t),d()):c},r.paddingOuter=function(t){return arguments.length?(h=+t,d()):h},r.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),d()):u},r.copy=function(){return Lh(n(),[a,s]).round(l).paddingInner(c).paddingOuter(h).align(u)},Eo.apply(d(),arguments)}function Nh(t){for(var e=t.length/6|0,r=new Array(e),n=0;n<e;)r[n]="#"+t.slice(6*n,6*++n);return r}o(hc,"pad"),o(uc,"requote"),o(dc,"formatRe"),o(pc,"formatLookup"),o(gc,"parseWeekdayNumberSunday"),o(fc,"parseWeekdayNumberMonday"),o(mc,"parseWeekNumberSunday"),o(yc,"parseWeekNumberISO"),o(vc,"parseWeekNumberMonday"),o(xc,"parseFullYear"),o(bc,"parseYear"),o(wc,"parseZone"),o(kc,"parseQuarter"),o(Tc,"parseMonthNumber"),o(_c,"parseDayOfMonth"),o(Ec,"parseDayOfYear"),o(Cc,"parseHour24"),o(Sc,"parseMinutes"),o(Ac,"parseSeconds"),o(Lc,"parseMilliseconds"),o(Nc,"parseMicroseconds"),o(Ic,"parseLiteralPercent"),o(Rc,"parseUnixTimestamp"),o(Mc,"parseUnixTimestampSeconds"),o(Dc,"formatDayOfMonth"),o(Oc,"formatHour24"),o(Pc,"formatHour12"),o(Bc,"formatDayOfYear"),o($c,"formatMilliseconds"),o(Fc,"formatMicroseconds"),o(zc,"formatMonthNumber"),o(Uc,"formatMinutes"),o(Gc,"formatSeconds"),o(qc,"formatWeekdayNumberMonday"),o(jc,"formatWeekNumberSunday"),o(Wc,"dISO"),o(Yc,"formatWeekNumberISO"),o(Hc,"formatWeekdayNumberSunday"),o(Vc,"formatWeekNumberMonday"),o(Xc,"formatYear"),o(Kc,"formatYearISO"),o(Zc,"formatFullYear"),o(Qc,"formatFullYearISO"),o(Jc,"formatZone"),o(th,"formatUTCDayOfMonth"),o(eh,"formatUTCHour24"),o(rh,"formatUTCHour12"),o(nh,"formatUTCDayOfYear"),o(ih,"formatUTCMilliseconds"),o(ah,"formatUTCMicroseconds"),o(sh,"formatUTCMonthNumber"),o(oh,"formatUTCMinutes"),o(lh,"formatUTCSeconds"),o(ch,"formatUTCWeekdayNumberMonday"),o(hh,"formatUTCWeekNumberSunday"),o(uh,"UTCdISO"),o(dh,"formatUTCWeekNumberISO"),o(ph,"formatUTCWeekdayNumberSunday"),o(gh,"formatUTCWeekNumberMonday"),o(fh,"formatUTCYear"),o(mh,"formatUTCYearISO"),o(yh,"formatUTCFullYear"),o(vh,"formatUTCFullYearISO"),o(xh,"formatUTCZone"),o(bh,"formatLiteralPercent"),o(wh,"formatUnixTimestamp"),o(kh,"formatUnixTimestampSeconds"),Th({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),o(Th,"defaultLocale"),o(_h,"nice"),o(Eh,"date"),o(Ch,"number"),o(Sh,"calendar"),o(Ah,"time"),o(Lh,"band"),o(Nh,"default");var Ih=Nh("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Rh(t){return o((function(){return t}),"constant")}o(Rh,"default");var Mh=Math.abs,Dh=Math.atan2,Oh=Math.cos,Ph=Math.max,Bh=Math.min,$h=Math.sin,Fh=Math.sqrt,zh=1e-12,Uh=Math.PI,Gh=Uh/2,qh=2*Uh;function jh(t){return t>1?0:t<-1?Uh:Math.acos(t)}function Wh(t){return t>=1?Gh:t<=-1?-Gh:Math.asin(t)}o(jh,"acos"),o(Wh,"asin");var Yh=Math.PI,Hh=2*Yh,Vh=1e-6,Xh=Hh-Vh;function Kh(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function Zh(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Kh;const r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}o(Kh,"append"),o(Zh,"appendRound");var Qh=class{static{o(this,"Path")}constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Kh:Zh(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,r,n){this._append`Q${+t},${+e},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(t,e,r,n,i,a){this._append`C${+t},${+e},${+r},${+n},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,r,n,i){if(t=+t,e=+e,r=+r,n=+n,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=this._x1,s=this._y1,o=r-t,l=n-e,c=a-t,h=s-e,u=c*c+h*h;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(u>Vh)if(Math.abs(h*o-l*c)>Vh&&i){let d=r-a,p=n-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan((Yh-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>Vh&&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,r,n,i,a){if(t=+t,e=+e,a=!!a,(r=+r)<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,c=e+o,h=1^a,u=a?n-i:i-n;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Vh||Math.abs(this._y1-c)>Vh)&&this._append`L${l},${c}`,r&&(u<0&&(u=u%Hh+Hh),u>Xh?this._append`A${r},${r},0,1,${h},${t-s},${e-o}A${r},${r},0,1,${h},${this._x1=l},${this._y1=c}`:u>Vh&&this._append`A${r},${r},0,${+(u>=Yh)},${h},${this._x1=t+r*Math.cos(i)},${this._y1=e+r*Math.sin(i)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}};function Jh(){return new Qh}function tu(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{const t=Math.floor(r);if(!(t>=0))throw new RangeError(`invalid digits: ${r}`);e=t}return t},()=>new Qh(e)}function eu(t){return t.innerRadius}function ru(t){return t.outerRadius}function nu(t){return t.startAngle}function iu(t){return t.endAngle}function au(t){return t&&t.padAngle}function su(t,e,r,n,i,a,s,o){var l=r-t,c=n-e,h=s-i,u=o-a,d=u*l-h*c;if(!(d*d<zh))return[t+(d=(h*(e-a)-u*(t-i))/d)*l,e+d*c]}function ou(t,e,r,n,i,a,s){var o=t-r,l=e-n,c=(s?a:-a)/Fh(o*o+l*l),h=c*l,u=-c*o,d=t+h,p=e+u,g=r+h,f=n+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)*Fh(Ph(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 lu(){var t=eu,e=ru,r=Rh(0),n=null,i=nu,a=iu,s=au,l=null,c=tu(h);function h(){var o,h,u=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-Gh,g=a.apply(this,arguments)-Gh,f=Mh(g-p),m=g>p;if(l||(l=o=c()),d<u&&(h=d,d=u,u=h),d>zh)if(f>qh-zh)l.moveTo(d*Oh(p),d*$h(p)),l.arc(0,0,d,p,g,!m),u>zh&&(l.moveTo(u*Oh(g),u*$h(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=s.apply(this,arguments)/2,C=E>zh&&(n?+n.apply(this,arguments):Fh(u*u+d*d)),S=Bh(Mh(d-u)/2,+r.apply(this,arguments)),A=S,L=S;if(C>zh){var N=Wh(C/u*$h(E)),I=Wh(C/d*$h(E));(T-=2*N)>zh?(w+=N*=m?1:-1,k-=N):(T=0,w=k=(p+g)/2),(_-=2*I)>zh?(x+=I*=m?1:-1,b-=I):(_=0,x=b=(p+g)/2)}var R=d*Oh(x),M=d*$h(x),D=u*Oh(k),O=u*$h(k);if(S>zh){var P,B=d*Oh(b),$=d*$h(b),F=u*Oh(w),z=u*$h(w);if(f<Uh)if(P=su(R,M,F,z,B,$,D,O)){var U=R-P[0],G=M-P[1],q=B-P[0],j=$-P[1],W=1/$h(jh((U*q+G*j)/(Fh(U*U+G*G)*Fh(q*q+j*j)))/2),Y=Fh(P[0]*P[0]+P[1]*P[1]);A=Bh(S,(u-Y)/(W-1)),L=Bh(S,(d-Y)/(W+1))}else A=L=0}_>zh?L>zh?(y=ou(F,z,R,M,d,L,m),v=ou(B,$,D,O,d,L,m),l.moveTo(y.cx+y.x01,y.cy+y.y01),L<S?l.arc(y.cx,y.cy,L,Dh(y.y01,y.x01),Dh(v.y01,v.x01),!m):(l.arc(y.cx,y.cy,L,Dh(y.y01,y.x01),Dh(y.y11,y.x11),!m),l.arc(0,0,d,Dh(y.cy+y.y11,y.cx+y.x11),Dh(v.cy+v.y11,v.cx+v.x11),!m),l.arc(v.cx,v.cy,L,Dh(v.y11,v.x11),Dh(v.y01,v.x01),!m))):(l.moveTo(R,M),l.arc(0,0,d,x,b,!m)):l.moveTo(R,M),u>zh&&T>zh?A>zh?(y=ou(D,O,B,$,u,-A,m),v=ou(R,M,F,z,u,-A,m),l.lineTo(y.cx+y.x01,y.cy+y.y01),A<S?l.arc(y.cx,y.cy,A,Dh(y.y01,y.x01),Dh(v.y01,v.x01),!m):(l.arc(y.cx,y.cy,A,Dh(y.y01,y.x01),Dh(y.y11,y.x11),!m),l.arc(0,0,u,Dh(y.cy+y.y11,y.cx+y.x11),Dh(v.cy+v.y11,v.cx+v.x11),m),l.arc(v.cx,v.cy,A,Dh(v.y11,v.x11),Dh(v.y01,v.x01),!m))):l.arc(0,0,u,k,w,m):l.lineTo(D,O)}else l.moveTo(0,0);if(l.closePath(),o)return l=null,o+""||null}return o(h,"arc"),h.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Uh/2;return[Oh(n)*r,$h(n)*r]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Rh(+e),h):t},h.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Rh(+t),h):e},h.cornerRadius=function(t){return arguments.length?(r="function"==typeof t?t:Rh(+t),h):r},h.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Rh(+t),h):n},h.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Rh(+t),h):i},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Rh(+t),h):a},h.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Rh(+t),h):s},h.context=function(t){return arguments.length?(l=null==t?null:t,h):l},h}function cu(t){this._context=t}function hu(t){return new cu(t)}function uu(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function du(t){return t[0]}function pu(t){return t[1]}function gu(t,e){var r=Rh(!0),n=null,i=hu,a=null,s=tu(l);function l(o){var l,c,h,u=(o=uu(o)).length,d=!1;for(null==n&&(a=i(h=s())),l=0;l<=u;++l)!(l<u&&r(c=o[l],l,o))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(c,l,o),+e(c,l,o));if(h)return a=null,h+""||null}return t="function"==typeof t?t:void 0===t?du:Rh(t),e="function"==typeof e?e:void 0===e?pu:Rh(e),o(l,"line"),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Rh(+e),l):t},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Rh(+t),l):e},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Rh(!!t),l):r},l.curve=function(t){return arguments.length?(i=t,null!=n&&(a=i(n)),l):i},l.context=function(t){return arguments.length?(null==t?n=a=null:a=i(n=t),l):n},l}function fu(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function mu(t){return t}function yu(){var t=mu,e=fu,r=null,n=Rh(0),i=Rh(qh),a=Rh(0);function s(s){var o,l,c,h,u,d=(s=uu(s)).length,p=0,g=new Array(d),f=new Array(d),m=+n.apply(this,arguments),y=Math.min(qh,Math.max(-qh,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;o<d;++o)(u=f[g[o]=o]=+t(s[o],o,s))>0&&(p+=u);for(null!=e?g.sort((function(t,r){return e(f[t],f[r])})):null!=r&&g.sort((function(t,e){return r(s[t],s[e])})),o=0,c=p?(y-d*x)/p:0;o<d;++o,m=h)l=g[o],h=m+((u=f[l])>0?u*c:0)+x,f[l]={data:s[l],index:o,value:u,startAngle:m,endAngle:h,padAngle:v};return f}return o(s,"pie"),s.value=function(e){return arguments.length?(t="function"==typeof e?e:Rh(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,r=null,s):e},s.sort=function(t){return arguments.length?(r=t,e=null,s):r},s.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Rh(+t),s):n},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Rh(+t),s):i},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Rh(+t),s):a},s}o(Jh,"path"),Jh.prototype=Qh.prototype,o(tu,"withPath"),o(eu,"arcInnerRadius"),o(ru,"arcOuterRadius"),o(nu,"arcStartAngle"),o(iu,"arcEndAngle"),o(au,"arcPadAngle"),o(su,"intersect"),o(ou,"cornerTangents"),o(lu,"default"),o(cu,"Linear"),cu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((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")},o(hu,"default"),o(uu,"default"),o(du,"x"),o(pu,"y"),o(gu,"default"),o(fu,"default"),o(mu,"default"),o(yu,"default");var vu=class{static{o(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 xu(t){return new vu(t,!0)}function bu(t){return new vu(t,!1)}function wu(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ku(t){this._context=t}function Tu(t){return new ku(t)}function _u(){}function Eu(t){this._context=t}function Cu(t){return new Eu(t)}function Su(t){this._context=t}function Au(t){return new Su(t)}function Lu(t,e){this._basis=new ku(t),this._beta=e}o(xu,"bumpX"),o(bu,"bumpY"),o(wu,"point"),o(ku,"Basis"),ku.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 3:wu(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:o((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:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Tu,"default"),o(_u,"default"),o(Eu,"BasisClosed"),Eu.prototype={areaStart:_u,areaEnd:_u,lineStart:o((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:o((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:o((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:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Cu,"default"),o(Su,"BasisOpen"),Su.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:wu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}),"point")},o(Au,"default"),o(Lu,"Bundle"),Lu.prototype={lineStart:o((function(){this._x=[],this._y=[],this._basis.lineStart()}),"lineStart"),lineEnd:o((function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,i=t[0],a=e[0],s=t[r]-i,o=e[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(i+n*s),this._beta*e[l]+(1-this._beta)*(a+n*o));this._x=this._y=null,this._basis.lineEnd()}),"lineEnd"),point:o((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")};var Nu=o((function t(e){function r(t){return 1===e?new ku(t):new Lu(t,e)}return o(r,"bundle"),r.beta=function(e){return t(+e)},r}),"custom")(.85);function Iu(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Ru(t,e){this._context=t,this._k=(1-e)/6}o(Iu,"point"),o(Ru,"Cardinal"),Ru.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Iu(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((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:Iu(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=o((function t(e){function r(t){return new Ru(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function Du(t,e){this._context=t,this._k=(1-e)/6}o(Du,"CardinalClosed"),Du.prototype={areaStart:_u,areaEnd:_u,lineStart:o((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:o((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:o((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:Iu(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 Ou=o((function t(e){function r(t){return new Du(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function Pu(t,e){this._context=t,this._k=(1-e)/6}o(Pu,"CardinalOpen"),Pu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((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:Iu(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 Bu=o((function t(e){function r(t){return new Pu(t,e)}return o(r,"cardinal"),r.tension=function(e){return t(+e)},r}),"custom")(0);function $u(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>zh){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>zh){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-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function Fu(t,e){this._context=t,this._alpha=e}o($u,"point"),o(Fu,"CatmullRom"),Fu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((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:o((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:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:$u(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 zu=o((function t(e){function r(t){return e?new Fu(t,e):new Ru(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function Uu(t,e){this._context=t,this._alpha=e}o(Uu,"CatmullRomClosed"),Uu.prototype={areaStart:_u,areaEnd:_u,lineStart:o((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:o((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:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:$u(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 Gu=o((function t(e){function r(t){return e?new Uu(t,e):new Du(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function qu(t,e){this._context=t,this._alpha=e}o(qu,"CatmullRomOpen"),qu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((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:o((function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:$u(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 ju=o((function t(e){function r(t){return e?new qu(t,e):new Pu(t,0)}return o(r,"catmullRom"),r.alpha=function(e){return t(+e)},r}),"custom")(.5);function Wu(t){this._context=t}function Yu(t){return new Wu(t)}function Hu(t){return t<0?-1:1}function Vu(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(Hu(a)+Hu(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Xu(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ku(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function Zu(t){this._context=t}function Qu(t){this._context=new Ju(t)}function Ju(t){this._context=t}function td(t){return new Zu(t)}function ed(t){return new Qu(t)}function rd(t){this._context=t}function nd(t){var e,r,n=t.length-1,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/a[e-1],a[e]-=r,s[e]-=r*s[e-1];for(i[n-1]=s[n-1]/a[n-1],e=n-2;e>=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function id(t){return new rd(t)}function ad(t,e){this._context=t,this._t=e}function sd(t){return new ad(t,.5)}function od(t){return new ad(t,0)}function ld(t){return new ad(t,1)}o(Wu,"LinearClosed"),Wu.prototype={areaStart:_u,areaEnd:_u,lineStart:o((function(){this._point=0}),"lineStart"),lineEnd:o((function(){this._point&&this._context.closePath()}),"lineEnd"),point:o((function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}),"point")},o(Yu,"default"),o(Hu,"sign"),o(Vu,"slope3"),o(Xu,"slope2"),o(Ku,"point"),o(Zu,"MonotoneX"),Zu.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ku(this,this._t0,Xu(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}),"lineEnd"),point:o((function(t,e){var r=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ku(this,Xu(this,r=Vu(this,t,e)),r);break;default:Ku(this,this._t0,r=Vu(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}),"point")},o(Qu,"MonotoneY"),(Qu.prototype=Object.create(Zu.prototype)).point=function(t,e){Zu.prototype.point.call(this,e,t)},o(Ju,"ReflectContext"),Ju.prototype={moveTo:o((function(t,e){this._context.moveTo(e,t)}),"moveTo"),closePath:o((function(){this._context.closePath()}),"closePath"),lineTo:o((function(t,e){this._context.lineTo(e,t)}),"lineTo"),bezierCurveTo:o((function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}),"bezierCurveTo")},o(td,"monotoneX"),o(ed,"monotoneY"),o(rd,"Natural"),rd.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x=[],this._y=[]}),"lineStart"),lineEnd:o((function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var n=nd(t),i=nd(e),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[s],e[s]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null}),"lineEnd"),point:o((function(t,e){this._x.push(+t),this._y.push(+e)}),"point")},o(nd,"controlPoints"),o(id,"default"),o(ad,"Step"),ad.prototype={areaStart:o((function(){this._line=0}),"areaStart"),areaEnd:o((function(){this._line=NaN}),"areaEnd"),lineStart:o((function(){this._x=this._y=NaN,this._point=0}),"lineStart"),lineEnd:o((function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}),"lineEnd"),point:o((function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}),"point")},o(sd,"default"),o(od,"stepBefore"),o(ld,"stepAfter");var cd={value:o((()=>{}),"value")};function hd(){for(var t,e=0,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new ud(n)}function ud(t){this._=t}function dd(t,e){return t.trim().split(/^|\s+/).map((function(t){var r="",n=t.indexOf(".");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function pd(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function gd(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=cd,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}o(hd,"dispatch"),o(ud,"Dispatch"),o(dd,"parseTypenames"),ud.prototype=hd.prototype={constructor:ud,on:o((function(t,e){var r,n=this._,i=dd(t+"",n),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(r=(t=i[a]).type)n[r]=gd(n[r],t.name,e);else if(null==e)for(r in n)n[r]=gd(n[r],t.name,null);return this}for(;++a<s;)if((r=(t=i[a]).type)&&(r=pd(n[r],t.name)))return r}),"on"),copy:o((function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new ud(t)}),"copy"),call:o((function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,r=(n=this._[t]).length;a<r;++a)n[a].value.apply(e,i)}),"call"),apply:o((function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}),"apply")},o(pd,"get"),o(gd,"set");var fd,md,yd=hd,vd=0,xd=0,bd=0,wd=0,kd=0,Td=0,_d="object"==typeof performance&&performance.now?performance:Date,Ed="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Cd(){return kd||(Ed(Sd),kd=_d.now()+Td)}function Sd(){kd=0}function Ad(){this._call=this._time=this._next=null}function Ld(t,e,r){var n=new Ad;return n.restart(t,e,r),n}function Nd(){Cd(),++vd;for(var t,e=fd;e;)(t=kd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vd}function Id(){kd=(wd=_d.now())+Td,vd=xd=0;try{Nd()}finally{vd=0,Md(),kd=0}}function Rd(){var t=_d.now(),e=t-wd;e>1e3&&(Td-=e,wd=t)}function Md(){for(var t,e,r=fd,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:fd=e);md=t,Dd(n)}function Dd(t){vd||(xd&&(xd=clearTimeout(xd)),t-kd>24?(t<1/0&&(xd=setTimeout(Id,t-_d.now()-Td)),bd&&(bd=clearInterval(bd))):(bd||(wd=_d.now(),bd=setInterval(Rd,1e3)),vd=1,Ed(Id)))}function Od(t,e,r){var n=new Ad;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}o(Cd,"now"),o(Sd,"clearNow"),o(Ad,"Timer"),Ad.prototype=Ld.prototype={constructor:Ad,restart:o((function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?Cd():+r)+(null==e?0:+e),this._next||md===this||(md?md._next=this:fd=this,md=this),this._call=t,this._time=r,Dd()}),"restart"),stop:o((function(){this._call&&(this._call=null,this._time=1/0,Dd())}),"stop")},o(Ld,"timer"),o(Nd,"timerFlush"),o(Id,"wake"),o(Rd,"poke"),o(Md,"nap"),o(Dd,"sleep"),o(Od,"default");var Pd=yd("start","end","cancel","interrupt"),Bd=[];function $d(t,e,r,n,i,a){var s=t.__transition;if(s){if(r in s)return}else t.__transition={};Gd(t,r,{name:e,index:n,group:i,on:Pd,tween:Bd,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Fd(t,e){var r=Ud(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function zd(t,e){var r=Ud(t,e);if(r.state>3)throw new Error("too late; already running");return r}function Ud(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Gd(t,e,r){var n,i=t.__transition;function a(t){r.state=1,r.timer.restart(s,r.delay,r.time),r.delay<=t&&s(t-r.delay)}function s(a){var o,h,u,d;if(1!==r.state)return c();for(o in i)if((d=i[o]).name===r.name){if(3===d.state)return Od(s);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[o]):+o<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[o])}if(Od((function(){3===r.state&&(r.state=4,r.timer.restart(l,r.delay,r.time),l(a))})),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,n=new Array(u=r.tween.length),o=0,h=-1;o<u;++o)(d=r.tween[o].value.call(t,t.__data__,r.index,r.group))&&(n[++h]=d);n.length=h+1}}function l(e){for(var i=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(c),r.state=5,1),a=-1,s=n.length;++a<s;)n[a].call(t,i);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),c())}function c(){for(var n in r.state=6,r.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=r,r.timer=Ld(a,0,r.time),o(a,"schedule"),o(s,"start"),o(l,"tick"),o(c,"stop")}function qd(t,e){var r,n,i,a=t.__transition,s=!0;if(a){for(i in e=null==e?null:e+"",a)(r=a[i]).name===e?(n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete a[i]):s=!1;s&&delete t.__transition}}function jd(t){return this.each((function(){qd(this,t)}))}function Wd(t,e){var r,n;return function(){var i=zd(this,t),a=i.tween;if(a!==r)for(var s=0,o=(n=r=a).length;s<o;++s)if(n[s].name===e){(n=n.slice()).splice(s,1);break}i.tween=n}}function Yd(t,e,r){var n,i;if("function"!=typeof r)throw new Error;return function(){var a=zd(this,t),s=a.tween;if(s!==n){i=(n=s).slice();for(var o={name:e,value:r},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=o;break}l===c&&i.push(o)}a.tween=i}}function Hd(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,i=Ud(this.node(),r).tween,a=0,s=i.length;a<s;++a)if((n=i[a]).name===t)return n.value;return null}return this.each((null==e?Wd:Yd)(r,t,e))}function Vd(t,e,r){var n=t._id;return t.each((function(){var t=zd(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return Ud(t,n).value[e]}}function Xd(t,e){var r;return("number"==typeof e?so:e instanceof cs?eo:(r=cs(e))?(e=r,eo):po)(t,e)}function Kd(t){return function(){this.removeAttribute(t)}}function Zd(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qd(t,e,r){var n,i,a=r+"";return function(){var s=this.getAttribute(t);return s===a?null:s===n?i:i=e(n=s,r)}}function Jd(t,e,r){var n,i,a=r+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===a?null:s===n?i:i=e(n=s,r)}}function tp(t,e,r){var n,i,a;return function(){var s,o,l=r(this);if(null!=l)return(s=this.getAttribute(t))===(o=l+"")?null:s===n&&o===i?a:(i=o,a=e(n=s,l));this.removeAttribute(t)}}function ep(t,e,r){var n,i,a;return function(){var s,o,l=r(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(o=l+"")?null:s===n&&o===i?a:(i=o,a=e(n=s,l));this.removeAttributeNS(t.space,t.local)}}function rp(t,e){var r=Ni(t),n="transform"===r?_o:Xd;return this.attrTween(t,"function"==typeof e?(r.local?ep:tp)(r,n,Vd(this,"attr."+t,e)):null==e?(r.local?Zd:Kd)(r):(r.local?Jd:Qd)(r,n,e))}function np(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function ip(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function ap(t,e){var r,n;function i(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&ip(t,i)),r}return o(i,"tween"),i._value=e,i}function sp(t,e){var r,n;function i(){var i=e.apply(this,arguments);return i!==n&&(r=(n=i)&&np(t,i)),r}return o(i,"tween"),i._value=e,i}function op(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var n=Ni(t);return this.tween(r,(n.local?ap:sp)(n,e))}function lp(t,e){return function(){Fd(this,t).delay=+e.apply(this,arguments)}}function cp(t,e){return e=+e,function(){Fd(this,t).delay=e}}function hp(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?lp:cp)(e,t)):Ud(this.node(),e).delay}function up(t,e){return function(){zd(this,t).duration=+e.apply(this,arguments)}}function dp(t,e){return e=+e,function(){zd(this,t).duration=e}}function pp(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?up:dp)(e,t)):Ud(this.node(),e).duration}function gp(t,e){if("function"!=typeof e)throw new Error;return function(){zd(this,t).ease=e}}function fp(t){var e=this._id;return arguments.length?this.each(gp(e,t)):Ud(this.node(),e).ease}function mp(t,e){return function(){var r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;zd(this,t).ease=r}}function yp(t){if("function"!=typeof t)throw new Error;return this.each(mp(this._id,t))}function vp(t){"function"!=typeof t&&(t=Kn(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a,s=e[i],o=s.length,l=n[i]=[],c=0;c<o;++c)(a=s[c])&&t.call(a,a.__data__,c,s)&&l.push(a);return new Hp(n,this._parents,this._name,this._id)}function xp(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),o=0;o<a;++o)for(var l,c=e[o],h=r[o],u=c.length,d=s[o]=new Array(u),p=0;p<u;++p)(l=c[p]||h[p])&&(d[p]=l);for(;o<n;++o)s[o]=e[o];return new Hp(s,this._parents,this._name,this._id)}function bp(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}function wp(t,e,r){var n,i,a=bp(e)?Fd:zd;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function kp(t,e){var r=this._id;return arguments.length<2?Ud(this.node(),r).on.on(t):this.each(wp(r,t,e))}function Tp(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function _p(){return this.on("end.remove",Tp(this._id))}function Ep(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=qn(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o,l,c=n[s],h=c.length,u=a[s]=new Array(h),d=0;d<h;++d)(o=c[d])&&(l=t.call(o,o.__data__,d,c))&&("__data__"in o&&(l.__data__=o.__data__),u[d]=l,$d(u[d],e,r,d,u,Ud(o,r)));return new Hp(a,this._parents,e,r)}function Cp(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=Hn(t));for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var l,c=n[o],h=c.length,u=0;u<h;++u)if(l=c[u]){for(var d,p=t.call(l,l.__data__,u,c),g=Ud(l,r),f=0,m=p.length;f<m;++f)(d=p[f])&&$d(d,e,r,f,p,g);a.push(p),s.push(l)}return new Hp(a,s,e,r)}o($d,"default"),o(Fd,"init"),o(zd,"set"),o(Ud,"get"),o(Gd,"create"),o(qd,"default"),o(jd,"default"),o(Wd,"tweenRemove"),o(Yd,"tweenFunction"),o(Hd,"default"),o(Vd,"tweenValue"),o(Xd,"default"),o(Kd,"attrRemove"),o(Zd,"attrRemoveNS"),o(Qd,"attrConstant"),o(Jd,"attrConstantNS"),o(tp,"attrFunction"),o(ep,"attrFunctionNS"),o(rp,"default"),o(np,"attrInterpolate"),o(ip,"attrInterpolateNS"),o(ap,"attrTweenNS"),o(sp,"attrTween"),o(op,"default"),o(lp,"delayFunction"),o(cp,"delayConstant"),o(hp,"default"),o(up,"durationFunction"),o(dp,"durationConstant"),o(pp,"default"),o(gp,"easeConstant"),o(fp,"default"),o(mp,"easeVarying"),o(yp,"default"),o(vp,"default"),o(xp,"default"),o(bp,"start"),o(wp,"onFunction"),o(kp,"default"),o(Tp,"removeFunction"),o(_p,"default"),o(Ep,"default"),o(Cp,"default");var Sp=Ua.prototype.constructor;function Ap(){return new Sp(this._groups,this._parents)}function Lp(t,e){var r,n,i;return function(){var a=qi(this,t),s=(this.style.removeProperty(t),qi(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function Np(t){return function(){this.style.removeProperty(t)}}function Ip(t,e,r){var n,i,a=r+"";return function(){var s=qi(this,t);return s===a?null:s===n?i:i=e(n=s,r)}}function Rp(t,e,r){var n,i,a;return function(){var s=qi(this,t),o=r(this),l=o+"";return null==o&&(this.style.removeProperty(t),l=o=qi(this,t)),s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o))}}function Mp(t,e){var r,n,i,a,s="style."+e,o="end."+s;return function(){var l=zd(this,t),c=l.on,h=null==l.value[s]?a||(a=Np(e)):void 0;c===r&&i===h||(n=(r=c).copy()).on(o,i=h),l.on=n}}function Dp(t,e,r){var n="transform"==(t+="")?To:Xd;return null==e?this.styleTween(t,Lp(t,n)).on("end.style."+t,Np(t)):"function"==typeof e?this.styleTween(t,Rp(t,n,Vd(this,"style."+t,e))).each(Mp(this._id,t)):this.styleTween(t,Ip(t,n,e),r).on("end.style."+t,null)}function Op(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Pp(t,e,r){var n,i;function a(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&Op(t,a,r)),n}return o(a,"tween"),a._value=e,a}function Bp(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;return this.tween(n,Pp(t,e,null==r?"":r))}function $p(t){return function(){this.textContent=t}}function Fp(t){return function(){var e=t(this);this.textContent=null==e?"":e}}function zp(t){return this.tween("text","function"==typeof t?Fp(Vd(this,"text",t)):$p(null==t?"":t+""))}function Up(t){return function(e){this.textContent=t.call(this,e)}}function Gp(t){var e,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&Up(n)),e}return o(n,"tween"),n._value=t,n}function qp(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Gp(t))}function jp(){for(var t=this._name,e=this._id,r=Xp(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s,o=n[a],l=o.length,c=0;c<l;++c)if(s=o[c]){var h=Ud(s,e);$d(s,t,r,c,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Hp(n,this._parents,t,r)}function Wp(){var t,e,r=this,n=r._id,i=r.size();return new Promise((function(a,s){var l={value:s},c={value:o((function(){0==--i&&a()}),"value")};r.each((function(){var r=zd(this,n),i=r.on;i!==t&&((e=(t=i).copy())._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),r.on=e})),0===i&&a()}))}o(Ap,"default"),o(Lp,"styleNull"),o(Np,"styleRemove"),o(Ip,"styleConstant"),o(Rp,"styleFunction"),o(Mp,"styleMaybeRemove"),o(Dp,"default"),o(Op,"styleInterpolate"),o(Pp,"styleTween"),o(Bp,"default"),o($p,"textConstant"),o(Fp,"textFunction"),o(zp,"default"),o(Up,"textInterpolate"),o(Gp,"textTween"),o(qp,"default"),o(jp,"default"),o(Wp,"default");var Yp=0;function Hp(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Vp(t){return Ua().transition(t)}function Xp(){return++Yp}o(Hp,"Transition"),o(Vp,"transition"),o(Xp,"newId");var Kp=Ua.prototype;function Zp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Hp.prototype=Vp.prototype={constructor:Hp,select:Ep,selectAll:Cp,selectChild:Kp.selectChild,selectChildren:Kp.selectChildren,filter:vp,merge:xp,selection:Ap,transition:jp,call:Kp.call,nodes:Kp.nodes,node:Kp.node,size:Kp.size,empty:Kp.empty,each:Kp.each,on:kp,attr:rp,attrTween:op,style:Dp,styleTween:Bp,text:zp,textTween:qp,remove:_p,tween:Hd,delay:hp,duration:pp,ease:fp,easeVarying:yp,end:Wp,[Symbol.iterator]:Kp[Symbol.iterator]},o(Zp,"cubicInOut");var Qp={time:null,delay:0,duration:250,ease:Zp};function Jp(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function tg(t){var e,r;t instanceof Hp?(e=t._id,t=t._name):(e=Xp(),(r=Qp).time=Cd(),t=null==t?null:t+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s,o=n[a],l=o.length,c=0;c<l;++c)(s=o[c])&&$d(s,t,e,c,o,r||Jp(s,e));return new Hp(n,this._parents,t,e)}function eg(t){return[+t[0],+t[1]]}function rg(t,e,r){this.k=t,this.x=e,this.y=r}o(Jp,"inherit"),o(tg,"default"),Ua.prototype.interrupt=jd,Ua.prototype.transition=tg,o(eg,"number1"),o((function(t){return[eg(t[0]),eg(t[1])]}),"number2"),o((function(t){return{type:t}}),"type"),o(rg,"Transform"),rg.prototype={constructor:rg,scale:o((function(t){return 1===t?this:new rg(this.k*t,this.x,this.y)}),"scale"),translate:o((function(t,e){return 0===t&0===e?this:new rg(this.k,this.x+this.k*t,this.y+this.k*e)}),"translate"),apply:o((function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]}),"apply"),applyX:o((function(t){return t*this.k+this.x}),"applyX"),applyY:o((function(t){return t*this.k+this.y}),"applyY"),invert:o((function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]}),"invert"),invertX:o((function(t){return(t-this.x)/this.k}),"invertX"),invertY:o((function(t){return(t-this.y)/this.k}),"invertY"),rescaleX:o((function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))}),"rescaleX"),rescaleY:o((function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))}),"rescaleY"),toString:o((function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}),"toString")};var ng=new rg(1,0,0);function ig(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ng;return t.__zoom}ig.prototype=rg.prototype,o(ig,"transform");
/*! Bundled license information:
dompurify/dist/purify.es.mjs:
(*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE *)
*/
var ag=o((t=>{const{securityLevel:e}=Qr();let r=Ga("body");if("sandbox"===e){const e=Ga(`#i${t}`);r=Ga((e.node()?.contentDocument??document).body)}return r.select(`#${t}`)}),"selectSvgElement");function sg(t){return null==t}function og(t){return"object"==typeof t&&null!==t}function lg(t){return Array.isArray(t)?t:sg(t)?[]:[t]}function cg(t,e){var r,n,i,a;if(e)for(r=0,n=(a=Object.keys(e)).length;r<n;r+=1)t[i=a[r]]=e[i];return t}function hg(t,e){var r,n="";for(r=0;r<e;r+=1)n+=t;return n}function ug(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}o(sg,"isNothing"),o(og,"isObject"),o(lg,"toArray"),o(cg,"extend"),o(hg,"repeat"),o(ug,"isNegativeZero");var dg={isNothing:sg,isObject:og,toArray:lg,repeat:hg,isNegativeZero:ug,extend:cg};function pg(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+="\n\n"+t.mark.snippet),n+" "+r):n}function gg(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=pg(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}o(pg,"formatError"),o(gg,"YAMLException$1"),gg.prototype=Object.create(Error.prototype),gg.prototype.constructor=gg,gg.prototype.toString=o((function(t){return this.name+": "+pg(this,t)}),"toString");var fg=gg;function mg(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(e=n-o+(a=" ... ").length),r-n>o&&(r=n+o-(s=" ...").length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}function yg(t,e){return dg.repeat(" ",e-t.length)+t}function vg(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 r,n=/\r?\n|\r|\0/g,i=[0],a=[],s=-1;r=n.exec(t.buffer);)a.push(r.index),i.push(r.index+r[0].length),t.position<=r.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=mg(t.buffer,i[s-o],a[s-o],t.position-(i[s]-i[s-o]),u),c=dg.repeat(" ",e.indent)+yg((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=mg(t.buffer,i[s],a[s],t.position,u),c+=dg.repeat(" ",e.indent)+yg((t.line+1).toString(),h)+" | "+l.str+"\n",c+=dg.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(s+o>=a.length);o++)l=mg(t.buffer,i[s+o],a[s+o],t.position-(i[s]-i[s+o]),u),c+=dg.repeat(" ",e.indent)+yg((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}o(mg,"getLine"),o(yg,"padStart"),o(vg,"makeSnippet");var xg=vg,bg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],wg=["scalar","sequence","mapping"];function kg(t){var e={};return null!==t&&Object.keys(t).forEach((function(r){t[r].forEach((function(t){e[String(t)]=r}))})),e}function Tg(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===bg.indexOf(e))throw new fg('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=kg(e.styleAliases||null),-1===wg.indexOf(this.kind))throw new fg('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}o(kg,"compileStyleAliases"),o(Tg,"Type$1");var _g=Tg;function Eg(t,e){var r=[];return t[e].forEach((function(t){var e=r.length;r.forEach((function(r,n){r.tag===t.tag&&r.kind===t.kind&&r.multi===t.multi&&(e=n)})),r[e]=t})),r}function Cg(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for(o(n,"collectType"),t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(n);return r}function Sg(t){return this.extend(t)}o(Eg,"compileList"),o(Cg,"compileMap"),o(Sg,"Schema$1"),Sg.prototype.extend=o((function(t){var e=[],r=[];if(t instanceof _g)r.push(t);else if(Array.isArray(t))r=r.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new fg("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof _g))throw new fg("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new fg("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new fg("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(t){if(!(t instanceof _g))throw new fg("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(Sg.prototype);return n.implicit=(this.implicit||[]).concat(e),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=Eg(n,"implicit"),n.compiledExplicit=Eg(n,"explicit"),n.compiledTypeMap=Cg(n.compiledImplicit,n.compiledExplicit),n}),"extend");var Ag=Sg,Lg=new _g("tag:yaml.org,2002:str",{kind:"scalar",construct:o((function(t){return null!==t?t:""}),"construct")}),Ng=new _g("tag:yaml.org,2002:seq",{kind:"sequence",construct:o((function(t){return null!==t?t:[]}),"construct")}),Ig=new _g("tag:yaml.org,2002:map",{kind:"mapping",construct:o((function(t){return null!==t?t:{}}),"construct")}),Rg=new Ag({explicit:[Lg,Ng,Ig]});function Mg(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function Dg(){return null}function Og(t){return null===t}o(Mg,"resolveYamlNull"),o(Dg,"constructYamlNull"),o(Og,"isNull");var Pg=new _g("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mg,construct:Dg,predicate:Og,represent:{canonical:o((function(){return"~"}),"canonical"),lowercase:o((function(){return"null"}),"lowercase"),uppercase:o((function(){return"NULL"}),"uppercase"),camelcase:o((function(){return"Null"}),"camelcase"),empty:o((function(){return""}),"empty")},defaultStyle:"lowercase"});function Bg(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function $g(t){return"true"===t||"True"===t||"TRUE"===t}function Fg(t){return"[object Boolean]"===Object.prototype.toString.call(t)}o(Bg,"resolveYamlBoolean"),o($g,"constructYamlBoolean"),o(Fg,"isBoolean");var zg=new _g("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Bg,construct:$g,predicate:Fg,represent:{lowercase:o((function(t){return t?"true":"false"}),"lowercase"),uppercase:o((function(t){return t?"TRUE":"FALSE"}),"uppercase"),camelcase:o((function(t){return t?"True":"False"}),"camelcase")},defaultStyle:"lowercase"});function Ug(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function Gg(t){return 48<=t&&t<=55}function qg(t){return 48<=t&&t<=57}function jg(t){if(null===t)return!1;var e,r=t.length,n=0,i=!1;if(!r)return!1;if("-"!==(e=t[n])&&"+"!==e||(e=t[++n]),"0"===e){if(n+1===r)return!0;if("b"===(e=t[++n])){for(n++;n<r;n++)if("_"!==(e=t[n])){if("0"!==e&&"1"!==e)return!1;i=!0}return i&&"_"!==e}if("x"===e){for(n++;n<r;n++)if("_"!==(e=t[n])){if(!Ug(t.charCodeAt(n)))return!1;i=!0}return i&&"_"!==e}if("o"===e){for(n++;n<r;n++)if("_"!==(e=t[n])){if(!Gg(t.charCodeAt(n)))return!1;i=!0}return i&&"_"!==e}}if("_"===e)return!1;for(;n<r;n++)if("_"!==(e=t[n])){if(!qg(t.charCodeAt(n)))return!1;i=!0}return!(!i||"_"===e)}function Wg(t){var e,r=t,n=1;if(-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(n=-1),e=(r=r.slice(1))[0]),"0"===r)return 0;if("0"===e){if("b"===r[1])return n*parseInt(r.slice(2),2);if("x"===r[1])return n*parseInt(r.slice(2),16);if("o"===r[1])return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Yg(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!dg.isNegativeZero(t)}o(Ug,"isHexCode"),o(Gg,"isOctCode"),o(qg,"isDecCode"),o(jg,"resolveYamlInteger"),o(Wg,"constructYamlInteger"),o(Yg,"isInteger");var Hg=new _g("tag:yaml.org,2002:int",{kind:"scalar",resolve:jg,construct:Wg,predicate:Yg,represent:{binary:o((function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)}),"binary"),octal:o((function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}),"octal"),decimal:o((function(t){return t.toString(10)}),"decimal"),hexadecimal:o((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"]}}),Vg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xg(t){return null!==t&&!(!Vg.test(t)||"_"===t[t.length-1])}function Kg(t){var e,r;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:r*parseFloat(e,10)}o(Xg,"resolveYamlFloat"),o(Kg,"constructYamlFloat");var Zg=/^[-+]?[0-9]+e/;function Qg(t,e){var r;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(dg.isNegativeZero(t))return"-0.0";return r=t.toString(10),Zg.test(r)?r.replace("e",".e"):r}function Jg(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||dg.isNegativeZero(t))}o(Qg,"representYamlFloat"),o(Jg,"isFloat");var tf=new _g("tag:yaml.org,2002:float",{kind:"scalar",resolve:Xg,construct:Kg,predicate:Jg,represent:Qg,defaultStyle:"lowercase"}),ef=Rg.extend({implicit:[Pg,zg,Hg,tf]}),rf=ef,nf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),af=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 sf(t){return null!==t&&(null!==nf.exec(t)||null!==af.exec(t))}function of(t){var e,r,n,i,a,s,o,l,c=0,h=null;if(null===(e=nf.exec(t))&&(e=af.exec(t)),null===e)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,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(r,n,i,a,s,o,c)),h&&l.setTime(l.getTime()-h),l}function lf(t){return t.toISOString()}o(sf,"resolveYamlTimestamp"),o(of,"constructYamlTimestamp"),o(lf,"representYamlTimestamp");var cf=new _g("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:sf,construct:of,instanceOf:Date,represent:lf});function hf(t){return"<<"===t||null===t}o(hf,"resolveYamlMerge");var uf=new _g("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hf}),df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function pf(t){if(null===t)return!1;var e,r,n=0,i=t.length,a=df;for(r=0;r<i;r++)if(!((e=a.indexOf(t.charAt(r)))>64)){if(e<0)return!1;n+=6}return n%8==0}function gf(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=df,s=0,o=[];for(e=0;e<i;e++)e%4==0&&e&&(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)),s=s<<6|a.indexOf(n.charAt(e));return 0===(r=i%4*6)?(o.push(s>>16&255),o.push(s>>8&255),o.push(255&s)):18===r?(o.push(s>>10&255),o.push(s>>2&255)):12===r&&o.push(s>>4&255),new Uint8Array(o)}function ff(t){var e,r,n="",i=0,a=t.length,s=df;for(e=0;e<a;e++)e%3==0&&e&&(n+=s[i>>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]),i=(i<<8)+t[e];return 0===(r=a%3)?(n+=s[i>>18&63],n+=s[i>>12&63],n+=s[i>>6&63],n+=s[63&i]):2===r?(n+=s[i>>10&63],n+=s[i>>4&63],n+=s[i<<2&63],n+=s[64]):1===r&&(n+=s[i>>2&63],n+=s[i<<4&63],n+=s[64],n+=s[64]),n}function mf(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}o(pf,"resolveYamlBinary"),o(gf,"constructYamlBinary"),o(ff,"representYamlBinary"),o(mf,"isBinary");var yf=new _g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:pf,construct:gf,predicate:mf,represent:ff}),vf=Object.prototype.hasOwnProperty,xf=Object.prototype.toString;function bf(t){if(null===t)return!0;var e,r,n,i,a,s=[],o=t;for(e=0,r=o.length;e<r;e+=1){if(n=o[e],a=!1,"[object Object]"!==xf.call(n))return!1;for(i in n)if(vf.call(n,i)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==s.indexOf(i))return!1;s.push(i)}return!0}function wf(t){return null!==t?t:[]}o(bf,"resolveYamlOmap"),o(wf,"constructYamlOmap");var kf=new _g("tag:yaml.org,2002:omap",{kind:"sequence",resolve:bf,construct:wf}),Tf=Object.prototype.toString;function _f(t){if(null===t)return!0;var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1){if(n=s[e],"[object Object]"!==Tf.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;a[e]=[i[0],n[i[0]]]}return!0}function Ef(t){if(null===t)return[];var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1)n=s[e],i=Object.keys(n),a[e]=[i[0],n[i[0]]];return a}o(_f,"resolveYamlPairs"),o(Ef,"constructYamlPairs");var Cf=new _g("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:_f,construct:Ef}),Sf=Object.prototype.hasOwnProperty;function Af(t){if(null===t)return!0;var e,r=t;for(e in r)if(Sf.call(r,e)&&null!==r[e])return!1;return!0}function Lf(t){return null!==t?t:{}}o(Af,"resolveYamlSet"),o(Lf,"constructYamlSet");var Nf=new _g("tag:yaml.org,2002:set",{kind:"mapping",resolve:Af,construct:Lf}),If=rf.extend({implicit:[cf,uf],explicit:[yf,kf,Cf,Nf]}),Rf=Object.prototype.hasOwnProperty,Mf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Df=/[\x85\u2028\u2029]/,Of=/[,\[\]\{\}]/,Pf=/^(?:!|!!|![a-z\-]+!)$/i,Bf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function $f(t){return Object.prototype.toString.call(t)}function Ff(t){return 10===t||13===t}function zf(t){return 9===t||32===t}function Uf(t){return 9===t||32===t||10===t||13===t}function Gf(t){return 44===t||91===t||93===t||123===t||125===t}function qf(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function jf(t){return 120===t?2:117===t?4:85===t?8:0}function Wf(t){return 48<=t&&t<=57?t-48:-1}function Yf(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function Hf(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}o($f,"_class"),o(Ff,"is_EOL"),o(zf,"is_WHITE_SPACE"),o(Uf,"is_WS_OR_EOL"),o(Gf,"is_FLOW_INDICATOR"),o(qf,"fromHexCode"),o(jf,"escapedHexLen"),o(Wf,"fromDecimalCode"),o(Yf,"simpleEscapeSequence"),o(Hf,"charFromCodepoint");var Vf,Xf=new Array(256),Kf=new Array(256);for(Vf=0;Vf<256;Vf++)Xf[Vf]=Yf(Vf)?1:0,Kf[Vf]=Yf(Vf);function Zf(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||If,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 Qf(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=xg(r),new fg(e,r)}function Jf(t,e){throw Qf(t,e)}function tm(t,e){t.onWarning&&t.onWarning.call(null,Qf(t,e))}o(Zf,"State$1"),o(Qf,"generateError"),o(Jf,"throwError"),o(tm,"throwWarning");var em={YAML:o((function(t,e,r){var n,i,a;null!==t.version&&Jf(t,"duplication of %YAML directive"),1!==r.length&&Jf(t,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&Jf(t,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),a=parseInt(n[2],10),1!==i&&Jf(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,1!==a&&2!==a&&tm(t,"unsupported YAML version of the document")}),"handleYamlDirective"),TAG:o((function(t,e,r){var n,i;2!==r.length&&Jf(t,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],Pf.test(n)||Jf(t,"ill-formed tag handle (first argument) of the TAG directive"),Rf.call(t.tagMap,n)&&Jf(t,'there is a previously declared suffix for "'+n+'" tag handle'),Bf.test(i)||Jf(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){Jf(t,"tag prefix is malformed: "+i)}t.tagMap[n]=i}),"handleTagDirective")};function rm(t,e,r,n){var i,a,s,o;if(e<r){if(o=t.input.slice(e,r),n)for(i=0,a=o.length;i<a;i+=1)9===(s=o.charCodeAt(i))||32<=s&&s<=1114111||Jf(t,"expected valid JSON character");else Mf.test(o)&&Jf(t,"the stream contains non-printable characters");t.result+=o}}function nm(t,e,r,n){var i,a,s,o;for(dg.isObject(r)||Jf(t,"cannot merge mappings; the provided source object is unacceptable"),s=0,o=(i=Object.keys(r)).length;s<o;s+=1)a=i[s],Rf.call(e,a)||(e[a]=r[a],n[a]=!0)}function im(t,e,r,n,i,a,s,o,l){var c,h;if(Array.isArray(i))for(c=0,h=(i=Array.prototype.slice.call(i)).length;c<h;c+=1)Array.isArray(i[c])&&Jf(t,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===$f(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===$f(i)&&(i="[object Object]"),i=String(i),null===e&&(e={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(a))for(c=0,h=a.length;c<h;c+=1)nm(t,e,a[c],r);else nm(t,e,a,r);else t.json||Rf.call(r,i)||!Rf.call(e,i)||(t.line=s||t.line,t.lineStart=o||t.lineStart,t.position=l||t.position,Jf(t,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(e,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[i]=a,delete r[i];return e}function am(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):Jf(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function sm(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);0!==i;){for(;zf(i);)9===i&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&35===i)do{i=t.input.charCodeAt(++t.position)}while(10!==i&&13!==i&&0!==i);if(!Ff(i))break;for(am(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;32===i;)t.lineIndent++,i=t.input.charCodeAt(++t.position)}return-1!==r&&0!==n&&t.lineIndent<r&&tm(t,"deficient indentation"),n}function om(t){var e,r=t.position;return!(45!==(e=t.input.charCodeAt(r))&&46!==e||e!==t.input.charCodeAt(r+1)||e!==t.input.charCodeAt(r+2)||(r+=3,0!==(e=t.input.charCodeAt(r))&&!Uf(e)))}function lm(t,e){1===e?t.result+=" ":e>1&&(t.result+=dg.repeat("\n",e-1))}function cm(t,e,r){var n,i,a,s,o,l,c,h,u=t.kind,d=t.result;if(Uf(h=t.input.charCodeAt(t.position))||Gf(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)&&(Uf(n=t.input.charCodeAt(t.position+1))||r&&Gf(n)))return!1;for(t.kind="scalar",t.result="",i=a=t.position,s=!1;0!==h;){if(58===h){if(Uf(n=t.input.charCodeAt(t.position+1))||r&&Gf(n))break}else if(35===h){if(Uf(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&om(t)||r&&Gf(h))break;if(Ff(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,sm(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&&(rm(t,i,a,!1),lm(t,t.line-o),i=a=t.position,s=!1),zf(h)||(a=t.position+1),h=t.input.charCodeAt(++t.position)}return rm(t,i,a,!1),!!t.result||(t.kind=u,t.result=d,!1)}function hm(t,e){var r,n,i;if(39!==(r=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(r=t.input.charCodeAt(t.position));)if(39===r){if(rm(t,n,t.position,!0),39!==(r=t.input.charCodeAt(++t.position)))return!0;n=t.position,t.position++,i=t.position}else Ff(r)?(rm(t,n,i,!0),lm(t,sm(t,!1,e)),n=i=t.position):t.position===t.lineStart&&om(t)?Jf(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Jf(t,"unexpected end of the stream within a single quoted scalar")}function um(t,e){var r,n,i,a,s,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return rm(t,r,t.position,!0),t.position++,!0;if(92===o){if(rm(t,r,t.position,!0),Ff(o=t.input.charCodeAt(++t.position)))sm(t,!1,e);else if(o<256&&Xf[o])t.result+=Kf[o],t.position++;else if((s=jf(o))>0){for(i=s,a=0;i>0;i--)(s=qf(o=t.input.charCodeAt(++t.position)))>=0?a=(a<<4)+s:Jf(t,"expected hexadecimal character");t.result+=Hf(a),t.position++}else Jf(t,"unknown escape sequence");r=n=t.position}else Ff(o)?(rm(t,r,n,!0),lm(t,sm(t,!1,e)),r=n=t.position):t.position===t.lineStart&&om(t)?Jf(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Jf(t,"unexpected end of the stream within a double quoted scalar")}function dm(t,e){var r,n,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(sm(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&&Jf(t,"expected the node content, but found ','"):Jf(t,"missed comma between flow collection entries"),d=null,o=l=!1,63===p&&Uf(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,sm(t,!0,e)),r=t.line,n=t.lineStart,i=t.position,xm(t,e,1,!1,!0),u=t.tag,h=t.result,sm(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==r||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),sm(t,!0,e),xm(t,e,1,!1,!0),d=t.result),c?im(t,a,y,u,h,d,r,n,i):o?a.push(im(t,null,y,u,h,d,r,n,i)):a.push(h),sm(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}Jf(t,"unexpected end of the stream within a flow collection")}function pm(t,e){var r,n,i,a,s=1,o=!1,l=!1,c=e,h=0,u=!1;if(124===(a=t.input.charCodeAt(t.position)))n=!1;else{if(62!==a)return!1;n=!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:Jf(t,"repeat of a chomping mode identifier");else{if(!((i=Wf(a))>=0))break;0===i?Jf(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?Jf(t,"repeat of an indentation width identifier"):(c=e+i-1,l=!0)}if(zf(a)){do{a=t.input.charCodeAt(++t.position)}while(zf(a));if(35===a)do{a=t.input.charCodeAt(++t.position)}while(!Ff(a)&&0!==a)}for(;0!==a;){for(am(t),t.lineIndent=0,a=t.input.charCodeAt(t.position);(!l||t.lineIndent<c)&&32===a;)t.lineIndent++,a=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>c&&(c=t.lineIndent),Ff(a))h++;else{if(t.lineIndent<c){3===s?t.result+=dg.repeat("\n",o?1+h:h):1===s&&o&&(t.result+="\n");break}for(n?zf(a)?(u=!0,t.result+=dg.repeat("\n",o?1+h:h)):u?(u=!1,t.result+=dg.repeat("\n",h+1)):0===h?o&&(t.result+=" "):t.result+=dg.repeat("\n",h):t.result+=dg.repeat("\n",o?1+h:h),o=!0,l=!0,h=0,r=t.position;!Ff(a)&&0!==a;)a=t.input.charCodeAt(++t.position);rm(t,r,t.position,!1)}}return!0}function gm(t,e){var r,n,i=t.tag,a=t.anchor,s=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),n=t.input.charCodeAt(t.position);0!==n&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,Jf(t,"tab characters must not be used in indentation")),45===n)&&Uf(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,sm(t,!0,-1)&&t.lineIndent<=e)s.push(null),n=t.input.charCodeAt(t.position);else if(r=t.line,xm(t,e,3,!1,!0),s.push(t.result),sm(t,!0,-1),n=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==n)Jf(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!o&&(t.tag=i,t.anchor=a,t.kind="sequence",t.result=s,!0)}function fm(t,e,r){var n,i,a,s,o,l,c,h=t.tag,u=t.anchor,d={},p=Object.create(null),g=null,f=null,m=null,y=!1,v=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=d),c=t.input.charCodeAt(t.position);0!==c;){if(y||-1===t.firstTabInLine||(t.position=t.firstTabInLine,Jf(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),a=t.line,63!==c&&58!==c||!Uf(n)){if(s=t.line,o=t.lineStart,l=t.position,!xm(t,r,2,!1,!0))break;if(t.line===a){for(c=t.input.charCodeAt(t.position);zf(c);)c=t.input.charCodeAt(++t.position);if(58===c)Uf(c=t.input.charCodeAt(++t.position))||Jf(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(im(t,d,p,g,f,null,s,o,l),g=f=m=null),v=!0,y=!1,i=!1,g=t.tag,f=t.result;else{if(!v)return t.tag=h,t.anchor=u,!0;Jf(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return t.tag=h,t.anchor=u,!0;Jf(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(y&&(im(t,d,p,g,f,null,s,o,l),g=f=m=null),v=!0,y=!0,i=!0):y?(y=!1,i=!0):Jf(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,c=n;if((t.line===a||t.lineIndent>e)&&(y&&(s=t.line,o=t.lineStart,l=t.position),xm(t,e,4,!0,i)&&(y?f=t.result:m=t.result),y||(im(t,d,p,g,f,m,s,o,l),g=f=m=null),sm(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&0!==c)Jf(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&im(t,d,p,g,f,null,s,o,l),v&&(t.tag=h,t.anchor=u,t.kind="mapping",t.result=d),v}function mm(t){var e,r,n,i,a=!1,s=!1;if(33!==(i=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&Jf(t,"duplication of a tag property"),60===(i=t.input.charCodeAt(++t.position))?(a=!0,i=t.input.charCodeAt(++t.position)):33===i?(s=!0,r="!!",i=t.input.charCodeAt(++t.position)):r="!",e=t.position,a){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&62!==i);t.position<t.length?(n=t.input.slice(e,t.position),i=t.input.charCodeAt(++t.position)):Jf(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!Uf(i);)33===i&&(s?Jf(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),Pf.test(r)||Jf(t,"named tag handle cannot contain such characters"),s=!0,e=t.position+1)),i=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),Of.test(n)&&Jf(t,"tag suffix cannot contain flow indicator characters")}n&&!Bf.test(n)&&Jf(t,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(e){Jf(t,"tag name is malformed: "+n)}return a?t.tag=n:Rf.call(t.tagMap,r)?t.tag=t.tagMap[r]+n:"!"===r?t.tag="!"+n:"!!"===r?t.tag="tag:yaml.org,2002:"+n:Jf(t,'undeclared tag handle "'+r+'"'),!0}function ym(t){var e,r;if(38!==(r=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&Jf(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!Uf(r)&&!Gf(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Jf(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function vm(t){var e,r,n;if(42!==(n=t.input.charCodeAt(t.position)))return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!Uf(n)&&!Gf(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&Jf(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),Rf.call(t.anchorMap,r)||Jf(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],sm(t,!0,-1),!0}function xm(t,e,r,n,i){var a,s,o,l,c,h,u,d,p,g=1,f=!1,m=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=s=o=4===r||3===r,n&&sm(t,!0,-1)&&(f=!0,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)),1===g)for(;mm(t)||ym(t);)sm(t,!0,-1)?(f=!0,o=a,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)):o=!1;if(o&&(o=f||i),1!==g&&4!==r||(d=1===r||2===r?e:e+1,p=t.position-t.lineStart,1===g?o&&(gm(t,p)||fm(t,p,d))||dm(t,d)?m=!0:(s&&pm(t,d)||hm(t,d)||um(t,d)?m=!0:vm(t)?(m=!0,null===t.tag&&null===t.anchor||Jf(t,"alias node should not have any properties")):cm(t,d,1===r)&&(m=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===g&&(m=o&&gm(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&Jf(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l<c;l+=1)if((u=t.implicitTypes[l]).resolve(t.result)){t.result=u.construct(t.result),t.tag=u.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(Rf.call(t.typeMap[t.kind||"fallback"],t.tag))u=t.typeMap[t.kind||"fallback"][t.tag];else for(u=null,l=0,c=(h=t.typeMap.multi[t.kind||"fallback"]).length;l<c;l+=1)if(t.tag.slice(0,h[l].tag.length)===h[l].tag){u=h[l];break}u||Jf(t,"unknown tag !<"+t.tag+">"),null!==t.result&&u.kind!==t.kind&&Jf(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)):Jf(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 bm(t){var e,r,n,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))&&(sm(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&&!Uf(i);)i=t.input.charCodeAt(++t.position);for(n=[],(r=t.input.slice(e,t.position)).length<1&&Jf(t,"directive name must not be less than one character in length");0!==i;){for(;zf(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!Ff(i));break}if(Ff(i))break;for(e=t.position;0!==i&&!Uf(i);)i=t.input.charCodeAt(++t.position);n.push(t.input.slice(e,t.position))}0!==i&&am(t),Rf.call(em,r)?em[r](t,r,n):tm(t,'unknown document directive "'+r+'"')}sm(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,sm(t,!0,-1)):s&&Jf(t,"directives end mark is expected"),xm(t,t.lineIndent-1,4,!1,!0),sm(t,!0,-1),t.checkLineBreaks&&Df.test(t.input.slice(a,t.position))&&tm(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&om(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,sm(t,!0,-1)):t.position<t.length-1&&Jf(t,"end of the stream or a document separator is expected")}function wm(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var r=new Zf(t,e),n=t.indexOf("\0");for(-1!==n&&(r.position=n,Jf(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)bm(r);return r.documents}function km(t,e,r){null!==e&&"object"==typeof e&&void 0===r&&(r=e,e=null);var n=wm(t,r);if("function"!=typeof e)return n;for(var i=0,a=n.length;i<a;i+=1)e(n[i])}function Tm(t,e){var r=wm(t,e);if(0!==r.length){if(1===r.length)return r[0];throw new fg("expected a single document in the stream, but found more")}}o(rm,"captureSegment"),o(nm,"mergeMappings"),o(im,"storeMappingPair"),o(am,"readLineBreak"),o(sm,"skipSeparationSpace"),o(om,"testDocumentSeparator"),o(lm,"writeFoldedLines"),o(cm,"readPlainScalar"),o(hm,"readSingleQuotedScalar"),o(um,"readDoubleQuotedScalar"),o(dm,"readFlowCollection"),o(pm,"readBlockScalar"),o(gm,"readBlockSequence"),o(fm,"readBlockMapping"),o(mm,"readTagProperty"),o(ym,"readAnchorProperty"),o(vm,"readAlias"),o(xm,"composeNode"),o(bm,"readDocument"),o(wm,"loadDocuments"),o(km,"loadAll$1"),o(Tm,"load$1");var _m={loadAll:km,load:Tm},Em=Object.prototype.toString,Cm=Object.prototype.hasOwnProperty,Sm=65279,Am={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Lm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Nm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Im(t,e){var r,n,i,a,s,o,l;if(null===e)return{};for(r={},i=0,a=(n=Object.keys(e)).length;i<a;i+=1)s=n[i],o=String(e[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),(l=t.compiledTypeMap.fallback[s])&&Cm.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[s]=o;return r}function Rm(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else{if(!(t<=4294967295))throw new fg("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+dg.repeat("0",n-e.length)+e}o(Im,"compileStyleMap"),o(Rm,"encodeHex");function Mm(t){this.schema=t.schema||If,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=dg.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Im(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Dm(t,e){for(var r,n=dg.repeat(" ",e),i=0,a=-1,s="",o=t.length;i<o;)-1===(a=t.indexOf("\n",i))?(r=t.slice(i),i=o):(r=t.slice(i,a+1),i=a+1),r.length&&"\n"!==r&&(s+=n),s+=r;return s}function Om(t,e){return"\n"+dg.repeat(" ",t.indent*e)}function Pm(t,e){var r,n;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Bm(t){return 32===t||9===t}function $m(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&t!==Sm||65536<=t&&t<=1114111}function Fm(t){return $m(t)&&t!==Sm&&13!==t&&10!==t}function zm(t,e,r){var n=Fm(t),i=n&&!Bm(t);return(r?n:n&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!i)||Fm(e)&&!Bm(e)&&35===t||58===e&&i}function Um(t){return $m(t)&&t!==Sm&&!Bm(t)&&45!==t&&63!==t&&58!==t&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t&&35!==t&&38!==t&&42!==t&&33!==t&&124!==t&&61!==t&&62!==t&&39!==t&&34!==t&&37!==t&&64!==t&&96!==t}function Gm(t){return!Bm(t)&&58!==t}function qm(t,e){var r,n=t.charCodeAt(e);return n>=55296&&n<=56319&&e+1<t.length&&(r=t.charCodeAt(e+1))>=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function jm(t){return/^\n* /.test(t)}o(Mm,"State"),o(Dm,"indentString"),o(Om,"generateNextLine"),o(Pm,"testImplicitResolving"),o(Bm,"isWhitespace"),o($m,"isPrintable"),o(Fm,"isNsCharOrWhitespace"),o(zm,"isPlainSafe"),o(Um,"isPlainSafeFirst"),o(Gm,"isPlainSafeLast"),o(qm,"codePointAt"),o(jm,"needIndentIndicator");function Wm(t,e,r,n,i,a,s,o){var l,c=0,h=null,u=!1,d=!1,p=-1!==n,g=-1,f=Um(qm(t,0))&&Gm(qm(t,t.length-1));if(e||s)for(l=0;l<t.length;c>=65536?l+=2:l++){if(!$m(c=qm(t,l)))return 5;f=f&&zm(c,h,o),h=c}else{for(l=0;l<t.length;c>=65536?l+=2:l++){if(10===(c=qm(t,l)))u=!0,p&&(d=d||l-g-1>n&&" "!==t[g+1],g=l);else if(!$m(c))return 5;f=f&&zm(c,h,o),h=c}d=d||p&&l-g-1>n&&" "!==t[g+1]}return u||d?r>9&&jm(t)?5:s?2===a?5:2:d?4:3:!f||s||i(t)?2===a?5:2:1}function Ym(t,e,r,n,i){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==Lm.indexOf(e)||Nm.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),l=n||t.flowLevel>-1&&r>=t.flowLevel;function c(e){return Pm(t,e)}switch(o(c,"testAmbiguity"),Wm(e,l,t.indent,s,c,t.quotingType,t.forceQuotes&&!n,i)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+Hm(e,t.indent)+Vm(Dm(e,a));case 4:return">"+Hm(e,t.indent)+Vm(Dm(Xm(e,s),a));case 5:return'"'+Zm(e)+'"';default:throw new fg("impossible error: invalid scalar style")}}()}function Hm(t,e){var r=jm(t)?String(e):"",n="\n"===t[t.length-1];return r+(n&&("\n"===t[t.length-2]||"\n"===t)?"+":n?"":"-")+"\n"}function Vm(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Xm(t,e){for(var r,n,i,a=/(\n+)([^\n]*)/g,s=(r=-1!==(r=t.indexOf("\n"))?r:t.length,a.lastIndex=r,Km(t.slice(0,r),e)),o="\n"===t[0]||" "===t[0];i=a.exec(t);){var l=i[1],c=i[2];n=" "===c[0],s+=l+(o||n||""===c?"":"\n")+Km(c,e),o=n}return s}function Km(t,e){if(""===t||" "===t[0])return t;for(var r,n,i=/ [^ ]/g,a=0,s=0,o=0,l="";r=i.exec(t);)(o=r.index)-a>e&&(n=s>a?s:o,l+="\n"+t.slice(a,n),a=n+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 Zm(t){for(var e,r="",n=0,i=0;i<t.length;n>=65536?i+=2:i++)n=qm(t,i),!(e=Am[n])&&$m(n)?(r+=t[i],n>=65536&&(r+=t[i+1])):r+=e||Rm(n);return r}function Qm(t,e,r){var n,i,a,s="",o=t.tag;for(n=0,i=r.length;n<i;n+=1)a=r[n],t.replacer&&(a=t.replacer.call(r,String(n),a)),(ny(t,e,a,!1,!1)||void 0===a&&ny(t,e,null,!1,!1))&&(""!==s&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=o,t.dump="["+s+"]"}function Jm(t,e,r,n){var i,a,s,o="",l=t.tag;for(i=0,a=r.length;i<a;i+=1)s=r[i],t.replacer&&(s=t.replacer.call(r,String(i),s)),(ny(t,e+1,s,!0,!0,!1,!0)||void 0===s&&ny(t,e+1,null,!0,!0,!1,!0))&&(n&&""===o||(o+=Om(t,e)),t.dump&&10===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=l,t.dump=o||"[]"}function ty(t,e,r){var n,i,a,s,o,l="",c=t.tag,h=Object.keys(r);for(n=0,i=h.length;n<i;n+=1)o="",""!==l&&(o+=", "),t.condenseFlow&&(o+='"'),s=r[a=h[n]],t.replacer&&(s=t.replacer.call(r,a,s)),ny(t,e,a,!1,!1)&&(t.dump.length>1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ny(t,e,s,!1,!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function ey(t,e,r,n){var i,a,s,o,l,c,h="",u=t.tag,d=Object.keys(r);if(!0===t.sortKeys)d.sort();else if("function"==typeof t.sortKeys)d.sort(t.sortKeys);else if(t.sortKeys)throw new fg("sortKeys must be a boolean or a function");for(i=0,a=d.length;i<a;i+=1)c="",n&&""===h||(c+=Om(t,e)),o=r[s=d[i]],t.replacer&&(o=t.replacer.call(r,s,o)),ny(t,e+1,s,!0,!0,!0)&&((l=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=Om(t,e)),ny(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 ry(t,e,r){var n,i,a,s,o,l;for(a=0,s=(i=r?t.explicitTypes:t.implicitTypes).length;a<s;a+=1)if(((o=i[a]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof e&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){if(l=t.styleMap[o.tag]||o.defaultStyle,"[object Function]"===Em.call(o.represent))n=o.represent(e,l);else{if(!Cm.call(o.represent,l))throw new fg("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');n=o.represent[l](e,l)}t.dump=n}return!0}return!1}function ny(t,e,r,n,i,a,s){t.tag=null,t.dump=r,ry(t,r,!1)||ry(t,r,!0);var o,l=Em.call(t.dump),c=n;n&&(n=t.flowLevel<0||t.flowLevel>e);var h,u,d="[object Object]"===l||"[object Array]"===l;if(d&&(u=-1!==(h=t.duplicates.indexOf(r))),(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)n&&0!==Object.keys(t.dump).length?(ey(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(ty(t,e,t.dump),u&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)n&&0!==t.dump.length?(t.noArrayIndent&&!s&&e>0?Jm(t,e-1,t.dump,i):Jm(t,e,t.dump,i),u&&(t.dump="&ref_"+h+t.dump)):(Qm(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 fg("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&Ym(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 iy(t,e){var r,n,i=[],a=[];for(ay(t,i,a),r=0,n=a.length;r<n;r+=1)e.duplicates.push(i[a[r]]);e.usedDuplicates=new Array(n)}function ay(t,e,r){var n,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=e.indexOf(t)))-1===r.indexOf(i)&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)ay(t[i],e,r);else for(i=0,a=(n=Object.keys(t)).length;i<a;i+=1)ay(t[n[i]],e,r)}o(Wm,"chooseScalarStyle"),o(Ym,"writeScalar"),o(Hm,"blockHeader"),o(Vm,"dropEndingNewline"),o(Xm,"foldString"),o(Km,"foldLine"),o(Zm,"escapeString"),o(Qm,"writeFlowSequence"),o(Jm,"writeBlockSequence"),o(ty,"writeFlowMapping"),o(ey,"writeBlockMapping"),o(ry,"detectType"),o(ny,"writeNode"),o(iy,"getDuplicateReferences"),o(ay,"inspectNode"),o((function(t,e){var r=new Mm(e=e||{});r.noRefs||iy(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ny(r,0,n,!0,!0)?r.dump+"\n":""}),"dump$1"),o((function(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}),"renamed");var sy=ef,oy=_m.load,ly=l({"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(t,e){var r=1e3,n=60*r,i=60*n,a=24*i;function s(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*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;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>=n?Math.round(t/n)+"m":e>=r?Math.round(t/r)+"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>=n?h(t,e,n,"minute"):e>=r?h(t,e,r,"second"):t+" ms"}function h(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}e.exports=function(t,e){e=e||{};var r=typeof t;if("string"===r&&t.length>0)return s(t);if("number"===r&&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))},o(s,"parse"),o(l,"fmtShort"),o(c,"fmtLong"),o(h,"plural")}}),cy=l({"../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/common.js"(t,e){function r(t){function e(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return r.colors[Math.abs(e)%r.colors.length]}function r(t){let e,i,a,s=null;function l(...t){if(!l.enabled)return;const n=l,i=Number(new Date),a=i-(e||i);n.diff=a,n.prev=e,n.curr=i,e=i,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,i)=>{if("%%"===e)return"%";s++;const a=r.formatters[i];if("function"==typeof a){const r=t[s];e=a.call(n,r),t.splice(s,1),s--}return e})),r.formatArgs.call(n,t);(n.log||r.log).apply(n,t)}return o(l,"debug"),l.namespace=t,l.useColors=r.useColors(),l.color=r.selectColor(t),l.extend=n,l.destroy=r.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:o((()=>null!==s?s:(i!==r.namespaces&&(i=r.namespaces,a=r.enabled(t)),a)),"get"),set:o((t=>{s=t}),"set")}),"function"==typeof r.init&&r.init(l),l}function n(t,e){const n=r(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function i(t){r.save(t),r.namespaces=t,r.names=[],r.skips=[];const e=("string"==typeof t?t:"").trim().replace(" ",",").split(",").filter(Boolean);for(const t of e)"-"===t[0]?r.skips.push(t.slice(1)):r.names.push(t)}function a(t,e){let r=0,n=0,i=-1,a=0;for(;r<t.length;)if(n<e.length&&(e[n]===t[r]||"*"===e[n]))"*"===e[n]?(i=n,a=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,a++,r=a}for(;n<e.length&&"*"===e[n];)n++;return n===e.length}function s(){const t=[...r.names,...r.skips.map((t=>"-"+t))].join(",");return r.enable(""),t}function l(t){for(const e of r.skips)if(a(t,e))return!1;for(const e of r.names)if(a(t,e))return!0;return!1}function c(t){return t instanceof Error?t.stack||t.message:t}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=l,r.humanize=ly(),r.destroy=h,Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={},o(e,"selectColor"),r.selectColor=e,o(r,"createDebug"),o(n,"extend"),o(i,"enable"),o(a,"matchesTemplate"),o(s,"disable"),o(l,"enabled"),o(c,"coerce"),o(h,"destroy"),r.enable(r.load()),r}o(r,"setup"),e.exports=r}}),hy=l({"../../node_modules/.pnpm/debug@4.4.0_supports-color@8.1.1/node_modules/debug/src/browser.js"(t,e){function r(){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 n(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 r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),t.splice(i,0,r)}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 s(){try{return localStorage}catch(t){}}t.formatArgs=n,t.save=i,t.load=a,t.useColors=r,t.storage=s(),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"],o(r,"useColors"),o(n,"formatArgs"),t.log=console.debug||console.log||(()=>{}),o(i,"save"),o(a,"load"),o(s,"localstorage"),e.exports=cy()(t);var{formatters:l}=e.exports;l.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}}),uy=Object.freeze({left:0,top:0,width:16,height:16}),dy=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),py=Object.freeze({...uy,...dy}),gy=Object.freeze({...py,body:"",hidden:!1}),fy=Object.freeze({width:null,height:null}),my=Object.freeze({...fy,...dy}),yy=o(((t,e,r,n="")=>{const i=t.split(":");if("@"===t.slice(0,1)){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const t=i.pop(),r=i.pop(),a={provider:i.length>0?i[0]:n,prefix:r,name:t};return e&&!vy(a)?null:a}const a=i[0],s=a.split("-");if(s.length>1){const t={provider:n,prefix:s.shift(),name:s.join("-")};return e&&!vy(t)?null:t}if(r&&""===n){const t={provider:n,prefix:"",name:a};return e&&!vy(t,r)?null:t}return null}),"stringToIcon"),vy=o(((t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name)),"validateIconName");function xy(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function by(t,e){const r=xy(t,e);for(const n in gy)n in dy?n in t&&!(n in r)&&(r[n]=dy[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function wy(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(t){if(r[t])return i[t]=[];if(!(t in i)){i[t]=null;const e=n[t]&&n[t].parent,r=e&&a(e);r&&(i[t]=[e].concat(r))}return i[t]}return o(a,"resolve"),(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function ky(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(t){a=by(n[t]||i[t],a)}return o(s,"parse"),s(e),r.forEach(s),by(t,a)}function Ty(t,e){if(t.icons[e])return ky(t,e,[]);const r=wy(t,[e])[e];return r?ky(t,e,r):null}o(xy,"mergeIconTransformations"),o(by,"mergeIconData"),o(wy,"getIconsTree"),o(ky,"internalGetIconData"),o(Ty,"getIconData");var _y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ey=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Cy(t,e,r){if(1===e)return t;if(r=r||100,"number"==typeof t)return Math.ceil(t*e*r)/r;if("string"!=typeof t)return t;const n=t.split(_y);if(null===n||!n.length)return t;const i=[];let a=n.shift(),s=Ey.test(a);for(;;){if(s){const t=parseFloat(a);isNaN(t)?i.push(a):i.push(Math.ceil(t*e*r)/r)}else i.push(a);if(a=n.shift(),void 0===a)return i.join("");s=!s}}function Sy(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("</"+e);if(-1===i||-1===a)break;const s=t.indexOf(">",a);if(-1===s)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function Ay(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Ly(t,e,r){const n=Sy(t);return Ay(n.defs,e+n.content+r)}o(Cy,"calculateSize"),o(Sy,"splitSVGDefs"),o(Ay,"mergeDefsAndContent"),o(Ly,"wrapSVGContent");var Ny=o((t=>"unset"===t||"undefined"===t||"none"===t),"isUnsetKeyword");function Iy(t,e){const r={...py,...t},n={...my,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach((t=>{const e=[],r=t.hFlip,n=t.vFlip;let s,o=t.rotate;switch(r?n?o+=2:(e.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),e.push("scale(-1 1)"),i.top=i.left=0):n&&(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=Ly(a,'<g transform="'+e.join(" ")+'">',"</g>"))}));const s=n.width,l=n.height,c=i.width,h=i.height;let u,d;null===s?(d=null===l?"1em":"auto"===l?h:l,u=Cy(d,c/h)):(u="auto"===s?c:s,d=null===l?Cy(u,h/c):"auto"===l?h:l);const p={},g=o(((t,e)=>{Ny(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}}o(Iy,"iconToSVG");var Ry=/\sid="(\S+)"/g,My="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),Dy=0;function Oy(t,e=My){const r=[];let n;for(;n=Ry.exec(t);)r.push(n[1]);if(!r.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return r.forEach((r=>{const n="function"==typeof e?e(r):e+(Dy++).toString(),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+n+i+"$3")})),t=t.replace(new RegExp(i,"g"),"")}function Py(t,e){let r=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const t in e)r+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}o(Oy,"replaceIDs"),o(Py,"iconToHTML"),p(hy(),1);var By={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},$y=new Map,Fy=new Map,zy=o((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(y.debug("Registering icon pack:",e.name),"loader"in e)Fy.set(e.name,e.loader);else{if(!("icons"in e))throw y.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');$y.set(e.name,e.icons)}}}),"registerIconPacks"),Uy=o((async(t,e)=>{const r=yy(t,!0,void 0!==e);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=$y.get(n);if(!i){const t=Fy.get(n);if(!t)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await t(),prefix:n},$y.set(n,i)}catch(t){throw y.error(t),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Ty(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a}),"getRegisteredIconData"),Gy=o((async(t,e)=>{let r;try{r=await Uy(t,e?.fallbackPrefix)}catch(t){y.error(t),r=By}const n=Iy(r,e);return Py(Oy(n.body),n.attributes)}),"getIconSVG"),qy=o((({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}}),"getSubGraphTitleMargins"),jy=l({"../../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=/^.+(:|&colon;)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"}}),Wy=l({"../../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=jy();function r(t){return e.relativeFirstCharacters.indexOf(t[0])>-1}function n(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 s(t){if(!t)return e.BLANK_URL;var s,o=a(t.trim());do{s=(o=a(o=n(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(r(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}o(r,"isRelativeUrlWithoutProtocol"),o(n,"decodeHtmlCharacters"),o(i,"isValidUrl"),o(a,"decodeURI"),o(s,"sanitizeUrl"),t.sanitizeUrl=s}}),Yy="object"==typeof global&&global&&global.Object===Object&&global,Hy="object"==typeof self&&self&&self.Object===Object&&self,Vy=Yy||Hy||Function("return this")(),Xy=Vy.Symbol,Ky=Object.prototype,Zy=Ky.hasOwnProperty,Qy=Ky.toString,Jy=Xy?Xy.toStringTag:void 0;function tv(t){var e=Zy.call(t,Jy),r=t[Jy];try{t[Jy]=void 0;var n=!0}catch(t){}var i=Qy.call(t);return n&&(e?t[Jy]=r:delete t[Jy]),i}o(tv,"getRawTag");var ev=tv,rv=Object.prototype.toString;function nv(t){return rv.call(t)}o(nv,"objectToString");var iv=nv,av=Xy?Xy.toStringTag:void 0;function sv(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":av&&av in Object(t)?ev(t):iv(t)}o(sv,"baseGetTag");var ov=sv;function lv(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}o(lv,"isObject");var cv=lv;function hv(t){if(!cv(t))return!1;var e=ov(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}o(hv,"isFunction");var uv,dv=hv,pv=Vy["__core-js_shared__"],gv=(uv=/[^.]+$/.exec(pv&&pv.keys&&pv.keys.IE_PROTO||""))?"Symbol(src)_1."+uv:"";function fv(t){return!!gv&&gv in t}o(fv,"isMasked");var mv=fv,yv=Function.prototype.toString;function vv(t){if(null!=t){try{return yv.call(t)}catch(t){}try{return t+""}catch(t){}}return""}o(vv,"toSource");var xv=vv,bv=/^\[object .+?Constructor\]$/,wv=Function.prototype,kv=Object.prototype,Tv=wv.toString,_v=kv.hasOwnProperty,Ev=RegExp("^"+Tv.call(_v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cv(t){return!(!cv(t)||mv(t))&&(dv(t)?Ev:bv).test(xv(t))}o(Cv,"baseIsNative");var Sv=Cv;function Av(t,e){return null==t?void 0:t[e]}o(Av,"getValue");var Lv=Av;function Nv(t,e){var r=Lv(t,e);return Sv(r)?r:void 0}o(Nv,"getNative");var Iv=Nv,Rv=Iv(Object,"create");function Mv(){this.__data__=Rv?Rv(null):{},this.size=0}o(Mv,"hashClear");var Dv=Mv;function Ov(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}o(Ov,"hashDelete");var Pv=Ov,Bv=Object.prototype.hasOwnProperty;function $v(t){var e=this.__data__;if(Rv){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Bv.call(e,t)?e[t]:void 0}o($v,"hashGet");var Fv=$v,zv=Object.prototype.hasOwnProperty;function Uv(t){var e=this.__data__;return Rv?void 0!==e[t]:zv.call(e,t)}o(Uv,"hashHas");var Gv=Uv;function qv(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Rv&&void 0===e?"__lodash_hash_undefined__":e,this}o(qv,"hashSet");var jv=qv;function Wv(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Wv,"Hash"),Wv.prototype.clear=Dv,Wv.prototype.delete=Pv,Wv.prototype.get=Fv,Wv.prototype.has=Gv,Wv.prototype.set=jv;var Yv=Wv;function Hv(){this.__data__=[],this.size=0}o(Hv,"listCacheClear");var Vv=Hv;function Xv(t,e){return t===e||t!=t&&e!=e}o(Xv,"eq");var Kv=Xv;function Zv(t,e){for(var r=t.length;r--;)if(Kv(t[r][0],e))return r;return-1}o(Zv,"assocIndexOf");var Qv=Zv,Jv=Array.prototype.splice;function tx(t){var e=this.__data__,r=Qv(e,t);return!(r<0)&&(r==e.length-1?e.pop():Jv.call(e,r,1),--this.size,!0)}o(tx,"listCacheDelete");var ex=tx;function rx(t){var e=this.__data__,r=Qv(e,t);return r<0?void 0:e[r][1]}o(rx,"listCacheGet");var nx=rx;function ix(t){return Qv(this.__data__,t)>-1}o(ix,"listCacheHas");var ax=ix;function sx(t,e){var r=this.__data__,n=Qv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}o(sx,"listCacheSet");var ox=sx;function lx(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(lx,"ListCache"),lx.prototype.clear=Vv,lx.prototype.delete=ex,lx.prototype.get=nx,lx.prototype.has=ax,lx.prototype.set=ox;var cx=lx,hx=Iv(Vy,"Map");function ux(){this.size=0,this.__data__={hash:new Yv,map:new(hx||cx),string:new Yv}}o(ux,"mapCacheClear");var dx=ux;function px(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}o(px,"isKeyable");var gx=px;function fx(t,e){var r=t.__data__;return gx(e)?r["string"==typeof e?"string":"hash"]:r.map}o(fx,"getMapData");var mx=fx;function yx(t){var e=mx(this,t).delete(t);return this.size-=e?1:0,e}o(yx,"mapCacheDelete");var vx=yx;function xx(t){return mx(this,t).get(t)}o(xx,"mapCacheGet");var bx=xx;function wx(t){return mx(this,t).has(t)}o(wx,"mapCacheHas");var kx=wx;function Tx(t,e){var r=mx(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}o(Tx,"mapCacheSet");var _x=Tx;function Ex(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Ex,"MapCache"),Ex.prototype.clear=dx,Ex.prototype.delete=vx,Ex.prototype.get=bx,Ex.prototype.has=kx,Ex.prototype.set=_x;var Cx=Ex;function Sx(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=o((function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s}),"memoized");return r.cache=new(Sx.Cache||Cx),r}o(Sx,"memoize"),Sx.Cache=Cx;var Ax=Sx;function Lx(t){return function(){return t}}o(Lx,"constant");var Nx=Lx;function Ix(){this.__data__=new cx,this.size=0}o(Ix,"stackClear");var Rx=Ix;function Mx(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}o(Mx,"stackDelete");var Dx=Mx;function Ox(t){return this.__data__.get(t)}o(Ox,"stackGet");var Px=Ox;function Bx(t){return this.__data__.has(t)}o(Bx,"stackHas");var $x=Bx;function Fx(t,e){var r=this.__data__;if(r instanceof cx){var n=r.__data__;if(!hx||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Cx(n)}return r.set(t,e),this.size=r.size,this}o(Fx,"stackSet");var zx=Fx;function Ux(t){var e=this.__data__=new cx(t);this.size=e.size}o(Ux,"Stack"),Ux.prototype.clear=Rx,Ux.prototype.delete=Dx,Ux.prototype.get=Px,Ux.prototype.has=$x,Ux.prototype.set=zx;var Gx=Ux,qx=function(){try{var t=Iv(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function jx(t,e,r){"__proto__"==e&&qx?qx(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}o(jx,"baseAssignValue");var Wx=jx;function Yx(t,e,r){(void 0!==r&&!Kv(t[e],r)||void 0===r&&!(e in t))&&Wx(t,e,r)}o(Yx,"assignMergeValue");var Hx=Yx;function Vx(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[t?o:++i];if(!1===r(a[l],l,a))break}return e}}o(Vx,"createBaseFor");var Xx=Vx(),Kx="object"==typeof exports&&exports&&!exports.nodeType&&exports,Zx=Kx&&"object"==typeof module&&module&&!module.nodeType&&module,Qx=Zx&&Zx.exports===Kx?Vy.Buffer:void 0,Jx=Qx?Qx.allocUnsafe:void 0;function tb(t,e){if(e)return t.slice();var r=t.length,n=Jx?Jx(r):new t.constructor(r);return t.copy(n),n}o(tb,"cloneBuffer");var eb=tb,rb=Vy.Uint8Array;function nb(t){var e=new t.constructor(t.byteLength);return new rb(e).set(new rb(t)),e}o(nb,"cloneArrayBuffer");var ib=nb;function ab(t,e){var r=e?ib(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}o(ab,"cloneTypedArray");var sb=ab;function ob(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(ob,"copyArray");var lb=ob,cb=Object.create,hb=function(){function t(){}return o(t,"object"),function(e){if(!cv(e))return{};if(cb)return cb(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ub=hb;function db(t,e){return function(r){return t(e(r))}}o(db,"overArg");var pb=db,gb=pb(Object.getPrototypeOf,Object),fb=Object.prototype;function mb(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||fb)}o(mb,"isPrototype");var yb=mb;function vb(t){return"function"!=typeof t.constructor||yb(t)?{}:ub(gb(t))}o(vb,"initCloneObject");var xb=vb;function bb(t){return null!=t&&"object"==typeof t}o(bb,"isObjectLike");var wb=bb;function kb(t){return wb(t)&&"[object Arguments]"==ov(t)}o(kb,"baseIsArguments");var Tb=kb,_b=Object.prototype,Eb=_b.hasOwnProperty,Cb=_b.propertyIsEnumerable,Sb=Tb(function(){return arguments}())?Tb:function(t){return wb(t)&&Eb.call(t,"callee")&&!Cb.call(t,"callee")},Ab=Sb,Lb=Array.isArray;function Nb(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}o(Nb,"isLength");var Ib=Nb;function Rb(t){return null!=t&&Ib(t.length)&&!dv(t)}o(Rb,"isArrayLike");var Mb=Rb;function Db(t){return wb(t)&&Mb(t)}o(Db,"isArrayLikeObject");var Ob=Db;function Pb(){return!1}o(Pb,"stubFalse");var Bb=Pb,$b="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fb=$b&&"object"==typeof module&&module&&!module.nodeType&&module,zb=Fb&&Fb.exports===$b?Vy.Buffer:void 0,Ub=(zb?zb.isBuffer:void 0)||Bb,Gb=Function.prototype,qb=Object.prototype,jb=Gb.toString,Wb=qb.hasOwnProperty,Yb=jb.call(Object);function Hb(t){if(!wb(t)||"[object Object]"!=ov(t))return!1;var e=gb(t);if(null===e)return!0;var r=Wb.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&jb.call(r)==Yb}o(Hb,"isPlainObject");var Vb=Hb,Xb={};function Kb(t){return wb(t)&&Ib(t.length)&&!!Xb[ov(t)]}Xb["[object Float32Array]"]=Xb["[object Float64Array]"]=Xb["[object Int8Array]"]=Xb["[object Int16Array]"]=Xb["[object Int32Array]"]=Xb["[object Uint8Array]"]=Xb["[object Uint8ClampedArray]"]=Xb["[object Uint16Array]"]=Xb["[object Uint32Array]"]=!0,Xb["[object Arguments]"]=Xb["[object Array]"]=Xb["[object ArrayBuffer]"]=Xb["[object Boolean]"]=Xb["[object DataView]"]=Xb["[object Date]"]=Xb["[object Error]"]=Xb["[object Function]"]=Xb["[object Map]"]=Xb["[object Number]"]=Xb["[object Object]"]=Xb["[object RegExp]"]=Xb["[object Set]"]=Xb["[object String]"]=Xb["[object WeakMap]"]=!1,o(Kb,"baseIsTypedArray");var Zb=Kb;function Qb(t){return function(e){return t(e)}}o(Qb,"baseUnary");var Jb=Qb,tw="object"==typeof exports&&exports&&!exports.nodeType&&exports,ew=tw&&"object"==typeof module&&module&&!module.nodeType&&module,rw=ew&&ew.exports===tw&&Yy.process,nw=function(){try{var t=ew&&ew.require&&ew.require("util").types;return t||rw&&rw.binding&&rw.binding("util")}catch(t){}}(),iw=nw&&nw.isTypedArray,aw=iw?Jb(iw):Zb;function sw(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}o(sw,"safeGet");var ow=sw,lw=Object.prototype.hasOwnProperty;function cw(t,e,r){var n=t[e];lw.call(t,e)&&Kv(n,r)&&(void 0!==r||e in t)||Wx(t,e,r)}o(cw,"assignValue");var hw=cw;function uw(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=n?n(r[o],t[o],o,r,t):void 0;void 0===l&&(l=t[o]),i?Wx(r,o,l):hw(r,o,l)}return r}o(uw,"copyObject");var dw=uw;function pw(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}o(pw,"baseTimes");var gw=pw,fw=/^(?:0|[1-9]\d*)$/;function mw(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&fw.test(t))&&t>-1&&t%1==0&&t<e}o(mw,"isIndex");var yw=mw,vw=Object.prototype.hasOwnProperty;function xw(t,e){var r=Lb(t),n=!r&&Ab(t),i=!r&&!n&&Ub(t),a=!r&&!n&&!i&&aw(t),s=r||n||i||a,o=s?gw(t.length,String):[],l=o.length;for(var c in t)!e&&!vw.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yw(c,l))||o.push(c);return o}o(xw,"arrayLikeKeys");var bw=xw;function ww(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}o(ww,"nativeKeysIn");var kw=ww,Tw=Object.prototype.hasOwnProperty;function _w(t){if(!cv(t))return kw(t);var e=yb(t),r=[];for(var n in t)("constructor"!=n||!e&&Tw.call(t,n))&&r.push(n);return r}o(_w,"baseKeysIn");var Ew=_w;function Cw(t){return Mb(t)?bw(t,!0):Ew(t)}o(Cw,"keysIn");var Sw=Cw;function Aw(t){return dw(t,Sw(t))}o(Aw,"toPlainObject");var Lw=Aw;function Nw(t,e,r,n,i,a,s){var o=ow(t,r),l=ow(e,r),c=s.get(l);if(c)Hx(t,r,c);else{var h=a?a(o,l,r+"",t,e,s):void 0,u=void 0===h;if(u){var d=Lb(l),p=!d&&Ub(l),g=!d&&!p&&aw(l);h=l,d||p||g?Lb(o)?h=o:Ob(o)?h=lb(o):p?(u=!1,h=eb(l,!0)):g?(u=!1,h=sb(l,!0)):h=[]:Vb(l)||Ab(l)?(h=o,Ab(o)?h=Lw(o):cv(o)&&!dv(o)||(h=xb(l))):u=!1}u&&(s.set(l,h),i(h,l,n,a,s),s.delete(l)),Hx(t,r,h)}}o(Nw,"baseMergeDeep");var Iw=Nw;function Rw(t,e,r,n,i){t!==e&&Xx(e,(function(a,s){if(i||(i=new Gx),cv(a))Iw(t,e,s,r,Rw,n,i);else{var o=n?n(ow(t,s),a,s+"",t,e,i):void 0;void 0===o&&(o=a),Hx(t,s,o)}}),Sw)}o(Rw,"baseMerge");var Mw=Rw;function Dw(t){return t}o(Dw,"identity");var Ow=Dw;function Pw(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}o(Pw,"apply");var Bw=Pw,$w=Math.max;function Fw(t,e,r){return e=$w(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=$w(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),Bw(t,this,o)}}o(Fw,"overRest");var zw=Fw,Uw=qx?function(t,e){return qx(t,"toString",{configurable:!0,enumerable:!1,value:Nx(e),writable:!0})}:Ow,Gw=Uw,qw=Date.now;function jw(t){var e=0,r=0;return function(){var n=qw(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}o(jw,"shortOut");var Ww=jw(Gw);function Yw(t,e){return Ww(zw(t,e,Ow),t+"")}o(Yw,"baseRest");var Hw=Yw;function Vw(t,e,r){if(!cv(r))return!1;var n=typeof e;return!!("number"==n?Mb(r)&&yw(e,r.length):"string"==n&&e in r)&&Kv(r[e],t)}o(Vw,"isIterateeCall");var Xw=Vw;function Kw(t){return Hw((function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&Xw(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e}))}o(Kw,"createAssigner");var Zw=Kw,Qw=Zw((function(t,e,r){Mw(t,e,r)})),Jw=Qw,tk=p(Wy(),1),ek={curveBasis:Tu,curveBasisClosed:Cu,curveBasisOpen:Au,curveBumpX:xu,curveBumpY:bu,curveBundle:Nu,curveCardinalClosed:Ou,curveCardinalOpen:Bu,curveCardinal:Mu,curveCatmullRomClosed:Gu,curveCatmullRomOpen:ju,curveCatmullRom:zu,curveLinear:hu,curveLinearClosed:Yu,curveMonotoneX:td,curveMonotoneY:ed,curveNatural:id,curveStep:sd,curveStepAfter:ld,curveStepBefore:od},rk=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,nk=o((function(t,e){const r=ik(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const t=r.map((t=>t.args));Nt(t),n=N(n,[...t])}else n=r.args;if(!n)return;let i=E(t,e);const a="config";return void 0!==n[a]&&("flowchart-v2"===i&&(i="flowchart"),n[i]=n[a],delete n[a]),n}),"detectInit"),ik=o((function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${rk.source})(?=[}][%]{2}).*\n`,"ig");let n;t=t.trim().replace(r,"").replace(/'/gm,'"'),y.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const i=[];for(;null!==(n=w.exec(t));)if(n.index===w.lastIndex&&w.lastIndex++,n&&!e||e&&n[1]?.match(e)||e&&n[2]?.match(e)){const t=n[1]?n[1]:n[2],e=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:t,args:e})}return 0===i.length?{type:t,args:null}:1===i.length?i[0]:i}catch(r){return y.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}}),"detectDirective"),ak=o((function(t){return t.replace(w,"")}),"removeDirectives"),sk=o((function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1}),"isSubstringInArray");function ok(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return ek[r]??e}function lk(t,e){const r=t.trim();if(r)return"loose"!==e.securityLevel?(0,tk.sanitizeUrl)(r):r}o(ok,"interpolateToCurve"),o(lk,"formatUrl");var ck=o(((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let e=0;e<n;e++)if(a=a[r[e]],!a)return void y.error(`Function name: ${t} not found in window`);a[i](...e)}),"runFunc");function hk(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function uk(t){let e,r=0;t.forEach((t=>{r+=hk(t,e),e=t}));return gk(t,r/2)}function dk(t){return 1===t.length?t[0]:uk(t)}o(hk,"distance"),o(uk,"traverseEdge"),o(dk,"calcLabelPosition");var pk=o(((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r}),"roundNumber"),gk=o(((t,e)=>{let r,n=e;for(const e of t){if(r){const t=hk(e,r);if(0===t)return r;if(t<n)n-=t;else{const i=n/t;if(i<=0)return r;if(i>=1)return{x:e.x,y:e.y};if(i>0&&i<1)return{x:pk((1-i)*r.x+i*e.x,5),y:pk((1-i)*r.y+i*e.y,5)}}}r=e}throw new Error("Could not find a suitable point for the given distance")}),"calculatePoint"),fk=o(((t,e,r)=>{y.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const n=gk(e,25),i=t?10:5,a=Math.atan2(e[0].y-n.y,e[0].x-n.x),s={x:0,y:0};return s.x=Math.sin(a)*i+(e[0].x+n.x)/2,s.y=-Math.cos(a)*i+(e[0].y+n.y)/2,s}),"calcCardinalityPosition");function mk(t,e,r){const n=structuredClone(r);y.info("our points",n),"start_left"!==e&&"start_right"!==e&&n.reverse();const i=gk(n,25+t),a=10+.5*t,s=Math.atan2(n[0].y-i.y,n[0].x-i.x),o={x:0,y:0};return"start_left"===e?(o.x=Math.sin(s+Math.PI)*a+(n[0].x+i.x)/2,o.y=-Math.cos(s+Math.PI)*a+(n[0].y+i.y)/2):"end_right"===e?(o.x=Math.sin(s-Math.PI)*a+(n[0].x+i.x)/2-5,o.y=-Math.cos(s-Math.PI)*a+(n[0].y+i.y)/2-5):"end_left"===e?(o.x=Math.sin(s)*a+(n[0].x+i.x)/2-5,o.y=-Math.cos(s)*a+(n[0].y+i.y)/2-5):(o.x=Math.sin(s)*a+(n[0].x+i.x)/2,o.y=-Math.cos(s)*a+(n[0].y+i.y)/2),o}function yk(t){let e="",r="";for(const n of t)void 0!==n&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}o(mk,"calcTerminalLabelPosition"),o(yk,"getStylesFromArray");var vk=0,xk=o((()=>(vk++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vk)),"generateId");function bk(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}o(bk,"makeRandomHex");var wk=o((t=>bk(t.length)),"random"),kk=o((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"),Tk=o((function(t,e){const r=e.text.replace(Lr.lineBreakRegex," "),[,n]=Dk(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),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(r),i}),"drawSimpleText"),_k=Ax(((t,e,r)=>{if(!t)return t;if(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Lr.lineBreakRegex.test(t))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach(((t,s)=>{const o=Sk(`${t} `,r),l=Sk(a,r);if(o>e){const{hyphenatedStrings:n,remainingWord:s}=Ek(t,e,"-",r);i.push(a,...n),a=s}else l+o>=e?(i.push(a),a=t):a=[a,t].filter(Boolean).join(" ");s+1===n.length&&i.push(a)})),i.filter((t=>""!==t)).join(r.joinWith)}),((t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`)),Ek=Ax(((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach(((t,o)=>{const l=`${s}${t}`;if(Sk(l,n)>=e){const t=o+1,e=i.length===t,n=`${l}${r}`;a.push(e?l:n),s=""}else s=l})),{hyphenatedStrings:a,remainingWord:s}}),((t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`));function Ck(t,e){return Lk(t,e).height}function Sk(t,e){return Lk(t,e).width}o(Ck,"calculateTextHeight"),o(Sk,"calculateTextWidth");var Ak,Lk=Ax(((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Dk(r),s=["sans-serif",n],o=t.split(Lr.lineBreakRegex),l=[],c=Ga("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 r={width:0,height:0,lineHeight:0};for(const n of o){const s=kk();s.text=n||"";const o=Tk(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");r.width=Math.round(Math.max(r.width,l.width)),e=Math.round(l.height),r.height+=e,r.lineHeight=Math.round(Math.max(r.lineHeight,e))}l.push(r)}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}`)),Nk=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},Ik=o((function(t){return Ak=Ak||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ak.innerHTML=t,unescape(Ak.textContent)}),"entityDecode");function Rk(t){return"str"in t}o(Rk,"isDetailedError");var Mk=o(((t,e,r,n)=>{if(!n)return;const i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)}),"insertTitle"),Dk=o((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 Ok(t,e){return Jw({},t,e)}o(Ok,"cleanAndMerge");var Pk={assignWithDepth:N,wrapLabel:_k,calculateTextHeight:Ck,calculateTextWidth:Sk,calculateTextDimensions:Lk,cleanAndMerge:Ok,detectInit:nk,detectDirective:ik,isSubstringInArray:sk,interpolateToCurve:ok,calcLabelPosition:dk,calcCardinalityPosition:fk,calcTerminalLabelPosition:mk,formatUrl:lk,getStylesFromArray:yk,generateId:xk,random:wk,runFunc:ck,entityDecode:Ik,insertTitle:Mk,parseFontSize:Dk,InitIDGenerator:Nk},Bk=o((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"),$k=o((function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")}),"decodeEntities"),Fk=o(((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`),"getEdgeId");function zk(t){return t??null}function Uk(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from("string"==typeof t?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce((function(t,e){var r=e.match(/\n([\t ]+|(?!\s).)/g);return r?t.concat(r.map((function(t){var e,r;return null!==(r=null===(e=t.match(/[\t ]/g))||void 0===e?void 0:e.length)&&void 0!==r?r:0}))):t}),[]);if(i.length){var a=new RegExp("\n[\t ]{"+Math.min.apply(Math,i)+"}","g");n=n.map((function(t){return t.replace(a,"\n")}))}n[0]=n[0].replace(/^\r?\n/,"");var s=n[0];return e.forEach((function(t,e){var r=s.match(/(?:^|\n)( *)$/),i=r?r[1]:"",a=t;"string"==typeof t&&t.includes("\n")&&(a=String(t).split("\n").map((function(t,e){return 0===e?t:""+i+t})).join("\n")),s+=a+n[e+1]})),s}function Gk(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}o(zk,"handleUndefinedAttr"),o(Uk,"dedent"),o(Gk,"_getDefaults");var qk={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function jk(t){qk=t}o(jk,"changeDefaults");var Wk={exec:o((()=>null),"exec")};function Yk(t,e=""){let r="string"==typeof t?t:t.source;const n={replace:o(((t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Hk.caret,"$1"),r=r.replace(t,i),n}),"replace"),getRegex:o((()=>new RegExp(r,e)),"getRegex")};return n}o(Yk,"edit");var Hk={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o((t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`)),"listItemRegex"),nextBulletRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`)),"nextBulletRegex"),hrRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),"hrRegex"),fencesBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`)),"fencesBeginRegex"),headingBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`)),"headingBeginRegex"),htmlBeginRegex:o((t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")),"htmlBeginRegex")},Vk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xk=/(?:[*+-]|\d{1,9}[.)])/,Kk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Zk=Yk(Kk).replace(/bull/g,Xk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Qk=Yk(Kk).replace(/bull/g,Xk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tT=/(?!\s*\])(?:\\.|[^\[\]\\])+/,eT=Yk(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",tT).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rT=Yk(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xk).getRegex(),nT="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",iT=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,aT=Yk("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",iT).replace("tag",nT).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sT=Yk(Jk).replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex(),oT={blockquote:Yk(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sT).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:eT,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Vk,html:aT,lheading:Zk,list:rT,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:sT,table:Wk,text:/^[^\n]+/},lT=Yk("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex(),cT={...oT,lheading:Qk,table:lT,paragraph:Yk(Jk).replace("hr",Vk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lT).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",nT).getRegex()},hT={...oT,html:Yk("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",iT).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Yk(Jk).replace("hr",Vk).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Zk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uT=/^( {2,}|\\)\n(?!\s*$)/,dT=/[\p{P}\p{S}]/u,pT=/[\s\p{P}\p{S}]/u,gT=/[^\s\p{P}\p{S}]/u,fT=Yk(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pT).getRegex(),mT=/(?!~)[\p{P}\p{S}]/u,yT=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vT=Yk(yT,"u").replace(/punct/g,dT).getRegex(),xT=Yk(yT,"u").replace(/punct/g,mT).getRegex(),bT="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wT=Yk(bT,"gu").replace(/notPunctSpace/g,gT).replace(/punctSpace/g,pT).replace(/punct/g,dT).getRegex(),kT=Yk(bT,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,mT).getRegex(),TT=Yk("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gT).replace(/punctSpace/g,pT).replace(/punct/g,dT).getRegex(),_T=Yk(/\\(punct)/,"gu").replace(/punct/g,dT).getRegex(),ET=Yk(/^<(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(),CT=Yk(iT).replace("(?:--\x3e|$)","--\x3e").getRegex(),ST=Yk("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",CT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),AT=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,LT=Yk(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",AT).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NT=Yk(/^!?\[(label)\]\[(ref)\]/).replace("label",AT).replace("ref",tT).getRegex(),IT=Yk(/^!?\[(ref)\](?:\[\])?/).replace("ref",tT).getRegex(),RT={_backpedal:Wk,anyPunctuation:_T,autolink:ET,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:uT,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Wk,emStrongLDelim:vT,emStrongRDelimAst:wT,emStrongRDelimUnd:TT,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:LT,nolink:IT,punctuation:fT,reflink:NT,reflinkSearch:Yk("reflink|nolink(?!\\()","g").replace("reflink",NT).replace("nolink",IT).getRegex(),tag:ST,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Wk},MT={...RT,link:Yk(/^!?\[(label)\]\((.*?)\)/).replace("label",AT).getRegex(),reflink:Yk(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",AT).getRegex()},DT={...RT,emStrongRDelimAst:kT,emStrongLDelim:xT,url:Yk(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},OT={...DT,br:Yk(uT).replace("{2,}","*").getRegex(),text:Yk(DT.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},PT={normal:oT,gfm:cT,pedantic:hT},BT={normal:RT,gfm:DT,breaks:OT,pedantic:MT},$T={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FT=o((t=>$T[t]),"getEscapeReplacement");function zT(t,e){if(e){if(Hk.escapeTest.test(t))return t.replace(Hk.escapeReplace,FT)}else if(Hk.escapeTestNoEncode.test(t))return t.replace(Hk.escapeReplaceNoEncode,FT);return t}function UT(t){try{t=encodeURI(t).replace(Hk.percentDecode,"%")}catch{return null}return t}function GT(t,e){const r=t.replace(Hk.findPipe,((t,e,r)=>{let n=!1,i=e;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"})),n=r.split(Hk.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Hk.slashPipe,"|");return n}function qT(t,e,r){const n=t.length;if(0===n)return"";let i=0;for(;i<n;){if(t.charAt(n-i-1)!==e)break;i++}return t.slice(0,n-i)}function jT(t,e){if(-1===t.indexOf(e[1]))return-1;let r=0;for(let n=0;n<t.length;n++)if("\\"===t[n])n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return-1}function WT(t,e,r,n,i){const a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");if("!"!==t[0].charAt(0)){n.state.inLink=!0;const t={type:"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,t}return{type:"image",raw:r,href:a,title:s,text:o}}function YT(t,e,r){const n=t.match(r.other.indentCodeCompensation);if(null===n)return e;const i=n[1];return e.split("\n").map((t=>{const e=t.match(r.other.beginningSpace);if(null===e)return t;const[n]=e;return n.length>=i.length?t.slice(i.length):t})).join("\n")}o(zT,"escape"),o(UT,"cleanUrl"),o(GT,"splitCells"),o(qT,"rtrim"),o(jT,"findClosingBracket"),o(WT,"outputLink"),o(YT,"indentCodeCompensation");var HT=class{static{o(this,"_Tokenizer")}options;rules;lexer;constructor(t){this.options=t||qk}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(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:qT(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],r=YT(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=qT(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.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:qT(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=qT(e[0],"\n").split("\n"),r="",n="";const i=[];for(;t.length>0;){let e=!1;const a=[];let s;for(s=0;s<t.length;s++)if(this.rules.other.blockquoteStart.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(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${o}`:o,n=n?`${n}\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.at(-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,r=r.substring(0,r.length-e.raw.length)+s.raw,n=n.substring(0,n.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,r=r.substring(0,r.length-h.raw.length)+s.raw,n=n.substring(0,n.length-e.raw.length)+s.raw,t=a.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let s=!1;for(;t;){let r=!1,n="",o="";if(!(e=a.exec(t)))break;if(this.rules.block.hr.test(t))break;n=e[0],t=t.substring(n.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(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(this.rules.other.nonSpaceChar),u=u>4?1:u,o=l.slice(u),u+=e[1].length),h&&this.rules.other.blankLine.test(c)&&(n+=c+"\n",t=t.substring(c.length+1),r=!0),!r){const e=this.rules.other.nextBulletRegex(u),r=this.rules.other.hrRegex(u),i=this.rules.other.fencesBeginRegex(u),a=this.rules.other.headingBeginRegex(u),s=this.rules.other.htmlBeginRegex(u);for(;t;){const d=t.split("\n",1)[0];let p;if(c=d,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(a.test(c))break;if(s.test(c))break;if(e.test(c))break;if(r.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=u||!c.trim())o+="\n"+p.slice(u);else{if(h)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(a.test(l))break;if(r.test(l))break;o+="\n"+c}h||c.trim()||(h=!0),n+=d+"\n",t=t.substring(d.length+1),l=p.slice(u)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(s=!0));let d,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(o),p&&(d="[ ] "!==p[0],o=o.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:n,task:!!p,checked:d,loose:!1,text:o,tokens:[]}),i.raw+=n}const o=i.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++)if(this.lexer.state.top=!1,i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]),!i.loose){const e=i.items[t].tokens.filter((t=>"space"===t.type)),r=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));i.loose=r}if(i.loose)for(let t=0;t<i.items.length;t++)i.items[t].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e){return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=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:r,title:n}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const r=GT(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const t of n)this.rules.other.tableAlignRight.test(t)?a.align.push("right"):this.rules.other.tableAlignCenter.test(t)?a.align.push("center"):this.rules.other.tableAlignLeft.test(t)?a.align.push("left"):a.align.push(null);for(let t=0;t<r.length;t++)a.header.push({text:r[t],tokens:this.lexer.inline(r[t]),header:!0,align:a.align[t]});for(const t of i)a.rows.push(GT(t,a.header.length).map(((t,e)=>({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:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=qT(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=jT(e[2],"()");if(t>-1){const r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],n=t[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),WT(e,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return WT(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!n)return;if(n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const r=[...n[0]].length-1;let i,a,s=r,o=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+r);null!=(n=l.exec(e));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){s+=a;continue}if((n[5]||n[6])&&r%3&&!((r+a)%3)){o+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+o);const e=[...n[0]][0].length,l=t.slice(0,r+n.index+e+a);if(Math.min(r,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(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{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,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let n;do{n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(n!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},VT=class t{static{o(this,"_Lexer")}tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||qk,this.options.tokenizer=this.options.tokenizer||new HT,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:Hk,block:PT.normal,inline:BT.normal};this.options.pedantic?(e.block=PT.pedantic,e.inline=BT.pedantic):this.options.gfm&&(e.block=PT.gfm,this.options.breaks?e.inline=BT.breaks:e.inline=BT.gfm),this.tokenizer.rules=e}static get rules(){return{block:PT,inline:BT}}static lex(e,r){return new t(r).lex(e)}static lexInline(e,r){return new t(r).inlineTokens(e)}lex(t){t=t.replace(Hk.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){for(this.options.pedantic&&(t=t.replace(Hk.tabCharGlobal," ").replace(Hk.spaceLine,""));t;){let n;if(this.options.extensions?.block?.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);const r=e.at(-1);1===n.raw.length&&void 0!==r?r.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.at(-1).src=r.text):e.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);const r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),e.push(n);continue}let i=t;if(this.options.extensions?.startBlock){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startBlock.forEach((t=>{n=t.call({lexer:this},r),"number"==typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){const a=e.at(-1);r&&"paragraph"===a?.type?(a.raw+="\n"+n.raw,a.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(n),r=i.length!==t.length,t=t.substring(n.raw.length)}else if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===r?.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.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)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r=t,n=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(r));)t.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,a="";for(;t;){let n;if(i||(a=""),i=!1,this.options.extensions?.inline?.some((r=>!!(n=r.call({lexer:this},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0))))continue;if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length);const r=e.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):e.push(n);continue}if(n=this.tokenizer.emStrong(t,r,a)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length),e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length),e.push(n);continue}let s=t;if(this.options.extensions?.startInline){let e=1/0;const r=t.slice(1);let n;this.options.extensions.startInline.forEach((t=>{n=t.call({lexer:this},r),"number"==typeof n&&n>=0&&(e=Math.min(e,n))})),e<1/0&&e>=0&&(s=t.substring(0,e+1))}if(n=this.tokenizer.inlineText(s)){t=t.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),i=!0;const r=e.at(-1);"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)}}return e}},XT=class{static{o(this,"_Renderer")}options;parser;constructor(t){this.options=t||qk}space(t){return""}code({text:t,lang:e,escaped:r}){const n=(e||"").match(Hk.notSpaceStart)?.[0],i=t.replace(Hk.endingNewline,"")+"\n";return n?'<pre><code class="language-'+zT(n)+'">'+(r?i:zT(i,!0))+"</code></pre>\n":"<pre><code>"+(r?i:zT(i,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,r=t.start;let n="";for(let e=0;e<t.items.length;e++){const r=t.items[e];n+=this.listitem(r)}const i=e?"ol":"ul";return"<"+i+(e&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(t){let e="";if(t.task){const r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+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=r+" "+zT(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",r="";for(let e=0;e<t.header.length;e++)r+=this.tablecell(t.header[e]);e+=this.tablerow({text:r});let n="";for(let e=0;e<t.rows.length;e++){const i=t.rows[e];r="";for(let t=0;t<i.length;t++)r+=this.tablecell(i[t]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+n+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${zT(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const n=this.parser.parseInline(r),i=UT(t);if(null===i)return n;let a='<a href="'+(t=i)+'"';return e&&(a+=' title="'+zT(e)+'"'),a+=">"+n+"</a>",a}image({href:t,title:e,text:r}){const n=UT(t);if(null===n)return zT(r);let i=`<img src="${t=n}" alt="${r}"`;return e&&(i+=` title="${zT(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:zT(t.text)}},KT=class{static{o(this,"_TextRenderer")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ZT=class t{static{o(this,"_Parser")}options;renderer;textRenderer;constructor(t){this.options=t||qk,this.options.renderer=this.options.renderer||new XT,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new KT}static parse(e,r){return new t(r).parse(e)}static parseInline(e,r){return new t(r).parseInline(e)}parse(t,e=!0){let r="";for(let n=0;n<t.length;n++){const i=t[n];if(this.options.extensions?.renderers?.[i.type]){const t=i,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){r+=e||"";continue}}const a=i;switch(a.type){case"space":r+=this.renderer.space(a);continue;case"hr":r+=this.renderer.hr(a);continue;case"heading":r+=this.renderer.heading(a);continue;case"code":r+=this.renderer.code(a);continue;case"table":r+=this.renderer.table(a);continue;case"blockquote":r+=this.renderer.blockquote(a);continue;case"list":r+=this.renderer.list(a);continue;case"html":r+=this.renderer.html(a);continue;case"paragraph":r+=this.renderer.paragraph(a);continue;case"text":{let i=a,s=this.renderer.text(i);for(;n+1<t.length&&"text"===t[n+1].type;)i=t[++n],s+="\n"+this.renderer.text(i);r+=e?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}parseInline(t,e=this.renderer){let r="";for(let n=0;n<t.length;n++){const i=t[n];if(this.options.extensions?.renderers?.[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=t||"";continue}}const a=i;switch(a.type){case"escape":case"text":r+=e.text(a);break;case"html":r+=e.html(a);break;case"link":r+=e.link(a);break;case"image":r+=e.image(a);break;case"strong":r+=e.strong(a);break;case"em":r+=e.em(a);break;case"codespan":r+=e.codespan(a);break;case"br":r+=e.br(a);break;case"del":r+=e.del(a);break;default:{const t='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}},QT=class{static{o(this,"_Hooks")}options;block;constructor(t){this.options=t||qk}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?VT.lex:VT.lexInline}provideParser(){return this.block?ZT.parse:ZT.parseInline}},JT=class{static{o(this,"Marked")}defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ZT;Renderer=XT;TextRenderer=KT;Lexer=VT;Tokenizer=HT;Hooks=QT;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(const n of t)switch(r=r.concat(e.call(this,n)),n.type){case"table":{const t=n;for(const n of t.header)r=r.concat(this.walkTokens(n.tokens,e));for(const n of t.rows)for(const t of n)r=r.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=n;r=r.concat(this.walkTokens(t.items,e));break}default:{const t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((n=>{const i=t[n].flat(1/0);r=r.concat(this.walkTokens(i,e))})):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(...e){let n=t.renderer.apply(this,e);return!1===n&&(n=r.apply(this,e)),n}: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 r=e[t.level];r?r.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)})),r.extensions=e),t.renderer){const e=this.defaults.renderer||new XT(this.defaults);for(const r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=t.renderer[n],a=e[n];e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new HT(this.defaults);for(const r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=t.tokenizer[n],a=e[n];e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new QT;for(const r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const n=r,i=t.hooks[n],a=e[n];QT.passThroughHooks.has(r)?e[n]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>a.call(e,t)));const r=i.call(e,t);return a.call(e,r)}:e[n]=(...t)=>{let r=i.apply(e,t);return!1===r&&(r=a.apply(e,t)),r}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(n.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults={...this.defaults,...r}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return VT.lex(t,e??this.defaults)}parser(t,e){return ZT.parse(t,e??this.defaults)}parseMarkdown(t){const e=o(((e,r)=>{const n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===n.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==e)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?VT.lex:VT.lexInline,o=i.hooks?i.hooks.provideParser():t?ZT.parse:ZT.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then((t=>s(t,i))).then((t=>i.hooks?i.hooks.processAllTokens(t):t)).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>o(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let t=s(e,i);i.hooks&&(t=i.hooks.processAllTokens(t)),i.walkTokens&&this.walkTokens(t,i.walkTokens);let r=o(t,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(t){return a(t)}}),"parse");return e}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+zT(r.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}},t_=new JT;function e_(t,e){return t_.parse(t,e)}function r_(t,{markdownAutoWrap:e}){const r=Uk(t.replace(/<br\/>/g,"\n").replace(/\n{2,}/g,"\n"));return!1===e?r.replace(/ /g,"&nbsp;"):r}function n_(t,e={}){const r=r_(t,e),n=e_.lexer(r),i=[[]];let a=0;function s(t,e="normal"){if("text"===t.type){t.text.split("\n").forEach(((t,r)=>{0!==r&&(a++,i.push([])),t.split(" ").forEach((t=>{(t=t.replace(/&#39;/g,"'"))&&i[a].push({content:t,type:e})}))}))}else"strong"===t.type||"em"===t.type?t.tokens.forEach((e=>{s(e,t.type)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})}return o(s,"processNode"),n.forEach((t=>{"paragraph"===t.type?t.tokens?.forEach((t=>{s(t)})):"html"===t.type&&i[a].push({content:t.text,type:"normal"})})),i}function i_(t,{markdownAutoWrap:e}={}){const r=e_.lexer(t);function n(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):"strong"===t.type?`<strong>${t.tokens?.map(n).join("")}</strong>`:"em"===t.type?`<em>${t.tokens?.map(n).join("")}</em>`:"paragraph"===t.type?`<p>${t.tokens?.map(n).join("")}</p>`:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:`Unsupported markdown: ${t.type}`}return o(n,"output"),r.map(n).join("")}function a_(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map((t=>t.segment)):[...t]}function s_(t,e){return o_(t,[],a_(e.content),e.type)}function o_(t,e,r,n){if(0===r.length)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?o_(t,s,a,n):(0===e.length&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}function l_(t,e){if(t.some((({content:t})=>t.includes("\n"))))throw new Error("splitLineToFitWidth does not support newlines in the line");return c_(t,e)}function c_(t,e,r=[],n=[]){if(0===t.length)return n.length>0&&r.push(n),r.length>0?r:[];let i="";" "===t[0].content&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(""!==i&&s.push({content:i,type:"normal"}),s.push(a),e(s))return c_(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[n,i]=s_(e,a);r.push([n]),i.content&&t.unshift(i)}return c_(t,e,r)}function h_(t,e){e&&t.attr("style",e)}async function u_(t,e,r,n,i=!1){const a=t.append("foreignObject");a.attr("width",10*r+"px"),a.attr("height",10*r+"px");const s=a.append("xhtml:div");let o=e.label;e.label&&Cr(e.label)&&(o=await Ar(e.label.replace(Lr.lineBreakRegex,"\n"),Qr()));const l=e.isNode?"nodeLabel":"edgeLabel",c=s.append("span");c.html(o),h_(c,e.labelStyle),c.attr("class",`${l} ${n}`),h_(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"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===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),h=s.node().getBoundingClientRect()),a.node()}function d_(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function p_(t,e,r){const n=t.append("text"),i=d_(n,1,e);m_(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}function g_(t,e,r){const n=t.append("text"),i=d_(n,1,e);m_(i,[{content:r,type:"normal"}]);const a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function f_(t,e,r,n=!1){const i=e.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),s=i.append("text").attr("y","-10.1");let l=0;for(const e of r){const r=o((e=>p_(i,1.1,e)<=t),"checkWidth"),n=r(e)?[e]:l_(e,r);for(const t of n){m_(d_(s,l,1.1),t),l++}}if(n){const t=s.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 s.node()}function m_(t,e){t.text(""),e.forEach(((e,r)=>{const n=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===r?n.text(e.content):n.text(" "+e.content)}))}function y_(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`))}o(e_,"marked"),e_.options=e_.setOptions=function(t){return t_.setOptions(t),e_.defaults=t_.defaults,jk(e_.defaults),e_},e_.getDefaults=Gk,e_.defaults=qk,e_.use=function(...t){return t_.use(...t),e_.defaults=t_.defaults,jk(e_.defaults),e_},e_.walkTokens=function(t,e){return t_.walkTokens(t,e)},e_.parseInline=t_.parseInline,e_.Parser=ZT,e_.parser=ZT.parse,e_.Renderer=XT,e_.TextRenderer=KT,e_.Lexer=VT,e_.lexer=VT.lex,e_.Tokenizer=HT,e_.Hooks=QT,e_.parse=e_,e_.options,e_.setOptions,e_.use,e_.walkTokens,e_.parseInline,ZT.parse,VT.lex,o(r_,"preprocessMarkdown"),o(n_,"markdownToLines"),o(i_,"markdownToHTML"),o(a_,"splitTextToChars"),o(s_,"splitWordToFitWidth"),o(o_,"splitWordToFitWidthRecursion"),o(l_,"splitLineToFitWidth"),o(c_,"splitLineToFitWidthRecursion"),o(h_,"applyStyle"),o(u_,"addHtmlSpan"),o(d_,"createTspan"),o(p_,"computeWidthOfText"),o(g_,"computeDimensionOfText"),o(f_,"createFormattedText"),o(m_,"updateTextContentAndStyles"),o(y_,"replaceIconSubstring");var v_=o((async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:o=200,addSvgBackground:l=!1}={},c)=>{if(y.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",l),a){const n=i_(e,c),a=y_($k(n)),h=e.replace(/\\\\/g,"\\"),u={isNode:s,label:Cr(e)?h:a,labelStyle:r.replace("fill:","color:")};return await u_(t,u,o,i,l)}{const n=f_(o,t,n_(e.replace(/<br\s*\/?>/g,"<br/>").replace("<br>","<br/>"),c),!!e&&l);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ga(n).attr("style",t)}else{const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ga(n).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ga(n).select("text").attr("style",e)}return n}}),"createText"),x_=o((async(t,e,r)=>{let n;const i=e.useHtmlLabels||yr(Qr()?.htmlLabels);n=r||"node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",zk(e.labelStyle));let l;l=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const c=await v_(s,hr($k(l),Qr()),{useHtmlLabels:i,width:e.width||Qr().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=Ga(c),r=t.getElementsByTagName("img");if(r){const t=""===l.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=Qr().fontSize?Qr().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[n=Lt.fontSize]=Dk(t),i=n*r+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return i?s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):s.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:u,label:s}}),"labelHelper"),b_=o((async(t,e,r)=>{const n=r.useHtmlLabels||yr(Qr()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await v_(i,hr($k(e),Qr()),{useHtmlLabels:n,width:r.width||Qr()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(yr(Qr()?.flowchart?.htmlLabels)){const t=a.children[0],e=Ga(a);s=t.getBoundingClientRect(),e.attr("width",s.width),e.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.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"),w_=o(((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height}),"updateNodeBounds"),k_=o(((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||"")),"getNodeClasses");function T_(t){const e=t.map(((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`));return e.push("Z"),e.join(" ")}function __(t,e,r,n,i,a){const s=[],o=r-t,l=n-e,c=o/a,h=2*Math.PI/c,u=e+l/2;for(let e=0;e<=50;e++){const r=t+e/50*o,n=u+i*Math.sin(h*(r-t));s.push({x:r,y:n})}return s}function E_(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;i<n;i++){const n=o+i*l,a=t+r*Math.cos(n),c=e+r*Math.sin(n);s.push({x:-a,y:-c})}return s}function C_(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const e of t){const[t,r]=e;e[0]=(t-n)*s-(r-i)*o+n,e[1]=(t-n)*o+(r-i)*s+i}}}function S_(t,e){return t[0]===e[0]&&t[1]===e[1]}function A_(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,o=[0,0];if(i)for(const t of s)C_(t,o,i);const l=function(t,e,r){const n=[];for(const e of t){const t=[...e];S_(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&n.push(t)}const i=[];e=Math.max(e,.1);const a=[];for(const t of n)for(let e=0;e<t.length-1;e++){const r=t[e],n=t[e+1];if(r[1]!==n[1]){const t=Math.min(r[1],n[1]);a.push({ymin:t,ymax:Math.max(r[1],n[1]),x:t===r[1]?r[0]:n[0],islope:(n[0]-r[0])/(n[1]-r[1])})}}if(a.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.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;e<a.length&&!(a[e].ymin>o);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!==r||l%e==0)&&s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const r=s[t].edge,n=s[e].edge;i.push([[Math.round(r.x),o],[Math.round(n.x),o]])}o+=r,s.forEach((t=>{t.edge.x=t.edge.x+r*t.edge.islope})),l++}return i}(s,a,n);if(i){for(const t of s)C_(t,o,-i);!function(t,e,r){const n=[];t.forEach((t=>n.push(...t))),C_(n,e,r)}(l,o,-i)}return l}function L_(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&((null===(r=e.randomizer)||void 0===r?void 0:r.next())||Math.random())>.7&&(a=i),A_(t,i,n,a||1)}o(T_,"createPathFromPoints"),o(__,"generateFullSineWavePoints"),o(E_,"generateCirclePoints"),o(C_,"t"),o(S_,"e"),o(A_,"s"),o(L_,"n");var N_=class{static{o(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const r=L_(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){const r=[];for(const n of t)r.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return r}};function I_(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}o(I_,"a");var R_=class extends N_{static{o(this,"h")}fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);const n=L_(t,Object.assign({},e,{hachureGap:r})),i=Math.PI/180*e.hachureAngle,a=[],s=.5*r*Math.cos(i),o=.5*r*Math.sin(i);for(const[t,e]of n)I_([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)}}},M_=class extends N_{static{o(this,"r")}fillPolygons(t,e){const r=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),i=this._fillPolygons(t,n);return r.ops=r.ops.concat(i.ops),r}},D_=class{static{o(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){const r=L_(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){const r=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);const a=n/4;for(const s of t){const t=I_(s),o=t/n,l=Math.ceil(o)-1,c=t-l*n,h=(s[0][0]+s[1][0])/2-n/4,u=Math.min(s[0][1],s[1][1]);for(let t=0;t<l;t++){const s=u+c+t*n,o=h-a+2*Math.random()*a,l=s-a+2*Math.random()*a,d=this.helper.ellipse(o,l,i,i,e);r.push(...d.ops)}}return{type:"fillSketch",ops:r}}},O_=class{static{o(this,"c")}constructor(t){this.helper=t}fillPolygons(t,e){const r=L_(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){const r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,i=[];return t.forEach((t=>{const a=I_(t),s=Math.floor(a/(r+n)),o=(a+n-s*(r+n))/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<s;t++){const a=t*(r+n),s=a+r,c=[l[0]+a*Math.cos(h)+o*Math.cos(h),l[1]+a*Math.sin(h)+o*Math.sin(h)],u=[l[0]+s*Math.cos(h)+o*Math.cos(h),l[1]+s*Math.sin(h)+o*Math.sin(h)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],e))}})),i}},P_=class{static{o(this,"l")}constructor(t){this.helper=t}fillPolygons(t,e){const r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?r:e.zigzagOffset,i=L_(t,e=Object.assign({},e,{hachureGap:r+n}));return{type:"fillSketch",ops:this.zigzagLines(i,n,e)}}zigzagLines(t,e,r){const n=[];return t.forEach((t=>{const i=I_(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;t<a;t++){const i=2*t*e,a=2*(t+1)*e,o=Math.sqrt(2*Math.pow(e,2)),c=[s[0]+i*Math.cos(l),s[1]+i*Math.sin(l)],h=[s[0]+a*Math.cos(l),s[1]+a*Math.sin(l)],u=[c[0]+o*Math.cos(l+Math.PI/4),c[1]+o*Math.sin(l+Math.PI/4)];n.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],r),...this.helper.doubleLineOps(u[0],u[1],h[0],h[1],r))}})),n}},B_={},$_=class{static{o(this,"p")}constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},F_={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function z_(t,e){return t.type===e}function U_(t){const e=[],r=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",i=0,a=r[i];for(;!z_(a,2);){let s=0;const o=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return U_("M0,0"+t);i++,s=F_[a.text],n=a.text}else z_(a,1)?s=F_[n]:(i++,s=F_[a.text],n=a.text);if(!(i+s<r.length))throw new Error("Path data ended short");for(let t=i;t<i+s;t++){const e=r[t];if(!z_(e,1))throw new Error("Param not a number: "+n+","+e.text);o[o.length]=+e.text}if("number"!=typeof F_[n])throw new Error("Bad segment: "+n);{const t={key:n,data:o};e.push(t),i+=s,a=r[i],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function G_(t){let e=0,r=0,n=0,i=0;const a=[];for(const{key:s,data:o}of t)switch(s){case"M":a.push({key:"M",data:[...o]}),[e,r]=o,[n,i]=o;break;case"m":e+=o[0],r+=o[1],a.push({key:"M",data:[e,r]}),n=e,i=r;break;case"L":a.push({key:"L",data:[...o]}),[e,r]=o;break;case"l":e+=o[0],r+=o[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...o]}),e=o[4],r=o[5];break;case"c":{const t=o.map(((t,n)=>n%2?t+r:t+e));a.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const t=o.map(((t,n)=>n%2?t+r:t+e));a.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const t=o.map(((t,n)=>n%2?t+r:t+e));a.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function q_(t){const e=[];let r="",n=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]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let t=0,a=0;"C"===r||"S"===r?(t=n+(n-o),a=i+(i-l)):(t=n,a=i),e.push({key:"C",data:[t,a,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[t,a]=h;let s=0,c=0;"Q"===r||"T"===r?(s=n+(n-o),c=i+(i-l)):(s=n,c=i);const u=n+2*(s-n)/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,n=t,i=a;break}case"Q":{const[t,r,a,s]=h,c=n+2*(t-n)/3,u=i+2*(r-i)/3,d=a+2*(t-a)/3,p=s+2*(r-s)/3;e.push({key:"C",data:[c,u,d,p,a,s]}),o=t,l=r,n=a,i=s;break}case"A":{const t=Math.abs(h[0]),r=Math.abs(h[1]),a=h[2],s=h[3],o=h[4],l=h[5],c=h[6];0===t||0===r?(e.push({key:"C",data:[n,i,l,c,l,c]}),n=l,i=c):n===l&&i===c||(W_(n,i,l,c,t,r,a,s,o).forEach((function(t){e.push({key:"C",data:t})})),n=l,i=c);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=c}return e}function j_(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function W_(t,e,r,n,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]=j_(t,e,-h),[r,n]=j_(r,n,-h);const s=(t-r)/2,c=(e-n)/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+r)/2,m=b*-a*s/i+(e+n)/2,p=Math.asin(parseFloat(((e-m)/a).toFixed(9))),g=Math.asin(parseFloat(((n-m)/a).toFixed(9))),t<f&&(p=Math.PI-p),r<f&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(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=r,o=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=W_(r=f+i*Math.cos(g),n=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=[r+T*w,n-_*b],A=[r,n];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;e<d.length;e+=3){const r=j_(d[e][0],d[e][1],h),n=j_(d[e+1][0],d[e+1][1],h),i=j_(d[e+2][0],d[e+2][1],h);t.push([r[0],r[1],n[0],n[1],i[0],i[1]])}return t}}o(z_,"k"),o(U_,"b"),o(G_,"y"),o(q_,"m"),o(j_,"w"),o(W_,"x");var Y_={randOffset:o((function(t,e){return sE(t,e)}),"randOffset"),randOffsetWithRange:o((function(t,e,r){return aE(t,e,r)}),"randOffsetWithRange"),ellipse:o((function(t,e,r,n,i){return Q_(t,e,i,Z_(r,n,i)).opset}),"ellipse"),doubleLineOps:o((function(t,e,r,n,i){return oE(t,e,r,n,i,!0)}),"doubleLineOps")};function H_(t,e,r,n,i){return{type:"path",ops:oE(t,e,r,n,i)}}function V_(t,e,r){const n=(t||[]).length;if(n>2){const i=[];for(let e=0;e<n-1;e++)i.push(...oE(t[e][0],t[e][1],t[e+1][0],t[e+1][1],r));return e&&i.push(...oE(t[n-1][0],t[n-1][1],t[0][0],t[0][1],r)),{type:"path",ops:i}}return 2===n?H_(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function X_(t,e,r,n,i){return function(t,e){return V_(t,!0,e)}([[t,e],[t+r,e],[t+r,e+n],[t,e+n]],i)}function K_(t,e){if(t.length){const r="number"==typeof t[0][0]?[t]:t,n=cE(r[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:cE(r[0],1.5*(1+.22*e.roughness),nE(e));for(let t=1;t<r.length;t++){const a=r[t];if(a.length){const t=cE(a,1*(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:cE(a,1.5*(1+.22*e.roughness),nE(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of r)"move"!==t.op&&i.push(t)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function Z_(t,e,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i;let s=Math.abs(t/2),o=Math.abs(e/2);const l=1-r.curveFitting;return s+=sE(s*l,r),o+=sE(o*l,r),{increment:a,rx:s,ry:o}}function Q_(t,e,r,n){const[i,a]=uE(n.increment,t,e,n.rx,n.ry,1,n.increment*aE(.1,aE(.4,1,r),r),r);let s=hE(i,null,r);if(!r.disableMultiStroke&&0!==r.roughness){const[i]=uE(n.increment,t,e,n.rx,n.ry,1.5,0,r),a=hE(i,null,r);s=s.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function J_(t,e,r,n,i,a,s,o,l){const c=t,h=e;let u=Math.abs(r/2),d=Math.abs(n/2);u+=sE(.01*u,l),d+=sE(.01*d,l);let p=i,g=a;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),y=dE(m,c,h,u,d,p,g,1,l);if(!l.disableMultiStroke){const t=dE(m,c,h,u,d,p,g,1.5,l);y.push(...t)}return s&&(o?y.push(...oE(c,h,c+u*Math.cos(p),h+d*Math.sin(p),l),...oE(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 tE(t,e){const r=q_(G_(U_(t))),n=[];let i=[0,0],a=[0,0];for(const{key:t,data:s}of r)switch(t){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...oE(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[t,r,i,o,l,c]=s;n.push(...pE(t,r,i,o,l,c,a,e)),a=[l,c];break}case"Z":n.push(...oE(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function eE(t,e){const r=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,i=n.length;if(i>2){r.push({op:"move",data:[n[0][0]+sE(t,e),n[0][1]+sE(t,e)]});for(let a=1;a<i;a++)r.push({op:"lineTo",data:[n[a][0]+sE(t,e),n[a][1]+sE(t,e)]})}}return{type:"fillPath",ops:r}}function rE(t,e){return function(t,e){let r=t.fillStyle||"hachure";if(!B_[r])switch(r){case"zigzag":B_[r]||(B_[r]=new R_(e));break;case"cross-hatch":B_[r]||(B_[r]=new M_(e));break;case"dots":B_[r]||(B_[r]=new D_(e));break;case"dashed":B_[r]||(B_[r]=new O_(e));break;case"zigzag-line":B_[r]||(B_[r]=new P_(e));break;default:r="hachure",B_[r]||(B_[r]=new N_(e))}return B_[r]}(e,Y_).fillPolygons(t,e)}function nE(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function iE(t){return t.randomizer||(t.randomizer=new $_(t.seed||0)),t.randomizer.next()}function aE(t,e,r,n=1){return r.roughness*n*(iE(r)*(e-t)+t)}function sE(t,e,r=1){return aE(-t,t,e,r)}function oE(t,e,r,n,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=lE(t,e,r,n,i,!0,!1);if(s)return o;const l=lE(t,e,r,n,i,!0,!0);return o.concat(l)}function lE(t,e,r,n,i,a,s){const l=Math.pow(t-r,2)+Math.pow(e-n,2),c=Math.sqrt(l);let h=1;h=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);const d=u/2,p=.2+.2*iE(i);let g=i.bowing*i.maxRandomnessOffset*(n-e)/200,f=i.bowing*i.maxRandomnessOffset*(t-r)/200;g=sE(g,i,h),f=sE(f,i,h);const m=[],y=o((()=>sE(d,i,h)),"M"),v=o((()=>sE(u,i,h)),"k"),x=i.preserveVertices;return a&&(s?m.push({op:"move",data:[t+(x?0:y()),e+(x?0:y())]}):m.push({op:"move",data:[t+(x?0:sE(u,i,h)),e+(x?0:sE(u,i,h))]})),s?m.push({op:"bcurveTo",data:[g+t+(r-t)*p+y(),f+e+(n-e)*p+y(),g+t+2*(r-t)*p+y(),f+e+2*(n-e)*p+y(),r+(x?0:y()),n+(x?0:y())]}):m.push({op:"bcurveTo",data:[g+t+(r-t)*p+v(),f+e+(n-e)*p+v(),g+t+2*(r-t)*p+v(),f+e+2*(n-e)*p+v(),r+(x?0:v()),n+(x?0:v())]}),m}function cE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+sE(e,r),t[0][1]+sE(e,r)]),n.push([t[0][0]+sE(e,r),t[0][1]+sE(e,r)]);for(let i=1;i<t.length;i++)n.push([t[i][0]+sE(e,r),t[i][1]+sE(e,r)]),i===t.length-1&&n.push([t[i][0]+sE(e,r),t[i][1]+sE(e,r)]);return hE(n,null,r)}function hE(t,e,r){const n=t.length,i=[];if(n>3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const r=t[e];a[0]=[r[0],r[1]],a[1]=[r[0]+(s*t[e+1][0]-s*t[e-1][0])/6,r[1]+(s*t[e+1][1]-s*t[e-1][1])/6],a[2]=[t[e+1][0]+(s*t[e][0]-s*t[e+2][0])/6,t[e+1][1]+(s*t[e][1]-s*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=r.maxRandomnessOffset;i.push({op:"lineTo",data:[e[0]+sE(t,r),e[1]+sE(t,r)]})}}else 3===n?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&i.push(...lE(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return i}function uE(t,e,r,n,i,a,s,o){const l=[],c=[];if(0===o.roughness){t/=4,c.push([e+n*Math.cos(-t),r+i*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),r+i*Math.sin(a)];l.push(t),c.push(t)}c.push([e+n*Math.cos(0),r+i*Math.sin(0)]),c.push([e+n*Math.cos(t),r+i*Math.sin(t)])}else{const h=sE(.5,o)-Math.PI/2;c.push([sE(a,o)+e+.9*n*Math.cos(h-t),sE(a,o)+r+.9*i*Math.sin(h-t)]);const u=2*Math.PI+h-.01;for(let s=h;s<u;s+=t){const t=[sE(a,o)+e+n*Math.cos(s),sE(a,o)+r+i*Math.sin(s)];l.push(t),c.push(t)}c.push([sE(a,o)+e+n*Math.cos(h+2*Math.PI+.5*s),sE(a,o)+r+i*Math.sin(h+2*Math.PI+.5*s)]),c.push([sE(a,o)+e+.98*n*Math.cos(h+s),sE(a,o)+r+.98*i*Math.sin(h+s)]),c.push([sE(a,o)+e+.9*n*Math.cos(h+.5*s),sE(a,o)+r+.9*i*Math.sin(h+.5*s)])}return[c,l]}function dE(t,e,r,n,i,a,s,o,l){const c=a+sE(.1,l),h=[];h.push([sE(o,l)+e+.9*n*Math.cos(c-t),sE(o,l)+r+.9*i*Math.sin(c-t)]);for(let a=c;a<=s;a+=t)h.push([sE(o,l)+e+n*Math.cos(a),sE(o,l)+r+i*Math.sin(a)]);return h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),hE(h,null,l)}function pE(t,e,r,n,i,a,s,o){const l=[],c=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let h=[0,0];const u=o.disableMultiStroke?1:2,d=o.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(d?0:sE(c[0],o)),s[1]+(d?0:sE(c[0],o))]}),h=d?[i,a]:[i+sE(c[p],o),a+sE(c[p],o)],l.push({op:"bcurveTo",data:[t+sE(c[p],o),e+sE(c[p],o),r+sE(c[p],o),n+sE(c[p],o),h[0],h[1]]});return l}function gE(t){return[...t]}function fE(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(3===r)n.push(gE(t[0]),gE(t[1]),gE(t[2]),gE(t[2]));else{const r=[];r.push(t[0],t[0]);for(let e=1;e<t.length;e++)r.push(t[e]),e===t.length-1&&r.push(t[e]);const i=[],a=1-e;n.push(gE(r[0]));for(let t=1;t+2<r.length;t++){const e=r[t];i[0]=[e[0],e[1]],i[1]=[e[0]+(a*r[t+1][0]-a*r[t-1][0])/6,e[1]+(a*r[t+1][1]-a*r[t-1][1])/6],i[2]=[r[t+1][0]+(a*r[t][0]-a*r[t+2][0])/6,r[t+1][1]+(a*r[t][1]-a*r[t+2][1])/6],i[3]=[r[t+1][0],r[t+1][1]],n.push(i[1],i[2],i[3])}}return n}function mE(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function yE(t,e,r){const n=mE(e,r);if(0===n)return mE(t,e);let i=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/n;return i=Math.max(0,Math.min(1,i)),mE(t,vE(e,r,i))}function vE(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function xE(t,e,r,n){const i=n||[];if(function(t,e){const r=t[e+0],n=t[e+1],i=t[e+2],a=t[e+3];let s=3*n[0]-2*r[0]-a[0];s*=s;let o=3*n[1]-2*r[1]-a[1];o*=o;let l=3*i[0]-2*a[0]-r[0];l*=l;let c=3*i[1]-2*a[1]-r[1];return c*=c,s<l&&(s=l),o<c&&(o=c),s+o}(t,e)<r){const r=t[e+0];i.length?(a=i[i.length-1],s=r,Math.sqrt(mE(a,s))>1&&i.push(r)):i.push(r),i.push(t[e+3])}else{const n=.5,a=t[e+0],s=t[e+1],o=t[e+2],l=t[e+3],c=vE(a,s,n),h=vE(s,o,n),u=vE(o,l,n),d=vE(c,h,n),p=vE(h,u,n),g=vE(d,p,n);xE([a,c,d,g],0,r,i),xE([g,p,u,l],0,r,i)}var a,s;return i}function bE(t,e){return wE(t,0,t.length,e)}function wE(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,c=1;for(let n=e+1;n<r-1;++n){const e=yE(t[n],s,o);e>l&&(l=e,c=n)}return Math.sqrt(l)>n?(wE(t,e,c+1,n,a),wE(t,c,r,n,a)):(a.length||a.push(s),a.push(o)),a}function kE(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let r=0;r<i;r++)xE(t,3*r,e,n);return r&&r>0?wE(n,0,n.length,r):n}o(H_,"v"),o(V_,"S"),o(X_,"O"),o(K_,"L"),o(Z_,"T"),o(Q_,"D"),o(J_,"A"),o(tE,"_"),o(eE,"I"),o(rE,"C"),o(nE,"z"),o(iE,"W"),o(aE,"E"),o(sE,"G"),o(oE,"$"),o(lE,"R"),o(cE,"j"),o(hE,"q"),o(uE,"F"),o(dE,"V"),o(pE,"Z"),o(gE,"Q"),o(fE,"H"),o(mE,"N"),o(yE,"B"),o(vE,"J"),o(xE,"K"),o(bE,"U"),o(wE,"X"),o(kE,"Y");var TE="none",_E=class{static{o(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,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,n,i){const a=this._o(i);return this._d("line",[H_(t,e,r,n,a)],a)}rectangle(t,e,r,n,i){const a=this._o(i),s=[],o=X_(t,e,r,n,a);if(a.fill){const i=[[t,e],[t+r,e],[t+r,e+n],[t,e+n]];"solid"===a.fillStyle?s.push(eE([i],a)):s.push(rE([i],a))}return a.stroke!==TE&&s.push(o),this._d("rectangle",s,a)}ellipse(t,e,r,n,i){const a=this._o(i),s=[],o=Z_(r,n,a),l=Q_(t,e,a,o);if(a.fill)if("solid"===a.fillStyle){const r=Q_(t,e,a,o).opset;r.type="fillPath",s.push(r)}else s.push(rE([l.estimatedPoints],a));return a.stroke!==TE&&s.push(l.opset),this._d("ellipse",s,a)}circle(t,e,r,n){const i=this.ellipse(t,e,r,r,n);return i.shape="circle",i}linearPath(t,e){const r=this._o(e);return this._d("linearPath",[V_(t,!1,r)],r)}arc(t,e,r,n,i,a,s=!1,o){const l=this._o(o),c=[],h=J_(t,e,r,n,i,a,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){const s=Object.assign({},l);s.disableMultiStroke=!0;const o=J_(t,e,r,n,i,a,!0,!1,s);o.type="fillPath",c.push(o)}else c.push(function(t,e,r,n,i,a,s){const o=t,l=e;let c=Math.abs(r/2),h=Math.abs(n/2);c+=sE(.01*c,s),h+=sE(.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]),rE([g],s)}(t,e,r,n,i,a,l));return l.stroke!==TE&&c.push(h),this._d("arc",c,l)}curve(t,e){const r=this._o(e),n=[],i=K_(t,r);if(r.fill&&r.fill!==TE)if("solid"===r.fillStyle){const e=K_(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.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 n of t)n.length<3?e.push(...n):3===n.length?e.push(...kE(fE([n[0],n[0],n[1],n[2]]),10,(1+r.roughness)/2)):e.push(...kE(fE(n),10,(1+r.roughness)/2))}e.length&&n.push(rE([e],r))}return r.stroke!==TE&&n.push(i),this._d("curve",n,r)}polygon(t,e){const r=this._o(e),n=[],i=V_(t,!0,r);return r.fill&&("solid"===r.fillStyle?n.push(eE([t],r)):n.push(rE([t],r))),r.stroke!==TE&&n.push(i),this._d("polygon",n,r)}path(t,e){const r=this._o(e),n=[];if(!t)return this._d("path",n,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&"transparent"!==r.fill&&r.fill!==TE,a=r.stroke!==TE,s=!!(r.simplification&&r.simplification<1),l=function(t,e,r){const n=q_(G_(U_(t))),i=[];let a=[],s=[0,0],l=[];const c=o((()=>{l.length>=4&&a.push(...kE(l,1)),l=[]}),"i"),h=o((()=>{c(),a.length&&(i.push(a),a=[])}),"c");for(const{key:t,data:e}of n)switch(t){case"M":h(),s=[e[0],e[1]],a.push(s);break;case"L":c(),a.push([e[0],e[1]]);break;case"C":if(!l.length){const t=a.length?a[a.length-1]:s;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([s[0],s[1]])}if(h(),!r)return i;const u=[];for(const t of i){const e=bE(t,r);e.length&&u.push(e)}return u}(t,0,s?4-4*(r.simplification||1):(1+r.roughness)/2),c=tE(t,r);if(i)if("solid"===r.fillStyle)if(1===l.length){const e=tE(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(eE(l,r));else n.push(rE(l,r));return a&&(s?l.forEach((t=>{n.push(V_(t,!1,r))})):n.push(c)),this._d("path",n,r)}opsToPath(t,e){let r="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){const e=t.sets||[],r=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:TE};break;case"fillPath":e={d:this.opsToPath(t),stroke:TE,strokeWidth:0,fill:r.fill||TE};break;case"fillSketch":e=this.fillSketch(t,r)}e&&n.push(e)}return n}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||TE,strokeWidth:r,fill:TE}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}},EE=class{static{o(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new _E(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===r.stroke?"transparent":r.stroke,n.lineWidth=r.strokeWidth,r.strokeLineDash&&n.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(n.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(n,a,i),n.restore();break;case"fillPath":{n.save(),n.fillStyle=r.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,i,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,r)}}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=n,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof r&&r>=0?n.data.map((t=>+t.toFixed(r))):n.data;switch(n.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(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a),a}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a),a}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a),a}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i),i}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,n,i,a,s=!1,o){const l=this.gen.arc(t,e,r,n,i,a,s,o);return this.draw(l),l}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){const r=this.gen.path(t,e);return this.draw(r),r}},CE="http://www.w3.org/2000/svg",SE=class{static{o(this,"ot")}constructor(t,e){this.svg=t,this.gen=new _E(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,i=n.createElementNS(CE,"g"),a=t.options.fixedDecimalPlaceDigits;for(const s of e){let e=null;switch(s.type){case"path":e=n.createElementNS(CE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(CE,"path"),e.setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,s,r)}e&&i.appendChild(e)}return i}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2);const i=t.createElementNS(CE,"path");return i.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",n+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,n,i){const a=this.gen.line(t,e,r,n,i);return this.draw(a)}rectangle(t,e,r,n,i){const a=this.gen.rectangle(t,e,r,n,i);return this.draw(a)}ellipse(t,e,r,n,i){const a=this.gen.ellipse(t,e,r,n,i);return this.draw(a)}circle(t,e,r,n){const i=this.gen.circle(t,e,r,n);return this.draw(i)}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,n,i,a,s=!1,o){const l=this.gen.arc(t,e,r,n,i,a,s,o);return this.draw(l)}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r)}path(t,e){const r=this.gen.path(t,e);return this.draw(r)}},AE={canvas:o(((t,e)=>new EE(t,e)),"canvas"),svg:o(((t,e)=>new SE(t,e)),"svg"),generator:o((t=>new _E(t)),"generator"),newSeed:o((()=>_E.newSeed()),"newSeed")},LE=o(((t,e)=>{var r,n,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),r=0===o?0:c*s/o,n=c):(s<0&&(l=-l),r=l,n=0===s?0:l*o/s),{x:i+r,y:a+n}}),"intersectRect"),NE=LE;function IE(t,e){e&&t.attr("style",e)}async function RE(t){const e=Ga(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div");let n=t.label;t.label&&Cr(t.label)&&(n=await Ar(t.label.replace(Lr.lineBreakRegex,"\n"),Qr()));const i=t.isNode?"nodeLabel":"edgeLabel";return r.html('<span class="'+i+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+n+"</span>"),IE(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}o(IE,"applyStyle"),o(RE,"addHtmlLabel");var ME=o((async(t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),yr(Qr().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),y.info("vertexText"+i);const t={isNode:n,label:$k(i).replace(/fa[blrs]?:fa-[\w-]+/g,(t=>`<i class='${t.replace(":"," ")}'></i>`)),labelStyle:e?e.replace("fill:","color:"):e};return await RE(t)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let n=[];n="string"==typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[];for(const e of n){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"),r?n.setAttribute("class","title-row"):n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}return t}}),"createLabel"),DE=ME,OE=o(((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" ")),"createRoundedRectPathD"),PE=o((t=>{const{handDrawnSeed:e}=Qr();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}}),"solidStateFill"),BE=o((t=>{const e=$E([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}}),"compileStyles"),$E=o((t=>{const e=new Map;return t.forEach((t=>{const[r,n]=t.split(":");e.set(r.trim(),n?.trim())})),e}),"styles2Map"),FE=o((t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t),"isLabelStyle"),zE=o((t=>{const{stylesArray:e}=BE(t),r=[],n=[],i=[],a=[];return e.forEach((t=>{const e=t[0];FE(e)?r.push(t.join(":")+" !important"):(n.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))})),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}}),"styles2String"),UE=o(((t,e)=>{const{themeVariables:r,handDrawnSeed:n}=Qr(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=BE(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0]},e)}),"userNodeOverrides"),GE=o((async(t,e)=>{y.info("Creating subgraph rect for ",e.id,e);const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=zE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=yr(r.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await v_(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0});let f=g.getBBox();if(yr(r.flowchart.htmlLabels)){const t=g.children[0],e=Ga(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-m/2,b=e.y-v/2;let w;if(y.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=AE.svg(u),r=UE(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),n=t.path(OE(x,b,m,v,0),r);w=u.insert((()=>(y.debug("Rough node insert CXC",n),n)),":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",m).attr("height",v);const{subGraphTitleTopMargin:k}=qy(r);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 NE(e,t)},{cluster:u,labelBBox:f}}),"rect"),qE=o(((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return NE(e,t)},{cluster:r,labelBBox:{width:0,height:0}}}),"noteGroup"),jE=o((async(t,e)=>{const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,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(yr(r.flowchart.htmlLabels)){const t=p.children[0],e=Ga(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"),r=AE.svg(c),n=e.rx||e.ry?r.path(OE(b,w,y,v,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):r.rectangle(b,w,y,v,{seed:i});T=c.insert((()=>n),":first-child");const h=r.rectangle(b,k,y,x,{fill:t?a:s,fillStyle:t?"hachure":"solid",stroke:l,seed:i});T=c.insert((()=>n),":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-(yr(r.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 NE(e,t)},{cluster:c,labelBBox:g}}),"roundedWithTitle"),WE=o((async(t,e)=>{y.info("Creating subgraph rect for ",e.id,e);const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=zE(e),u=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),d=yr(r.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await v_(p,e.label,{style:e.labelStyle,useHtmlLabels:d,isNode:!0,width:e.width});let f=g.getBBox();if(yr(r.flowchart.htmlLabels)){const t=g.children[0],e=Ga(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,x=e.x-m/2,b=e.y-v/2;let w;if(y.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=AE.svg(u),r=UE(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),n=t.path(OE(x,b,m,v,e.rx),r);w=u.insert((()=>(y.debug("Rough node insert CXC",n),n)),":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",m).attr("height",v);const{subGraphTitleTopMargin:k}=qy(r);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 NE(e,t)},{cluster:u,labelBBox:f}}),"kanbanSection"),YE=o(((t,e)=>{const r=Qr(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,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=AE.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 NE(e,t)},{cluster:s,labelBBox:{}}}),"divider"),HE={rect:GE,squareRect:GE,roundedWithTitle:jE,noteGroup:qE,divider:YE,kanbanSection:WE},VE=new Map,XE=o((async(t,e)=>{const r=e.shape||"rect",n=await HE[r](t,e);return VE.set(e.id,n),n}),"insertCluster"),KE=o((()=>{VE=new Map}),"clear");function ZE(t,e){return t.intersect(e)}o(ZE,"intersectNode");var QE=ZE;function JE(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);n.x<i&&(c=-c);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+c,y:a+h}}o(JE,"intersectEllipse");var tC=JE;function eC(t,e,r){return tC(t,e,e,r)}o(eC,"intersectCircle");var rC=eC;function nC(t,e,r,n){var i,a,s,o,l,c,h,u,d,p,g,f,m;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,d=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(0!==d&&0!==p&&iC(d,p)||(a=n.y-r.y,o=r.x-n.x,c=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+c,u=a*e.x+o*e.y+c,0!==h&&0!==u&&iC(h,u)||0==(g=i*o-a*s))))return f=Math.abs(g/2),{x:(m=s*c-o*l)<0?(m-f)/g:(m+f)/g,y:(m=a*l-i*c)<0?(m-f)/g:(m+f)/g}}function iC(t,e){return t*e>0}o(nC,"intersectLine"),o(iC,"sameSign");var aC=nC;function sC(t,e,r){let n=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=n-t.width/2-s,c=i-t.height/2-o;for(let n=0;n<e.length;n++){let i=e[n],s=e[n<e.length-1?n+1:0],o=aC(t,r,{x:l+i.x,y:c+i.y},{x:l+s.x,y:c+s.y});o&&a.push(o)}return a.length?(a.length>1&&a.sort((function(t,e){let n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return a<l?-1:a===l?0:1})),a[0]):t}o(sC,"intersectPolygon");var oC={node:QE,circle:rC,ellipse:tC,polygon:sC,rect:NE};function lC(t,e){const{labelStyles:r}=zE(e);e.labelStyle=r;const n=k_(e);let i=n;n||(i="anchor");const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:s}=e,o=AE.svg(a),l=UE(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(l.roughness=0);const c=o.circle(0,0,2,l),h=a.insert((()=>c),":first-child");return h.attr("class","anchor").attr("style",zk(s)),w_(e,h),e.intersect=function(t){return y.info("Circle intersect",e,1,t),oC.circle(e,1,t)},a}function cC(t,e,r,n,i,a,s){const o=(t+r)/2,l=(e+n)/2,c=Math.atan2(n-e,r-t),h=(r-t)/2/i,u=(n-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((n-f)/a,(r-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,r=g+i*Math.cos(e),n=f+a*Math.sin(e);v.push({x:r,y:n})}return v}async function hC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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},...cC(-s/2,-o/2,-s/2,o/2,c,l,!1),{x:s/2,y:o/2},...cC(s/2,o/2,s/2,-o/2,c,l,!0)],d=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(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),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(${c/2}, 0)`),w_(e,m),e.intersect=function(t){return oC.polygon(e,u,t)},i}function uC(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}async function dC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=T_(c),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),u&&h.attr("style",u)}else h=uC(i,o,s,c);return n&&h.attr("style",n),w_(e,h),e.intersect=function(t){return oC.polygon(e,c,t)},i}function pC(t,e){const{nodeStyles:r}=zE(e);e.label="";const n=t.insert("g").attr("class",k_(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=AE.svg(n),l=UE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=T_(s),h=o.path(c,l),u=n.insert((()=>h),":first-child");return i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),r&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(t){return oC.polygon(e,s,t)},n}async function gC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await x_(t,e,k_(e)),o=a.width/2+s;let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{}),n=t.circle(0,0,2*o,r);l=i.insert((()=>n),":first-child"),l.attr("class","basic label-container").attr("style",zk(c))}else l=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",o).attr("cx",0).attr("cy",0);return w_(e,l),e.intersect=function(t){return y.info("Circle intersect",e,o,t),oC.circle(e,o,t)},i}function fC(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=2*t;return`M ${-n/2*e},${n/2*r} L ${n/2*e},${-n/2*r}\n M ${n/2*e},${n/2*r} L ${-n/2*e},${-n/2*r}`}function mC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,o=AE.svg(i),l=UE(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*a,l),h=fC(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),n&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",n),w_(e,d),e.intersect=function(t){y.info("crossedCircle intersect",e,{radius:a,point:t});return oC.circle(e,a,t)},i}function yC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;i<n;i++){const n=o+i*l,a=t+r*Math.cos(n),c=e+r*Math.sin(n);s.push({x:-a,y:-c})}return s}async function vC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...yC(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...yC(o/2+2*c,-c,c,20,-180,-270),...yC(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...yC(o/2,l/2,c,20,0,90)],d=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...yC(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...yC(o/2+.1*o,-c,c,20,-180,-270),...yC(o/2+.1*o,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...yC(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2,y:l/2+c}],p=AE.svg(i),g=UE(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=T_(u).replace("Z",""),m=p.path(f,g),y=T_(d),v=p.path(y,{...g}),x=i.insert("g",":first-child");return x.insert((()=>v),":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),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),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))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,d,t)},i}function xC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;i<n;i++){const n=o+i*l,a=t+r*Math.cos(n),c=e+r*Math.sin(n);s.push({x:a,y:c})}return s}async function bC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...xC(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...xC(o/2+2*c,-c,c,20,-180,-270),...xC(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...xC(o/2,l/2,c,20,0,90)],d=[{x:-o/2,y:-l/2-c},{x:o/2,y:-l/2-c},...xC(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...xC(o/2+2*c,-c,c,20,-180,-270),...xC(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...xC(o/2,l/2,c,20,0,90),{x:o/2,y:l/2+c},{x:-o/2,y:l/2+c}],p=AE.svg(i),g=UE(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=T_(u).replace("Z",""),m=p.path(f,g),y=T_(d),v=p.path(y,{...g}),x=i.insert("g",":first-child");return x.insert((()=>v),":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),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),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))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,d,t)},i}function wC(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,l=(a*Math.PI/180-o)/(n-1);for(let i=0;i<n;i++){const n=o+i*l,a=t+r*Math.cos(n),c=e+r*Math.sin(n);s.push({x:-a,y:-c})}return s}async function kC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=a.width+(e.padding??0),l=a.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,u=[...wC(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...wC(o/2+2*c,-c,c,20,-180,-270),...wC(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...wC(o/2,l/2,c,20,0,90)],d=[...wC(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...wC(-o/2-c/2,-c,c,20,0,90),...wC(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...wC(-o/2+c+c/2,l/2,c,30,-180,-270)],p=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...wC(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...wC(o/2+2*c,-c,c,20,-180,-270),...wC(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...wC(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2-c-c/2,y:l/2+c},...wC(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...wC(-o/2-c/2,-c,c,20,0,90),...wC(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...wC(-o/2+c+c/2,l/2,c,30,-180,-270)],g=AE.svg(i),f=UE(e,{fill:"none"});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=T_(u).replace("Z",""),y=g.path(m,f),v=T_(d).replace("Z",""),x=g.path(v,f),b=T_(p),w=g.path(b,{...f}),k=i.insert("g",":first-child");return k.insert((()=>w),":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),n&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",n),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))})`),w_(e,k),e.intersect=function(t){return oC.polygon(e,p,t)},i}async function TC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),u=UE(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},...E_(-d,-o/2,l,50,270,90)],f=T_(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),n&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(${-s/2}, ${-o/2})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}o(lC,"anchor"),o(cC,"generateArcPoints"),o(hC,"bowTieRect"),o(uC,"insertPolygonShape"),o(dC,"card"),o(pC,"choice"),o(gC,"circle"),o(fC,"createLine"),o(mC,"crossedCircle"),o(yC,"generateCirclePoints"),o(vC,"curlyBraceLeft"),o(xC,"generateCirclePoints"),o(bC,"curlyBraceRight"),o(wC,"generateCirclePoints"),o(kC,"curlyBraces"),o(TC,"curvedTrapezoid");var _C=o(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createCylinderPathD"),EC=o(((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n].join(" ")),"createOuterCylinderPathD"),CC=o(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function SC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),r=EC(0,0,o,h,l,c),n=CC(0,c,o,h,l,c),a=t.path(r,UE(e,{})),s=t.path(n,UE(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=_C(0,0,o,h,l,c);u=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(d)).attr("style",n)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),w_(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 r=oC.rect(e,t),n=r.x-(e.x??0);if(0!=l&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-n*n/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function AC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),g=UE(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),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),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))})`),w_(e,y),e.intersect=function(t){return oC.rect(e,t)},i}async function LC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s}=await x_(t,e,k_(e)),o=a.width/2+s+5,l=a.width/2+s;let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=AE.svg(i),r=UE(e,{roughness:.2,strokeWidth:2.5}),n=UE(e,{roughness:.2,strokeWidth:1.5}),a=t.circle(0,0,2*o,r),s=t.circle(0,0,2*l,n);c=i.insert("g",":first-child"),c.attr("class",zk(e.cssClasses)).attr("style",zk(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",n),t.attr("class","outer-circle").attr("style",n).attr("r",o).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0)}return w_(e,c),e.intersect=function(t){return y.info("DoubleCircle intersect",e,o,t),oC.circle(e,o,t)},i}function NC(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",k_(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=AE.svg(a),{nodeBorder:l}=r,c=UE(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),w_(e,u),e.intersect=function(t){y.info("filledCircle intersect",e,{radius:7,point:t});return oC.circle(e,7,t)},a}async function IC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(h),f=d.path(g,p),m=i.insert((()=>f),":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return u&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",u),n&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",n),e.width=o,e.height=l,w_(e,m),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 y.info("Triangle intersect",e,h,t),oC.polygon(e,h,t)},i}function RC(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=zE(e);e.label="";const s=t.insert("g").attr("class",k_(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"===r&&(l=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));const h=-1*l/2,u=-1*c/2,d=AE.svg(s),p=UE(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),w_(e,f);const m=n?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(t){return oC.rect(e,t)},s}async function MC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),u=UE(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},...E_(-s/2+l,0,l,50,90,270),{x:s/2-l,y:o/2},{x:-s/2,y:o/2}],p=T_(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),n&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",n),w_(e,f),e.intersect=function(t){y.info("Pill intersect",e,{radius:l,point:t});return oC.polygon(e,d,t)},i}o(SC,"cylinder"),o(AC,"dividedRectangle"),o(LC,"doublecircle"),o(NC,"filledCircle"),o(IC,"flippedTriangle"),o(RC,"forkJoin"),o(MC,"halfRoundedRectangle");var DC=o(((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" ")),"createHexagonPathD");async function OC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=DC(0,0,l,s,o),a=t.path(n,r);h=i.insert((()=>a),":first-child").attr("transform",`translate(${-l/2}, ${s/2})`),u&&h.attr("style",u)}else h=uC(i,l,s,c);return n&&h.attr("style",n),e.width=l,e.height=s,w_(e,h),e.intersect=function(t){return oC.polygon(e,c,t)},i}async function PC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await x_(t,e,k_(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,l=AE.svg(i),c=UE(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=T_(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),n&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),w_(e,p),e.intersect=function(t){y.info("Pill intersect",e,{points:h});return oC.polygon(e,h,t)},i}async function BC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await x_(t,e,"icon-shape default"),d="t"===e.pos,p=o,g=o,{nodeBorder:f}=r,{stylesMap:m}=BE(e),v=-g/2,x=-p/2,b=e.label?8:0,w=AE.svg(c),k=UE(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(`<g>${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/2-a},${d?h.height/2+b/2-i/2-s:-h.height/2-b/2-i/2-s})`),t.attr("style",`color: ${m.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})`),w_(e,A),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=d?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+b},{x:r+g/2,y:n-i/2+h.height+b},{x:r+g/2,y:n+i/2},{x:r-g/2,y:n+i/2},{x:r-g/2,y:n-i/2+h.height+b},{x:r-h.width/2,y:n-i/2+h.height+b}]:[{x:r-g/2,y:n-i/2},{x:r+g/2,y:n-i/2},{x:r+g/2,y:n-i/2+p},{x:r+h.width/2,y:n-i/2+p},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+p},{x:r-g/2,y:n-i/2+p}];return oC.polygon(e,a,t)},c}async function $C(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:u}=await x_(t,e,"icon-shape default"),d=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:f}=r,{stylesMap:m}=BE(e),v=AE.svg(c),x=UE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=m.get("fill");x.stroke=b??f;const w=c.append("g");e.icon&&w.html(`<g>${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);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"}),R=c.insert((()=>A),":first-child"),M=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: ${m.get("stroke")??g};`),u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),R.attr("transform",`translate(0,${p?h.height/2+d/2:-h.height/2-d/2})`),w_(e,M),e.intersect=function(t){y.info("iconSquare intersect",e,t);return oC.rect(e,t)},c}async function FC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await x_(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:m,mainBkg:v}=r,{stylesMap:x}=BE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=AE.svg(c),_=UE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(OE(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(`<g>${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/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")??m};`)}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})`),w_(e,I),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=p?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+k},{x:r+f/2,y:n-i/2+h.height+k},{x:r+f/2,y:n+i/2},{x:r-f/2,y:n+i/2},{x:r-f/2,y:n-i/2+h.height+k},{x:r-h.width/2,y:n-i/2+h.height+k}]:[{x:r-f/2,y:n-i/2},{x:r+f/2,y:n-i/2},{x:r+f/2,y:n-i/2+g},{x:r+h.width/2,y:n-i/2+g},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+g},{x:r-f/2,y:n-i/2+g}];return oC.polygon(e,a,t)},c}async function zC(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zE(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:u,label:d}=await x_(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*u,f=o+2*u,{nodeBorder:m,mainBkg:v}=r,{stylesMap:x}=BE(e),b=-f/2,w=-g/2,k=e.label?8:0,T=AE.svg(c),_=UE(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");const E=x.get("fill");_.stroke=E??v;const C=T.path(OE(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(`<g>${await Gy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),n=r.width,i=r.height,a=r.x,s=r.y;t.attr("transform",`translate(${-n/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")??m};`)}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})`),w_(e,I),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=p?[{x:r-h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2},{x:r+h.width/2,y:n-i/2+h.height+k},{x:r+f/2,y:n-i/2+h.height+k},{x:r+f/2,y:n+i/2},{x:r-f/2,y:n+i/2},{x:r-f/2,y:n-i/2+h.height+k},{x:r-h.width/2,y:n-i/2+h.height+k}]:[{x:r-f/2,y:n-i/2},{x:r+f/2,y:n-i/2},{x:r+f/2,y:n-i/2+g},{x:r+h.width/2,y:n-i/2+g},{x:r+h.width/2/2,y:n+i/2},{x:r-h.width/2,y:n+i/2},{x:r-h.width/2,y:n-i/2+g},{x:r-f/2,y:n-i/2+g}];return oC.polygon(e,a,t)},c}async function UC(t,e,{config:{flowchart:r}}){const n=new Image;n.src=e?.img??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=zE(e);e.labelStyle=s;const o=r?.wrappingWidth;e.defaultWidth=r?.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 x_(t,e,"image-shape default"),g="t"===e.pos,f=-c/2,m=-h/2,v=e.label?8:0,x=AE.svg(u),b=UE(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const w=x.rectangle(f,m,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})`),w_(e,C),e.intersect=function(t){if(y.info("iconSquare intersect",e,t),!e.label)return oC.rect(e,t);const r=e.x??0,n=e.y??0,i=e.height??0;let a=[];a=g?[{x:r-d.width/2,y:n-i/2},{x:r+d.width/2,y:n-i/2},{x:r+d.width/2,y:n-i/2+d.height+v},{x:r+c/2,y:n-i/2+d.height+v},{x:r+c/2,y:n+i/2},{x:r-c/2,y:n+i/2},{x:r-c/2,y:n-i/2+d.height+v},{x:r-d.width/2,y:n-i/2+d.height+v}]:[{x:r-c/2,y:n-i/2},{x:r+c/2,y:n-i/2},{x:r+c/2,y:n-i/2+h},{x:r+d.width/2,y:n-i/2+h},{x:r+d.width/2/2,y:n+i/2},{x:r-d.width/2,y:n+i/2},{x:r-d.width/2,y:n-i/2+h},{x:r-c/2,y:n-i/2+h}];return oC.polygon(e,a,t)},u}async function GC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function qC(t,e,r){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await x_(t,e,k_(e)),o=Math.max(s.width+2*r.labelPaddingX,e?.width||0),l=Math.max(s.height+2*r.labelPaddingY,e?.height||0),c=-o/2,h=-l/2;let u,{rx:d,ry:p}=e;const{cssStyles:g}=e;if(r?.rx&&r.ry&&(d=r.rx,p=r.ry),"handDrawn"===e.look){const t=AE.svg(a),r=UE(e,{}),n=d||p?t.path(OE(c,h,o,l,d||0),r):t.rectangle(c,h,o,l,r);u=a.insert((()=>n),":first-child"),u.attr("class","basic label-container").attr("style",zk(g))}else u=a.insert("rect",":first-child"),u.attr("class","basic label-container").attr("style",i).attr("rx",zk(d)).attr("ry",zk(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return w_(e,u),e.intersect=function(t){return oC.rect(e,t)},a}async function jC(t,e){const{shapeSvg:r,bbox:n,label:i}=await x_(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-n.height/2-(n.y-(n.top??0))})`),w_(e,a),e.intersect=function(t){return oC.rect(e,t)},r}async function WC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function YC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}function HC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",k_(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=AE.svg(i),h=UE(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const u=T_(l),d=c.path(u,h),p=i.insert((()=>d),":first-child");return a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),n&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",n),p.attr("transform",`translate(-${s/2},${-o})`),w_(e,p),e.intersect=function(t){y.info("lightningBolt intersect",e,t);return oC.polygon(e,l,t)},i}o(OC,"hexagon"),o(PC,"hourglass"),o(BC,"icon"),o($C,"iconCircle"),o(FC,"iconRounded"),o(zC,"iconSquare"),o(UC,"imageSquare"),o(GC,"inv_trapezoid"),o(qC,"drawRect"),o(jC,"labelRect"),o(WC,"lean_left"),o(YC,"lean_right"),o(HC,"lightningBolt");var VC=o(((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createCylinderPathD"),XC=o(((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,"l0,"+-n,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createOuterCylinderPathD"),KC=o(((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" ")),"createInnerCylinderPathD");async function ZC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),r=XC(0,0,o,h,l,c,u),n=KC(0,c,o,h,l,c),a=UE(e,{}),s=t.path(r,a),g=t.path(n,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=VC(0,0,o,h,l,c,u);d=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(p)).attr("style",n)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),w_(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 r=oC.rect(e,t),n=r.x-(e.x??0);if(0!=l&&(Math.abs(n)<(e.width??0)/2||Math.abs(n)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let i=c*c*(1-n*n/(l*l));i>0&&(i=Math.sqrt(i)),i=c-i,t.y-(e.y??0)>0&&(i=-i),r.y+=i}return r},i}async function QC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(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},...__(-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),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),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))})`),w_(e,m),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function JC(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(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=T_(g),y=d.path(m,p),v=T_(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),n&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",n),s.attr("transform",`translate(${-a.width/2-5-(a.x-(a.left??0))}, ${-a.height/2+5-(a.y-(a.top??0))})`),w_(e,b),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function tS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=__(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=AE.svg(i),x=UE(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=T_(m),w=v.path(b,x),k=T_(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),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.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))})`),w_(e,_),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function eS(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;e.useHtmlLabels||!1!==Gt().flowchart?.htmlLabels||(e.centerLabel=!0);const{shapeSvg:a,bbox:s}=await x_(t,e,k_(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=AE.svg(a),p=UE(e,{fill:r.noteBkgColor,stroke:r.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),w_(e,f),e.intersect=function(t){return oC.rect(e,t)},a}o(ZC,"linedCylinder"),o(QC,"linedWaveEdgedRect"),o(JC,"multiRect"),o(tS,"multiWaveEdgedRectangle"),o(eS,"note");var rS=o(((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" ")),"createDecisionBoxPathD");async function nS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=rS(0,0,s),a=t.path(n,r);l=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${s/2})`),c&&l.attr("style",c)}else l=uC(i,s,s,o);return n&&l.attr("style",n),w_(e,l),e.intersect=function(t){return y.debug("APA12 Intersect called SPLIT\npoint:",t,"\nnode:\n",e,"\nres:",oC.polygon(e,o,t)),oC.polygon(e,o,t)},i}async function iS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=T_(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),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),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))})`),w_(e,m),e.intersect=function(t){return oC.polygon(e,h,t)},i}async function aS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);let i;e.labelStyle=r,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",n),l=e.description,c=e.label,h=o.node().appendChild(await DE(c,e.labelStyle,!0,!0));let u={width:0,height:0};if(yr(Qr()?.flowchart?.htmlLabels)){const t=h.children[0],e=Ga(h);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}y.info("Text 2",l);const d=l||[],p=h.getBBox(),g=o.node().appendChild(await DE(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0)),f=g.children[0],m=Ga(g);u=f.getBoundingClientRect(),m.attr("width",u.width),m.attr("height",u.height);const v=(e.padding||0)/2;Ga(g).attr("transform","translate( "+(u.width>p.width?0:(p.width-u.width)/2)+", "+(p.height+v+5)+")"),Ga(h).attr("transform","translate( "+(u.width<p.width?0:-(p.width-u.width)/2)+", 0)"),u=o.node().getBBox(),o.attr("transform","translate("+-u.width/2+", "+(-u.height/2-v+3)+")");const x=u.width+(e.padding||0),b=u.height+(e.padding||0),w=-u.width/2-v,k=-u.height/2-v;let T,_;if("handDrawn"===e.look){const t=AE.svg(a),r=UE(e,{}),n=t.path(OE(w,k,x,b,e.rx||0),r),i=t.line(-u.width/2-v,-u.height/2-v+p.height+v,u.width/2+v,-u.height/2-v+p.height+v,r);_=a.insert((()=>(y.debug("Rough node insert CXC",n),i)),":first-child"),T=a.insert((()=>(y.debug("Rough node insert CXC",n),n)),":first-child")}else T=s.insert("rect",":first-child"),_=s.insert("line"),T.attr("class","outer title-state").attr("style",n).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 w_(e,T),e.intersect=function(t){return oC.rect(e,t)},a}async function sS(t,e){return qC(t,e,{rx:5,ry:5,classes:"",labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function oS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),g=UE(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",zk(d)),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),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))})`),w_(e,y),e.intersect=function(t){return oC.rect(e,t)},i}async function lS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(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=T_(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),n&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",n),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))})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function cS(t,e){return qC(t,e,{rx:0,ry:0,classes:"",labelPaddingX:2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function hS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=OE(-o/2,-s/2,o,s,s/2),a=t.path(n,r);l=i.insert((()=>a),":first-child"),l.attr("class","basic label-container").attr("style",zk(c))}else l=i.insert("rect",":first-child"),l.attr("class","basic label-container").attr("style",n).attr("rx",s/2).attr("ry",s/2).attr("x",-o/2).attr("y",-s/2).attr("width",o).attr("height",s);return w_(e,l),e.intersect=function(t){return oC.rect(e,t)},i}async function uS(t,e){return qC(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function dS(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l}=r,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=AE.svg(c),u=UE(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),w_(e,f),e.intersect=function(t){return oC.circle(e,7,t)},c}function pS(t,e,{config:{themeVariables:r}}){const{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if("handDrawn"===e.look){const t=AE.svg(i).circle(0,0,14,PE(n));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 w_(e,a),e.intersect=function(t){return oC.circle(e,7,t)},i}async function gS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=t.rectangle(c-8,h,o+16,l,r),a=t.line(c,h,c,h+l,r),s=t.line(c+o,h,c+o,h+l,r);i.insert((()=>a),":first-child"),i.insert((()=>s),":first-child");const u=i.insert((()=>n),":first-child"),{cssStyles:d}=e;u.attr("class","basic label-container").attr("style",zk(d)),w_(e,u)}else{const t=uC(i,o,l,u);n&&t.attr("style",n),w_(e,t)}return e.intersect=function(t){return oC.polygon(e,u,t)},i}async function fS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),g=UE(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=T_(f),v=p.path(y,g),x=T_(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),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),w_(e,w),e.intersect=function(t){return oC.polygon(e,f,t)},i}async function mS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-o/2*.1,y:d/2},...__(-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)},...__(y+o,1.3*(v+l),y+o-h,1.5*(v+l),.03*-l,.5)],b=T_(m),w=g.path(b,f),k=T_(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),n&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",n),_.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))})`),w_(e,_),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function yS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",o),w_(e,h),e.intersect=function(t){return oC.rect(e,t)},i}o(nS,"question"),o(iS,"rect_left_inv_arrow"),o(aS,"rectWithTitle"),o(sS,"roundedRect"),o(oS,"shadedProcess"),o(lS,"slopedRect"),o(cS,"squareRect"),o(hS,"stadium"),o(uS,"state"),o(dS,"stateEnd"),o(pS,"stateStart"),o(gS,"subroutine"),o(fS,"taggedRect"),o(mS,"taggedWaveEdgedRectangle"),o(yS,"text");var vS=o(((t,e,r,n,i,a)=>`M${t},${e}\n a${i},${a} 0,0,1 0,${-n}\n l${r},0\n a${i},${a} 0,0,1 0,${n}\n M${r},${-n}\n a${i},${a} 0,0,0 0,${n}\n l${-r},0`),"createCylinderPathD"),xS=o(((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" ")),"createOuterCylinderPathD"),bS=o(((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" ")),"createInnerCylinderPathD");async function wS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s,halfPadding:o}=await x_(t,e,k_(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=AE.svg(i),r=xS(0,0,d,c,u,h),n=bS(0,0,d,c,u,h),a=t.path(r,UE(e,{})),s=t.path(n,UE(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=vS(0,0,d,c,u,h);g=i.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",zk(p)).attr("style",n),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}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))})`),w_(e,g),e.intersect=function(t){const r=oC.rect(e,t),n=r.y-(e.y??0);if(0!=h&&(Math.abs(n)<(e.height??0)/2||Math.abs(n)==(e.height??0)/2&&Math.abs(r.x-(e.x??0))>(e.width??0)/2-u)){let i=u*u*(1-n*n/(h*h));0!=i&&(i=Math.sqrt(Math.abs(i))),i=u-i,t.x-(e.x??0)>0&&(i=-i),r.x+=i}return r},i}async function kS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),r=UE(e,{}),n=T_(l),a=t.path(n,r);c=i.insert((()=>a),":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),h&&c.attr("style",h)}else c=uC(i,s,o,l);return n&&c.attr("style",n),e.width=s,e.height=o,w_(e,c),e.intersect=function(t){return oC.polygon(e,l,t)},i}async function TS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),h=UE(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=T_(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),n&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",n),w_(e,g),e.intersect=function(t){return oC.polygon(e,u,t)},i}async function _S(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(e)),o=yr(Qr().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=AE.svg(i),g=UE(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=T_(u),m=p.path(f,g),v=i.insert((()=>m),":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",d),n&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",n),e.width=l,e.height=c,w_(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 y.info("Triangle intersect",e,u,t),oC.polygon(e,u,t)},i}async function ES(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-p,y:h/2},...__(-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=T_(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),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),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))})`),w_(e,x),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function CS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await x_(t,e,k_(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=AE.svg(i),f=UE(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-c/2,y:d/2},...__(-c/2,d/2,c/2,d/2,u,1),{x:c/2,y:-d/2},...__(c/2,-d/2,-c/2,-d/2,u,-1)],y=T_(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),n&&"handDrawn"!==e.look&&x.selectAll("path").attr("style",n),w_(e,x),e.intersect=function(t){return oC.polygon(e,m,t)},i}async function SS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await x_(t,e,k_(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=AE.svg(i),p=UE(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),n&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",n),s.attr("transform",`translate(${-a.width/2+2.5-(a.x-(a.left??0))}, ${-a.height/2+2.5-(a.y-(a.top??0))})`),w_(e,y),e.intersect=function(t){return oC.polygon(e,g,t)},i}async function AS(t,e){const r=e;if(r.alias&&(e.label=r.alias),"handDrawn"===e.look){const{themeVariables:r}=Gt(),{background:n}=r,i={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${n}`]};await AS(t,i)}const n=Gt();e.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,a=n.er?.entityPadding??6;const{cssStyles:s}=e,{labelStyles:o}=zE(e);if(0===r.attributes.length&&e.label){const r={rx:0,ry:0,labelPaddingX:i,labelPaddingY:1.5*i,classes:""};Sk(e.label,n)+2*r.labelPaddingX<n.er.minEntityWidth&&(e.width=n.er.minEntityWidth);const a=await qC(t,e,r);if(!yr(n.htmlLabels)){const t=a.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return a}n.htmlLabels||(i*=1.25,a*=1.25);let l=k_(e);l||(l="node default");const c=t.insert("g").attr("class",l).attr("id",e.domId||e.id),h=await LS(c,e.label??"",n,0,0,["name"],o);h.height+=a;let u=0;const d=[];let p=0,g=0,f=0,m=0,y=!0,v=!0;for(const t of r.attributes){const e=await LS(c,t.type,n,0,u,["attribute-type"],o);p=Math.max(p,e.width+i);const r=await LS(c,t.name,n,0,u,["attribute-name"],o);g=Math.max(g,r.width+i);const s=await LS(c,t.keys.join(),n,0,u,["attribute-keys"],o);f=Math.max(f,s.width+i);const l=await LS(c,t.comment,n,0,u,["attribute-comment"],o);m=Math.max(m,l.width+i),u+=Math.max(e.height,r.height,s.height,l.height)+a,d.push(u)}d.pop();let x=4;f<=i&&(y=!1,f=0,x--),m<=i&&(v=!1,m=0,x--);const b=c.node().getBBox();if(h.width+2*i-(p+g+f+m)>0){const t=h.width+2*i-(p+g+f+m);p+=t/x,g+=t/x,f>0&&(f+=t/x),m>0&&(m+=t/x)}const w=p+g+f+m,k=AE.svg(c),T=UE(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid");const _=Math.max(b.width+2*i,e?.width||0,w),E=Math.max(b.height+(d[0]||u)+a,e?.height||0),C=-_/2,S=-E/2;c.selectAll("g:not(:first-child)").each(((t,e,r)=>{const n=Ga(r[e]),s=n.attr("transform");let o=0,l=0;if(s){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);t&&(o=parseFloat(t[1]),l=parseFloat(t[2]),n.attr("class").includes("attribute-name")?o+=p:n.attr("class").includes("attribute-keys")?o+=p+g:n.attr("class").includes("attribute-comment")&&(o+=p+g+f))}n.attr("transform",`translate(${C+i/2+o}, ${l+S+h.height+a/2})`)})),c.select(".name").attr("transform","translate("+-h.width/2+", "+(S+a/2)+")");const A=k.rectangle(C,S,_,E,T),L=c.insert((()=>A),":first-child").attr("style",s.join("")),{themeVariables:N}=Gt(),{rowEven:I,rowOdd:R,nodeBorder:M}=N;d.push(0);for(const[t,e]of d.entries()){if(0===t&&d.length>1)continue;const r=t%2==0&&0!==e,n=k.rectangle(C,h.height+S+e,_,h.height,{...T,fill:r?I:R,stroke:M});c.insert((()=>n),"g.label").attr("style",s.join("")).attr("class","row-rect-"+(t%2==0?"even":"odd"))}let D=k.line(C,h.height+S,_+C,h.height+S,T);c.insert((()=>D)).attr("class","divider"),D=k.line(p+C,h.height+S,p+C,E+S,T),c.insert((()=>D)).attr("class","divider"),y&&(D=k.line(p+g+C,h.height+S,p+g+C,E+S,T),c.insert((()=>D)).attr("class","divider")),v&&(D=k.line(p+g+f+C,h.height+S,p+g+f+C,E+S,T),c.insert((()=>D)).attr("class","divider"));for(const t of d)D=k.line(C,h.height+S+t,_+C,h.height+S+t,T),c.insert((()=>D)).attr("class","divider");return w_(e,L),e.intersect=function(t){return oC.rect(e,t)},c}async function LS(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==br(e)&&(e=(e=br(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=o.node().appendChild(await v_(o,e,{width:Sk(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let t=l.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)t=t.childNodes[0],t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(yr(r.htmlLabels)){const t=l.children[0];t.style.textAlign="start";const e=Ga(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}return c}async function NS(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",k_(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 IS(o,{text:`«${t}»`},0);u=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await IS(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 IS(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 IS(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 IS(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Gt();let s="useHtmlLabels"in e?e.useHtmlLabels:yr(a.htmlLabels)??!0,l="";l="text"in e?e.text:e.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),Cr(l)&&(s=!0);const c=await v_(i,en($k(l)),{width:Sk(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let h,u=1;if(s){const t=c.children[0],e=Ga(c);u=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(u+=t.innerHTML.split("<mrow>").length-1);const r=t.getElementsByTagName("img");if(r){const t=""===l.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,r=5,n=parseInt(t,10)*r+"px";e.style.minWidth=n,e.style.maxWidth=n}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{n.includes("font-weight: bolder")&&Ga(c).selectAll("tspan").attr("font-weight",""),u=c.children.length;const t=c.children[0];if(""===c.textContent||c.textContent.includes("&gt")){t.textContent=l[0]+l.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").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)+r)+")"),h.height}async function RS(t,e){const r=Qr(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??yr(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];const{shapeSvg:o,bbox:l}=await NS(t,e,r,a,i),{labelStyles:c,nodeStyles:h}=zE(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&&!r.class?.hideEmptyMembersBox,p=AE.svg(o),g=UE(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-n,v-n-(d?n:0===s.members.length&&0===s.methods.length?-n/2:0),f+2*n,m+2*n+(d?2*n:0===s.members.length&&0===s.methods.length?-n: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,r)=>{const i=Ga(r[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+n-(d?n:0===s.members.length&&0===s.methods.length?-n/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,r){"middle"===window.getComputedStyle(r[e]).textAnchor&&(u=0)}))),i.attr("transform",`translate(${u}, ${h})`)}));const k=o.select(".annotation-group").node().getBBox().height-(d?n/2:0)||0,T=o.select(".label-group").node().getBBox().height-(d?n/2:0)||0,_=o.select(".members-group").node().getBBox().height-(d?n/2:0)||0;if(s.members.length>0||s.methods.length>0||d){const t=p.line(w.x,k+T+v+n,w.x+w.width,k+T+v+n,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+n,w.x+w.width,k+T+_+v+n+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 w_(e,b),e.intersect=function(t){return oC.rect(e,t)},o}async function MS(t,e){const{labelStyles:r,nodeStyles:n}=zE(e);e.labelStyle=r;const i=e,a=e,s="verifyMethod"in e,o=k_(e),l=t.insert("g").attr("class",o).attr("id",e.domId??e.id);let c;c=s?await DS(l,`&lt;&lt;${i.type}&gt;&gt;`,0,e.labelStyle):await DS(l,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let h=c;const u=await DS(l,i.name,h,e.labelStyle+"; font-weight: bold;");if(h+=u+20,s){h+=await DS(l,""+(i.requirementId?`Id: ${i.requirementId}`:""),h,e.labelStyle);h+=await DS(l,""+(i.text?`Text: ${i.text}`:""),h,e.labelStyle);h+=await DS(l,""+(i.risk?`Risk: ${i.risk}`:""),h,e.labelStyle),await DS(l,""+(i.verifyMethod?`Verification: ${i.verifyMethod}`:""),h,e.labelStyle)}else{h+=await DS(l,""+(a.type?`Type: ${a.type}`:""),h,e.labelStyle),await DS(l,""+(a.docRef?`Doc Ref: ${a.docRef}`:""),h,e.labelStyle)}const d=(l.node()?.getBBox().width??200)+20,p=(l.node()?.getBBox().height??200)+20,g=-d/2,f=-p/2,m=AE.svg(l),y=UE(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const v=m.rectangle(g,f,d,p,y),x=l.insert((()=>v),":first-child");if(x.attr("class","basic label-container").attr("style",n),l.selectAll(".label").each(((t,e,r)=>{const n=Ga(r[e]),i=n.attr("transform");let a=0,s=0;if(i){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);t&&(a=parseFloat(t[1]),s=parseFloat(t[2]))}const o=s-p/2;let l=g+10;0!==e&&1!==e||(l=a),n.attr("transform",`translate(${l}, ${o+20})`)})),h>c+u+20){const t=m.line(g,f+c+u+20,g+d,f+c+u+20,y);l.insert((()=>t)).attr("style",n)}return w_(e,x),e.intersect=function(t){return oC.rect(e,t)},l}async function DS(t,e,r,n=""){if(""===e)return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Qr(),s=a.htmlLabels??!0,o=await v_(i,en($k(e)),{width:Sk(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const t=o.children[0],e=Ga(o);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}else{const t=o.children[0];for(const e of t.children)e.textContent=e.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&e.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}o(wS,"tiltedCylinder"),o(kS,"trapezoid"),o(TS,"trapezoidalPentagon"),o(_S,"triangle"),o(ES,"waveEdgedRectangle"),o(CS,"waveRectangle"),o(SS,"windowPane"),o(AS,"erBox"),o(LS,"addText"),o(NS,"textHelper"),o(IS,"addText"),o(RS,"classBox"),o(MS,"requirementBox"),o(DS,"addText");var OS=o((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 PS(t,e,{config:r}){const{labelStyles:n,nodeStyles:i}=zE(e);e.labelStyle=n||"";const a=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:o,label:l}=await x_(t,e,k_(e)),c=e.padding||10;let h,u="";"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(u=r?.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 b_(h,"ticket"in e&&e.ticket||"",d):await b_(s,"ticket"in e&&e.ticket||"",d));const{label:f,bbox:m}=await b_(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=AE.svg(s),r=UE(e,{}),n=T||_?t.path(OE(b,w,y,x,T||0),r):t.rectangle(b,w,y,x,r);k=s.insert((()=>n),":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"),r=b+2,n=w+Math.floor((T??0)/2),i=w+x-Math.floor((T??0)/2);e.attr("x1",r).attr("y1",n).attr("x2",r).attr("y2",i).attr("stroke-width","4").attr("stroke",OS(t))}}return w_(e,k),e.height=x,e.intersect=function(t){return oC.rect(e,t)},s}o(PS,"kanbanItem");var BS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:cS},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:sS},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:hS},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:gS},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:SC},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:gC},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:nS},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:OC},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:YC},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:WC},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:kS},{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:GC},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:LC},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:yS},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:dC},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:oS},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:pS},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:dS},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:RC},{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:vC},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:bC},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:kC},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:HC},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:ES},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:MC},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:wS},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ZC},{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:_S},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:SS},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:NC},{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:IC},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:lS},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:tS},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:JC},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:hC},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:mC},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:mS},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:fS},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:CS},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:iS},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:QC}],$S=o((()=>{const t={state:uS,choice:pC,note:eS,rectWithTitle:aS,labelRect:jC,iconSquare:zC,iconCircle:$C,icon:BC,iconRounded:FC,imageSquare:UC,anchor:lC,kanbanItem:PS,classBox:RS,erBox:AS,requirementBox:MS},e=[...Object.entries(t),...BS.flatMap((t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map((e=>[e,t.handler]))))];return Object.fromEntries(e)}),"generateShapeMap"),FS=$S();function zS(t){return t in FS}o(zS,"isValidShape");var US=new Map;async function GS(t,e,r){let n,i;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?FS[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;"sandbox"===r.config.securityLevel?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),US.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}o(GS,"insertNode");var qS=o(((t,e)=>{US.set(e.id,t)}),"setNodeElem"),jS=o((()=>{US.clear()}),"clear"),WS=o((t=>{const e=US.get(t.id);y.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode"),YS={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function HS(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=VS(t),e=VS(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}o(HS,"calculateDeltaAndAngle");var VS=o((t=>Array.isArray(t)?{x:t[0],y:t[1]}:t),"pointTransformer"),XS=o((t=>({x:o((function(e,r,n){let i=0;const a=VS(n[0]).x<VS(n[n.length-1]).x?"left":"right";if(0===r&&Object.hasOwn(YS,t.arrowTypeStart)){const{angle:e,deltaX:r}=HS(n[0],n[1]);i=YS[t.arrowTypeStart]*Math.cos(e)*(r>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(YS,t.arrowTypeEnd)){const{angle:e,deltaX:r}=HS(n[n.length-1],n[n.length-2]);i=YS[t.arrowTypeEnd]*Math.cos(e)*(r>=0?1:-1)}const s=Math.abs(VS(e).x-VS(n[n.length-1]).x),o=Math.abs(VS(e).y-VS(n[n.length-1]).y),l=Math.abs(VS(e).x-VS(n[0]).x),c=Math.abs(VS(e).y-VS(n[0]).y),h=YS[t.arrowTypeStart],u=YS[t.arrowTypeEnd];if(s<u&&s>0&&o<u){let t=u+1-s;t*="right"===a?-1:1,i-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="right"===a?-1:1,i+=t}return VS(e).x+i}),"x"),y:o((function(e,r,n){let i=0;const a=VS(n[0]).y<VS(n[n.length-1]).y?"down":"up";if(0===r&&Object.hasOwn(YS,t.arrowTypeStart)){const{angle:e,deltaY:r}=HS(n[0],n[1]);i=YS[t.arrowTypeStart]*Math.abs(Math.sin(e))*(r>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(YS,t.arrowTypeEnd)){const{angle:e,deltaY:r}=HS(n[n.length-1],n[n.length-2]);i=YS[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(r>=0?1:-1)}const s=Math.abs(VS(e).y-VS(n[n.length-1]).y),o=Math.abs(VS(e).x-VS(n[n.length-1]).x),l=Math.abs(VS(e).y-VS(n[0]).y),c=Math.abs(VS(e).x-VS(n[0]).x),h=YS[t.arrowTypeStart],u=YS[t.arrowTypeEnd];if(s<u&&s>0&&o<u){let t=u+1-s;t*="up"===a?-1:1,i-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="up"===a?-1:1,i+=t}return VS(e).y+i}),"y")})),"getLineFunctionsWithOffset"),KS=o(((t,e,r,n,i,a)=>{e.arrowTypeStart&&QS(t,"start",e.arrowTypeStart,r,n,i,a),e.arrowTypeEnd&&QS(t,"end",e.arrowTypeEnd,r,n,i,a)}),"addEdgeMarkers"),ZS={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},QS=o(((t,e,r,n,i,a,s)=>{const o=ZS[r];if(!o)return void y.warn(`Unknown arrow type: ${r}`);const l=`${i}_${a}-${o.type}${"start"===e?"Start":"End"}`;if(s&&""!==s.trim()){const r=`${l}_${s.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(r)){const t=document.getElementById(l);if(t){const e=t.cloneNode(!0);e.id=r;e.querySelectorAll("path, circle, line").forEach((t=>{t.setAttribute("stroke",s),o.fill&&t.setAttribute("fill",s)})),t.parentNode?.appendChild(e)}}t.attr(`marker-${e}`,`url(${n}#${r})`)}else t.attr(`marker-${e}`,`url(${n}#${l})`)}),"addEdgeMarker"),JS=new Map,tA=new Map,eA=o((()=>{JS.clear(),tA.clear()}),"clear"),rA=o((t=>t?t.reduce(((t,e)=>t+";"+e),""):""),"getLabelStyles"),nA=o((async(t,e)=>{let r=yr(Qr().flowchart.htmlLabels);const n=await v_(t,e.label,{style:rA(e.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});y.info("abc82",e,e.labelType);const i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(n);let s,o=n.getBBox();if(r){const t=n.children[0],e=Ga(n);o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}if(a.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),JS.set(e.id,i),e.width=o.width,e.height=o.height,e.startLabelLeft){const r=await DE(e.startLabelLeft,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).startLeft=n,iA(s,e.startLabelLeft)}if(e.startLabelRight){const r=await DE(e.startLabelRight,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=n.node().appendChild(r),i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).startRight=n,iA(s,e.startLabelRight)}if(e.endLabelLeft){const r=await DE(e.endLabelLeft,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).endLeft=n,iA(s,e.endLabelLeft)}if(e.endLabelRight){const r=await DE(e.endLabelRight,rA(e.labelStyle)),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");s=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),tA.get(e.id)||tA.set(e.id,{}),tA.get(e.id).endRight=n,iA(s,e.endLabelRight)}return n}),"insertEdgeLabel");function iA(t,e){Qr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}o(iA,"setTerminalWidth");var aA=o(((t,e)=>{y.debug("Moving label abc88 ",t.id,t.label,JS.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Qr(),{subGraphTitleTotalMargin:i}=qy(n);if(t.label){const n=JS.get(t.id);let a=t.x,s=t.y;if(r){const n=Pk.calcLabelPosition(r);y.debug("Moving label "+t.label+" from (",a,",",s,") to (",n.x,",",n.y,") abc88"),e.updatedPath&&(a=n.x,s=n.y)}n.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=tA.get(t.id).startLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.startLabelRight){const e=tA.get(t.id).startRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelLeft){const e=tA.get(t.id).endLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelRight){const e=tA.get(t.id).endRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}}),"positionEdgeLabel"),sA=o(((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),oA=o(((t,e,r)=>{y.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,c=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let t=r.y<e.y?e.y-l-i:i-l-e.y;o=h*t/c;const n={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(n.x=e.x,n.y=e.y),0===h&&(n.x=e.x),0===c&&(n.y=e.y),y.debug(`abc89 top/bottom calc, Q ${c}, q ${t}, R ${h}, r ${o}`,n),n}{o=r.x<e.x?e.x-s-n:n-s-e.x;let t=c*o/h,i=r.x<e.x?r.x+h-o:r.x-h+o,a=r.y<e.y?r.y+t:r.y-t;return y.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`,{_x:i,_y:a}),0===o&&(i=e.x,a=e.y),0===h&&(i=e.x),0===c&&(a=e.y),{x:i,y:a}}}),"intersection"),lA=o(((t,e)=>{y.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach((t=>{if(y.info("abc88 checking point",t,e),sA(e,t)||i)y.warn("abc88 outside",t,n),n=t,i||r.push(t);else{const a=oA(e,n,t);y.debug("abc88 inside",t,n,a),y.debug("abc88 intersection",a,e);let s=!1;r.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))?y.warn("abc88 no intersect",a,r):r.push(a),i=!0}})),y.debug("returning points",r),r}),"cutPathAtIntersect");function cA(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],a=t[n],s=t[n+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}o(cA,"extractCornerPoints");var hA=o((function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=r/Math.sqrt(n*n+i*i);return{x:e.x-a*n,y:e.y-a*i}}),"findAdjacentPoint"),uA=o((function(t){const{cornerPointPositions:e}=cA(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const e=t[n-1],i=t[n+1],a=t[n],s=hA(e,a,5),o=hA(i,a,5),l=o.x-s.x,c=o.y-s.y;r.push(s);const h=2*Math.sqrt(2);let u={x:a.x,y:a.y};if(Math.abs(i.x-e.x)>10&&Math.abs(i.y-e.y)>=10){y.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 y.debug("Corner point skipping fixing",Math.abs(i.x-e.x),Math.abs(i.y-e.y));r.push(u,o)}else r.push(t[n]);return r}),"fixCorners"),dA=o((function(t,e,r,n,i,a,s){const{handDrawnSeed:o}=Qr();let l=e.points,c=!1;const h=i;var u=a;const d=[];for(const t in e.cssCompiledStyles)FE(t)||d.push(e.cssCompiledStyles[t]);u.intersect&&h.intersect&&(l=l.slice(1,e.points.length-1),l.unshift(h.intersect(l[0])),y.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&&(y.info("to cluster abc88",r.get(e.toCluster)),l=lA(e.points,r.get(e.toCluster).node),c=!0),e.fromCluster&&(y.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(l,null,2)),l=lA(l.reverse(),r.get(e.fromCluster).node).reverse(),c=!0);let p=l.filter((t=>!Number.isNaN(t.y)));p=uA(p);let g=Tu;switch(g=hu,e.curve){case"linear":g=hu;break;case"basis":default:g=Tu;break;case"cardinal":g=Mu;break;case"bumpX":g=xu;break;case"bumpY":g=bu;break;case"catmullRom":g=zu;break;case"monotoneX":g=td;break;case"monotoneY":g=ed;break;case"natural":g=id;break;case"step":g=sd;break;case"stepAfter":g=ld;break;case"stepBefore":g=od}const{x:f,y:m}=XS(e),v=gu().x(f).y(m).curve(g);let x,b;switch(e.thickness){case"normal":default:x="edge-thickness-normal";break;case"thick":x="edge-thickness-thick";break;case"invisible":x="edge-thickness-invisible"}switch(e.pattern){case"solid":default:x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}let w=v(p);const k=Array.isArray(e.style)?e.style:[e.style];let T=k.find((t=>t?.startsWith("stroke:")));if("handDrawn"===e.look){const r=AE.svg(t);Object.assign([],p);x+=" transition",b=Ga(r.path(w,{roughness:.3,seed:o})).select("path").attr("id",e.id).attr("class"," "+x+(e.classes?" "+e.classes:"")).attr("style",k?k.reduce(((t,e)=>t+";"+e),""):"");let n=b.attr("d");b.attr("d",n),t.node().appendChild(b.node())}else{const r=d.join(";"),n=k?k.reduce(((t,e)=>t+e+";"),""):"";let i="";e.animate&&(i=" edge-animation-fast"),e.animation&&(i=" edge-animation-"+e.animation);const a=r?r+";"+n+";":n;b=t.append("path").attr("d",w).attr("id",e.id).attr("class"," "+x+(e.classes?" "+e.classes:"")+(i??"")).attr("style",a),T=a.match(/stroke:([^;]+)/)?.[1]}let _="";(Qr().flowchart.arrowMarkerAbsolute||Qr().state.arrowMarkerAbsolute)&&(_=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,_=_.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),y.info("arrowTypeStart",e.arrowTypeStart),y.info("arrowTypeEnd",e.arrowTypeEnd),KS(b,e,_,s,n,T);let E={};return c&&(E.updatedPath=l),E.originalPath=e.points,E}),"insertEdge"),pA=o(((t,e,r,n)=>{e.forEach((e=>{LA[e](t,r,n)}))}),"insertMarkers"),gA=o(((t,e,r)=>{y.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",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",r+"_"+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"),fA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),mA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),yA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),vA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),xA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),bA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),wA=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),kA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),TA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")}),"only_one"),_A=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")}),"zero_or_one"),EA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")}),"one_or_more"),CA=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")}),"zero_or_more"),SA=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d","M0,0\n L20,10\n M20,10\n L0,20")}),"requirement_arrow"),AA=o(((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)}),"requirement_contains"),LA={extension:gA,composition:fA,aggregation:mA,dependency:yA,lollipop:vA,point:xA,circle:bA,cross:wA,barb:kA,only_one:TA,zero_or_one:_A,one_or_more:EA,zero_or_more:CA,requirement_arrow:SA,requirement_contains:AA},NA=pA,IA={common:Lr,getConfig:Gt,insertCluster:XE,insertEdge:dA,insertEdgeLabel:nA,insertMarkers:NA,insertNode:GS,interpolateToCurve:ok,labelHelper:x_,log:y,positionEdgeLabel:aA},RA={},MA=o((t=>{for(const e of t)RA[e.name]=e}),"registerLayoutLoaders");o((()=>{MA([{name:"dagre",loader:o((async()=>await Promise.resolve().then((function(){return EH}))),"loader")}])}),"registerDefaultLayoutLoaders")();var DA=o((async(t,e)=>{if(!(t.layoutAlgorithm in RA))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=RA[t.layoutAlgorithm];return(await r.loader()).render(t,e,IA,{algorithm:r.algorithm})}),"render"),OA=o(((t="",{fallback:e="dagre"}={})=>{if(t in RA)return t;if(e in RA)return y.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"),PA=pb(Object.keys,Object),BA=Object.prototype.hasOwnProperty;function $A(t){if(!yb(t))return PA(t);var e=[];for(var r in Object(t))BA.call(t,r)&&"constructor"!=r&&e.push(r);return e}o($A,"baseKeys");var FA=$A,zA=Iv(Vy,"DataView"),UA=Iv(Vy,"Promise"),GA=Iv(Vy,"Set"),qA=Iv(Vy,"WeakMap"),jA="[object Map]",WA="[object Promise]",YA="[object Set]",HA="[object WeakMap]",VA="[object DataView]",XA=xv(zA),KA=xv(hx),ZA=xv(UA),QA=xv(GA),JA=xv(qA),tL=ov;(zA&&tL(new zA(new ArrayBuffer(1)))!=VA||hx&&tL(new hx)!=jA||UA&&tL(UA.resolve())!=WA||GA&&tL(new GA)!=YA||qA&&tL(new qA)!=HA)&&(tL=o((function(t){var e=ov(t),r="[object Object]"==e?t.constructor:void 0,n=r?xv(r):"";if(n)switch(n){case XA:return VA;case KA:return jA;case ZA:return WA;case QA:return YA;case JA:return HA}return e}),"getTag"));var eL=tL,rL=Object.prototype.hasOwnProperty;function nL(t){if(null==t)return!0;if(Mb(t)&&(Lb(t)||"string"==typeof t||"function"==typeof t.splice||Ub(t)||aw(t)||Ab(t)))return!t.length;var e=eL(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(yb(t))return!FA(t).length;for(var r in t)if(rL.call(t,r))return!1;return!0}o(nL,"isEmpty");var iL=nL,aL={id:"c4",detector:o((t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return sX}));return{id:"c4",diagram:t}}),"loader")},sL="flowchart",oL=o(((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t)),"detector"),lL={id:sL,detector:oL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:sL,diagram:t}}),"loader")},cL="flowchart-v2",hL=o(((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"),uL={id:cL,detector:hL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:cL,diagram:t}}),"loader")},dL={id:"er",detector:o((t=>/^\s*erDiagram/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return LX}));return{id:"er",diagram:t}}),"loader")},pL="gitGraph",gL={id:pL,detector:o((t=>/^\s*gitGraph/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return int}));return{id:pL,diagram:t}}),"loader")},fL="gantt",mL={id:fL,detector:o((t=>/^\s*gantt/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Fit}));return{id:fL,diagram:t}}),"loader")},yL="info",vL={id:yL,detector:o((t=>/^\s*info/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Wit}));return{id:yL,diagram:t}}),"loader")},xL={id:"pie",detector:o((t=>/^\s*pie/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return oat}));return{id:"pie",diagram:t}}),"loader")},bL="quadrantChart",wL={id:bL,detector:o((t=>/^\s*quadrantChart/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Pat}));return{id:bL,diagram:t}}),"loader")},kL="xychart",TL={id:kL,detector:o((t=>/^\s*xychart-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Rst}));return{id:kL,diagram:t}}),"loader")},_L="requirement",EL={id:_L,detector:o((t=>/^\s*requirement(Diagram)?/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return zst}));return{id:_L,diagram:t}}),"loader")},CL="sequence",SL={id:CL,detector:o((t=>/^\s*sequenceDiagram/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Vot}));return{id:CL,diagram:t}}),"loader")},AL="class",LL=o(((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t)),"detector"),NL={id:AL,detector:LL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return clt}));return{id:AL,diagram:t}}),"loader")},IL="classDiagram",RL=o(((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t)),"detector"),ML={id:IL,detector:RL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return ult}));return{id:IL,diagram:t}}),"loader")},DL="state",OL=o(((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t)),"detector"),PL={id:DL,detector:OL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Cct}));return{id:DL,diagram:t}}),"loader")},BL="stateDiagram",$L=o(((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer)),"detector"),FL={id:BL,detector:$L,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return Act}));return{id:BL,diagram:t}}),"loader")},zL="journey",UL={id:zL,detector:o((t=>/^\s*journey/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return fht}));return{id:zL,diagram:t}}),"loader")},GL=o(((t,e,r)=>{y.debug("rendering svg for syntax error\n");const n=ag(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Rr(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)}),"draw"),qL={draw:GL},jL=qL,WL={db:{},renderer:qL,parser:{parse:o((()=>{}),"parse")}},YL="flowchart-elk",HL=o(((t,e={})=>!!(/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0)),"detector"),VL={id:YL,detector:HL,loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return wX}));return{id:YL,diagram:t}}),"loader")},XL="timeline",KL={id:XL,detector:o((t=>/^\s*timeline/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return iut}));return{id:XL,diagram:t}}),"loader")},ZL="mindmap",QL={id:ZL,detector:o((t=>/^\s*mindmap/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return DCt}));return{id:ZL,diagram:t}}),"loader")},JL="kanban",tN={id:JL,detector:o((t=>/^\s*kanban/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return iSt}));return{id:JL,diagram:t}}),"loader")},eN="sankey",rN={id:eN,detector:o((t=>/^\s*sankey-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return uAt}));return{id:eN,diagram:t}}),"loader")},nN="packet",iN={id:nN,detector:o((t=>/^\s*packet-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return SAt}));return{id:nN,diagram:t}}),"loader")},aN="radar",sN={id:aN,detector:o((t=>/^\s*radar-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return rLt}));return{id:aN,diagram:t}}),"loader")},oN="block",lN={id:oN,detector:o((t=>/^\s*block-beta/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return TIt}));return{id:oN,diagram:t}}),"loader")},cN="architecture",hN={id:cN,detector:o((t=>/^\s*architecture/.test(t)),"detector"),loader:o((async()=>{const{diagram:t}=await Promise.resolve().then((function(){return LRt}));return{id:cN,diagram:t}}),"loader")},uN=!1,dN=o((()=>{uN||(uN=!0,sn("error",WL,(t=>"error"===t.toLowerCase().trim())),sn("---",{db:{clear:o((()=>{}),"clear")},styles:{},renderer:{draw:o((()=>{}),"draw")},parser:{parse:o((()=>{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:o((()=>null),"init")},(t=>t.toLowerCase().trimStart().startsWith("---"))),C(aL,tN,ML,NL,dL,mL,vL,xL,EL,SL,VL,uL,lL,QL,KL,gL,FL,PL,UL,wL,rN,iN,TL,lN,hN,sN))}),"addDiagrams"),pN=o((async()=>{y.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(_).map((async([t,{detector:e,loader:r}])=>{if(r)try{on(t)}catch{try{const{diagram:t,id:n}=await r();sn(n,t,e)}catch(e){throw y.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete _[t],e}}})))).filter((t=>"rejected"===t.status));if(t.length>0){y.error(`Failed to load ${t.length} external diagrams`);for(const e of t)y.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}}),"loadRegisteredDiagrams"),gN="comm",fN="rule",mN="decl",yN=Math.abs,vN=String.fromCharCode;function xN(t){return t.trim()}function bN(t,e,r){return t.replace(e,r)}function wN(t,e,r){return t.indexOf(e,r)}function kN(t,e){return 0|t.charCodeAt(e)}function TN(t,e,r){return t.slice(e,r)}function _N(t){return t.length}function EN(t){return t.length}function CN(t,e){return e.push(t),t}o(xN,"trim"),o(bN,"replace"),o(wN,"indexof"),o(kN,"charat"),o(TN,"substr"),o(_N,"strlen"),o(EN,"sizeof"),o(CN,"append");var SN=1,AN=1,LN=0,NN=0,IN=0,RN="";function MN(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:SN,column:AN,length:s,return:"",siblings:o}}function DN(){return IN}function ON(){return IN=NN>0?kN(RN,--NN):0,AN--,10===IN&&(AN=1,SN--),IN}function PN(){return IN=NN<LN?kN(RN,NN++):0,AN++,10===IN&&(AN=1,SN++),IN}function BN(){return kN(RN,NN)}function $N(){return NN}function FN(t,e){return TN(RN,t,e)}function zN(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function UN(t){return SN=AN=1,LN=_N(RN=t),NN=0,[]}function GN(t){return RN="",t}function qN(t){return xN(FN(NN-1,YN(91===t?t+2:40===t?t+1:t)))}function jN(t){for(;(IN=BN())&&IN<33;)PN();return zN(t)>2||zN(IN)>3?"":" "}function WN(t,e){for(;--e&&PN()&&!(IN<48||IN>102||IN>57&&IN<65||IN>70&&IN<97););return FN(t,$N()+(e<6&&32==BN()&&32==PN()))}function YN(t){for(;PN();)switch(IN){case t:return NN;case 34:case 39:34!==t&&39!==t&&YN(IN);break;case 40:41===t&&YN(t);break;case 92:PN()}return NN}function HN(t,e){for(;PN()&&t+IN!==57&&(t+IN!==84||47!==BN()););return"/*"+FN(e,NN-1)+"*"+vN(47===t?t:PN())}function VN(t){for(;!zN(BN());)PN();return FN(t,NN)}function XN(t){return GN(KN("",null,null,null,[""],t=UN(t),0,[0],t))}function KN(t,e,r,n,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=n,T=x;m;)switch(g=v,v=PN()){case 40:if(108!=g&&58==kN(T,u-1)){-1!=wN(T+=bN(qN(v),"&","&\f"),"&\f",yN(c?o[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:T+=qN(v);break;case 9:case 10:case 13:case 32:T+=jN(g);break;case 92:T+=WN($N()-1,7);continue;case 47:switch(BN()){case 42:case 47:CN(QN(HN(PN(),$N()),e,r,l),l),5!=zN(g||1)&&5!=zN(BN()||1)||!_N(T)||" "===TN(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*f:o[c++]=_N(T)*y;case 125*f:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+h:-1==y&&(T=bN(T,/\f/g,"")),p>0&&(_N(T)-u||0===f&&47===g)&&CN(p>32?JN(T+";",n,r,u-1,l):JN(bN(T," ","")+";",n,r,u-2,l),l);break;case 59:T+=";";default:if(CN(k=ZN(T,e,r,c,h,i,o,x,b=[],w=[],u,a),a),123===v)if(0===h)KN(T,e,k,k,b,a,u,o,w);else{switch(d){case 99:if(110===kN(T,3))break;case 108:if(97===kN(T,2))break;default:h=0;case 100:case 109:case 115:}h?KN(t,k,k,n&&CN(ZN(t,k,k,0,0,i,o,x,i,b=[],u,w),w),i,w,u,o,n?b:w):KN(T,k,k,k,[""],w,0,o,w)}}c=h=p=0,f=y=1,x=T="",u=s;break;case 58:u=1+_N(T),p=g;default:if(f<1)if(123==v)--f;else if(125==v&&0==f++&&125==ON())continue;switch(T+=vN(v),v*f){case 38:y=h>0?1:(T+="\f",-1);break;case 44:o[c++]=(_N(T)-1)*y,y=1;break;case 64:45===BN()&&(T+=qN(PN())),d=BN(),h=u=_N(x=T+=VN($N())),v++;break;case 45:45===g&&2==_N(T)&&(f=0)}}return a}function ZN(t,e,r,n,i,a,s,o,l,c,h,u){for(var d=i-1,p=0===i?a:[""],g=EN(p),f=0,m=0,y=0;f<n;++f)for(var v=0,x=TN(t,d+1,d=yN(m=s[f])),b=t;v<g;++v)(b=xN(m>0?p[v]+" "+x:bN(x,/&\f/g,p[v])))&&(l[y++]=b);return MN(t,e,r,0===i?fN:o,l,c,h,u)}function QN(t,e,r,n){return MN(t,e,r,gN,vN(DN()),TN(t,2,-2),0,n)}function JN(t,e,r,n,i){return MN(t,e,r,mN,TN(t,0,n),TN(t,n+1,-1),n,i)}function tI(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function eI(t,e,r,n){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case"@namespace":case mN:return t.return=t.return||t.value;case gN:return"";case"@keyframes":return t.return=t.value+"{"+tI(t.children,n)+"}";case fN:if(!_N(t.value=t.props.join(",")))return""}return _N(r=tI(t.children,n))?t.return=t.value+"{"+r+"}":""}o(MN,"node"),o(DN,"char"),o(ON,"prev"),o(PN,"next"),o(BN,"peek"),o($N,"caret"),o(FN,"slice"),o(zN,"token"),o(UN,"alloc"),o(GN,"dealloc"),o(qN,"delimit"),o(jN,"whitespace"),o(WN,"escaping"),o(YN,"delimiter"),o(HN,"commenter"),o(VN,"identifier"),o(XN,"compile"),o(KN,"parse"),o(ZN,"ruleset"),o(QN,"comment"),o(JN,"declaration"),o(tI,"serialize"),o(eI,"stringify");function rI(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function nI(t,e,r,n){if(void 0!==t.insert){if(r){const e=`chart-desc-${n}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(r)}if(e){const r=`chart-title-${n}`;t.attr("aria-labelledby",r),t.insert("title",":first-child").attr("id",r).text(e)}}}o(rI,"setA11yDiagramInfo"),o(nI,"addSVGa11yTitleDescription");var iI=class t{constructor(t,e,r,n,i){this.type=t,this.text=e,this.db=r,this.parser=n,this.renderer=i}static{o(this,"Diagram")}static async fromText(e,r={}){const n=Gt(),i=E(e,n);e=Bk(e)+"\n";try{on(i)}catch{const t=A(i);if(!t)throw new T(`Diagram ${i} not found.`);const{id:e,diagram:r}=await t();sn(e,r)}const{db:a,parser:s,renderer:o,init:l}=on(i);return s.parser&&(s.parser.yy=a),a.clear?.(),l?.(n),r.title&&a.setDiagramTitle?.(r.title),await s.parse(e),new t(i,e,a,s,o)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},aI=[],sI=o((()=>{aI.forEach((t=>{t()})),aI=[]}),"attachFunctions"),oI=o((t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()),"cleanupComments");function lI(t){const e=t.match(b);if(!e)return{text:t,metadata:{}};let r=oy(e[1],{schema:sy})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:t.slice(e[0].length),metadata:n}}o(lI,"extractFrontMatter");var cI=o((t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,((t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"))),"cleanupText"),hI=o((t=>{const{text:e,metadata:r}=lI(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}}),"processFrontmatter"),uI=o((t=>{const e=Pk.detectInit(t)??{},r=Pk.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some((({type:t})=>"wrap"===t)):"wrap"===r?.type&&(e.wrap=!0),{text:ak(t),directive:e}}),"processDirectives");function dI(t){const e=cI(t),r=hI(e),n=uI(r.text),i=Ok(r.config,n.directive);return{code:t=oI(n.text),title:r.title,config:i}}function pI(t){const e=(new TextEncoder).encode(t),r=Array.from(e,(t=>String.fromCodePoint(t))).join("");return btoa(r)}o(dI,"preprocessDiagram"),o(pI,"toBase64");var gI=["foreignobject"],fI=["dominant-baseline"];function mI(t){const e=dI(t);return Wt(),jt(e.config??{}),e}async function yI(t,e){dN();try{const{code:e,config:r}=mI(t);return{diagramType:(await AI(e)).type,config:r}}catch(t){if(e?.suppressErrors)return!1;throw t}}o(mI,"processAndSetConfigs"),o(yI,"parse");var vI=o(((t,e,r=[])=>`\n.${t} ${e} { ${r.join(" !important; ")} !important; }`),"cssImportantStyles"),xI=o(((t,e=new Map)=>{let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const n=["> *","span"],i=["rect","polygon","ellipse","circle","path"],a=t.htmlLabels??t.flowchart?.htmlLabels?n:i;e.forEach((t=>{iL(t.styles)||a.forEach((e=>{r+=vI(t.id,e,t.styles)})),iL(t.textStyles)||(r+=vI(t.id,"tspan",(t?.textStyles||[]).map((t=>t.replace("color","fill")))))}))}return r}),"createCssStyles"),bI=o(((t,e,r,n)=>{const i=xI(t,r);return tI(XN(`${n}{${Br(e,i,t.themeVariables)}}`),eI)}),"createUserStyles"),wI=o(((t="",e,r)=>{let n=t;return r||e||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=$k(n),n=n.replace(/<br>/g,"<br/>"),n}),"cleanUpSvgCode"),kI=o(((t="",e)=>`<iframe style="width:100%;height:${e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":"100%"};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${pI(`<body style="margin:0">${t}</body>`)}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n The "iframe" tag is not supported by your browser.\n</iframe>`),"putIntoIFrame"),TI=o(((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return i&&s.attr("xmlns:xlink",i),s.append("g"),t}),"appendDivSvgG");function _I(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}o(_I,"sandboxedIframe");var EI=o(((t,e,r,n)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(n)?.remove()}),"removeExistingElements"),CI=o((async function(e,r,n){dN();const i=mI(r);r=i.code;const a=Gt();y.debug(a),r.length>(a?.maxTextSize??5e4)&&(r="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const s="#"+e,l="i"+e,c="#"+l,h="d"+e,u="#"+h,d=o((()=>{const t=Ga(g?c:u).node();t&&"remove"in t&&t.remove()}),"removeTempElements");let p=Ga("body");const g="sandbox"===a.securityLevel,f="loose"===a.securityLevel,m=a.fontFamily;if(void 0!==n){if(n&&(n.innerHTML=""),g){const t=_I(Ga(n),l);p=Ga(t.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=Ga(n);TI(p,e,h,`font-family: ${m}`,"http://www.w3.org/1999/xlink")}else{if(EI(document,e,h,l),g){const t=_I(Ga("body"),l);p=Ga(t.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=Ga("body");TI(p,e,h)}let v,x;try{v=await iI.fromText(r,{title:i.title})}catch(t){if(a.suppressErrorRendering)throw d(),t;v=await iI.fromText("error"),x=t}const b=p.select(u).node(),w=v.type,k=b.firstChild,T=k.firstChild,_=v.renderer.getClasses?.(r,v),E=bI(a,w,_,s),C=document.createElement("style");C.innerHTML=E,k.insertBefore(C,T);try{await v.renderer.draw(r,e,t,v)}catch(n){throw a.suppressErrorRendering?d():jL.draw(r,e,t),n}const S=p.select(`${u} svg`),A=v.db.getAccTitle?.(),L=v.db.getAccDescription?.();LI(w,S,A,L),p.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let N=p.select(u).node().innerHTML;if(y.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),N=wI(N,g,yr(a.arrowMarkerAbsolute)),g){const t=p.select(u+" svg").node();N=kI(N,t)}else f||(N=nr.sanitize(N,{ADD_TAGS:gI,ADD_ATTR:fI,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(sI(),x)throw x;return d(),{diagramType:w,svg:N,bindFunctions:v.db.bindFunctions}}),"render");function SI(t={}){const e=N({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),$t(e),e?.theme&&e.theme in _t?e.themeVariables=_t[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=_t.default.getThemeVariables(e.themeVariables));const r="object"==typeof e?Bt(e):zt();v(r.logLevel),dN()}o(SI,"initialize");var AI=o(((t,e={})=>{const{code:r}=dI(t);return iI.fromText(r,e)}),"getDiagramFromText");function LI(t,e,r,n){rI(e,t),nI(e,r,n,e.attr("id"))}o(LI,"addA11yInfo");var NI=Object.freeze({render:CI,parse:yI,getDiagramFromText:AI,initialize:SI,getConfig:Gt,setConfig:Ut,getSiteConfig:zt,updateSiteConfig:Ft,reset:o((()=>{Wt()}),"reset"),globalReset:o((()=>{Wt(Rt)}),"globalReset"),defaultConfig:Rt});v(Gt().logLevel),Wt(Gt());var II=o(((t,e,r)=>{y.warn(t),Rk(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))}),"handleError"),RI=o((async function(t={querySelector:".mermaid"}){try{await MI(t)}catch(e){if(Rk(e)&&y.error(e.str),jI.parseError&&jI.parseError(e),!t.suppressErrors)throw y.error("Use the suppressErrors option to suppress these errors"),e}}),"run"),MI=o((async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=NI.getConfig();let i;if(y.debug((t?"":"No ")+"Callback function found"),r)i=r;else{if(!e)throw new Error("Nodes and querySelector are both undefined");i=document.querySelectorAll(e)}y.debug(`Found ${i.length} diagrams`),void 0!==n?.startOnLoad&&(y.debug("Start On Load: "+n?.startOnLoad),NI.updateSiteConfig({startOnLoad:n?.startOnLoad}));const a=new Pk.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const e of Array.from(i)){if(y.info("Rendering diagram: "+e.id),e.getAttribute("data-processed"))continue;e.setAttribute("data-processed","true");const r=`mermaid-${a.next()}`;s=e.innerHTML,s=Uk(Pk.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const n=Pk.detectInit(s);n&&y.debug("Detected early reinit: ",n);try{const{svg:n,bindFunctions:i}=await qI(r,s,e);e.innerHTML=n,t&&await t(r),i&&i(e)}catch(t){II(t,o,jI.parseError)}}if(o.length>0)throw o[0]}),"runThrowsErrors"),DI=o((function(t){NI.initialize(t)}),"initialize"),OI=o((async function(t,e,r){y.warn("mermaid.init is deprecated. Please use run instead."),t&&DI(t);const n={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof e?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await RI(n)}),"init"),PI=o((async(t,{lazyLoad:e=!0}={})=>{dN(),C(...t),!1===e&&await pN()}),"registerExternalDiagrams"),BI=o((function(){if(jI.startOnLoad){const{startOnLoad:t}=NI.getConfig();t&&jI.run().catch((t=>y.error("Mermaid failed to initialize",t)))}}),"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",BI,!1);var $I=o((function(t){jI.parseError=t}),"setParseErrorHandler"),FI=[],zI=!1,UI=o((async()=>{if(!zI){for(zI=!0;FI.length>0;){const t=FI.shift();if(t)try{await t()}catch(t){y.error("Error executing queue",t)}}zI=!1}}),"executeQueue"),GI=o((async(t,e)=>new Promise(((r,n)=>{const i=o((()=>new Promise(((i,a)=>{NI.parse(t,e).then((t=>{i(t),r(t)}),(t=>{y.error("Error parsing",t),jI.parseError?.(t),a(t),n(t)}))}))),"performCall");FI.push(i),UI().catch(n)}))),"parse"),qI=o(((t,e,r)=>new Promise(((n,i)=>{const a=o((()=>new Promise(((a,s)=>{NI.render(t,e,r).then((t=>{a(t),n(t)}),(t=>{y.error("Error parsing",t),jI.parseError?.(t),s(t),i(t)}))}))),"performCall");FI.push(a),UI().catch(i)}))),"render"),jI={startOnLoad:!0,mermaidAPI:NI,parse:GI,render:qI,init:OI,run:RI,registerExternalDiagrams:PI,registerLayoutLoaders:MA,initialize:DI,parseError:void 0,contentLoaded:BI,setParseErrorHandler:$I,detectType:E,registerIconPacks:zy},WI=jI;function YI(t){let{beforeRender:e,afterRender:r}=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:r,afterRender:n}=t;if(!1===await(null==r?void 0:r(e)))return;const i=e.textContent.trim();try{const{svg:t}=await WI.render(`mermaid-${Math.random().toString(36).substring(2)}`,i);e.innerHTML=t,await(null==n?void 0:n(e))}catch(t){let r="";null!=t&&t.str&&(r=t.str),null!=t&&t.message&&(r=t.message),console.error(r,{error:t,graphDefinition:i,el:e}),e.innerHTML=r}}({el:t,beforeRender:e,afterRender:r})}}const HI={id:"mermaid",init:function(t){const{...e}=t.getConfig().mermaid||{},{...r}=t.getConfig().mermaidPlugin||{},n=YI({beforeRender:r.beforeRender,afterRender:r.afterRender});WI.initialize({startOnLoad:!1,...e});const i=t.getRevealElement().querySelectorAll(".mermaid");Array.from(i).forEach((function(t){n(t)}))}};var VI=class t{static{o(this,"SourceLocation")}constructor(t,e,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=e,this.end=r}static range(e,r){return r?e&&e.loc&&r.loc&&e.loc.lexer===r.loc.lexer?new t(e.loc.lexer,e.loc.start,r.loc.end):null:e&&e.loc}},XI=class t{static{o(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,r){return new t(r,VI.range(this,e))}},KI=class t{static{o(this,"ParseError")}constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,i,a="KaTeX parse error: "+e,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,i=s.end,n===o.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var l=o.slice(n,i).replace(/[^]/g,"$&̲");a+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+l+(i+15<o.length?o.slice(i,i+15)+"…":o.slice(i))}var c=new Error(a);return c.name="ParseError",c.__proto__=t.prototype,c.position=n,null!=n&&null!=i&&(c.length=i-n),c.rawMessage=e,c}};KI.prototype.__proto__=Error.prototype;var ZI=o((function(t,e){return-1!==t.indexOf(e)}),"contains"),QI=o((function(t,e){return void 0===t?e:t}),"deflt"),JI=/([A-Z])/g,tR=o((function(t){return t.replace(JI,"-$1").toLowerCase()}),"hyphenate"),eR={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},rR=/[&><"']/g;function nR(t){return String(t).replace(rR,(t=>eR[t]))}o(nR,"escape");var iR=o((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"),aR=o((function(t){var e=iR(t);return"mathord"===e.type||"textord"===e.type||"atom"===e.type}),"isCharacterBox"),sR=o((function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t}),"assert"),oR={contains:ZI,deflt:QI,escape:nR,hyphenate:tR,getBaseElem:iR,isCharacterBox:aR,protocolFromUrl:o((function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*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")},lR={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 <type>"},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 <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:o((t=>"#"+t),"cliProcessor")},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:o(((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:o((t=>Math.max(0,t)),"processor"),cli:"--min-rule-thickness <size>",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:o((t=>Math.max(0,t)),"processor"),cli:"-s, --max-size <n>",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:o((t=>Math.max(0,t)),"processor"),cli:"-e, --max-expand <n>",cliProcessor:o((t=>"Infinity"===t?1/0:parseInt(t)),"cliProcessor")},globalGroup:{type:"boolean",cli:!1}};function cR(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}o(cR,"getDefaultValue");var hR=class{static{o(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||{},lR)if(lR.hasOwnProperty(e)){var r=lR[e];this[e]=void 0!==t[e]?r.processor?r.processor(t[e]):t[e]:cR(r)}}reportNonstrict(t,e,r){var n=this.strict;if("function"==typeof n&&(n=n(t,e,r)),n&&"ignore"!==n){if(!0===n||"error"===n)throw new KI("LaTeX-incompatible input and strict mode is set to 'error': "+e+" ["+t+"]",r);"warn"===n?"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 '"+n+"': "+e+" ["+t+"]")}}useStrictBehavior(t,e,r){var n=this.strict;if("function"==typeof n)try{n=n(t,e,r)}catch(t){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("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 '"+n+"': "+e+" ["+t+"]"),!1)))}isTrusted(t){if(t.url&&!t.protocol){var e=oR.protocolFromUrl(t.url);if(null==e)return!1;t.protocol=e}var r="function"==typeof this.trust?this.trust(t):this.trust;return Boolean(r)}},uR=class{static{o(this,"Style")}constructor(t,e,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=e,this.cramped=r}sup(){return dR[pR[this.id]]}sub(){return dR[gR[this.id]]}fracNum(){return dR[fR[this.id]]}fracDen(){return dR[mR[this.id]]}cramp(){return dR[yR[this.id]]}text(){return dR[vR[this.id]]}isTight(){return this.size>=2}},dR=[new uR(0,0,!1),new uR(1,0,!0),new uR(2,1,!1),new uR(3,1,!0),new uR(4,2,!1),new uR(5,2,!0),new uR(6,3,!1),new uR(7,3,!0)],pR=[4,5,4,5,6,7,6,7],gR=[5,5,5,5,7,7,7,7],fR=[2,3,4,5,6,7,6,7],mR=[3,3,5,5,7,7,7,7],yR=[1,1,3,3,5,5,7,7],vR=[0,1,2,3,2,3,2,3],xR={DISPLAY:dR[0],TEXT:dR[2],SCRIPT:dR[4],SCRIPTSCRIPT:dR[6]},bR=[{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 wR(t){for(var e=0;e<bR.length;e++)for(var r=bR[e],n=0;n<r.blocks.length;n++){var i=r.blocks[n];if(t>=i[0]&&t<=i[1])return r.name}return null}o(wR,"scriptFromCodepoint");var kR=[];function TR(t){for(var e=0;e<kR.length;e+=2)if(t>=kR[e]&&t<=kR[e+1])return!0;return!1}bR.forEach((t=>t.blocks.forEach((t=>kR.push(...t))))),o(TR,"supportedCodepoint");var _R=80,ER=o((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"),CR=o((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"),SR=o((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"),AR=o((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"),LR=o((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"),NR=o((function(t){return"M400000 "+t+" H0 L"+t/2+" 0 l65 45 L145 "+(t-80)+" H400000z"}),"phasePath"),IR=o((function(t,e,r){return"M702 "+(t+e)+"H400000"+(40+t)+"\nH742v"+(r-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"),RR=o((function(t,e,r){e*=1e3;var n="";switch(t){case"sqrtMain":n=ER(e,_R);break;case"sqrtSize1":n=CR(e,_R);break;case"sqrtSize2":n=SR(e,_R);break;case"sqrtSize3":n=AR(e,_R);break;case"sqrtSize4":n=LR(e,_R);break;case"sqrtTall":n=IR(e,_R,r)}return n}),"sqrtPath"),MR=o((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"),DR={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"},OR=o((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"),PR=class{static{o(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 oR.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t}toMarkup(){for(var t="",e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t}toText(){var t=o((t=>t.toText()),"toText");return this.children.map(t).join("")}},BR={"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]}},$R={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]},FR={"Å":"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 zR(t,e){BR[t]=e}function UR(t,e,r){if(!BR[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=BR[e][n];if(!i&&t[0]in FR&&(n=FR[t[0]].charCodeAt(0),i=BR[e][n]),i||"text"!==r||TR(n)&&(i=BR[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}o(zR,"setFontMetrics"),o(UR,"getCharacterMetrics");var GR={};function qR(t){var e;if(!GR[e=t>=5?0:t>=3?1:2]){var r=GR[e]={cssEmPerMu:$R.quad[e]/18};for(var n in $R)$R.hasOwnProperty(n)&&(r[n]=$R[n][e])}return GR[e]}o(qR,"getGlobalMetrics");var jR=[[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]],WR=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],YR=o((function(t,e){return e.size<2?t:jR[t-1][e.size-1]}),"sizeAtStyle"),HR=class t{static{o(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=WR[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={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 n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return new t(r)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:YR(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:WR[t-1]})}havingBaseStyle(e){e=e||this.style.text();var r=YR(t.BASESIZE,e);return this.size===r&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}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=qR(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};HR.BASESIZE=6;var VR={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},XR={ex:!0,em:!0,mu:!0},KR=o((function(t){return"string"!=typeof t&&(t=t.unit),t in VR||t in XR||"ex"===t}),"validUnit"),ZR=o((function(t,e){var r;if(t.unit in VR)r=VR[t.unit]/e.fontMetrics().ptPerEm/e.sizeMultiplier;else if("mu"===t.unit)r=e.fontMetrics().cssEmPerMu;else{var n;if(n=e.style.isTight()?e.havingStyle(e.style.text()):e,"ex"===t.unit)r=n.fontMetrics().xHeight;else{if("em"!==t.unit)throw new KI("Invalid unit: '"+t.unit+"'");r=n.fontMetrics().quad}n!==e&&(r*=n.sizeMultiplier/e.sizeMultiplier)}return Math.min(t.number*r,e.maxSize)}),"calculateSize"),QR=o((function(t){return+t.toFixed(4)+"em"}),"makeEm"),JR=o((function(t){return t.filter((t=>t)).join(" ")}),"createClass"),tM=o((function(t,e,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},e){e.style.isTight()&&this.classes.push("mtight");var n=e.getColor();n&&(this.style.color=n)}}),"initNode"),eM=o((function(t){var e=document.createElement(t);for(var r in e.className=JR(this.classes),this.style)this.style.hasOwnProperty(r)&&(e.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&e.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)e.appendChild(this.children[i].toNode());return e}),"toNode"),rM=o((function(t){var e="<"+t;this.classes.length&&(e+=' class="'+oR.escape(JR(this.classes))+'"');var r="";for(var n in this.style)this.style.hasOwnProperty(n)&&(r+=oR.hyphenate(n)+":"+this.style[n]+";");for(var i in r&&(e+=' style="'+oR.escape(r)+'"'),this.attributes)this.attributes.hasOwnProperty(i)&&(e+=" "+i+'="'+oR.escape(this.attributes[i])+'"');e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</"+t+">"}),"toMarkup"),nM=class{static{o(this,"Span")}constructor(t,e,r,n){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,tM.call(this,t,r,n),this.children=e||[]}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return oR.contains(this.classes,t)}toNode(){return eM.call(this,"span")}toMarkup(){return rM.call(this,"span")}},iM=class{static{o(this,"Anchor")}constructor(t,e,r,n){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,tM.call(this,e,n),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,e){this.attributes[t]=e}hasClass(t){return oR.contains(this.classes,t)}toNode(){return eM.call(this,"a")}toMarkup(){return rM.call(this,"a")}},aM=class{static{o(this,"Img")}constructor(t,e,r){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=r}hasClass(t){return oR.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='<img src="'+oR.escape(this.src)+'" alt="'+oR.escape(this.alt)+'"',e="";for(var r in this.style)this.style.hasOwnProperty(r)&&(e+=oR.hyphenate(r)+":"+this.style[r]+";");return e&&(t+=' style="'+oR.escape(e)+'"'),t+="'/>"}},sM={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"},oM=class{static{o(this,"SymbolNode")}constructor(t,e,r,n,i,a,s,o){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=e||0,this.depth=r||0,this.italic=n||0,this.skew=i||0,this.width=a||0,this.classes=s||[],this.style=o||{},this.maxFontSize=0;var l=wR(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=sM[this.text])}hasClass(t){return oR.contains(this.classes,t)}toNode(){var t=document.createTextNode(this.text),e=null;for(var r in this.italic>0&&((e=document.createElement("span")).style.marginRight=QR(this.italic)),this.classes.length>0&&((e=e||document.createElement("span")).className=JR(this.classes)),this.style)this.style.hasOwnProperty(r)&&((e=e||document.createElement("span")).style[r]=this.style[r]);return e?(e.appendChild(t),e):t}toMarkup(){var t=!1,e="<span";this.classes.length&&(t=!0,e+=' class="',e+=oR.escape(JR(this.classes)),e+='"');var r="";for(var n in this.italic>0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=oR.hyphenate(n)+":"+this.style[n]+";");r&&(t=!0,e+=' style="'+oR.escape(r)+'"');var i=oR.escape(this.text);return t?(e+=">",e+=i,e+="</span>"):i}},lM=class{static{o(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 r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="'+oR.escape(this.attributes[e])+'"');t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>"}},cM=class{static{o(this,"PathNode")}constructor(t,e){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=e}toNode(){var t=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",DR[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+oR.escape(this.alternate)+'"/>':'<path d="'+oR.escape(DR[this.pathName])+'"/>'}},hM=class{static{o(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="<line";for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="'+oR.escape(this.attributes[e])+'"');return t+="/>"}};function uM(t){if(t instanceof oM)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function dM(t){if(t instanceof nM)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}o(uM,"assertSymbolDomNode"),o(dM,"assertSpan");var pM={bin:1,close:1,inner:1,open:1,punct:1,rel:1},gM={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},fM={math:{},text:{}};function mM(t,e,r,n,i,a){fM[t][i]={font:e,group:r,replace:n},a&&n&&(fM[t][n]=fM[t][i])}o(mM,"defineSymbol");var yM="math",vM="text",xM="main",bM="ams",wM="accent-token",kM="bin",TM="close",_M="inner",EM="mathord",CM="op-token",SM="open",AM="punct",LM="rel",NM="spacing",IM="textord";mM(yM,xM,LM,"≡","\\equiv",!0),mM(yM,xM,LM,"≺","\\prec",!0),mM(yM,xM,LM,"≻","\\succ",!0),mM(yM,xM,LM,"","\\sim",!0),mM(yM,xM,LM,"⊥","\\perp"),mM(yM,xM,LM,"⪯","\\preceq",!0),mM(yM,xM,LM,"⪰","\\succeq",!0),mM(yM,xM,LM,"≃","\\simeq",!0),mM(yM,xM,LM,"","\\mid",!0),mM(yM,xM,LM,"≪","\\ll",!0),mM(yM,xM,LM,"≫","\\gg",!0),mM(yM,xM,LM,"≍","\\asymp",!0),mM(yM,xM,LM,"∥","\\parallel"),mM(yM,xM,LM,"⋈","\\bowtie",!0),mM(yM,xM,LM,"⌣","\\smile",!0),mM(yM,xM,LM,"⊑","\\sqsubseteq",!0),mM(yM,xM,LM,"⊒","\\sqsupseteq",!0),mM(yM,xM,LM,"≐","\\doteq",!0),mM(yM,xM,LM,"⌢","\\frown",!0),mM(yM,xM,LM,"∋","\\ni",!0),mM(yM,xM,LM,"∝","\\propto",!0),mM(yM,xM,LM,"⊢","\\vdash",!0),mM(yM,xM,LM,"⊣","\\dashv",!0),mM(yM,xM,LM,"∋","\\owns"),mM(yM,xM,AM,".","\\ldotp"),mM(yM,xM,AM,"⋅","\\cdotp"),mM(yM,xM,IM,"#","\\#"),mM(vM,xM,IM,"#","\\#"),mM(yM,xM,IM,"&","\\&"),mM(vM,xM,IM,"&","\\&"),mM(yM,xM,IM,"ℵ","\\aleph",!0),mM(yM,xM,IM,"∀","\\forall",!0),mM(yM,xM,IM,"ℏ","\\hbar",!0),mM(yM,xM,IM,"∃","\\exists",!0),mM(yM,xM,IM,"∇","\\nabla",!0),mM(yM,xM,IM,"♭","\\flat",!0),mM(yM,xM,IM,"","\\ell",!0),mM(yM,xM,IM,"♮","\\natural",!0),mM(yM,xM,IM,"♣","\\clubsuit",!0),mM(yM,xM,IM,"℘","\\wp",!0),mM(yM,xM,IM,"♯","\\sharp",!0),mM(yM,xM,IM,"♢","\\diamondsuit",!0),mM(yM,xM,IM,"","\\Re",!0),mM(yM,xM,IM,"♡","\\heartsuit",!0),mM(yM,xM,IM,"","\\Im",!0),mM(yM,xM,IM,"♠","\\spadesuit",!0),mM(yM,xM,IM,"§","\\S",!0),mM(vM,xM,IM,"§","\\S"),mM(yM,xM,IM,"¶","\\P",!0),mM(vM,xM,IM,"¶","\\P"),mM(yM,xM,IM,"†","\\dag"),mM(vM,xM,IM,"†","\\dag"),mM(vM,xM,IM,"†","\\textdagger"),mM(yM,xM,IM,"‡","\\ddag"),mM(vM,xM,IM,"‡","\\ddag"),mM(vM,xM,IM,"‡","\\textdaggerdbl"),mM(yM,xM,TM,"⎱","\\rmoustache",!0),mM(yM,xM,SM,"⎰","\\lmoustache",!0),mM(yM,xM,TM,"⟯","\\rgroup",!0),mM(yM,xM,SM,"⟮","\\lgroup",!0),mM(yM,xM,kM,"∓","\\mp",!0),mM(yM,xM,kM,"⊖","\\ominus",!0),mM(yM,xM,kM,"⊎","\\uplus",!0),mM(yM,xM,kM,"⊓","\\sqcap",!0),mM(yM,xM,kM,"","\\ast"),mM(yM,xM,kM,"⊔","\\sqcup",!0),mM(yM,xM,kM,"◯","\\bigcirc",!0),mM(yM,xM,kM,"∙","\\bullet",!0),mM(yM,xM,kM,"‡","\\ddagger"),mM(yM,xM,kM,"≀","\\wr",!0),mM(yM,xM,kM,"⨿","\\amalg"),mM(yM,xM,kM,"&","\\And"),mM(yM,xM,LM,"⟵","\\longleftarrow",!0),mM(yM,xM,LM,"⇐","\\Leftarrow",!0),mM(yM,xM,LM,"⟸","\\Longleftarrow",!0),mM(yM,xM,LM,"⟶","\\longrightarrow",!0),mM(yM,xM,LM,"⇒","\\Rightarrow",!0),mM(yM,xM,LM,"⟹","\\Longrightarrow",!0),mM(yM,xM,LM,"↔","\\leftrightarrow",!0),mM(yM,xM,LM,"⟷","\\longleftrightarrow",!0),mM(yM,xM,LM,"⇔","\\Leftrightarrow",!0),mM(yM,xM,LM,"⟺","\\Longleftrightarrow",!0),mM(yM,xM,LM,"↦","\\mapsto",!0),mM(yM,xM,LM,"⟼","\\longmapsto",!0),mM(yM,xM,LM,"↗","\\nearrow",!0),mM(yM,xM,LM,"↩","\\hookleftarrow",!0),mM(yM,xM,LM,"↪","\\hookrightarrow",!0),mM(yM,xM,LM,"↘","\\searrow",!0),mM(yM,xM,LM,"↼","\\leftharpoonup",!0),mM(yM,xM,LM,"⇀","\\rightharpoonup",!0),mM(yM,xM,LM,"↙","\\swarrow",!0),mM(yM,xM,LM,"↽","\\leftharpoondown",!0),mM(yM,xM,LM,"⇁","\\rightharpoondown",!0),mM(yM,xM,LM,"↖","\\nwarrow",!0),mM(yM,xM,LM,"⇌","\\rightleftharpoons",!0),mM(yM,bM,LM,"≮","\\nless",!0),mM(yM,bM,LM,"","\\@nleqslant"),mM(yM,bM,LM,"","\\@nleqq"),mM(yM,bM,LM,"⪇","\\lneq",!0),mM(yM,bM,LM,"≨","\\lneqq",!0),mM(yM,bM,LM,"","\\@lvertneqq"),mM(yM,bM,LM,"⋦","\\lnsim",!0),mM(yM,bM,LM,"⪉","\\lnapprox",!0),mM(yM,bM,LM,"⊀","\\nprec",!0),mM(yM,bM,LM,"⋠","\\npreceq",!0),mM(yM,bM,LM,"⋨","\\precnsim",!0),mM(yM,bM,LM,"⪹","\\precnapprox",!0),mM(yM,bM,LM,"≁","\\nsim",!0),mM(yM,bM,LM,"","\\@nshortmid"),mM(yM,bM,LM,"∤","\\nmid",!0),mM(yM,bM,LM,"⊬","\\nvdash",!0),mM(yM,bM,LM,"⊭","\\nvDash",!0),mM(yM,bM,LM,"⋪","\\ntriangleleft"),mM(yM,bM,LM,"⋬","\\ntrianglelefteq",!0),mM(yM,bM,LM,"⊊","\\subsetneq",!0),mM(yM,bM,LM,"","\\@varsubsetneq"),mM(yM,bM,LM,"⫋","\\subsetneqq",!0),mM(yM,bM,LM,"","\\@varsubsetneqq"),mM(yM,bM,LM,"≯","\\ngtr",!0),mM(yM,bM,LM,"","\\@ngeqslant"),mM(yM,bM,LM,"","\\@ngeqq"),mM(yM,bM,LM,"⪈","\\gneq",!0),mM(yM,bM,LM,"≩","\\gneqq",!0),mM(yM,bM,LM,"","\\@gvertneqq"),mM(yM,bM,LM,"⋧","\\gnsim",!0),mM(yM,bM,LM,"⪊","\\gnapprox",!0),mM(yM,bM,LM,"⊁","\\nsucc",!0),mM(yM,bM,LM,"⋡","\\nsucceq",!0),mM(yM,bM,LM,"⋩","\\succnsim",!0),mM(yM,bM,LM,"⪺","\\succnapprox",!0),mM(yM,bM,LM,"≆","\\ncong",!0),mM(yM,bM,LM,"","\\@nshortparallel"),mM(yM,bM,LM,"∦","\\nparallel",!0),mM(yM,bM,LM,"⊯","\\nVDash",!0),mM(yM,bM,LM,"⋫","\\ntriangleright"),mM(yM,bM,LM,"⋭","\\ntrianglerighteq",!0),mM(yM,bM,LM,"","\\@nsupseteqq"),mM(yM,bM,LM,"⊋","\\supsetneq",!0),mM(yM,bM,LM,"","\\@varsupsetneq"),mM(yM,bM,LM,"⫌","\\supsetneqq",!0),mM(yM,bM,LM,"","\\@varsupsetneqq"),mM(yM,bM,LM,"⊮","\\nVdash",!0),mM(yM,bM,LM,"⪵","\\precneqq",!0),mM(yM,bM,LM,"⪶","\\succneqq",!0),mM(yM,bM,LM,"","\\@nsubseteqq"),mM(yM,bM,kM,"⊴","\\unlhd"),mM(yM,bM,kM,"⊵","\\unrhd"),mM(yM,bM,LM,"↚","\\nleftarrow",!0),mM(yM,bM,LM,"↛","\\nrightarrow",!0),mM(yM,bM,LM,"⇍","\\nLeftarrow",!0),mM(yM,bM,LM,"⇏","\\nRightarrow",!0),mM(yM,bM,LM,"↮","\\nleftrightarrow",!0),mM(yM,bM,LM,"⇎","\\nLeftrightarrow",!0),mM(yM,bM,LM,"△","\\vartriangle"),mM(yM,bM,IM,"ℏ","\\hslash"),mM(yM,bM,IM,"▽","\\triangledown"),mM(yM,bM,IM,"◊","\\lozenge"),mM(yM,bM,IM,"Ⓢ","\\circledS"),mM(yM,bM,IM,"®","\\circledR"),mM(vM,bM,IM,"®","\\circledR"),mM(yM,bM,IM,"∡","\\measuredangle",!0),mM(yM,bM,IM,"∄","\\nexists"),mM(yM,bM,IM,"℧","\\mho"),mM(yM,bM,IM,"Ⅎ","\\Finv",!0),mM(yM,bM,IM,"⅁","\\Game",!0),mM(yM,bM,IM,"","\\backprime"),mM(yM,bM,IM,"▲","\\blacktriangle"),mM(yM,bM,IM,"▼","\\blacktriangledown"),mM(yM,bM,IM,"■","\\blacksquare"),mM(yM,bM,IM,"⧫","\\blacklozenge"),mM(yM,bM,IM,"★","\\bigstar"),mM(yM,bM,IM,"∢","\\sphericalangle",!0),mM(yM,bM,IM,"∁","\\complement",!0),mM(yM,bM,IM,"ð","\\eth",!0),mM(vM,xM,IM,"ð","ð"),mM(yM,bM,IM,"","\\diagup"),mM(yM,bM,IM,"╲","\\diagdown"),mM(yM,bM,IM,"□","\\square"),mM(yM,bM,IM,"□","\\Box"),mM(yM,bM,IM,"◊","\\Diamond"),mM(yM,bM,IM,"¥","\\yen",!0),mM(vM,bM,IM,"¥","\\yen",!0),mM(yM,bM,IM,"✓","\\checkmark",!0),mM(vM,bM,IM,"✓","\\checkmark"),mM(yM,bM,IM,"ℶ","\\beth",!0),mM(yM,bM,IM,"ℸ","\\daleth",!0),mM(yM,bM,IM,"ℷ","\\gimel",!0),mM(yM,bM,IM,"ϝ","\\digamma",!0),mM(yM,bM,IM,"ϰ","\\varkappa"),mM(yM,bM,SM,"┌","\\@ulcorner",!0),mM(yM,bM,TM,"┐","\\@urcorner",!0),mM(yM,bM,SM,"└","\\@llcorner",!0),mM(yM,bM,TM,"┘","\\@lrcorner",!0),mM(yM,bM,LM,"≦","\\leqq",!0),mM(yM,bM,LM,"⩽","\\leqslant",!0),mM(yM,bM,LM,"⪕","\\eqslantless",!0),mM(yM,bM,LM,"≲","\\lesssim",!0),mM(yM,bM,LM,"⪅","\\lessapprox",!0),mM(yM,bM,LM,"≊","\\approxeq",!0),mM(yM,bM,kM,"⋖","\\lessdot"),mM(yM,bM,LM,"⋘","\\lll",!0),mM(yM,bM,LM,"≶","\\lessgtr",!0),mM(yM,bM,LM,"⋚","\\lesseqgtr",!0),mM(yM,bM,LM,"⪋","\\lesseqqgtr",!0),mM(yM,bM,LM,"≑","\\doteqdot"),mM(yM,bM,LM,"≓","\\risingdotseq",!0),mM(yM,bM,LM,"≒","\\fallingdotseq",!0),mM(yM,bM,LM,"∽","\\backsim",!0),mM(yM,bM,LM,"⋍","\\backsimeq",!0),mM(yM,bM,LM,"⫅","\\subseteqq",!0),mM(yM,bM,LM,"⋐","\\Subset",!0),mM(yM,bM,LM,"⊏","\\sqsubset",!0),mM(yM,bM,LM,"≼","\\preccurlyeq",!0),mM(yM,bM,LM,"⋞","\\curlyeqprec",!0),mM(yM,bM,LM,"≾","\\precsim",!0),mM(yM,bM,LM,"⪷","\\precapprox",!0),mM(yM,bM,LM,"⊲","\\vartriangleleft"),mM(yM,bM,LM,"⊴","\\trianglelefteq"),mM(yM,bM,LM,"⊨","\\vDash",!0),mM(yM,bM,LM,"⊪","\\Vvdash",!0),mM(yM,bM,LM,"⌣","\\smallsmile"),mM(yM,bM,LM,"⌢","\\smallfrown"),mM(yM,bM,LM,"≏","\\bumpeq",!0),mM(yM,bM,LM,"≎","\\Bumpeq",!0),mM(yM,bM,LM,"≧","\\geqq",!0),mM(yM,bM,LM,"⩾","\\geqslant",!0),mM(yM,bM,LM,"⪖","\\eqslantgtr",!0),mM(yM,bM,LM,"≳","\\gtrsim",!0),mM(yM,bM,LM,"⪆","\\gtrapprox",!0),mM(yM,bM,kM,"⋗","\\gtrdot"),mM(yM,bM,LM,"⋙","\\ggg",!0),mM(yM,bM,LM,"≷","\\gtrless",!0),mM(yM,bM,LM,"⋛","\\gtreqless",!0),mM(yM,bM,LM,"⪌","\\gtreqqless",!0),mM(yM,bM,LM,"≖","\\eqcirc",!0),mM(yM,bM,LM,"≗","\\circeq",!0),mM(yM,bM,LM,"≜","\\triangleq",!0),mM(yM,bM,LM,"","\\thicksim"),mM(yM,bM,LM,"≈","\\thickapprox"),mM(yM,bM,LM,"⫆","\\supseteqq",!0),mM(yM,bM,LM,"⋑","\\Supset",!0),mM(yM,bM,LM,"⊐","\\sqsupset",!0),mM(yM,bM,LM,"≽","\\succcurlyeq",!0),mM(yM,bM,LM,"⋟","\\curlyeqsucc",!0),mM(yM,bM,LM,"≿","\\succsim",!0),mM(yM,bM,LM,"⪸","\\succapprox",!0),mM(yM,bM,LM,"⊳","\\vartriangleright"),mM(yM,bM,LM,"⊵","\\trianglerighteq"),mM(yM,bM,LM,"⊩","\\Vdash",!0),mM(yM,bM,LM,"","\\shortmid"),mM(yM,bM,LM,"∥","\\shortparallel"),mM(yM,bM,LM,"≬","\\between",!0),mM(yM,bM,LM,"⋔","\\pitchfork",!0),mM(yM,bM,LM,"∝","\\varpropto"),mM(yM,bM,LM,"◀","\\blacktriangleleft"),mM(yM,bM,LM,"∴","\\therefore",!0),mM(yM,bM,LM,"∍","\\backepsilon"),mM(yM,bM,LM,"▶","\\blacktriangleright"),mM(yM,bM,LM,"∵","\\because",!0),mM(yM,bM,LM,"⋘","\\llless"),mM(yM,bM,LM,"⋙","\\gggtr"),mM(yM,bM,kM,"⊲","\\lhd"),mM(yM,bM,kM,"⊳","\\rhd"),mM(yM,bM,LM,"≂","\\eqsim",!0),mM(yM,xM,LM,"⋈","\\Join"),mM(yM,bM,LM,"≑","\\Doteq",!0),mM(yM,bM,kM,"∔","\\dotplus",!0),mM(yM,bM,kM,"","\\smallsetminus"),mM(yM,bM,kM,"⋒","\\Cap",!0),mM(yM,bM,kM,"⋓","\\Cup",!0),mM(yM,bM,kM,"⩞","\\doublebarwedge",!0),mM(yM,bM,kM,"⊟","\\boxminus",!0),mM(yM,bM,kM,"⊞","\\boxplus",!0),mM(yM,bM,kM,"⋇","\\divideontimes",!0),mM(yM,bM,kM,"⋉","\\ltimes",!0),mM(yM,bM,kM,"⋊","\\rtimes",!0),mM(yM,bM,kM,"⋋","\\leftthreetimes",!0),mM(yM,bM,kM,"⋌","\\rightthreetimes",!0),mM(yM,bM,kM,"⋏","\\curlywedge",!0),mM(yM,bM,kM,"⋎","\\curlyvee",!0),mM(yM,bM,kM,"⊝","\\circleddash",!0),mM(yM,bM,kM,"⊛","\\circledast",!0),mM(yM,bM,kM,"⋅","\\centerdot"),mM(yM,bM,kM,"⊺","\\intercal",!0),mM(yM,bM,kM,"⋒","\\doublecap"),mM(yM,bM,kM,"⋓","\\doublecup"),mM(yM,bM,kM,"⊠","\\boxtimes",!0),mM(yM,bM,LM,"⇢","\\dashrightarrow",!0),mM(yM,bM,LM,"⇠","\\dashleftarrow",!0),mM(yM,bM,LM,"⇇","\\leftleftarrows",!0),mM(yM,bM,LM,"⇆","\\leftrightarrows",!0),mM(yM,bM,LM,"⇚","\\Lleftarrow",!0),mM(yM,bM,LM,"↞","\\twoheadleftarrow",!0),mM(yM,bM,LM,"↢","\\leftarrowtail",!0),mM(yM,bM,LM,"↫","\\looparrowleft",!0),mM(yM,bM,LM,"⇋","\\leftrightharpoons",!0),mM(yM,bM,LM,"↶","\\curvearrowleft",!0),mM(yM,bM,LM,"↺","\\circlearrowleft",!0),mM(yM,bM,LM,"↰","\\Lsh",!0),mM(yM,bM,LM,"⇈","\\upuparrows",!0),mM(yM,bM,LM,"↿","\\upharpoonleft",!0),mM(yM,bM,LM,"⇃","\\downharpoonleft",!0),mM(yM,xM,LM,"⊶","\\origof",!0),mM(yM,xM,LM,"⊷","\\imageof",!0),mM(yM,bM,LM,"⊸","\\multimap",!0),mM(yM,bM,LM,"↭","\\leftrightsquigarrow",!0),mM(yM,bM,LM,"⇉","\\rightrightarrows",!0),mM(yM,bM,LM,"⇄","\\rightleftarrows",!0),mM(yM,bM,LM,"↠","\\twoheadrightarrow",!0),mM(yM,bM,LM,"↣","\\rightarrowtail",!0),mM(yM,bM,LM,"↬","\\looparrowright",!0),mM(yM,bM,LM,"↷","\\curvearrowright",!0),mM(yM,bM,LM,"↻","\\circlearrowright",!0),mM(yM,bM,LM,"↱","\\Rsh",!0),mM(yM,bM,LM,"⇊","\\downdownarrows",!0),mM(yM,bM,LM,"↾","\\upharpoonright",!0),mM(yM,bM,LM,"⇂","\\downharpoonright",!0),mM(yM,bM,LM,"⇝","\\rightsquigarrow",!0),mM(yM,bM,LM,"⇝","\\leadsto"),mM(yM,bM,LM,"⇛","\\Rrightarrow",!0),mM(yM,bM,LM,"↾","\\restriction"),mM(yM,xM,IM,"","`"),mM(yM,xM,IM,"$","\\$"),mM(vM,xM,IM,"$","\\$"),mM(vM,xM,IM,"$","\\textdollar"),mM(yM,xM,IM,"%","\\%"),mM(vM,xM,IM,"%","\\%"),mM(yM,xM,IM,"_","\\_"),mM(vM,xM,IM,"_","\\_"),mM(vM,xM,IM,"_","\\textunderscore"),mM(yM,xM,IM,"∠","\\angle",!0),mM(yM,xM,IM,"∞","\\infty",!0),mM(yM,xM,IM,"","\\prime"),mM(yM,xM,IM,"△","\\triangle"),mM(yM,xM,IM,"Γ","\\Gamma",!0),mM(yM,xM,IM,"Δ","\\Delta",!0),mM(yM,xM,IM,"Θ","\\Theta",!0),mM(yM,xM,IM,"Λ","\\Lambda",!0),mM(yM,xM,IM,"Ξ","\\Xi",!0),mM(yM,xM,IM,"Π","\\Pi",!0),mM(yM,xM,IM,"Σ","\\Sigma",!0),mM(yM,xM,IM,"Υ","\\Upsilon",!0),mM(yM,xM,IM,"Φ","\\Phi",!0),mM(yM,xM,IM,"Ψ","\\Psi",!0),mM(yM,xM,IM,"Ω","\\Omega",!0),mM(yM,xM,IM,"A","Α"),mM(yM,xM,IM,"B","Β"),mM(yM,xM,IM,"E","Ε"),mM(yM,xM,IM,"Z","Ζ"),mM(yM,xM,IM,"H","Η"),mM(yM,xM,IM,"I","Ι"),mM(yM,xM,IM,"K","Κ"),mM(yM,xM,IM,"M","Μ"),mM(yM,xM,IM,"N","Ν"),mM(yM,xM,IM,"O","Ο"),mM(yM,xM,IM,"P","Ρ"),mM(yM,xM,IM,"T","Τ"),mM(yM,xM,IM,"X","Χ"),mM(yM,xM,IM,"¬","\\neg",!0),mM(yM,xM,IM,"¬","\\lnot"),mM(yM,xM,IM,"","\\top"),mM(yM,xM,IM,"⊥","\\bot"),mM(yM,xM,IM,"∅","\\emptyset"),mM(yM,bM,IM,"∅","\\varnothing"),mM(yM,xM,EM,"α","\\alpha",!0),mM(yM,xM,EM,"β","\\beta",!0),mM(yM,xM,EM,"γ","\\gamma",!0),mM(yM,xM,EM,"δ","\\delta",!0),mM(yM,xM,EM,"ϵ","\\epsilon",!0),mM(yM,xM,EM,"ζ","\\zeta",!0),mM(yM,xM,EM,"η","\\eta",!0),mM(yM,xM,EM,"θ","\\theta",!0),mM(yM,xM,EM,"ι","\\iota",!0),mM(yM,xM,EM,"κ","\\kappa",!0),mM(yM,xM,EM,"λ","\\lambda",!0),mM(yM,xM,EM,"μ","\\mu",!0),mM(yM,xM,EM,"ν","\\nu",!0),mM(yM,xM,EM,"ξ","\\xi",!0),mM(yM,xM,EM,"ο","\\omicron",!0),mM(yM,xM,EM,"π","\\pi",!0),mM(yM,xM,EM,"ρ","\\rho",!0),mM(yM,xM,EM,"σ","\\sigma",!0),mM(yM,xM,EM,"τ","\\tau",!0),mM(yM,xM,EM,"υ","\\upsilon",!0),mM(yM,xM,EM,"ϕ","\\phi",!0),mM(yM,xM,EM,"χ","\\chi",!0),mM(yM,xM,EM,"ψ","\\psi",!0),mM(yM,xM,EM,"ω","\\omega",!0),mM(yM,xM,EM,"ε","\\varepsilon",!0),mM(yM,xM,EM,"ϑ","\\vartheta",!0),mM(yM,xM,EM,"ϖ","\\varpi",!0),mM(yM,xM,EM,"ϱ","\\varrho",!0),mM(yM,xM,EM,"ς","\\varsigma",!0),mM(yM,xM,EM,"φ","\\varphi",!0),mM(yM,xM,kM,"","*",!0),mM(yM,xM,kM,"+","+"),mM(yM,xM,kM,"","-",!0),mM(yM,xM,kM,"⋅","\\cdot",!0),mM(yM,xM,kM,"∘","\\circ",!0),mM(yM,xM,kM,"÷","\\div",!0),mM(yM,xM,kM,"±","\\pm",!0),mM(yM,xM,kM,"×","\\times",!0),mM(yM,xM,kM,"∩","\\cap",!0),mM(yM,xM,kM,"","\\cup",!0),mM(yM,xM,kM,"","\\setminus",!0),mM(yM,xM,kM,"∧","\\land"),mM(yM,xM,kM,"","\\lor"),mM(yM,xM,kM,"∧","\\wedge",!0),mM(yM,xM,kM,"","\\vee",!0),mM(yM,xM,IM,"√","\\surd"),mM(yM,xM,SM,"⟨","\\langle",!0),mM(yM,xM,SM,"","\\lvert"),mM(yM,xM,SM,"∥","\\lVert"),mM(yM,xM,TM,"?","?"),mM(yM,xM,TM,"!","!"),mM(yM,xM,TM,"⟩","\\rangle",!0),mM(yM,xM,TM,"","\\rvert"),mM(yM,xM,TM,"∥","\\rVert"),mM(yM,xM,LM,"=","="),mM(yM,xM,LM,":",":"),mM(yM,xM,LM,"≈","\\approx",!0),mM(yM,xM,LM,"≅","\\cong",!0),mM(yM,xM,LM,"≥","\\ge"),mM(yM,xM,LM,"≥","\\geq",!0),mM(yM,xM,LM,"←","\\gets"),mM(yM,xM,LM,">","\\gt",!0),mM(yM,xM,LM,"∈","\\in",!0),mM(yM,xM,LM,"","\\@not"),mM(yM,xM,LM,"⊂","\\subset",!0),mM(yM,xM,LM,"⊃","\\supset",!0),mM(yM,xM,LM,"⊆","\\subseteq",!0),mM(yM,xM,LM,"⊇","\\supseteq",!0),mM(yM,bM,LM,"⊈","\\nsubseteq",!0),mM(yM,bM,LM,"⊉","\\nsupseteq",!0),mM(yM,xM,LM,"⊨","\\models"),mM(yM,xM,LM,"←","\\leftarrow",!0),mM(yM,xM,LM,"≤","\\le"),mM(yM,xM,LM,"≤","\\leq",!0),mM(yM,xM,LM,"<","\\lt",!0),mM(yM,xM,LM,"→","\\rightarrow",!0),mM(yM,xM,LM,"→","\\to"),mM(yM,bM,LM,"≱","\\ngeq",!0),mM(yM,bM,LM,"≰","\\nleq",!0),mM(yM,xM,NM," ","\\ "),mM(yM,xM,NM," ","\\space"),mM(yM,xM,NM," ","\\nobreakspace"),mM(vM,xM,NM," ","\\ "),mM(vM,xM,NM," "," "),mM(vM,xM,NM," ","\\space"),mM(vM,xM,NM," ","\\nobreakspace"),mM(yM,xM,NM,null,"\\nobreak"),mM(yM,xM,NM,null,"\\allowbreak"),mM(yM,xM,AM,",",","),mM(yM,xM,AM,";",";"),mM(yM,bM,kM,"⊼","\\barwedge",!0),mM(yM,bM,kM,"⊻","\\veebar",!0),mM(yM,xM,kM,"⊙","\\odot",!0),mM(yM,xM,kM,"⊕","\\oplus",!0),mM(yM,xM,kM,"⊗","\\otimes",!0),mM(yM,xM,IM,"∂","\\partial",!0),mM(yM,xM,kM,"⊘","\\oslash",!0),mM(yM,bM,kM,"⊚","\\circledcirc",!0),mM(yM,bM,kM,"⊡","\\boxdot",!0),mM(yM,xM,kM,"△","\\bigtriangleup"),mM(yM,xM,kM,"▽","\\bigtriangledown"),mM(yM,xM,kM,"†","\\dagger"),mM(yM,xM,kM,"⋄","\\diamond"),mM(yM,xM,kM,"⋆","\\star"),mM(yM,xM,kM,"◃","\\triangleleft"),mM(yM,xM,kM,"▹","\\triangleright"),mM(yM,xM,SM,"{","\\{"),mM(vM,xM,IM,"{","\\{"),mM(vM,xM,IM,"{","\\textbraceleft"),mM(yM,xM,TM,"}","\\}"),mM(vM,xM,IM,"}","\\}"),mM(vM,xM,IM,"}","\\textbraceright"),mM(yM,xM,SM,"{","\\lbrace"),mM(yM,xM,TM,"}","\\rbrace"),mM(yM,xM,SM,"[","\\lbrack",!0),mM(vM,xM,IM,"[","\\lbrack",!0),mM(yM,xM,TM,"]","\\rbrack",!0),mM(vM,xM,IM,"]","\\rbrack",!0),mM(yM,xM,SM,"(","\\lparen",!0),mM(yM,xM,TM,")","\\rparen",!0),mM(vM,xM,IM,"<","\\textless",!0),mM(vM,xM,IM,">","\\textgreater",!0),mM(yM,xM,SM,"⌊","\\lfloor",!0),mM(yM,xM,TM,"⌋","\\rfloor",!0),mM(yM,xM,SM,"⌈","\\lceil",!0),mM(yM,xM,TM,"⌉","\\rceil",!0),mM(yM,xM,IM,"\\","\\backslash"),mM(yM,xM,IM,"","|"),mM(yM,xM,IM,"","\\vert"),mM(vM,xM,IM,"|","\\textbar",!0),mM(yM,xM,IM,"∥","\\|"),mM(yM,xM,IM,"∥","\\Vert"),mM(vM,xM,IM,"∥","\\textbardbl"),mM(vM,xM,IM,"~","\\textasciitilde"),mM(vM,xM,IM,"\\","\\textbackslash"),mM(vM,xM,IM,"^","\\textasciicircum"),mM(yM,xM,LM,"↑","\\uparrow",!0),mM(yM,xM,LM,"⇑","\\Uparrow",!0),mM(yM,xM,LM,"↓","\\downarrow",!0),mM(yM,xM,LM,"⇓","\\Downarrow",!0),mM(yM,xM,LM,"↕","\\updownarrow",!0),mM(yM,xM,LM,"⇕","\\Updownarrow",!0),mM(yM,xM,CM,"∐","\\coprod"),mM(yM,xM,CM,"","\\bigvee"),mM(yM,xM,CM,"⋀","\\bigwedge"),mM(yM,xM,CM,"⨄","\\biguplus"),mM(yM,xM,CM,"⋂","\\bigcap"),mM(yM,xM,CM,"","\\bigcup"),mM(yM,xM,CM,"∫","\\int"),mM(yM,xM,CM,"∫","\\intop"),mM(yM,xM,CM,"∬","\\iint"),mM(yM,xM,CM,"∭","\\iiint"),mM(yM,xM,CM,"∏","\\prod"),mM(yM,xM,CM,"∑","\\sum"),mM(yM,xM,CM,"⨂","\\bigotimes"),mM(yM,xM,CM,"⨁","\\bigoplus"),mM(yM,xM,CM,"⨀","\\bigodot"),mM(yM,xM,CM,"∮","\\oint"),mM(yM,xM,CM,"∯","\\oiint"),mM(yM,xM,CM,"∰","\\oiiint"),mM(yM,xM,CM,"⨆","\\bigsqcup"),mM(yM,xM,CM,"∫","\\smallint"),mM(vM,xM,_M,"…","\\textellipsis"),mM(yM,xM,_M,"…","\\mathellipsis"),mM(vM,xM,_M,"…","\\ldots",!0),mM(yM,xM,_M,"…","\\ldots",!0),mM(yM,xM,_M,"⋯","\\@cdots",!0),mM(yM,xM,_M,"⋱","\\ddots",!0),mM(yM,xM,IM,"⋮","\\varvdots"),mM(yM,xM,wM,"ˊ","\\acute"),mM(yM,xM,wM,"ˋ","\\grave"),mM(yM,xM,wM,"¨","\\ddot"),mM(yM,xM,wM,"~","\\tilde"),mM(yM,xM,wM,"ˉ","\\bar"),mM(yM,xM,wM,"˘","\\breve"),mM(yM,xM,wM,"ˇ","\\check"),mM(yM,xM,wM,"^","\\hat"),mM(yM,xM,wM,"⃗","\\vec"),mM(yM,xM,wM,"˙","\\dot"),mM(yM,xM,wM,"˚","\\mathring"),mM(yM,xM,EM,"","\\@imath"),mM(yM,xM,EM,"","\\@jmath"),mM(yM,xM,IM,"ı","ı"),mM(yM,xM,IM,"ȷ","ȷ"),mM(vM,xM,IM,"ı","\\i",!0),mM(vM,xM,IM,"ȷ","\\j",!0),mM(vM,xM,IM,"ß","\\ss",!0),mM(vM,xM,IM,"æ","\\ae",!0),mM(vM,xM,IM,"œ","\\oe",!0),mM(vM,xM,IM,"ø","\\o",!0),mM(vM,xM,IM,"Æ","\\AE",!0),mM(vM,xM,IM,"Œ","\\OE",!0),mM(vM,xM,IM,"Ø","\\O",!0),mM(vM,xM,wM,"ˊ","\\'"),mM(vM,xM,wM,"ˋ","\\`"),mM(vM,xM,wM,"ˆ","\\^"),mM(vM,xM,wM,"˜","\\~"),mM(vM,xM,wM,"ˉ","\\="),mM(vM,xM,wM,"˘","\\u"),mM(vM,xM,wM,"˙","\\."),mM(vM,xM,wM,"¸","\\c"),mM(vM,xM,wM,"˚","\\r"),mM(vM,xM,wM,"ˇ","\\v"),mM(vM,xM,wM,"¨",'\\"'),mM(vM,xM,wM,"˝","\\H"),mM(vM,xM,wM,"◯","\\textcircled");var RM={"--":!0,"---":!0,"``":!0,"''":!0};mM(vM,xM,IM,"","--",!0),mM(vM,xM,IM,"","\\textendash"),mM(vM,xM,IM,"—","---",!0),mM(vM,xM,IM,"—","\\textemdash"),mM(vM,xM,IM,"","`",!0),mM(vM,xM,IM,"","\\textquoteleft"),mM(vM,xM,IM,"","'",!0),mM(vM,xM,IM,"","\\textquoteright"),mM(vM,xM,IM,"“","``",!0),mM(vM,xM,IM,"“","\\textquotedblleft"),mM(vM,xM,IM,"”","''",!0),mM(vM,xM,IM,"”","\\textquotedblright"),mM(yM,xM,IM,"°","\\degree",!0),mM(vM,xM,IM,"°","\\degree"),mM(vM,xM,IM,"°","\\textdegree",!0),mM(yM,xM,IM,"£","\\pounds"),mM(yM,xM,IM,"£","\\mathsterling",!0),mM(vM,xM,IM,"£","\\pounds"),mM(vM,xM,IM,"£","\\textsterling",!0),mM(yM,bM,IM,"✠","\\maltese"),mM(vM,bM,IM,"✠","\\maltese");var MM,DM,OM='0123456789/@."';for(DM=0;DM<OM.length;DM++)mM(yM,xM,IM,MM=OM.charAt(DM),MM);var PM,BM,$M='0123456789!@*()-=+";:?/.,';for(BM=0;BM<$M.length;BM++)mM(vM,xM,IM,PM=$M.charAt(BM),PM);var FM,zM,UM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(zM=0;zM<UM.length;zM++)mM(yM,xM,EM,FM=UM.charAt(zM),FM),mM(vM,xM,IM,FM,FM);mM(yM,bM,IM,"C",""),mM(vM,bM,IM,"C",""),mM(yM,bM,IM,"H",""),mM(vM,bM,IM,"H",""),mM(yM,bM,IM,"N",""),mM(vM,bM,IM,"N",""),mM(yM,bM,IM,"P",""),mM(vM,bM,IM,"P",""),mM(yM,bM,IM,"Q",""),mM(vM,bM,IM,"Q",""),mM(yM,bM,IM,"R",""),mM(vM,bM,IM,"R",""),mM(yM,bM,IM,"Z",""),mM(vM,bM,IM,"Z",""),mM(yM,xM,EM,"h",""),mM(vM,xM,EM,"h","");var GM,qM,jM,WM,YM="";for(qM=0;qM<UM.length;qM++)mM(yM,xM,EM,GM=UM.charAt(qM),YM=String.fromCharCode(55349,56320+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56372+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56424+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56580+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56684+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56736+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56788+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56840+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56944+qM)),mM(vM,xM,IM,GM,YM),qM<26&&(mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56632+qM)),mM(vM,xM,IM,GM,YM),mM(yM,xM,EM,GM,YM=String.fromCharCode(55349,56476+qM)),mM(vM,xM,IM,GM,YM));for(mM(yM,xM,EM,"k",YM=String.fromCharCode(55349,56668)),mM(vM,xM,IM,"k",YM),WM=0;WM<10;WM++)mM(yM,xM,EM,jM=WM.toString(),YM=String.fromCharCode(55349,57294+WM)),mM(vM,xM,IM,jM,YM),mM(yM,xM,EM,jM,YM=String.fromCharCode(55349,57314+WM)),mM(vM,xM,IM,jM,YM),mM(yM,xM,EM,jM,YM=String.fromCharCode(55349,57324+WM)),mM(vM,xM,IM,jM,YM),mM(yM,xM,EM,jM,YM=String.fromCharCode(55349,57334+WM)),mM(vM,xM,IM,jM,YM);var HM,VM,XM="ÐÞþ";for(VM=0;VM<XM.length;VM++)mM(yM,xM,EM,HM=XM.charAt(VM),HM),mM(vM,xM,IM,HM,HM);var KM=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],ZM=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],QM=o((function(t,e){var r=1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536,n="math"===e?0:1;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return[KM[i][2],KM[i][n]]}if(120782<=r&&r<=120831){var a=Math.floor((r-120782)/10);return[ZM[a][2],ZM[a][n]]}if(120485===r||120486===r)return[KM[0][2],KM[0][n]];if(120486<r&&r<120782)return["",""];throw new KI("Unsupported character: "+t)}),"wideCharacterFont"),JM=o((function(t,e,r){return fM[r][t]&&fM[r][t].replace&&(t=fM[r][t].replace),{value:t,metrics:UR(t,e,r)}}),"lookupSymbol"),tD=o((function(t,e,r,n,i){var a,s=JM(t,e,r),o=s.metrics;if(t=s.value,o){var l=o.italic;("text"===r||n&&"mathit"===n.font)&&(l=0),a=new oM(t,o.height,o.depth,l,o.skew,o.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+t+"' in style '"+e+"' and mode '"+r+"'"),a=new oM(t,0,0,0,0,0,i);if(n){a.maxFontSize=n.sizeMultiplier,n.style.isTight()&&a.classes.push("mtight");var c=n.getColor();c&&(a.style.color=c)}return a}),"makeSymbol"),eD=o((function(t,e,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&JM(t,"Main-Bold",e).metrics?tD(t,"Main-Bold",e,r,n.concat(["mathbf"])):"\\"===t||"main"===fM[e][t].font?tD(t,"Main-Regular",e,r,n):tD(t,"AMS-Regular",e,r,n.concat(["amsrm"]))}),"mathsym"),rD=o((function(t,e,r,n,i){return"textord"!==i&&JM(t,"Math-BoldItalic",e).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}),"boldsymbol"),nD=o((function(t,e,r){var n=t.mode,i=t.text,a=["mord"],s="math"===n||"text"===n&&e.font,o=s?e.font:e.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=QM(i,n)),l.length>0)return tD(i,l,n,e,a.concat(c));if(o){var h,u;if("boldsymbol"===o){var d=rD(i,n,e,a,r);h=d.fontName,u=[d.fontClass]}else s?(h=yD[o].fontName,u=[o]):(h=mD(o,e.fontWeight,e.fontShape),u=[o,e.fontWeight,e.fontShape]);if(JM(i,h,n).metrics)return tD(i,h,n,e,a.concat(u));if(RM.hasOwnProperty(i)&&"Typewriter"===h.slice(0,10)){for(var p=[],g=0;g<i.length;g++)p.push(tD(i[g],h,n,e,a.concat(u)));return uD(p)}}if("mathord"===r)return tD(i,"Math-Italic",n,e,a.concat(["mathnormal"]));if("textord"===r){var f=fM[n][i]&&fM[n][i].font;if("ams"===f){var m=mD("amsrm",e.fontWeight,e.fontShape);return tD(i,m,n,e,a.concat("amsrm",e.fontWeight,e.fontShape))}if("main"!==f&&f){var y=mD(f,e.fontWeight,e.fontShape);return tD(i,y,n,e,a.concat(y,e.fontWeight,e.fontShape))}var v=mD("textrm",e.fontWeight,e.fontShape);return tD(i,v,n,e,a.concat(e.fontWeight,e.fontShape))}throw new Error("unexpected type: "+r+" in makeOrd")}),"makeOrd"),iD=o(((t,e)=>{if(JR(t.classes)!==JR(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(1===t.classes.length){var r=t.classes[0];if("mbin"===r||"mord"===r)return!1}for(var n in t.style)if(t.style.hasOwnProperty(n)&&t.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0}),"canCombine"),aD=o((t=>{for(var e=0;e<t.length-1;e++){var r=t[e],n=t[e+1];r instanceof oM&&n instanceof oM&&iD(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,t.splice(e+1,1),e--)}return t}),"tryCombineChars"),sD=o((function(t){for(var e=0,r=0,n=0,i=0;i<t.children.length;i++){var a=t.children[i];a.height>e&&(e=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>n&&(n=a.maxFontSize)}t.height=e,t.depth=r,t.maxFontSize=n}),"sizeElementFromChildren"),oD=o((function(t,e,r,n){var i=new nM(t,e,r,n);return sD(i),i}),"makeSpan"),lD=o(((t,e,r,n)=>new nM(t,e,r,n)),"makeSvgSpan"),cD=o((function(t,e,r){var n=oD([t],[],e);return n.height=Math.max(r||e.fontMetrics().defaultRuleThickness,e.minRuleThickness),n.style.borderBottomWidth=QR(n.height),n.maxFontSize=1,n}),"makeLineSpan"),hD=o((function(t,e,r,n){var i=new iM(t,e,r,n);return sD(i),i}),"makeAnchor"),uD=o((function(t){var e=new PR(t);return sD(e),e}),"makeFragment"),dD=o((function(t,e){return t instanceof PR?oD([],[t],e):t}),"wrapFragment"),pD=o((function(t){if("individualShift"===t.positionType){for(var e=t.children,r=[e[0]],n=-e[0].shift-e[0].elem.depth,i=n,a=1;a<e.length;a++){var s=-e[a].shift-i-e[a].elem.depth,o=s-(e[a-1].elem.height+e[a-1].elem.depth);i+=s,r.push({type:"kern",size:o}),r.push(e[a])}return{children:r,depth:n}}var l;if("top"===t.positionType){for(var c=t.positionData,h=0;h<t.children.length;h++){var u=t.children[h];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===t.positionType)l=-t.positionData;else{var d=t.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===t.positionType)l=-d.elem.depth-t.positionData;else{if("firstBaseline"!==t.positionType)throw new Error("Invalid positionType "+t.positionType+".");l=-d.elem.depth}}return{children:t.children,depth:l}}),"getVListChildrenAndDepth"),gD=o((function(t,e){for(var{children:r,depth:n}=pD(t),i=0,a=0;a<r.length;a++){var s=r[a];if("elem"===s.type){var o=s.elem;i=Math.max(i,o.maxFontSize,o.height)}}i+=2;var l=oD(["pstrut"],[]);l.style.height=QR(i);for(var c=[],h=n,u=n,d=n,p=0;p<r.length;p++){var g=r[p];if("kern"===g.type)d+=g.size;else{var f=g.elem,m=g.wrapperClasses||[],y=g.wrapperStyle||{},v=oD(m,[l,f],void 0,y);v.style.top=QR(-i-d-f.depth),g.marginLeft&&(v.style.marginLeft=g.marginLeft),g.marginRight&&(v.style.marginRight=g.marginRight),c.push(v),d+=f.height+f.depth}h=Math.min(h,d),u=Math.max(u,d)}var x,b=oD(["vlist"],c);if(b.style.height=QR(u),h<0){var w=oD([],[]),k=oD(["vlist"],[w]);k.style.height=QR(-h);var T=oD(["vlist-s"],[new oM("")]);x=[oD(["vlist-r"],[b,T]),oD(["vlist-r"],[k])]}else x=[oD(["vlist-r"],[b])];var _=oD(["vlist-t"],x);return 2===x.length&&_.classes.push("vlist-t2"),_.height=u,_.depth=-h,_}),"makeVList"),fD=o(((t,e)=>{var r=oD(["mspace"],[],e),n=ZR(t,e);return r.style.marginRight=QR(n),r}),"makeGlue"),mD=o((function(t,e,r){var n="";switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return n+"-"+("textbf"===e&&"textit"===r?"BoldItalic":"textbf"===e?"Bold":"textit"===e?"Italic":"Regular")}),"retrieveTextFontName"),yD={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"}},vD={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},xD=o((function(t,e){var[r,n,i]=vD[t],a=new cM(r),s=new lM([a],{width:QR(n),height:QR(i),style:"width:"+QR(n),viewBox:"0 0 "+1e3*n+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),o=lD(["overlay"],[s],e);return o.height=i,o.style.height=QR(i),o.style.width=QR(n),o}),"staticSvg"),bD={fontMap:yD,makeSymbol:tD,mathsym:eD,makeSpan:oD,makeSvgSpan:lD,makeLineSpan:cD,makeAnchor:hD,makeFragment:uD,wrapFragment:dD,makeVList:gD,makeOrd:nD,makeGlue:fD,staticSvg:xD,svgData:vD,tryCombineChars:aD},wD={number:3,unit:"mu"},kD={number:4,unit:"mu"},TD={number:5,unit:"mu"},_D={mord:{mop:wD,mbin:kD,mrel:TD,minner:wD},mop:{mord:wD,mop:wD,mrel:TD,minner:wD},mbin:{mord:kD,mop:kD,mopen:kD,minner:kD},mrel:{mord:TD,mop:TD,mopen:TD,minner:TD},mopen:{},mclose:{mop:wD,mbin:kD,mrel:TD,minner:wD},mpunct:{mord:wD,mop:wD,mrel:TD,mopen:wD,mclose:wD,mpunct:wD,minner:wD},minner:{mord:wD,mop:wD,mbin:kD,mrel:TD,mopen:wD,mpunct:wD,minner:wD}},ED={mord:{mop:wD},mop:{mord:wD,mop:wD},mbin:{},mrel:{},mopen:{},mclose:{mop:wD},mpunct:{},minner:{mop:wD}},CD={},SD={},AD={};function LD(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<r.length;++l)CD[r[l]]=o;e&&(a&&(SD[e]=a),s&&(AD[e]=s))}function ND(t){var{type:e,htmlBuilder:r,mathmlBuilder:n}=t;LD({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}o(LD,"defineFunction"),o(ND,"defineFunctionBuilders");var ID=o((function(t){return"ordgroup"===t.type&&1===t.body.length?t.body[0]:t}),"normalizeArgument"),RD=o((function(t){return"ordgroup"===t.type?t.body:[t]}),"ordargument"),MD=bD.makeSpan,DD=["leftmost","mbin","mopen","mrel","mop","mpunct"],OD=["rightmost","mrel","mclose","mpunct"],PD={display:xR.DISPLAY,text:xR.TEXT,script:xR.SCRIPT,scriptscript:xR.SCRIPTSCRIPT},BD={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},$D=o((function(t,e,r,n){void 0===n&&(n=[null,null]);for(var i=[],a=0;a<t.length;a++){var s=jD(t[a],e);if(s instanceof PR){var o=s.children;i.push(...o)}else i.push(s)}if(bD.tryCombineChars(i),!r)return i;var l=e;if(1===t.length){var c=t[0];"sizing"===c.type?l=e.havingSize(c.size):"styling"===c.type&&(l=e.havingStyle(PD[c.style]))}var h=MD([n[0]||"leftmost"],[],e),u=MD([n[1]||"rightmost"],[],e),d="root"===r;return FD(i,((t,e)=>{var r=e.classes[0],n=t.classes[0];"mbin"===r&&oR.contains(OD,n)?e.classes[0]="mord":"mbin"===n&&oR.contains(DD,r)&&(t.classes[0]="mord")}),{node:h},u,d),FD(i,((t,e)=>{var r=GD(e),n=GD(t),i=r&&n?t.hasClass("mtight")?ED[r][n]:_D[r][n]:null;if(i)return bD.makeGlue(i,l)}),{node:h},u,d),i}),"buildExpression"),FD=o((function t(e,r,n,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=zD(o);if(l)t(l.children,r,n,null,a);else{var c=!o.hasClass("mspace");if(c){var h=r(o,n.node);h&&(n.insertAfter?n.insertAfter(h):(e.unshift(h),s++))}c?n.node=o:a&&o.hasClass("newline")&&(n.node=MD(["leftmost"])),n.insertAfter=(t=>r=>{e.splice(t+1,0,r),s++})(s)}}i&&e.pop()}),"traverseNonSpaceNodes"),zD=o((function(t){return t instanceof PR||t instanceof iM||t instanceof nM&&t.hasClass("enclosing")?t:null}),"checkPartialGroup"),UD=o((function t(e,r){var n=zD(e);if(n){var i=n.children;if(i.length){if("right"===r)return t(i[i.length-1],"right");if("left"===r)return t(i[0],"left")}}return e}),"getOutermostNode"),GD=o((function(t,e){return t?(e&&(t=UD(t,e)),BD[t.classes[0]]||null):null}),"getTypeOfDomTree"),qD=o((function(t,e){var r=["nulldelimiter"].concat(t.baseSizingClasses());return MD(e.concat(r))}),"makeNullDelimiter"),jD=o((function(t,e,r){if(!t)return MD();if(SD[t.type]){var n=SD[t.type](t,e);if(r&&e.size!==r.size){n=MD(e.sizingClasses(r),[n],e);var i=e.sizeMultiplier/r.sizeMultiplier;n.height*=i,n.depth*=i}return n}throw new KI("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function WD(t,e){var r=MD(["base"],t,e),n=MD(["strut"]);return n.style.height=QR(r.height+r.depth),r.depth&&(n.style.verticalAlign=QR(-r.depth)),r.children.unshift(n),r}function YD(t,e){var r=null;1===t.length&&"tag"===t[0].type&&(r=t[0].tag,t=t[0].body);var n,i=$D(t,e,"root");2===i.length&&i[1].hasClass("tag")&&(n=i.pop());for(var a,s=[],o=[],l=0;l<i.length;l++)if(o.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,o.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(s.push(WD(o,e)),o=[])}else i[l].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(WD(o,e)),o=[]),s.push(i[l]));o.length>0&&s.push(WD(o,e)),r?((a=WD($D(r,e,!0))).classes=["tag"],s.push(a)):n&&s.push(n);var h=MD(["katex-html"],s);if(h.setAttribute("aria-hidden","true"),a){var u=a.children[0];u.style.height=QR(h.height+h.depth),h.depth&&(u.style.verticalAlign=QR(-h.depth))}return h}function HD(t){return new PR(t)}o(WD,"buildHTMLUnbreakable"),o(YD,"buildHTML"),o(HD,"newDocumentFragment");var VD=class{static{o(this,"MathNode")}constructor(t,e,r){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=r||[]}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=JR(this.classes));for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="',t+=oR.escape(this.attributes[e]),t+='"');this.classes.length>0&&(t+=' class ="'+oR.escape(JR(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">"}toText(){return this.children.map((t=>t.toText())).join("")}},XD=class{static{o(this,"TextNode")}constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return oR.escape(this.toText())}toText(){return this.text}},KD=class{static{o(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",QR(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+QR(this.width)+'"/>'}toText(){return this.character?this.character:" "}},ZD={MathNode:VD,TextNode:XD,SpaceNode:KD,newDocumentFragment:HD},QD=o((function(t,e,r){return!fM[e][t]||!fM[e][t].replace||55349===t.charCodeAt(0)||RM.hasOwnProperty(t)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(t=fM[e][t].replace),new ZD.TextNode(t)}),"makeText"),JD=o((function(t){return 1===t.length?t[0]:new ZD.MathNode("mrow",t)}),"makeRow"),tO=o((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 r=e.font;if(!r||"mathnormal"===r)return null;var n=t.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===t.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var i=t.text;return oR.contains(["\\imath","\\jmath"],i)?null:(fM[n][i]&&fM[n][i].replace&&(i=fM[n][i].replace),UR(i,bD.fontMap[r].fontName,n)?bD.fontMap[r].variant:null)}),"getVariant"),eO=o((function(t,e,r){if(1===t.length){var n=nO(t[0],e);return r&&n instanceof VD&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var i,a=[],s=0;s<t.length;s++){var o=nO(t[s],e);if(o instanceof VD&&i instanceof VD){if("mtext"===o.type&&"mtext"===i.type&&o.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...o.children);continue}if("mn"===o.type&&"mn"===i.type){i.children.push(...o.children);continue}if("mi"===o.type&&1===o.children.length&&"mn"===i.type){var l=o.children[0];if(l instanceof XD&&"."===l.text){i.children.push(...o.children);continue}}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof XD&&"̸"===c.text&&("mo"===o.type||"mi"===o.type||"mn"===o.type)){var h=o.children[0];h instanceof XD&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),a.pop())}}}a.push(o),i=o}return a}),"buildExpression"),rO=o((function(t,e,r){return JD(eO(t,e,r))}),"buildExpressionRow"),nO=o((function(t,e){if(!t)return new ZD.MathNode("mrow");if(AD[t.type])return AD[t.type](t,e);throw new KI("Got group of unknown type: '"+t.type+"'")}),"buildGroup");function iO(t,e,r,n,i){var a,s=eO(t,r);a=1===s.length&&s[0]instanceof VD&&oR.contains(["mrow","mtable"],s[0].type)?s[0]:new ZD.MathNode("mrow",s);var o=new ZD.MathNode("annotation",[new ZD.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var l=new ZD.MathNode("semantics",[a,o]),c=new ZD.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");var h=i?"katex":"katex-mathml";return bD.makeSpan([h],[c])}o(iO,"buildMathML");var aO=o((function(t){return new HR({style:t.displayMode?xR.DISPLAY:xR.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})}),"optionsFromSettings"),sO=o((function(t,e){if(e.displayMode){var r=["katex-display"];e.leqno&&r.push("leqno"),e.fleqn&&r.push("fleqn"),t=bD.makeSpan(r,[t])}return t}),"displayWrap"),oO=o((function(t,e,r){var n,i=aO(r);if("mathml"===r.output)return iO(t,e,i,r.displayMode,!0);if("html"===r.output){var a=YD(t,i);n=bD.makeSpan(["katex"],[a])}else{var s=iO(t,e,i,r.displayMode,!1),o=YD(t,i);n=bD.makeSpan(["katex"],[s,o])}return sO(n,r)}),"buildTree"),lO=o((function(t,e,r){var n=YD(t,aO(r)),i=bD.makeSpan(["katex"],[n]);return sO(i,r)}),"buildHTMLTree"),cO={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":"="},hO=o((function(t){var e=new ZD.MathNode("mo",[new ZD.TextNode(cO[t.replace(/^\\/,"")])]);return e.setAttribute("stretchy","true"),e}),"mathMLnode"),uO={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]},dO=o((function(t){return"ordgroup"===t.type?t.body.length:1}),"groupLength"),pO=o((function(t,e){function r(){var r=4e5,n=t.label.slice(1);if(oR.contains(["widehat","widecheck","widetilde","utilde"],n)){var i,a,s,o=dO(t.base);if(o>5)"widehat"===n||"widecheck"===n?(i=420,r=2364,s=.42,a=n+"4"):(i=312,r=2340,s=.34,a="tilde4");else{var l=[1,1,2,2,3,3][o];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],a=n+l):(r=[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 cM(a),h=new lM([c],{width:"100%",height:QR(s),viewBox:"0 0 "+r+" "+i,preserveAspectRatio:"none"});return{span:bD.makeSvgSpan([],[h],e),minWidth:0,height:s}}var u,d,p=[],g=uO[n],[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;b<x;b++){var w=new cM(f[b]),k=new lM([w],{width:"400em",height:QR(v),viewBox:"0 0 "+r+" "+y,preserveAspectRatio:d[b]+" slice"}),T=bD.makeSvgSpan([u[b]],[k],e);if(1===x)return{span:T,minWidth:m,height:v};T.style.height=QR(v),p.push(T)}return{span:bD.makeSpan(["stretchy"],p,e),minWidth:m,height:v}}o(r,"buildSvgSpan_");var{span:n,minWidth:i,height:a}=r();return n.height=a,n.style.height=QR(a),i>0&&(n.style.minWidth=QR(i)),n}),"svgSpan"),gO=o((function(t,e,r,n,i){var a,s=t.height+t.depth+r+n;if(/fbox|color|angl/.test(e)){if(a=bD.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 hM({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&l.push(new hM({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new lM(l,{width:"100%",height:QR(s)});a=bD.makeSvgSpan([],[c],i)}return a.height=s,a.style.height=QR(s),a}),"encloseSpan"),fO={encloseSpan:gO,mathMLnode:hO,svgSpan:pO};function mO(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 yO(t){var e=vO(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 vO(t){return t&&("atom"===t.type||gM.hasOwnProperty(t.type))?t:null}o(mO,"assertNodeType"),o(yO,"assertSymbolNodeType"),o(vO,"checkSymbolNodeType");var xO=o(((t,e)=>{var r,n,i;t&&"supsub"===t.type?(r=(n=mO(t.base,"accent")).base,t.base=r,i=dM(jD(t,e)),t.base=n):r=(n=mO(t,"accent")).base;var a=jD(r,e.havingCrampedStyle()),s=0;if(n.isShifty&&oR.isCharacterBox(r)){var o=oR.getBaseElem(r);s=uM(jD(o,e.havingCrampedStyle())).skew}var l,c="\\c"===n.label,h=c?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight);if(n.isStretchy)l=fO.svgSpan(n,e),l=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+QR(2*s)+")",marginLeft:QR(2*s)}:void 0}]},e);else{var u,d;"\\vec"===n.label?(u=bD.staticSvg("vec",e),d=bD.svgData.vec[1]):((u=uM(u=bD.makeOrd({mode:n.mode,text:n.label},e,"textord"))).italic=0,d=u.width,c&&(h+=u.depth)),l=bD.makeSpan(["accent-body"],[u]);var p="\\textcircled"===n.label;p&&(l.classes.push("accent-full"),h=a.height);var g=s;p||(g-=d/2),l.style.left=QR(g),"\\textcircled"===n.label&&(l.style.top=".2em"),l=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-h},{type:"elem",elem:l}]},e)}var f=bD.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"),bO=o(((t,e)=>{var r=t.isStretchy?fO.mathMLnode(t.label):new ZD.MathNode("mo",[QD(t.label,t.mode)]),n=new ZD.MathNode("mover",[nO(t.base,e),r]);return n.setAttribute("accent","true"),n}),"mathmlBuilder$9"),wO=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((t=>"\\"+t)).join("|"));LD({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:o(((t,e)=>{var r=ID(e[0]),n=!wO.test(t.funcName),i=!n||"\\widehat"===t.funcName||"\\widetilde"===t.funcName||"\\widecheck"===t.funcName;return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}}),"handler"),htmlBuilder:xO,mathmlBuilder:bO}),LD({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:o(((t,e)=>{var r=e[0],n=t.parser.mode;return"math"===n&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}}),"handler"),htmlBuilder:xO,mathmlBuilder:bO}),LD({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}}),"handler"),htmlBuilder:o(((t,e)=>{var r=jD(t.base,e),n=fO.svgSpan(t,e),i="\\utilde"===t.label?.12:0,a=bD.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]},e);return bD.makeSpan(["mord","accentunder"],[a],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=fO.mathMLnode(t.label),n=new ZD.MathNode("munder",[nO(t.base,e),r]);return n.setAttribute("accentunder","true"),n}),"mathmlBuilder")});var kO=o((t=>{var e=new ZD.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e}),"paddedNode");LD({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,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r,n=e.style,i=e.havingStyle(n.sup()),a=bD.wrapFragment(jD(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(n.sub()),(r=bD.wrapFragment(jD(t.below,i,e),e)).classes.push(s+"-arrow-pad"));var o,l=fO.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),r){var u=-e.fontMetrics().axisHeight+r.height+.5*l.height+.111;o=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:h},{type:"elem",elem:l,shift:c},{type:"elem",elem:r,shift:u}]},e)}else o=bD.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"),bD.makeSpan(["mrel","x-arrow"],[o],e)},mathmlBuilder(t,e){var r,n=fO.mathMLnode(t.label);if(n.setAttribute("minsize","x"===t.label.charAt(0)?"1.75em":"3.0em"),t.body){var i=kO(nO(t.body,e));if(t.below){var a=kO(nO(t.below,e));r=new ZD.MathNode("munderover",[n,a,i])}else r=new ZD.MathNode("mover",[n,i])}else if(t.below){var s=kO(nO(t.below,e));r=new ZD.MathNode("munder",[n,s])}else r=kO(),r=new ZD.MathNode("mover",[n,r]);return r}});var TO=bD.makeSpan;function _O(t,e){var r=$D(t.body,e,!0);return TO([t.mclass],r,e)}function EO(t,e){var r,n=eO(t.body,e);return"minner"===t.mclass?r=new ZD.MathNode("mpadded",n):"mord"===t.mclass?t.isCharacterBox?(r=n[0]).type="mi":r=new ZD.MathNode("mi",n):(t.isCharacterBox?(r=n[0]).type="mo":r=new ZD.MathNode("mo",n),"mbin"===t.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===t.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===t.mclass||"mclose"===t.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===t.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}o(_O,"htmlBuilder$9"),o(EO,"mathmlBuilder$8"),LD({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:RD(i),isCharacterBox:oR.isCharacterBox(i)}},htmlBuilder:_O,mathmlBuilder:EO});var CO=o((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");LD({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:CO(e[0]),body:RD(e[1]),isCharacterBox:oR.isCharacterBox(e[1])}}}),LD({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var r,{parser:n,funcName:i}=t,a=e[1],s=e[0];r="\\stackrel"!==i?CO(a):"mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:RD(a)},l={type:"supsub",mode:s.mode,base:o,sup:"\\underset"===i?null:s,sub:"\\underset"===i?s:null};return{type:"mclass",mode:n.mode,mclass:r,body:[l],isCharacterBox:oR.isCharacterBox(l)}},htmlBuilder:_O,mathmlBuilder:EO}),LD({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:CO(e[0]),body:RD(e[0])}},htmlBuilder(t,e){var r=$D(t.body,e,!0),n=bD.makeSpan([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=eO(t.body,e),n=new ZD.MathNode("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var SO={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},AO=o((()=>({type:"styling",body:[],mode:"math",style:"display"})),"newCell"),LO=o((t=>"textord"===t.type&&"@"===t.text),"isStartOfArrow"),NO=o(((t,e)=>("mathord"===t.type||"atom"===t.type)&&t.text===e),"isLabelEnd");function IO(t,e,r){var n=SO[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:n,mode:"math",family:"rel"},a={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[e[0]],[]),r.callFunction("\\Big",[i],[]),r.callFunction("\\\\cdright",[e[1]],[])]};return r.callFunction("\\\\cdparent",[a],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}function RO(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 r=t.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===e[e.length-1].length&&e.pop();break}throw new KI("Expected \\\\ or \\cr or \\end",t.nextToken)}t.consume()}for(var n=[],i=[n],a=0;a<e.length;a++){for(var s=e[a],o=AO(),l=0;l<s.length;l++)if(LO(s[l])){n.push(o);var c=yO(s[l+=1]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new KI('Expected one of "<>AV=|." after @',s[l]);for(var u=0;u<2;u++){for(var d=!0,p=l+1;p<s.length;p++){if(NO(s[p],c)){d=!1,l=p;break}if(LO(s[p]))throw new KI("Missing a "+c+" character to complete a CD arrow.",s[p]);h[u].body.push(s[p])}if(d)throw new KI("Missing a "+c+" character to complete a CD arrow.",s[l])}}var g={type:"styling",body:[IO(c,h,t)],mode:"math",style:"display"};n.push(g),o=AO()}else o.body.push(s[l]);a%2==0?n.push(o):n.shift(),n=[],i.push(n)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}o(IO,"cdArrow"),o(RO,"parseCD"),LD({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=bD.wrapFragment(jD(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=QR(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new ZD.MathNode("mrow",[nO(t.label,e)]);return(r=new ZD.MathNode("mpadded",[r])).setAttribute("width","0"),"left"===t.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),(r=new ZD.MathNode("mstyle",[r])).setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),LD({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=bD.wrapFragment(jD(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:(t,e)=>new ZD.MathNode("mrow",[nO(t.fragment,e)])}),LD({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=mO(e[0],"ordgroup").body,i="",a=0;a<n.length;a++){i+=mO(n[a],"textord").text}var s,o=parseInt(i);if(isNaN(o))throw new KI("\\@char has non-numeric argument "+i);if(o<0||o>=1114111)throw new KI("\\@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:r.mode,text:s}}});var MO=o(((t,e)=>{var r=$D(t.body,e.withColor(t.color),!1);return bD.makeFragment(r)}),"htmlBuilder$8"),DO=o(((t,e)=>{var r=eO(t.body,e.withColor(t.color)),n=new ZD.MathNode("mstyle",r);return n.setAttribute("mathcolor",t.color),n}),"mathmlBuilder$7");LD({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=mO(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:RD(i)}},htmlBuilder:MO,mathmlBuilder:DO}),LD({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=mO(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:MO,mathmlBuilder:DO}),LD({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i="["===n.gullet.future().text?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&mO(i,"size").value}},htmlBuilder(t,e){var r=bD.makeSpan(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=QR(ZR(t.size,e)))),r},mathmlBuilder(t,e){var r=new ZD.MathNode("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",QR(ZR(t.size,e)))),r}});var OO={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},PO=o((t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new KI("Expected a control sequence",t);return e}),"checkControlSequence"),BO=o((t=>{var e=t.gullet.popToken();return"="===e.text&&" "===(e=t.gullet.popToken()).text&&(e=t.gullet.popToken()),e}),"getRHS"),$O=o(((t,e,r,n)=>{var i=t.gullet.macros.get(r.text);null==i&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)}),"letCommand");LD({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(OO[n.text])return"\\global"!==r&&"\\\\globallong"!==r||(n.text=OO[n.text]),mO(e.parseFunction(),"internal");throw new KI("Invalid token after macro prefix",n)}}),LD({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new KI("Expected a control sequence",n);for(var a,s=0,o=[[]];"{"!==e.gullet.future().text;)if("#"===(n=e.gullet.popToken()).text){if("{"===e.gullet.future().text){a=e.gullet.future(),o[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new KI('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new KI('Argument number "'+n.text+'" out of order');s++,o.push([])}else{if("EOF"===n.text)throw new KI("Expected a macro definition");o[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return a&&l.unshift(a),"\\edef"!==r&&"\\xdef"!==r||(l=e.gullet.expandTokens(l)).reverse(),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:o},r===OO[r]),{type:"internal",mode:e.mode}}}),LD({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=PO(e.gullet.popToken());e.gullet.consumeSpaces();var i=BO(e);return $O(e,n,i,"\\\\globallet"===r),{type:"internal",mode:e.mode}}}),LD({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=PO(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return $O(e,n,a,"\\\\globalfuture"===r),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var FO=o((function(t,e,r){var n=UR(fM.math[t]&&fM.math[t].replace||t,e,r);if(!n)throw new Error("Unsupported symbol "+t+" and font size "+e+".");return n}),"getMetrics"),zO=o((function(t,e,r,n){var i=r.havingBaseStyle(e),a=bD.makeSpan(n.concat(i.sizingClasses(r)),[t],r),s=i.sizeMultiplier/r.sizeMultiplier;return a.height*=s,a.depth*=s,a.maxFontSize=i.sizeMultiplier,a}),"styleWrap"),UO=o((function(t,e,r){var n=e.havingBaseStyle(r),i=(1-e.sizeMultiplier/n.sizeMultiplier)*e.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=QR(i),t.height-=i,t.depth+=i}),"centerSpan"),GO=o((function(t,e,r,n,i,a){var s=bD.makeSymbol(t,"Main-Regular",i,n),o=zO(s,e,n,a);return r&&UO(o,n,e),o}),"makeSmallDelim"),qO=o((function(t,e,r,n){return bD.makeSymbol(t,"Size"+e+"-Regular",r,n)}),"mathrmSize"),jO=o((function(t,e,r,n,i,a){var s=qO(t,e,i,n),o=zO(bD.makeSpan(["delimsizing","size"+e],[s],n),xR.TEXT,n,a);return r&&UO(o,n,xR.TEXT),o}),"makeLargeDelim"),WO=o((function(t,e,r){var n;return n="Size1-Regular"===e?"delim-size1":"delim-size4",{type:"elem",elem:bD.makeSpan(["delimsizinginner",n],[bD.makeSpan([],[bD.makeSymbol(t,e,r)])])}}),"makeGlyphSpan"),YO=o((function(t,e,r){var n=BR["Size4-Regular"][t.charCodeAt(0)]?BR["Size4-Regular"][t.charCodeAt(0)][4]:BR["Size1-Regular"][t.charCodeAt(0)][4],i=new cM("inner",MR(t,Math.round(1e3*e))),a=new lM([i],{width:QR(n),height:QR(e),style:"width:"+QR(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*e),preserveAspectRatio:"xMinYMin"}),s=bD.makeSvgSpan([],[a],r);return s.height=e,s.style.height=QR(e),s.style.width=QR(n),{type:"elem",elem:s}}),"makeInner"),HO={type:"kern",size:-.008},VO=["|","\\lvert","\\rvert","\\vert"],XO=["\\|","\\lVert","\\rVert","\\Vert"],KO=o((function(t,e,r,n,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"):oR.contains(VO,t)?(l="",h="vert",u=333):oR.contains(XO,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=FO(s,d,i),g=p.height+p.depth,f=FO(l,d,i),m=f.height+f.depth,y=FO(c,d,i),v=y.height+y.depth,x=0,b=1;if(null!==o){var w=FO(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,_=n.fontMetrics().axisHeight;r&&(_*=n.sizeMultiplier);var E=T/2-_,C=[];if(h.length>0){var S=T-g-v,A=Math.round(1e3*T),L=OR(h,Math.round(1e3*S)),N=new cM(h,L),I=(u/1e3).toFixed(3)+"em",R=(A/1e3).toFixed(3)+"em",M=new lM([N],{width:I,height:R,viewBox:"0 0 "+u+" "+A}),D=bD.makeSvgSpan([],[M],n);D.height=A/1e3,D.style.width=I,D.style.height=R,C.push({type:"elem",elem:D})}else{if(C.push(WO(c,d,i)),C.push(HO),null===o){var O=T-g-v+.016;C.push(YO(l,O,n))}else{var P=(T-g-v-x)/2+.016;C.push(YO(l,P,n)),C.push(HO),C.push(WO(o,d,i)),C.push(HO),C.push(YO(l,P,n))}C.push(HO),C.push(WO(s,d,i))}var B=n.havingBaseStyle(xR.TEXT),$=bD.makeVList({positionType:"bottom",positionData:E,children:C},B);return zO(bD.makeSpan(["delimsizing","mult"],[$],B),xR.TEXT,n,a)}),"makeStackedDelim"),ZO=.08,QO=o((function(t,e,r,n,i){var a=RR(t,n,r),s=new cM(t,a),o=new lM([s],{width:"400em",height:QR(e),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return bD.makeSvgSpan(["hide-tail"],[o],i)}),"sqrtSvg"),JO=o((function(t,e){var r,n,i=e.havingBaseSizing(),a=cP("\\surd",t*i.sizeMultiplier,oP,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,(r=QO("sqrtMain",l=(1+o+ZO)/s,h=1e3+1e3*o+80,o,e)).style.minWidth="0.853em",n=.833/s):"large"===a.type?(h=1080*nP[a.size],c=(nP[a.size]+o)/s,l=(nP[a.size]+o+ZO)/s,(r=QO("sqrtSize"+a.size,l,h,o,e)).style.minWidth="1.02em",n=1/s):(l=t+o+ZO,c=t+o,h=Math.floor(1e3*t+o)+80,(r=QO("sqrtTall",l,h,o,e)).style.minWidth="0.742em",n=1.056),r.height=c,r.style.height=QR(l),{span:r,advanceWidth:n,ruleWidth:(e.fontMetrics().sqrtRuleThickness+o)*s}}),"makeSqrtImage"),tP=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],eP=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],rP=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],nP=[0,1.2,1.8,2.4,3],iP=o((function(t,e,r,n,i){if("<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),oR.contains(tP,t)||oR.contains(rP,t))return jO(t,e,!1,r,n,i);if(oR.contains(eP,t))return KO(t,nP[e],!1,r,n,i);throw new KI("Illegal delimiter: '"+t+"'")}),"makeSizedDelim"),aP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],sP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"stack"}],oP=[{type:"small",style:xR.SCRIPTSCRIPT},{type:"small",style:xR.SCRIPT},{type:"small",style:xR.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],lP=o((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"),cP=o((function(t,e,r,n){for(var i=Math.min(2,3-n.style.size);i<r.length&&"stack"!==r[i].type;i++){var a=FO(t,lP(r[i]),"math"),s=a.height+a.depth;if("small"===r[i].type&&(s*=n.havingBaseStyle(r[i].style).sizeMultiplier),s>e)return r[i]}return r[r.length-1]}),"traverseSequence"),hP=o((function(t,e,r,n,i,a){var s;"<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),s=oR.contains(rP,t)?aP:oR.contains(tP,t)?oP:sP;var o=cP(t,e,s,n);return"small"===o.type?GO(t,o.style,r,n,i,a):"large"===o.type?jO(t,o.size,r,n,i,a):KO(t,e,r,n,i,a)}),"makeCustomSizedDelim"),uP=o((function(t,e,r,n,i,a){var s=n.fontMetrics().axisHeight*n.sizeMultiplier,o=5/n.fontMetrics().ptPerEm,l=Math.max(e-s,r+s),c=Math.max(l/500*901,2*l-o);return hP(t,c,!0,n,i,a)}),"makeLeftRightDelim"),dP={sqrtImage:JO,sizedDelim:iP,sizeToMaxHeight:nP,customSizedDelim:hP,leftRightDelim:uP},pP={"\\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}},gP=["(","\\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 fP(t,e){var r=vO(t);if(r&&oR.contains(gP,r.text))return r;throw new KI(r?"Invalid delimiter '"+r.text+"' after '"+e.funcName+"'":"Invalid delimiter type '"+t.type+"'",t)}function mP(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}o(fP,"checkDelimiter"),LD({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:o(((t,e)=>{var r=fP(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:pP[t.funcName].size,mclass:pP[t.funcName].mclass,delim:r.text}}),"handler"),htmlBuilder:o(((t,e)=>"."===t.delim?bD.makeSpan([t.mclass]):dP.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass])),"htmlBuilder"),mathmlBuilder:o((t=>{var e=[];"."!==t.delim&&e.push(QD(t.delim,t.mode));var r=new ZD.MathNode("mo",e);"mopen"===t.mclass||"mclose"===t.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=QR(dP.sizeToMaxHeight[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}),"mathmlBuilder")}),o(mP,"assertParsed"),LD({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new KI("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:fP(e[0],t).text,color:r}}),"handler")}),LD({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=fP(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=mO(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}}),"handler"),htmlBuilder:o(((t,e)=>{mP(t);for(var r,n,i=$D(t.body,e,!0,["mopen","mclose"]),a=0,s=0,o=!1,l=0;l<i.length;l++)i[l].isMiddle?o=!0:(a=Math.max(i[l].height,a),s=Math.max(i[l].depth,s));if(a*=e.sizeMultiplier,s*=e.sizeMultiplier,r="."===t.left?qD(e,["mopen"]):dP.leftRightDelim(t.left,a,s,e,t.mode,["mopen"]),i.unshift(r),o)for(var c=1;c<i.length;c++){var h=i[c].isMiddle;h&&(i[c]=dP.leftRightDelim(h.delim,a,s,h.options,t.mode,[]))}if("."===t.right)n=qD(e,["mclose"]);else{var u=t.rightColor?e.withColor(t.rightColor):e;n=dP.leftRightDelim(t.right,a,s,u,t.mode,["mclose"])}return i.push(n),bD.makeSpan(["minner"],i,e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{mP(t);var r=eO(t.body,e);if("."!==t.left){var n=new ZD.MathNode("mo",[QD(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if("."!==t.right){var i=new ZD.MathNode("mo",[QD(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return JD(r)}),"mathmlBuilder")}),LD({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var r=fP(e[0],t);if(!t.parser.leftrightDepth)throw new KI("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}}),"handler"),htmlBuilder:o(((t,e)=>{var r;if("."===t.delim)r=qD(e,[]);else{r=dP.sizedDelim(t.delim,1,e,t.mode,[]);var n={delim:t.delim,options:e};r.isMiddle=n}return r}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r="\\vert"===t.delim||"|"===t.delim?QD("|","text"):QD(t.delim,t.mode),n=new ZD.MathNode("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}),"mathmlBuilder")});var yP=o(((t,e)=>{var r,n,i=bD.wrapFragment(jD(t.body,e),e),a=t.label.slice(1),s=e.sizeMultiplier,o=0,l=oR.isCharacterBox(t.body);if("sout"===a)(r=bD.makeSpan(["stretchy","sout"])).height=e.fontMetrics().defaultRuleThickness/s,o=-.5*e.fontMetrics().xHeight;else if("phase"===a){var c=ZR({number:.6,unit:"pt"},e),h=ZR({number:.35,unit:"ex"},e);s/=e.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+h;i.style.paddingLeft=QR(u/2+c);var d=Math.floor(1e3*u*s),p=NR(d),g=new lM([new cM("phase",p)],{width:"400em",height:QR(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(r=bD.makeSvgSpan(["hide-tail"],[g],e)).style.height=QR(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,r=fO.encloseSpan(i,a,f,m,e),/fbox|boxed|fcolorbox/.test(a)?(r.style.borderStyle="solid",r.style.borderWidth=QR(y)):"angl"===a&&.049!==y&&(r.style.borderTopWidth=QR(y),r.style.borderRightWidth=QR(y)),o=i.depth+m,t.backgroundColor&&(r.style.backgroundColor=t.backgroundColor,t.borderColor&&(r.style.borderColor=t.borderColor))}if(t.backgroundColor)n=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:o},{type:"elem",elem:i,shift:0}]},e);else{var v=/cancel|phase/.test(a)?["svg-align"]:[];n=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:r,shift:o,wrapperClasses:v}]},e)}return/cancel/.test(a)&&(n.height=i.height,n.depth=i.depth),/cancel/.test(a)&&!l?bD.makeSpan(["mord","cancel-lap"],[n],e):bD.makeSpan(["mord"],[n],e)}),"htmlBuilder$7"),vP=o(((t,e)=>{var r=0,n=new ZD.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[nO(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===t.label){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n}),"mathmlBuilder$6");LD({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=mO(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=mO(e[0],"color-token").color,s=mO(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}}),LD({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:yP,mathmlBuilder:vP}),LD({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var xP={};function bP(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<r.length;++l)xP[r[l]]=o;a&&(SD[e]=a),s&&(AD[e]=s)}o(bP,"defineEnvironment");var wP={};function kP(t,e){wP[t]=e}function TP(t){var e=[];t.consumeSpaces();var r=t.fetch().text;for("\\relax"===r&&(t.consume(),t.consumeSpaces(),r=t.fetch().text);"\\hline"===r||"\\hdashline"===r;)t.consume(),e.push("\\hdashline"===r),t.consumeSpaces(),r=t.fetch().text;return e}o(kP,"defineMacro"),o(TP,"getHLines");var _P=o((t=>{if(!t.parser.settings.displayMode)throw new KI("{"+t.envName+"} can be used only in display mode.")}),"validateAmsEnvironmentContext");function EP(t){if(-1===t.indexOf("ed"))return-1===t.indexOf("*")}function CP(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:l,autoTag:c,singleRow:h,emptySingleRow:u,maxNumCols:d,leqno:p}=e;if(t.gullet.beginGroup(),h||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var g=t.gullet.expandMacroAsText("\\arraystretch");if(null==g)s=1;else if(!(s=parseFloat(g))||s<0)throw new KI("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 XI("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(Boolean(c)&&"1"===t.gullet.macros.get("\\@eqnsw")))}for(o(b,"beginRow"),o(w,"endRow"),b(),v.push(TP(t));;){var k=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},r&&(k={type:"styling",mode:t.mode,style:r,body:[k]}),f.push(k);var T=t.fetch().text;if("&"===T){if(d&&f.length===d){if(h||l)throw new KI("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.length<m.length+1&&v.push([]);break}if("\\\\"!==T)throw new KI("Expected & or \\\\ or \\cr or \\end",t.nextToken);t.consume();var _=void 0;" "!==t.gullet.future().text&&(_=t.parseSizeGroup(!0)),y.push(_?_.value:null),w(),v.push(TP(t)),f=[],m.push(f),b()}}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:s,body:m,cols:a,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:v,colSeparationType:l,tags:x,leqno:p}}function SP(t){return"d"===t.slice(0,1)?"display":"text"}o(EP,"getAutoTag"),o(CP,"parseArray"),o(SP,"dCellStyle");var AP=o((function(t,e){var r,n,i=t.body.length,a=t.hLinesBeforeRow,s=0,l=new Array(i),c=[],h=Math.max(e.fontMetrics().arrayRuleWidth,e.minRuleThickness),u=1/e.fontMetrics().ptPerEm,d=5*u;t.colSeparationType&&"small"===t.colSeparationType&&(d=e.havingStyle(xR.SCRIPT).sizeMultiplier/e.sizeMultiplier*.2778);var p="CD"===t.colSeparationType?ZR({number:3,unit:"ex"},e):12*u,g=3*u,f=t.arraystretch*p,m=.7*f,y=.3*f,v=0;function x(t){for(var e=0;e<t.length;++e)e>0&&(v+=.25),c.push({pos:v,isDashed:t[e]})}for(o(x,"setHLinePos"),x(a[0]),r=0;r<t.body.length;++r){var b=t.body[r],w=m,k=y;s<b.length&&(s=b.length);var T=new Array(b.length);for(n=0;n<b.length;++n){var _=jD(b[n],e);k<_.depth&&(k=_.depth),w<_.height&&(w=_.height),T[n]=_}var E=t.rowGaps[r],C=0;E&&(C=ZR(E,e))>0&&(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[r]=T,x(a[r+1])}var S,A,L=v/2+e.fontMetrics().axisHeight,N=t.cols||[],I=[],R=[];if(t.tags&&t.tags.some((t=>t)))for(r=0;r<i;++r){var M=l[r],D=M.pos-L,O=t.tags[r],P=void 0;(P=!0===O?bD.makeSpan(["eqn-num"],[],e):!1===O?bD.makeSpan([],[],e):bD.makeSpan([],$D(O,e,!0),e)).depth=M.depth,P.height=M.height,R.push({type:"elem",elem:P,shift:D})}for(n=0,A=0;n<s||A<N.length;++n,++A){for(var B=N[A]||{},$=!0;"separator"===B.type;){if($||((S=bD.makeSpan(["arraycolsep"],[])).style.width=QR(e.fontMetrics().doubleRuleSep),I.push(S)),"|"!==B.separator&&":"!==B.separator)throw new KI("Invalid separator type: "+B.separator);var F="|"===B.separator?"solid":"dashed",z=bD.makeSpan(["vertical-separator"],[],e);z.style.height=QR(v),z.style.borderRightWidth=QR(h),z.style.borderRightStyle=F,z.style.margin="0 "+QR(-h/2);var U=v-L;U&&(z.style.verticalAlign=QR(-U)),I.push(z),B=N[++A]||{},$=!1}if(!(n>=s)){var G=void 0;(n>0||t.hskipBeforeAndAfter)&&0!==(G=oR.deflt(B.pregap,d))&&((S=bD.makeSpan(["arraycolsep"],[])).style.width=QR(G),I.push(S));var q=[];for(r=0;r<i;++r){var j=l[r],W=j[n];if(W){var Y=j.pos-L;W.depth=j.depth,W.height=j.height,q.push({type:"elem",elem:W,shift:Y})}}q=bD.makeVList({positionType:"individualShift",children:q},e),q=bD.makeSpan(["col-align-"+(B.align||"c")],[q]),I.push(q),(n<s-1||t.hskipBeforeAndAfter)&&0!==(G=oR.deflt(B.postgap,d))&&((S=bD.makeSpan(["arraycolsep"],[])).style.width=QR(G),I.push(S))}}if(l=bD.makeSpan(["mtable"],I),c.length>0){for(var H=bD.makeLineSpan("hline",e,h),V=bD.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=bD.makeVList({positionType:"individualShift",children:X},e)}if(0===R.length)return bD.makeSpan(["mord"],[l],e);var Q=bD.makeVList({positionType:"individualShift",children:R},e);return Q=bD.makeSpan(["tag"],[Q],e),bD.makeFragment([l,Q])}),"htmlBuilder"),LP={c:"center ",l:"left ",r:"right "},NP=o((function(t,e){for(var r=[],n=new ZD.MathNode("mtd",[],["mtr-glue"]),i=new ZD.MathNode("mtd",[],["mml-eqn-num"]),a=0;a<t.body.length;a++){for(var s=t.body[a],o=[],l=0;l<s.length;l++)o.push(new ZD.MathNode("mtd",[nO(s[l],e)]));t.tags&&t.tags[a]&&(o.unshift(n),o.push(n),t.leqno?o.unshift(i):o.push(i)),r.push(new ZD.MathNode("mtr",o))}var c=new ZD.MathNode("mtable",r),h=.5===t.arraystretch?.1:.16+t.arraystretch-1+(t.addJot?.09:0);c.setAttribute("rowspacing",QR(h));var u="",d="";if(t.cols&&t.cols.length>0){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;v<y;v++)"align"===p[v].type?(d+=LP[p[v].align],f&&(g+="none "),f=!0):"separator"===p[v].type&&f&&(g+="|"===p[v].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(g)&&c.setAttribute("columnlines",g.trim())}if("align"===t.colSeparationType){for(var x=t.cols||[],b="",w=1;w<x.length;w++)b+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",b.trim())}else"alignat"===t.colSeparationType||"gather"===t.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===t.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===t.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var k="",T=t.hLinesBeforeRow;u+=T[0].length>0?"left ":"",u+=T[T.length-1].length>0?"right ":"";for(var _=1;_<T.length-1;_++)k+=0===T[_].length?"none ":T[_][0]?"dashed ":"solid ";return/[sd]/.test(k)&&c.setAttribute("rowlines",k.trim()),""!==u&&(c=new ZD.MathNode("menclose",[c])).setAttribute("notation",u.trim()),t.arraystretch&&t.arraystretch<1&&(c=new ZD.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c}),"mathmlBuilder"),IP=o((function(t,e){-1===t.envName.indexOf("ed")&&_P(t);var r,n=[],i=t.envName.indexOf("at")>-1?"alignat":"align",a="split"===t.envName,s=CP(t.parser,{cols:n,addJot:!0,autoTag:a?void 0:EP(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;h<e[0].body.length;h++){c+=mO(e[0].body[h],"textord").text}r=Number(c),o=2*r}var u=!o;s.body.forEach((function(t){for(var e=1;e<t.length;e+=2){var n=mO(t[e],"styling");mO(n.body[0],"ordgroup").body.unshift(l)}if(u)o<t.length&&(o=t.length);else{var i=t.length/2;if(r<i)throw new KI("Too many math in a row: expected "+r+", but got "+i,t[0])}}));for(var d=0;d<o;++d){var p="r",g=0;d%2==1?p="l":d>0&&u&&(g=1),n[d]={type:"align",align:p,pregap:g,postgap:0}}return s.colSeparationType=u?"align":"alignat",s}),"alignedHandler");bP({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=(vO(e[0])?[e[0]]:mO(e[0],"ordgroup").body).map((function(t){var e=yO(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 KI("Unknown column alignment: "+e,t)})),n={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return CP(t.parser,n,SP(t.envName))},htmlBuilder:AP,mathmlBuilder:NP}),bP({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("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===t.envName.charAt(t.envName.length-1)){var i=t.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,-1==="lcr".indexOf(r))throw new KI("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=CP(t.parser,n,SP(t.envName)),s=Math.max(0,...a.body.map((t=>t.length)));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e=CP(t.parser,{arraystretch:.5},"script");return e.colSeparationType="small",e},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=(vO(e[0])?[e[0]]:mO(e[0],"ordgroup").body).map((function(t){var e=yO(t).text;if(-1!=="lc".indexOf(e))return{type:"align",align:e};throw new KI("Unknown column alignment: "+e,t)}));if(r.length>1)throw new KI("{subarray} can contain only one column");var n={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((n=CP(t.parser,n,"script")).body.length>0&&n.body[0].length>1)throw new KI("{subarray} can contain only one column");return n},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e=CP(t.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},SP(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:AP,mathmlBuilder:NP}),bP({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:IP,htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){oR.contains(["gather","gather*"],t.envName)&&_P(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:EP(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return CP(t.parser,e,"display")},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:IP,htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){_P(t);var e={autoTag:EP(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return CP(t.parser,e,"display")},htmlBuilder:AP,mathmlBuilder:NP}),bP({type:"array",names:["CD"],props:{numArgs:0},handler:t=>(_P(t),RO(t.parser)),htmlBuilder:AP,mathmlBuilder:NP}),kP("\\nonumber","\\gdef\\@eqnsw{0}"),kP("\\notag","\\nonumber"),LD({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new KI(t.funcName+" valid only within array environment")}});var RP=xP;LD({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if("ordgroup"!==i.type)throw new KI("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=mO(i.body[s],"textord").text;if("\\begin"===n){if(!RP.hasOwnProperty(a))throw new KI("No such environment: "+a,i);var o=RP[a],{args:l,optArgs:c}=r.parseArguments("\\begin{"+a+"}",o),h={mode:r.mode,envName:a,parser:r},u=o.handler(h,l,c);r.expect("\\end",!1);var d=r.nextToken,p=mO(r.parseFunction(),"environment");if(p.name!==a)throw new KI("Mismatch: \\begin{"+a+"} matched by \\end{"+p.name+"}",d);return u}return{type:"environment",mode:r.mode,name:a,nameGroup:i}}});var MP=o(((t,e)=>{var r=t.font,n=e.withFont(r);return jD(t.body,n)}),"htmlBuilder$5"),DP=o(((t,e)=>{var r=t.font,n=e.withFont(r);return nO(t.body,n)}),"mathmlBuilder$4"),OP={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};LD({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=ID(e[0]),a=n;return a in OP&&(a=OP[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}}),"handler"),htmlBuilder:MP,mathmlBuilder:DP}),LD({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:o(((t,e)=>{var{parser:r}=t,n=e[0],i=oR.isCharacterBox(n);return{type:"mclass",mode:r.mode,mclass:CO(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}),"handler")}),LD({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:o(((t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}}),"handler"),htmlBuilder:MP,mathmlBuilder:DP});var PP=o(((t,e)=>{var r=e;return"display"===t?r=r.id>=xR.SCRIPT.id?r.text():xR.DISPLAY:"text"===t&&r.size===xR.DISPLAY.size?r=xR.TEXT:"script"===t?r=xR.SCRIPT:"scriptscript"===t&&(r=xR.SCRIPTSCRIPT),r}),"adjustStyle"),BP=o(((t,e)=>{var r,n=PP(t.size,e.style),i=n.fracNum(),a=n.fracDen();r=e.havingStyle(i);var s=jD(t.numer,r,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}r=e.havingStyle(a);var c,h,u,d,p,g,f,m,y,v,x=jD(t.denom,r,e);if(t.hasBarLine?(t.barSize?(h=ZR(t.barSize,e),c=bD.makeLineSpan("frac-line",e,h)):c=bD.makeLineSpan("frac-line",e),h=c.height,u=c.height):(c=null,h=0,u=e.fontMetrics().defaultRuleThickness),n.size===xR.DISPLAY.size||"display"===t.size?(d=e.fontMetrics().num1,p=h>0?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)<p&&(d+=p-(d-s.depth-(b+.5*h))),b-.5*h-(x.height-g)<p&&(g+=p-(b-.5*h-(x.height-g)));var w=-(b-.5*h);f=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:g},{type:"elem",elem:c,shift:w},{type:"elem",elem:s,shift:-d}]},e)}else{var k=d-s.depth-(x.height-g);k<p&&(d+=.5*(p-k),g+=.5*(p-k)),f=bD.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:g},{type:"elem",elem:s,shift:-d}]},e)}return r=e.havingStyle(n),f.height*=r.sizeMultiplier/e.sizeMultiplier,f.depth*=r.sizeMultiplier/e.sizeMultiplier,m=n.size===xR.DISPLAY.size?e.fontMetrics().delim1:n.size===xR.SCRIPTSCRIPT.size?e.havingStyle(xR.SCRIPT).fontMetrics().delim2:e.fontMetrics().delim2,y=null==t.leftDelim?qD(e,["mopen"]):dP.customSizedDelim(t.leftDelim,m,!0,e.havingStyle(n),t.mode,["mopen"]),v=t.continued?bD.makeSpan([]):null==t.rightDelim?qD(e,["mclose"]):dP.customSizedDelim(t.rightDelim,m,!0,e.havingStyle(n),t.mode,["mclose"]),bD.makeSpan(["mord"].concat(r.sizingClasses(e)),[y,bD.makeSpan(["mfrac"],[f]),v],e)}),"htmlBuilder$4"),$P=o(((t,e)=>{var r=new ZD.MathNode("mfrac",[nO(t.numer,e),nO(t.denom,e)]);if(t.hasBarLine){if(t.barSize){var n=ZR(t.barSize,e);r.setAttribute("linethickness",QR(n))}}else r.setAttribute("linethickness","0px");var i=PP(t.size,e.style);if(i.size!==e.style.size){r=new ZD.MathNode("mstyle",[r]);var a=i.size===xR.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",a),r.setAttribute("scriptlevel","0")}if(null!=t.leftDelim||null!=t.rightDelim){var s=[];if(null!=t.leftDelim){var o=new ZD.MathNode("mo",[new ZD.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(r),null!=t.rightDelim){var l=new ZD.MathNode("mo",[new ZD.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return JD(s)}return r}),"mathmlBuilder$3");LD({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:o(((t,e)=>{var r,{parser:n,funcName:i}=t,a=e[0],s=e[1],o=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":r=!0;break;case"\\\\atopfrac":r=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":r=!1,o="(",l=")";break;case"\\\\bracefrac":r=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":r=!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:n.mode,continued:!1,numer:a,denom:s,hasBarLine:r,leftDelim:o,rightDelim:l,size:c,barSize:null}}),"handler"),htmlBuilder:BP,mathmlBuilder:$P}),LD({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}),"handler")}),LD({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var e,{parser:r,funcName:n,token:i}=t;switch(n){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:r.mode,replaceWith:e,token:i}}});var FP=["display","text","script","scriptscript"],zP=o((function(t){var e=null;return t.length>0&&(e="."===(e=t)?null:e),e}),"delimFromValue");LD({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var r,{parser:n}=t,i=e[4],a=e[5],s=ID(e[0]),o="atom"===s.type&&"open"===s.family?zP(s.text):null,l=ID(e[1]),c="atom"===l.type&&"close"===l.family?zP(l.text):null,h=mO(e[2],"size"),u=null;r=!!h.isBlank||(u=h.value).number>0;var d="auto",p=e[3];if("ordgroup"===p.type){if(p.body.length>0){var g=mO(p.body[0],"textord");d=FP[Number(g.text)]}}else p=mO(p,"textord"),d=FP[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:r,barSize:u,leftDelim:o,rightDelim:c,size:d}},htmlBuilder:BP,mathmlBuilder:$P}),LD({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:mO(e[0],"size").value,token:i}}}),LD({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=sR(mO(e[1],"infix").size),s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}}),"handler"),htmlBuilder:BP,mathmlBuilder:$P});var UP=o(((t,e)=>{var r,n,i=e.style;"supsub"===t.type?(r=t.sup?jD(t.sup,e.havingStyle(i.sup()),e):jD(t.sub,e.havingStyle(i.sub()),e),n=mO(t.base,"horizBrace")):n=mO(t,"horizBrace");var a,s=jD(n.base,e.havingBaseStyle(xR.DISPLAY)),o=fO.svgSpan(n,e);if(n.isOver?(a=bD.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=bD.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"),r){var l=bD.makeSpan(["mord",n.isOver?"mover":"munder"],[a],e);a=n.isOver?bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},e):bD.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return bD.makeSpan(["mord",n.isOver?"mover":"munder"],[a],e)}),"htmlBuilder$3");LD({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:UP,mathmlBuilder:o(((t,e)=>{var r=fO.mathMLnode(t.label);return new ZD.MathNode(t.isOver?"mover":"munder",[nO(t.base,e),r])}),"mathmlBuilder$2")}),LD({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[1],i=mO(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:RD(n)}:r.formatUnsupportedCmd("\\href")}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.body,e,!1);return bD.makeAnchor(t.href,[],r,e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=rO(t.body,e);return r instanceof VD||(r=new VD("mrow",[r])),r.setAttribute("href",t.href),r}),"mathmlBuilder")}),LD({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=mO(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<n.length;a++){var s=n[a];"~"===s&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:r.mode,font:"\\texttt",body:i};return{type:"href",mode:r.mode,href:n,body:RD(o)}}),"handler")}),LD({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:r}=t;return{type:"hbox",mode:r.mode,body:RD(e[0])}},htmlBuilder(t,e){var r=$D(t.body,e,!1);return bD.makeFragment(r)},mathmlBuilder:(t,e)=>new ZD.MathNode("mrow",eO(t.body,e))}),LD({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:o(((t,e)=>{var r,{parser:n,funcName:i,token:a}=t,s=mO(e[0],"raw").string,o=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=s,r={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,r={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,r={command:"\\htmlStyle",style:s};break;case"\\htmlData":for(var c=s.split(","),h=0;h<c.length;h++){var u=c[h].split("=");if(2!==u.length)throw new KI("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}r={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(r)?{type:"html",mode:n.mode,attributes:l,body:RD(o)}:n.formatUnsupportedCmd(i)}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=bD.makeSpan(n,r,e);for(var a in t.attributes)"class"!==a&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>rO(t.body,e)),"mathmlBuilder")}),LD({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:RD(e[0]),mathml:RD(e[1])}}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.html,e,!1);return bD.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>rO(t.mathml,e)),"mathmlBuilder")});var GP=o((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 KI("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(e[1]+e[2]),unit:e[3]};if(!KR(r))throw new KI("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}),"sizeData");LD({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:o(((t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=mO(r[0],"raw").string.split(","),c=0;c<l.length;c++){var h=l[c].split("=");if(2===h.length){var u=h[1].trim();switch(h[0].trim()){case"alt":o=u;break;case"width":i=GP(u);break;case"height":a=GP(u);break;case"totalheight":s=GP(u);break;default:throw new KI("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var d=mO(e[0],"url").url;return""===o&&(o=(o=(o=d).replace(/^.*[\\/]/,"")).substring(0,o.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:n.mode,alt:o,width:i,height:a,totalheight:s,src:d}:n.formatUnsupportedCmd("\\includegraphics")}),"handler"),htmlBuilder:o(((t,e)=>{var r=ZR(t.height,e),n=0;t.totalheight.number>0&&(n=ZR(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=ZR(t.width,e));var a={height:QR(r+n)};i>0&&(a.width=QR(i)),n>0&&(a.verticalAlign=QR(-n));var s=new aM(t.src,t.alt,a);return s.height=r,s.depth=n,s}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=new ZD.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var n=ZR(t.height,e),i=0;if(t.totalheight.number>0&&(i=ZR(t.totalheight,e)-n,r.setAttribute("valign",QR(-i))),r.setAttribute("height",QR(n+i)),t.width.number>0){var a=ZR(t.width,e);r.setAttribute("width",QR(a))}return r.setAttribute("src",t.src),r}),"mathmlBuilder")}),LD({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=mO(e[0],"size");if(r.settings.strict){var a="m"===n[1],s="mu"===i.value.unit;a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+i.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder:(t,e)=>bD.makeGlue(t.dimension,e),mathmlBuilder(t,e){var r=ZR(t.dimension,e);return new ZD.SpaceNode(r)}}),LD({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}}),"handler"),htmlBuilder:o(((t,e)=>{var r;"clap"===t.alignment?(r=bD.makeSpan([],[jD(t.body,e)]),r=bD.makeSpan(["inner"],[r],e)):r=bD.makeSpan(["inner"],[jD(t.body,e)]);var n=bD.makeSpan(["fix"],[]),i=bD.makeSpan([t.alignment],[r,n],e),a=bD.makeSpan(["strut"]);return a.style.height=QR(i.height+i.depth),i.depth&&(a.style.verticalAlign=QR(-i.depth)),i.children.unshift(a),i=bD.makeSpan(["thinbox"],[i],e),bD.makeSpan(["mord","vbox"],[i],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=new ZD.MathNode("mpadded",[nO(t.body,e)]);if("rlap"!==t.alignment){var n="llap"===t.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}),"mathmlBuilder")}),LD({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a="\\("===r?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:s}}}),LD({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new KI("Mismatched "+t.funcName)}});var qP=o(((t,e)=>{switch(e.style.size){case xR.DISPLAY.size:return t.display;case xR.TEXT.size:return t.text;case xR.SCRIPT.size:return t.script;case xR.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}}),"chooseMathStyle");LD({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:o(((t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:RD(e[0]),text:RD(e[1]),script:RD(e[2]),scriptscript:RD(e[3])}}),"handler"),htmlBuilder:o(((t,e)=>{var r=qP(t,e),n=$D(r,e,!1);return bD.makeFragment(n)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=qP(t,e);return rO(r,e)}),"mathmlBuilder")});var jP=o(((t,e,r,n,i,a,s)=>{t=bD.makeSpan([],[t]);var o,l,c,h=r&&oR.isCharacterBox(r);if(e){var u=jD(e,n.havingStyle(i.sup()),n);l={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var d=jD(r,n.havingStyle(i.sub()),n);o={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}if(l&&o){var p=n.fontMetrics().bigOpSpacing5+o.elem.height+o.elem.depth+o.kern+t.depth+s;c=bD.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:QR(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:QR(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(o){var g=t.height-s;c=bD.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:o.elem,marginLeft:QR(-a)},{type:"kern",size:o.kern},{type:"elem",elem:t}]},n)}else{if(!l)return t;var f=t.depth+s;c=bD.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:QR(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var m=[c];if(o&&0!==a&&!h){var y=bD.makeSpan(["mspace"],[],n);y.style.marginRight=QR(a),m.unshift(y)}return bD.makeSpan(["mop","op-limits"],m,n)}),"assembleSupSub"),WP=["\\smallint"],YP=o(((t,e)=>{var r,n,i,a=!1;"supsub"===t.type?(r=t.sup,n=t.sub,i=mO(t.base,"op"),a=!0):i=mO(t,"op");var s,o=e.style,l=!1;if(o.size===xR.DISPLAY.size&&i.symbol&&!oR.contains(WP,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=bD.makeSymbol(i.name,c,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),h.length>0){var u=s.italic,d=bD.staticSvg(h+"Size"+(l?"2":"1"),e);s=bD.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=$D(i.body,e,!0);1===p.length&&p[0]instanceof oM?(s=p[0]).classes[0]="mop":s=bD.makeSpan(["mop"],p,e)}else{for(var g=[],f=1;f<i.name.length;f++)g.push(bD.mathsym(i.name[f],i.mode,e));s=bD.makeSpan(["mop"],g,e)}var m=0,y=0;return(s instanceof oM||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(m=(s.height-s.depth)/2-e.fontMetrics().axisHeight,y=s.italic),a?jP(s,r,n,e,o,y,m):(m&&(s.style.position="relative",s.style.top=QR(m)),s)}),"htmlBuilder$2"),HP=o(((t,e)=>{var r;if(t.symbol)r=new VD("mo",[QD(t.name,t.mode)]),oR.contains(WP,t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new VD("mo",eO(t.body,e));else{r=new VD("mi",[new XD(t.name.slice(1))]);var n=new VD("mo",[QD("","text")]);r=t.parentIsSupSub?new VD("mrow",[r,n]):HD([r,n])}return r}),"mathmlBuilder$1"),VP={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};LD({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=n;return 1===i.length&&(i=VP[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}}),"handler"),htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:RD(n)}}),"handler"),htmlBuilder:YP,mathmlBuilder:HP});var XP={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};LD({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:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:YP,mathmlBuilder:HP}),LD({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t,n=r;return 1===n.length&&(n=XP[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:YP,mathmlBuilder:HP});var KP=o(((t,e)=>{var r,n,i,a,s=!1;if("supsub"===t.type?(r=t.sup,n=t.sub,i=mO(t.base,"operatorname"),s=!0):i=mO(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=$D(o,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var h=l[c];h instanceof oM&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}a=bD.makeSpan(["mop"],l,e)}else a=bD.makeSpan(["mop"],[],e);return s?jP(a,r,n,e,e.style,0,0):a}),"htmlBuilder$1"),ZP=o(((t,e)=>{for(var r=eO(t.body,e.withFont("mathrm")),n=!0,i=0;i<r.length;i++){var a=r[i];if(a instanceof ZD.SpaceNode);else if(a instanceof ZD.MathNode)switch(a.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var s=a.children[0];1===a.children.length&&s instanceof ZD.TextNode?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break;default:n=!1}else n=!1}if(n){var o=r.map((t=>t.toText())).join("");r=[new ZD.TextNode(o)]}var l=new ZD.MathNode("mi",r);l.setAttribute("mathvariant","normal");var c=new ZD.MathNode("mo",[QD("","text")]);return t.parentIsSupSub?new ZD.MathNode("mrow",[l,c]):ZD.newDocumentFragment([l,c])}),"mathmlBuilder");function QP(t,e,r){for(var n=$D(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a<n.length;a++){var s=n[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[a].classes,e.sizingClasses(r)):n[a].classes[s+1]==="reset-size"+e.size&&(n[a].classes[s+1]="reset-size"+r.size),n[a].height*=i,n[a].depth*=i}return bD.makeFragment(n)}LD({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:o(((t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:RD(i),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}}),"handler"),htmlBuilder:KP,mathmlBuilder:ZP}),kP("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ND({type:"ordgroup",htmlBuilder:(t,e)=>t.semisimple?bD.makeFragment($D(t.body,e,!1)):bD.makeSpan(["mord"],$D(t.body,e,!0),e),mathmlBuilder:(t,e)=>rO(t.body,e,!0)}),LD({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=jD(t.body,e.havingCrampedStyle()),n=bD.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return bD.makeSpan(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[new ZD.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ZD.MathNode("mover",[nO(t.body,e),r]);return n.setAttribute("accent","true"),n}}),LD({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:RD(n)}}),"handler"),htmlBuilder:o(((t,e)=>{var r=$D(t.body,e.withPhantom(),!1);return bD.makeFragment(r)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=eO(t.body,e);return new ZD.MathNode("mphantom",r)}),"mathmlBuilder")}),LD({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"hphantom",mode:r.mode,body:n}}),"handler"),htmlBuilder:o(((t,e)=>{var r=bD.makeSpan([],[jD(t.body,e.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var n=0;n<r.children.length;n++)r.children[n].height=0,r.children[n].depth=0;return r=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e),bD.makeSpan(["mord"],[r],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=eO(RD(t.body),e),n=new ZD.MathNode("mphantom",r),i=new ZD.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}),"mathmlBuilder")}),LD({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:o(((t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}}),"handler"),htmlBuilder:o(((t,e)=>{var r=bD.makeSpan(["inner"],[jD(t.body,e.withPhantom())]),n=bD.makeSpan(["fix"],[]);return bD.makeSpan(["mord","rlap"],[r,n],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=eO(RD(t.body),e),n=new ZD.MathNode("mphantom",r),i=new ZD.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}),"mathmlBuilder")}),LD({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=mO(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=jD(t.body,e),n=ZR(t.dy,e);return bD.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]},e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mpadded",[nO(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}}),LD({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}}),LD({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=mO(e[0],"size"),s=mO(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&mO(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=bD.makeSpan(["mord","rule"],[],e),n=ZR(t.width,e),i=ZR(t.height,e),a=t.shift?ZR(t.shift,e):0;return r.style.borderRightWidth=QR(n),r.style.borderTopWidth=QR(i),r.style.bottom=QR(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=1.125*i*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=ZR(t.width,e),n=ZR(t.height,e),i=t.shift?ZR(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new ZD.MathNode("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",QR(r)),s.setAttribute("height",QR(n));var o=new ZD.MathNode("mpadded",[s]);return i>=0?o.setAttribute("height",QR(i)):(o.setAttribute("height",QR(i)),o.setAttribute("depth",QR(-i))),o.setAttribute("voffset",QR(i)),o}}),o(QP,"sizingGroup");var JP=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],tB=o(((t,e)=>{var r=e.havingSize(t.size);return QP(t.body,r,e)}),"htmlBuilder");LD({type:"sizing",names:JP,props:{numArgs:0,allowedInText:!0},handler:o(((t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:JP.indexOf(n)+1,body:a}}),"handler"),htmlBuilder:tB,mathmlBuilder:o(((t,e)=>{var r=e.havingSize(t.size),n=eO(t.body,r),i=new ZD.MathNode("mstyle",n);return i.setAttribute("mathsize",QR(r.sizeMultiplier)),i}),"mathmlBuilder")}),LD({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:o(((t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&mO(r[0],"ordgroup");if(s)for(var o="",l=0;l<s.body.length;++l){if("t"===(o=s.body[l].text))i=!0;else{if("b"!==o){i=!1,a=!1;break}a=!0}}else i=!0,a=!0;var c=e[0];return{type:"smash",mode:n.mode,body:c,smashHeight:i,smashDepth:a}}),"handler"),htmlBuilder:o(((t,e)=>{var r=bD.makeSpan([],[jD(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0,r.children))for(var n=0;n<r.children.length;n++)r.children[n].height=0;if(t.smashDepth&&(r.depth=0,r.children))for(var i=0;i<r.children.length;i++)r.children[i].depth=0;var a=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},e);return bD.makeSpan(["mord"],[a],e)}),"htmlBuilder"),mathmlBuilder:o(((t,e)=>{var r=new ZD.MathNode("mpadded",[nO(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}),"mathmlBuilder")}),LD({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=jD(t.body,e.havingCrampedStyle());0===r.height&&(r.height=e.fontMetrics().xHeight),r=bD.wrapFragment(r,e);var n=e.fontMetrics().defaultRuleThickness,i=n;e.style.id<xR.TEXT.id&&(i=e.fontMetrics().xHeight);var a=n+i/4,s=r.height+r.depth+a+n,{span:o,ruleWidth:l,advanceWidth:c}=dP.sqrtImage(s,e),h=o.height-l;h>r.height+r.depth+a&&(a=(a+h-r.height-r.depth)/2);var u=o.height-r.height-a-l;r.style.paddingLeft=QR(c);var d=bD.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:o},{type:"kern",size:l}]},e);if(t.index){var p=e.havingStyle(xR.SCRIPTSCRIPT),g=jD(t.index,p,e),f=.6*(d.height-d.depth),m=bD.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:g}]},e),y=bD.makeSpan(["root"],[m]);return bD.makeSpan(["mord","sqrt"],[y,d],e)}return bD.makeSpan(["mord","sqrt"],[d],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new ZD.MathNode("mroot",[nO(r,e),nO(n,e)]):new ZD.MathNode("msqrt",[nO(r,e)])}});var eB={display:xR.DISPLAY,text:xR.TEXT,script:xR.SCRIPT,scriptscript:xR.SCRIPTSCRIPT};LD({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=eB[t.style],n=e.havingStyle(r).withFont("");return QP(t.body,n,e)},mathmlBuilder(t,e){var r=eB[t.style],n=e.havingStyle(r),i=eO(t.body,n),a=new ZD.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 rB=o((function(t,e){var r=t.base;return r?"op"===r.type?r.limits&&(e.style.size===xR.DISPLAY.size||r.alwaysHandleSupSub)?YP:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(e.style.size===xR.DISPLAY.size||r.limits)?KP:null:"accent"===r.type?oR.isCharacterBox(r.base)?xO:null:"horizBrace"===r.type&&!t.sub===r.isOver?UP:null:null}),"htmlBuilderDelegate");ND({type:"supsub",htmlBuilder(t,e){var r=rB(t,e);if(r)return r(t,e);var n,i,a,{base:s,sup:o,sub:l}=t,c=jD(s,e),h=e.fontMetrics(),u=0,d=0,p=s&&oR.isCharacterBox(s);if(o){var g=e.havingStyle(e.style.sup());n=jD(o,g,e),p||(u=c.height-g.fontMetrics().supDrop*g.sizeMultiplier/e.sizeMultiplier)}if(l){var f=e.havingStyle(e.style.sub());i=jD(l,f,e),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/e.sizeMultiplier)}a=e.style===xR.DISPLAY?h.sup1:e.style.cramped?h.sup3:h.sup2;var m,y=e.sizeMultiplier,v=QR(.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 oM||b)&&(x=QR(-c.italic))}if(n&&i){u=Math.max(u,a,n.depth+.25*h.xHeight),d=Math.max(d,h.sub2);var w=4*h.defaultRuleThickness;if(u-n.depth-(i.height-d)<w){d=w-(u-n.depth)+i.height;var k=.8*h.xHeight-(u-n.depth);k>0&&(u+=k,d-=k)}var T=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:x},{type:"elem",elem:n,shift:-u,marginRight:v}];m=bD.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=bD.makeVList({positionType:"shift",positionData:d,children:_},e)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,a,n.depth+.25*h.xHeight),m=bD.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:v}]},e)}var E=GD(c,"right")||"mord";return bD.makeSpan([E],[c,bD.makeSpan(["msupsub"],[m])],e)},mathmlBuilder(t,e){var r,n=!1;t.base&&"horizBrace"===t.base.type&&!!t.sup===t.base.isOver&&(n=!0,r=t.base.isOver),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var i,a=[nO(t.base,e)];if(t.sub&&a.push(nO(t.sub,e)),t.sup&&a.push(nO(t.sup,e)),n)i=r?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;i=s&&"op"===s.type&&s.limits&&e.style===xR.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===xR.DISPLAY||s.limits)?"munderover":"msubsup"}else{var o=t.base;i=o&&"op"===o.type&&o.limits&&(e.style===xR.DISPLAY||o.alwaysHandleSupSub)||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(o.limits||e.style===xR.DISPLAY)?"munder":"msub"}else{var l=t.base;i=l&&"op"===l.type&&l.limits&&(e.style===xR.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===xR.DISPLAY)?"mover":"msup"}return new ZD.MathNode(i,a)}}),ND({type:"atom",htmlBuilder:(t,e)=>bD.mathsym(t.text,t.mode,e,["m"+t.family]),mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[QD(t.text,t.mode)]);if("bin"===t.family){var n=tO(t,e);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===t.family?r.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||r.setAttribute("stretchy","false");return r}});var nB={mi:"italic",mn:"normal",mtext:"normal"};ND({type:"mathord",htmlBuilder:(t,e)=>bD.makeOrd(t,e,"mathord"),mathmlBuilder(t,e){var r=new ZD.MathNode("mi",[QD(t.text,t.mode,e)]),n=tO(t,e)||"italic";return n!==nB[r.type]&&r.setAttribute("mathvariant",n),r}}),ND({type:"textord",htmlBuilder:(t,e)=>bD.makeOrd(t,e,"textord"),mathmlBuilder(t,e){var r,n=QD(t.text,t.mode,e),i=tO(t,e)||"normal";return r="text"===t.mode?new ZD.MathNode("mtext",[n]):/[0-9]/.test(t.text)?new ZD.MathNode("mn",[n]):"\\prime"===t.text?new ZD.MathNode("mo",[n]):new ZD.MathNode("mi",[n]),i!==nB[r.type]&&r.setAttribute("mathvariant",i),r}});var iB={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},aB={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ND({type:"spacing",htmlBuilder(t,e){if(aB.hasOwnProperty(t.text)){var r=aB[t.text].className||"";if("text"===t.mode){var n=bD.makeOrd(t,e,"textord");return n.classes.push(r),n}return bD.makeSpan(["mspace",r],[bD.mathsym(t.text,t.mode,e)],e)}if(iB.hasOwnProperty(t.text))return bD.makeSpan(["mspace",iB[t.text]],[],e);throw new KI('Unknown type of space "'+t.text+'"')},mathmlBuilder(t,e){if(!aB.hasOwnProperty(t.text)){if(iB.hasOwnProperty(t.text))return new ZD.MathNode("mspace");throw new KI('Unknown type of space "'+t.text+'"')}return new ZD.MathNode("mtext",[new ZD.TextNode(" ")])}});var sB=o((()=>{var t=new ZD.MathNode("mtd",[]);return t.setAttribute("width","50%"),t}),"pad");ND({type:"tag",mathmlBuilder(t,e){var r=new ZD.MathNode("mtable",[new ZD.MathNode("mtr",[sB(),new ZD.MathNode("mtd",[rO(t.body,e)]),sB(),new ZD.MathNode("mtd",[rO(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var oB={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},lB={"\\textbf":"textbf","\\textmd":"textmd"},cB={"\\textit":"textit","\\textup":"textup"},hB=o(((t,e)=>{var r=t.font;return r?oB[r]?e.withTextFontFamily(oB[r]):lB[r]?e.withTextFontWeight(lB[r]):"\\emph"===r?"textit"===e.fontShape?e.withTextFontShape("textup"):e.withTextFontShape("textit"):e.withTextFontShape(cB[r]):e}),"optionsWithFont");LD({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:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:RD(i),font:n}},htmlBuilder(t,e){var r=hB(t,e),n=$D(t.body,r,!0);return bD.makeSpan(["mord","text"],n,r)},mathmlBuilder(t,e){var r=hB(t,e);return rO(t.body,r)}}),LD({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=jD(t.body,e),n=bD.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=bD.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]},e);return bD.makeSpan(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new ZD.MathNode("mo",[new ZD.TextNode("‾")]);r.setAttribute("stretchy","true");var n=new ZD.MathNode("munder",[nO(t.body,e),r]);return n.setAttribute("accentunder","true"),n}}),LD({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=jD(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return bD.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]},e)},mathmlBuilder:(t,e)=>new ZD.MathNode("mpadded",[nO(t.body,e)],["vcenter"])}),LD({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new KI("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=uB(t),n=[],i=e.havingStyle(e.style.text()),a=0;a<r.length;a++){var s=r[a];"~"===s&&(s="\\textasciitilde"),n.push(bD.makeSymbol(s,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return bD.makeSpan(["mord","text"].concat(i.sizingClasses(e)),bD.tryCombineChars(n),i)},mathmlBuilder(t,e){var r=new ZD.TextNode(uB(t)),n=new ZD.MathNode("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var uB=o((t=>t.body.replace(/ /g,t.star?"␣":" ")),"makeVerb"),dB=CD,pB=new RegExp("[̀-ͯ]+$"),gB=class{static{o(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 XI("EOF",new VI(this,e,e));var r=this.tokenRegex.exec(t);if(null===r||r.index!==e)throw new KI("Unexpected character: '"+t[e]+"'",new XI(t[e],new VI(this,e,e+1)));var n=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[n]){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 XI(n,new VI(this,e,this.tokenRegex.lastIndex))}},fB=class{static{o(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 KI("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,r){if(void 0===r&&(r=!1),r){for(var n=0;n<this.undefStack.length;n++)delete this.undefStack[n][t];this.undefStack.length>0&&(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}},mB=wP;kP("\\noexpand",(function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}})),kP("\\expandafter",(function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}})),kP("\\@firstoftwo",(function(t){return{tokens:t.consumeArgs(2)[0],numArgs:0}})),kP("\\@secondoftwo",(function(t){return{tokens:t.consumeArgs(2)[1],numArgs:0}})),kP("\\@ifnextchar",(function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return 1===e[0].length&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),kP("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),kP("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var yB={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};kP("\\char",(function(t){var e,r=t.popToken(),n="";if("'"===r.text)e=8,r=t.popToken();else if('"'===r.text)e=16,r=t.popToken();else if("`"===r.text)if("\\"===(r=t.popToken()).text[0])n=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new KI("\\char` missing argument");n=r.text.charCodeAt(0)}else e=10;if(e){if(null==(n=yB[r.text])||n>=e)throw new KI("Invalid base-"+e+" digit "+r.text);for(var i;null!=(i=yB[t.future().text])&&i<e;)n*=e,n+=i,t.popToken()}return"\\@char{"+n+"}"}));var vB=o(((t,e,r)=>{var n=t.consumeArg().tokens;if(1!==n.length)throw new KI("\\newcommand's first argument must be a macro name");var i=n[0].text,a=t.isDefined(i);if(a&&!e)throw new KI("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!r)throw new KI("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(n=t.consumeArg().tokens).length&&"["===n[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 KI("Invalid number of arguments: "+o);s=parseInt(o),n=t.consumeArg().tokens}return t.macros.set(i,{tokens:n,numArgs:s}),""}),"newcommand");kP("\\newcommand",(t=>vB(t,!1,!0))),kP("\\renewcommand",(t=>vB(t,!0,!1))),kP("\\providecommand",(t=>vB(t,!0,!0))),kP("\\message",(t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map((t=>t.text)).join("")),""})),kP("\\errmessage",(t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map((t=>t.text)).join("")),""})),kP("\\show",(t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),dB[r],fM.math[r],fM.text[r]),""})),kP("\\bgroup","{"),kP("\\egroup","}"),kP("~","\\nobreakspace"),kP("\\lq","`"),kP("\\rq","'"),kP("\\aa","\\r a"),kP("\\AA","\\r A"),kP("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),kP("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),kP("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),kP("","\\mathscr{B}"),kP("","\\mathscr{E}"),kP("","\\mathscr{F}"),kP("","\\mathscr{H}"),kP("","\\mathscr{I}"),kP("","\\mathscr{L}"),kP("","\\mathscr{M}"),kP("","\\mathscr{R}"),kP("","\\mathfrak{C}"),kP("","\\mathfrak{H}"),kP("","\\mathfrak{Z}"),kP("\\Bbbk","\\Bbb{k}"),kP("·","\\cdotp"),kP("\\llap","\\mathllap{\\textrm{#1}}"),kP("\\rlap","\\mathrlap{\\textrm{#1}}"),kP("\\clap","\\mathclap{\\textrm{#1}}"),kP("\\mathstrut","\\vphantom{(}"),kP("\\underbar","\\underline{\\text{#1}}"),kP("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),kP("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),kP("\\ne","\\neq"),kP("≠","\\neq"),kP("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),kP("∉","\\notin"),kP("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),kP("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),kP("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),kP("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),kP("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),kP("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),kP("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),kP("⟂","\\perp"),kP("‼","\\mathclose{!\\mkern-0.8mu!}"),kP("∌","\\notni"),kP("⌜","\\ulcorner"),kP("⌝","\\urcorner"),kP("⌞","\\llcorner"),kP("⌟","\\lrcorner"),kP("©","\\copyright"),kP("®","\\textregistered"),kP("","\\textregistered"),kP("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),kP("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),kP("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),kP("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),kP("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),kP("⋮","\\vdots"),kP("\\varGamma","\\mathit{\\Gamma}"),kP("\\varDelta","\\mathit{\\Delta}"),kP("\\varTheta","\\mathit{\\Theta}"),kP("\\varLambda","\\mathit{\\Lambda}"),kP("\\varXi","\\mathit{\\Xi}"),kP("\\varPi","\\mathit{\\Pi}"),kP("\\varSigma","\\mathit{\\Sigma}"),kP("\\varUpsilon","\\mathit{\\Upsilon}"),kP("\\varPhi","\\mathit{\\Phi}"),kP("\\varPsi","\\mathit{\\Psi}"),kP("\\varOmega","\\mathit{\\Omega}"),kP("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),kP("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),kP("\\boxed","\\fbox{$\\displaystyle{#1}$}"),kP("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),kP("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),kP("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var xB={",":"\\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"};kP("\\dots",(function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in xB?e=xB[r]:("\\not"===r.slice(0,4)||r in fM.math&&oR.contains(["bin","rel"],fM.math[r].group))&&(e="\\dotsb"),e}));var bB={")":!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};kP("\\dotso",(function(t){return t.future().text in bB?"\\ldots\\,":"\\ldots"})),kP("\\dotsc",(function(t){var e=t.future().text;return e in bB&&","!==e?"\\ldots\\,":"\\ldots"})),kP("\\cdots",(function(t){return t.future().text in bB?"\\@cdots\\,":"\\@cdots"})),kP("\\dotsb","\\cdots"),kP("\\dotsm","\\cdots"),kP("\\dotsi","\\!\\cdots"),kP("\\dotsx","\\ldots\\,"),kP("\\DOTSI","\\relax"),kP("\\DOTSB","\\relax"),kP("\\DOTSX","\\relax"),kP("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),kP("\\,","\\tmspace+{3mu}{.1667em}"),kP("\\thinspace","\\,"),kP("\\>","\\mskip{4mu}"),kP("\\:","\\tmspace+{4mu}{.2222em}"),kP("\\medspace","\\:"),kP("\\;","\\tmspace+{5mu}{.2777em}"),kP("\\thickspace","\\;"),kP("\\!","\\tmspace-{3mu}{.1667em}"),kP("\\negthinspace","\\!"),kP("\\negmedspace","\\tmspace-{4mu}{.2222em}"),kP("\\negthickspace","\\tmspace-{5mu}{.277em}"),kP("\\enspace","\\kern.5em "),kP("\\enskip","\\hskip.5em\\relax"),kP("\\quad","\\hskip1em\\relax"),kP("\\qquad","\\hskip2em\\relax"),kP("\\tag","\\@ifstar\\tag@literal\\tag@paren"),kP("\\tag@paren","\\tag@literal{({#1})}"),kP("\\tag@literal",(t=>{if(t.macros.get("\\df@tag"))throw new KI("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),kP("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),kP("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),kP("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),kP("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),kP("\\newline","\\\\\\relax"),kP("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var wB=QR(BR["Main-Regular"]["T".charCodeAt(0)][1]-.7*BR["Main-Regular"]["A".charCodeAt(0)][1]);kP("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+wB+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),kP("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+wB+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),kP("\\hspace","\\@ifstar\\@hspacer\\@hspace"),kP("\\@hspace","\\hskip #1\\relax"),kP("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),kP("\\ordinarycolon",":"),kP("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),kP("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),kP("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),kP("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),kP("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),kP("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),kP("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),kP("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),kP("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),kP("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),kP("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),kP("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),kP("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),kP("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),kP("∷","\\dblcolon"),kP("∹","\\eqcolon"),kP("≔","\\coloneqq"),kP("≕","\\eqqcolon"),kP("⩴","\\Coloneqq"),kP("\\ratio","\\vcentcolon"),kP("\\coloncolon","\\dblcolon"),kP("\\colonequals","\\coloneqq"),kP("\\coloncolonequals","\\Coloneqq"),kP("\\equalscolon","\\eqqcolon"),kP("\\equalscoloncolon","\\Eqqcolon"),kP("\\colonminus","\\coloneq"),kP("\\coloncolonminus","\\Coloneq"),kP("\\minuscolon","\\eqcolon"),kP("\\minuscoloncolon","\\Eqcolon"),kP("\\coloncolonapprox","\\Colonapprox"),kP("\\coloncolonsim","\\Colonsim"),kP("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),kP("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),kP("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),kP("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),kP("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),kP("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),kP("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),kP("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),kP("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),kP("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),kP("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),kP("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),kP("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),kP("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),kP("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),kP("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),kP("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),kP("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),kP("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),kP("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),kP("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),kP("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),kP("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),kP("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),kP("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),kP("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),kP("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),kP("\\imath","\\html@mathml{\\@imath}{ı}"),kP("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),kP("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),kP("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),kP("⟦","\\llbracket"),kP("⟧","\\rrbracket"),kP("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),kP("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),kP("⦃","\\lBrace"),kP("⦄","\\rBrace"),kP("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),kP("⦵","\\minuso"),kP("\\darr","\\downarrow"),kP("\\dArr","\\Downarrow"),kP("\\Darr","\\Downarrow"),kP("\\lang","\\langle"),kP("\\rang","\\rangle"),kP("\\uarr","\\uparrow"),kP("\\uArr","\\Uparrow"),kP("\\Uarr","\\Uparrow"),kP("\\N","\\mathbb{N}"),kP("\\R","\\mathbb{R}"),kP("\\Z","\\mathbb{Z}"),kP("\\alef","\\aleph"),kP("\\alefsym","\\aleph"),kP("\\Alpha","\\mathrm{A}"),kP("\\Beta","\\mathrm{B}"),kP("\\bull","\\bullet"),kP("\\Chi","\\mathrm{X}"),kP("\\clubs","\\clubsuit"),kP("\\cnums","\\mathbb{C}"),kP("\\Complex","\\mathbb{C}"),kP("\\Dagger","\\ddagger"),kP("\\diamonds","\\diamondsuit"),kP("\\empty","\\emptyset"),kP("\\Epsilon","\\mathrm{E}"),kP("\\Eta","\\mathrm{H}"),kP("\\exist","\\exists"),kP("\\harr","\\leftrightarrow"),kP("\\hArr","\\Leftrightarrow"),kP("\\Harr","\\Leftrightarrow"),kP("\\hearts","\\heartsuit"),kP("\\image","\\Im"),kP("\\infin","\\infty"),kP("\\Iota","\\mathrm{I}"),kP("\\isin","\\in"),kP("\\Kappa","\\mathrm{K}"),kP("\\larr","\\leftarrow"),kP("\\lArr","\\Leftarrow"),kP("\\Larr","\\Leftarrow"),kP("\\lrarr","\\leftrightarrow"),kP("\\lrArr","\\Leftrightarrow"),kP("\\Lrarr","\\Leftrightarrow"),kP("\\Mu","\\mathrm{M}"),kP("\\natnums","\\mathbb{N}"),kP("\\Nu","\\mathrm{N}"),kP("\\Omicron","\\mathrm{O}"),kP("\\plusmn","\\pm"),kP("\\rarr","\\rightarrow"),kP("\\rArr","\\Rightarrow"),kP("\\Rarr","\\Rightarrow"),kP("\\real","\\Re"),kP("\\reals","\\mathbb{R}"),kP("\\Reals","\\mathbb{R}"),kP("\\Rho","\\mathrm{P}"),kP("\\sdot","\\cdot"),kP("\\sect","\\S"),kP("\\spades","\\spadesuit"),kP("\\sub","\\subset"),kP("\\sube","\\subseteq"),kP("\\supe","\\supseteq"),kP("\\Tau","\\mathrm{T}"),kP("\\thetasym","\\vartheta"),kP("\\weierp","\\wp"),kP("\\Zeta","\\mathrm{Z}"),kP("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),kP("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),kP("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),kP("\\bra","\\mathinner{\\langle{#1}|}"),kP("\\ket","\\mathinner{|{#1}\\rangle}"),kP("\\braket","\\mathinner{\\langle{#1}\\rangle}"),kP("\\Bra","\\left\\langle#1\\right|"),kP("\\Ket","\\left|#1\\right\\rangle");var kB=o((t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var c=o((e=>r=>{t&&(r.macros.set("|",s),i.length&&r.macros.set("\\|",l));var a=e;!e&&i.length&&("|"===r.future().text&&(r.popToken(),a=!0));return{tokens:a?i:n,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,...r]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}}),"braketHelper");kP("\\bra@ket",kB(!1)),kP("\\bra@set",kB(!0)),kP("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),kP("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),kP("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),kP("\\angln","{\\angl n}"),kP("\\blue","\\textcolor{##6495ed}{#1}"),kP("\\orange","\\textcolor{##ffa500}{#1}"),kP("\\pink","\\textcolor{##ff00af}{#1}"),kP("\\red","\\textcolor{##df0030}{#1}"),kP("\\green","\\textcolor{##28ae7b}{#1}"),kP("\\gray","\\textcolor{gray}{#1}"),kP("\\purple","\\textcolor{##9d38bd}{#1}"),kP("\\blueA","\\textcolor{##ccfaff}{#1}"),kP("\\blueB","\\textcolor{##80f6ff}{#1}"),kP("\\blueC","\\textcolor{##63d9ea}{#1}"),kP("\\blueD","\\textcolor{##11accd}{#1}"),kP("\\blueE","\\textcolor{##0c7f99}{#1}"),kP("\\tealA","\\textcolor{##94fff5}{#1}"),kP("\\tealB","\\textcolor{##26edd5}{#1}"),kP("\\tealC","\\textcolor{##01d1c1}{#1}"),kP("\\tealD","\\textcolor{##01a995}{#1}"),kP("\\tealE","\\textcolor{##208170}{#1}"),kP("\\greenA","\\textcolor{##b6ffb0}{#1}"),kP("\\greenB","\\textcolor{##8af281}{#1}"),kP("\\greenC","\\textcolor{##74cf70}{#1}"),kP("\\greenD","\\textcolor{##1fab54}{#1}"),kP("\\greenE","\\textcolor{##0d923f}{#1}"),kP("\\goldA","\\textcolor{##ffd0a9}{#1}"),kP("\\goldB","\\textcolor{##ffbb71}{#1}"),kP("\\goldC","\\textcolor{##ff9c39}{#1}"),kP("\\goldD","\\textcolor{##e07d10}{#1}"),kP("\\goldE","\\textcolor{##a75a05}{#1}"),kP("\\redA","\\textcolor{##fca9a9}{#1}"),kP("\\redB","\\textcolor{##ff8482}{#1}"),kP("\\redC","\\textcolor{##f9685d}{#1}"),kP("\\redD","\\textcolor{##e84d39}{#1}"),kP("\\redE","\\textcolor{##bc2612}{#1}"),kP("\\maroonA","\\textcolor{##ffbde0}{#1}"),kP("\\maroonB","\\textcolor{##ff92c6}{#1}"),kP("\\maroonC","\\textcolor{##ed5fa6}{#1}"),kP("\\maroonD","\\textcolor{##ca337c}{#1}"),kP("\\maroonE","\\textcolor{##9e034e}{#1}"),kP("\\purpleA","\\textcolor{##ddd7ff}{#1}"),kP("\\purpleB","\\textcolor{##c6b9fc}{#1}"),kP("\\purpleC","\\textcolor{##aa87ff}{#1}"),kP("\\purpleD","\\textcolor{##7854ab}{#1}"),kP("\\purpleE","\\textcolor{##543b78}{#1}"),kP("\\mintA","\\textcolor{##f5f9e8}{#1}"),kP("\\mintB","\\textcolor{##edf2df}{#1}"),kP("\\mintC","\\textcolor{##e0e5cc}{#1}"),kP("\\grayA","\\textcolor{##f6f7f7}{#1}"),kP("\\grayB","\\textcolor{##f0f1f2}{#1}"),kP("\\grayC","\\textcolor{##e3e5e6}{#1}"),kP("\\grayD","\\textcolor{##d6d8da}{#1}"),kP("\\grayE","\\textcolor{##babec2}{#1}"),kP("\\grayF","\\textcolor{##888d93}{#1}"),kP("\\grayG","\\textcolor{##626569}{#1}"),kP("\\grayH","\\textcolor{##3b3e40}{#1}"),kP("\\grayI","\\textcolor{##21242c}{#1}"),kP("\\kaBlue","\\textcolor{##314453}{#1}"),kP("\\kaGreen","\\textcolor{##71B307}{#1}");var TB={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},_B=class{static{o(this,"MacroExpander")}constructor(t,e,r){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 fB(mB,e.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new gB(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,r,n;if(t){if(this.consumeSpaces(),"["!==this.future().text)return null;e=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:e,end:r}=this.consumeArg());return this.pushToken(new XI("EOF",r.loc)),this.pushTokens(n),e.range(r,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(t){var e=[],r=t&&t.length>0;r||this.consumeSpaces();var n,i=this.future(),a=0,s=0;do{if(n=this.popToken(),e.push(n),"{"===n.text)++a;else if("}"===n.text){if(-1===--a)throw new KI("Extra }",n)}else if("EOF"===n.text)throw new KI("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",n);if(t&&r)if((0===a||1===a&&"{"===t[s])&&n.text===t[s]){if(++s===t.length){e.splice(-s,s);break}}else s=0}while(0!==a||r);return"{"===i.text&&"}"===e[e.length-1].text&&(e.pop(),e.shift()),e.reverse(),{tokens:e,start:i,end:n}}consumeArgs(t,e){if(e){if(e.length!==t+1)throw new KI("The length of delimiters doesn't match the number of args!");for(var r=e[0],n=0;n<r.length;n++){var i=this.popToken();if(r[n]!==i.text)throw new KI("Use of the macro doesn't match its definition",i)}}for(var a=[],s=0;s<t;s++)a.push(this.consumeArg(e&&e[s+1]).tokens);return a}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new KI("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var e=this.popToken(),r=e.text,n=e.noexpand?null:this._getExpansion(r);if(null==n||t&&n.unexpandable){if(t&&null==n&&"\\"===r[0]&&!this.isDefined(r))throw new KI("Undefined control sequence: "+r);return this.pushToken(e),!1}this.countExpansion(1);var i=n.tokens,a=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var o=i[s];if("#"===o.text){if(0===s)throw new KI("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 KI("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 XI(t)]):void 0}expandTokens(t){var e=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(!1===this.expandOnce(!0)){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),e.push(n)}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 r=this.lexer.catcodes[t];if(null!=r&&13!==r)return}var n="function"==typeof e?e(this):e;if("string"==typeof n){var i=0;if(-1!==n.indexOf("#"))for(var a=n.replace(/##/g,"");-1!==a.indexOf("#"+(i+1));)++i;for(var s=new gB(n,this.settings),o=[],l=s.lex();"EOF"!==l.text;)o.push(l),l=s.lex();return o.reverse(),{tokens:o,numArgs:i}}return n}isDefined(t){return this.macros.has(t)||dB.hasOwnProperty(t)||fM.math.hasOwnProperty(t)||fM.text.hasOwnProperty(t)||TB.hasOwnProperty(t)}isExpandable(t){var e=this.macros.get(t);return null!=e?"string"==typeof e||"function"==typeof e||!e.unexpandable:dB.hasOwnProperty(t)&&!dB[t].primitive}},EB=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,CB=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),SB={"́":{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"}},AB={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},LB=class t{static{o(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 _B(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 KI("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 XI("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=e,r}parseExpression(e,r){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==t.endOfExpression.indexOf(i.text))break;if(r&&i.text===r)break;if(e&&dB[i.text]&&dB[i.text].infix)break;var a=this.parseAtom(r);if(!a)break;"internal"!==a.type&&n.push(a)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(t){for(var e,r=-1,n=0;n<t.length;n++)if("infix"===t[n].type){if(-1!==r)throw new KI("only one infix operator per group",t[n].token);r=n,e=t[n].replaceWith}if(-1!==r&&e){var i,a,s=t.slice(0,r),o=t.slice(r+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},a=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},["\\\\abovefrac"===e?this.callFunction(e,[i,t[r],a],[]):this.callFunction(e,[i,a],[])]}return t}handleSupSubscript(t){var e=this.fetch(),r=e.text;this.consume(),this.consumeSpaces();var n=this.parseGroup(t);if(!n)throw new KI("Expected group after '"+r+"'",e);return n}formatUnsupportedCmd(t){for(var e=[],r=0;r<t.length;r++)e.push({type:"textord",mode:"text",text:t[r]});var n={type:"text",mode:this.mode,body:e};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[n]}}parseAtom(t){var e,r,n=this.parseGroup("atom",t);if("text"===this.mode)return n;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(n&&"op"===n.type){var a="\\limits"===i.text;n.limits=a,n.alwaysHandleSupSub=!0}else{if(!n||"operatorname"!==n.type)throw new KI("Limit controls must follow a math operator",i);n.alwaysHandleSupSub&&(n.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(e)throw new KI("Double superscript",i);e=this.handleSupSubscript("superscript")}else if("_"===i.text){if(r)throw new KI("Double subscript",i);r=this.handleSupSubscript("subscript")}else if("'"===i.text){if(e)throw new KI("Double superscript",i);var s={type:"textord",mode:this.mode,text:"\\prime"},o=[s];for(this.consume();"'"===this.fetch().text;)o.push(s),this.consume();"^"===this.fetch().text&&o.push(this.handleSupSubscript("superscript")),e={type:"ordgroup",mode:this.mode,body:o}}else{if(!CB[i.text])break;var l=EB.test(i.text),c=[];for(c.push(new XI(CB[i.text])),this.consume();;){var h=this.fetch().text;if(!CB[h])break;if(EB.test(h)!==l)break;c.unshift(new XI(CB[h])),this.consume()}var u=this.subparse(c);l?r={type:"ordgroup",mode:"math",body:u}:e={type:"ordgroup",mode:"math",body:u}}}return e||r?{type:"supsub",mode:this.mode,base:n,sup:e,sub:r}:n}parseFunction(t,e){var r=this.fetch(),n=r.text,i=dB[n];if(!i)return null;if(this.consume(),e&&"atom"!==e&&!i.allowedInArgument)throw new KI("Got function '"+n+"' with no arguments"+(e?" as "+e:""),r);if("text"===this.mode&&!i.allowedInText)throw new KI("Can't use function '"+n+"' in text mode",r);if("math"===this.mode&&!1===i.allowedInMath)throw new KI("Can't use function '"+n+"' in math mode",r);var{args:a,optArgs:s}=this.parseArguments(n,i);return this.callFunction(n,a,s,r,t)}callFunction(t,e,r,n,i){var a={funcName:t,parser:this,token:n,breakOnTokenText:i},s=dB[t];if(s&&s.handler)return s.handler(a,e,r);throw new KI("No function handler for "+t)}parseArguments(t,e){var r=e.numArgs+e.numOptionalArgs;if(0===r)return{args:[],optArgs:[]};for(var n=[],i=[],a=0;a<r;a++){var s=e.argTypes&&e.argTypes[a],o=a<e.numOptionalArgs;(e.primitive&&null==s||"sqrt"===e.type&&1===a&&null==i[0])&&(s="primitive");var l=this.parseGroupOfType("argument to '"+t+"'",s,o);if(o)i.push(l);else{if(null==l)throw new KI("Null argument, please report this as a bug");n.push(l)}}return{args:n,optArgs:i}}parseGroupOfType(t,e,r){switch(e){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,e);case"hbox":var n=this.parseArgumentGroup(r,"text");return null!=n?{type:"styling",mode:n.mode,body:[n],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",r);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(r)throw new KI("A primitive argument cannot be optional");var a=this.parseGroup(t);if(null==a)throw new KI("Expected group as "+t,this.fetch());return a;case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new KI("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(t,e){var r=this.gullet.scanArgument(e);if(null==r)return null;for(var n,i="";"EOF"!==(n=this.fetch()).text;)i+=n.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(t,e){for(var r,n=this.fetch(),i=n,a="";"EOF"!==(r=this.fetch()).text&&t.test(a+r.text);)a+=(i=r).text,this.consume();if(""===a)throw new KI("Invalid "+e+": '"+n.text+"'",n);return n.range(i,a)}parseColorGroup(t){var e=this.parseStringGroup("color",t);if(null==e)return null;var r=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(e.text);if(!r)throw new KI("Invalid color: '"+e.text+"'",e);var n=r[0];return/^[0-9a-f]{6}$/i.test(n)&&(n="#"+n),{type:"color-token",mode:this.mode,color:n}}parseSizeGroup(t){var e,r=!1;if(this.gullet.consumeSpaces(),!(e=t||"{"===this.gullet.future().text?this.parseStringGroup("size",t):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;t||0!==e.text.length||(e.text="0pt",r=!0);var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e.text);if(!n)throw new KI("Invalid size: '"+e.text+"'",e);var i={number:+(n[1]+n[2]),unit:n[3]};if(!KR(i))throw new KI("Invalid unit: '"+i.unit+"'",e);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var e=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==e)return null;var r=e.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,e){var r=this.gullet.scanArgument(t);if(null==r)return null;var n=this.mode;e&&this.switchMode(e),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var a={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return e&&this.switchMode(n),a}parseGroup(t,e){var r,n=this.fetch(),i=n.text;if("{"===i||"\\begingroup"===i){this.consume();var a="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,a),o=this.fetch();this.expect(a),this.gullet.endGroup(),r={type:"ordgroup",mode:this.mode,loc:VI.range(n,o),body:s,semisimple:"\\begingroup"===i||void 0}}else if(null==(r=this.parseFunction(e,t)||this.parseSymbol())&&"\\"===i[0]&&!TB.hasOwnProperty(i)){if(this.settings.throwOnError)throw new KI("Undefined control sequence: "+i,n);r=this.formatUnsupportedCmd(i),this.consume()}return r}formLigatures(t){for(var e=t.length-1,r=0;r<e;++r){var n=t[r],i=n.text;"-"===i&&"-"===t[r+1].text&&(r+1<e&&"-"===t[r+2].text?(t.splice(r,3,{type:"textord",mode:"text",loc:VI.range(n,t[r+2]),text:"---"}),e-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:VI.range(n,t[r+1]),text:"--"}),e-=1)),"'"!==i&&"`"!==i||t[r+1].text!==i||(t.splice(r,2,{type:"textord",mode:"text",loc:VI.range(n,t[r+1]),text:i+i}),e-=1)}}parseSymbol(){var t=this.fetch(),e=t.text;if(/^\\verb[^a-zA-Z]/.test(e)){this.consume();var r=e.slice(5),n="*"===r.charAt(0);if(n&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new KI("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:r=r.slice(1,-1),star:n}}AB.hasOwnProperty(e[0])&&!fM[this.mode][e[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+e[0]+'" used in math mode',t),e=AB[e[0]]+e.slice(1));var i,a=pB.exec(e);if(a&&("i"===(e=e.substring(0,a.index))?e="ı":"j"===e&&(e="ȷ")),fM[this.mode][e]){this.settings.strict&&"math"===this.mode&&XM.indexOf(e)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var s,o=fM[this.mode][e].group,l=VI.range(t);if(pM.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&&(TR(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:VI.range(t),text:e}}if(this.consume(),a)for(var h=0;h<a[0].length;h++){var u=a[0][h];if(!SB[u])throw new KI("Unknown accent ' "+u+"'",t);var d=SB[u][this.mode]||SB[u].text;if(!d)throw new KI("Accent "+u+" unsupported in "+this.mode+" mode",t);i={type:"accent",mode:this.mode,loc:VI.range(t),label:d,isStretchy:!1,isShifty:!0,base:i}}return i}};LB.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var NB=o((function(t,e){if(!("string"==typeof t||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new LB(t,e);delete r.gullet.macros.current["\\df@tag"];var n=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new KI("\\tag works only in display equations");n=[{type:"tag",mode:"text",body:n,tag:r.subparse([new XI("\\df@tag")])}]}return n}),"parseTree"),IB=o((function(t,e,r){e.textContent="";var n=OB(t,r).toNode();e.appendChild(n)}),"render");"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),IB=o((function(){throw new KI("KaTeX doesn't work in quirks mode.")}),"render"));var RB=o((function(t,e){return OB(t,e).toMarkup()}),"renderToString"),MB=o((function(t,e){var r=new hR(e);return NB(t,r)}),"generateParseTree"),DB=o((function(t,e,r){if(r.throwOnError||!(t instanceof KI))throw t;var n=bD.makeSpan(["katex-error"],[new oM(e)]);return n.setAttribute("title",t.toString()),n.setAttribute("style","color:"+r.errorColor),n}),"renderError"),OB=o((function(t,e){var r=new hR(e);try{var n=NB(t,r);return oO(n,t,r)}catch(e){return DB(e,t,r)}}),"renderToDomTree"),PB=o((function(t,e){var r=new hR(e);try{var n=NB(t,r);return lO(n,t,r)}catch(e){return DB(e,t,r)}}),"renderToHTMLTree"),BB={version:"0.16.11",render:IB,renderToString:RB,ParseError:KI,SETTINGS_SCHEMA:lR,__parse:MB,__renderToDomTree:OB,__renderToHTMLTree:PB,__setFontMetrics:zR,__defineSymbol:mM,__defineFunction:LD,__defineMacro:kP,__domTree:{Span:nM,Anchor:iM,SymbolNode:oM,SvgNode:lM,PathNode:cM,LineNode:hM}},$B=Object.freeze({__proto__:null,default:BB});function FB(t){return Mb(t)?bw(t):FA(t)}o(FB,"keys");var zB=FB;function UB(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}o(UB,"arrayEach");var GB=UB;function qB(t,e){return t&&dw(e,zB(e),t)}o(qB,"baseAssign");var jB=qB;function WB(t,e){return t&&dw(e,Sw(e),t)}o(WB,"baseAssignIn");var YB=WB;function HB(t,e){for(var r=-1,n=null==t?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}o(HB,"arrayFilter");var VB=HB;function XB(){return[]}o(XB,"stubArray");var KB=XB,ZB=Object.prototype.propertyIsEnumerable,QB=Object.getOwnPropertySymbols,JB=QB?function(t){return null==t?[]:(t=Object(t),VB(QB(t),(function(e){return ZB.call(t,e)})))}:KB,t$=JB;function e$(t,e){return dw(t,t$(t),e)}o(e$,"copySymbols");var r$=e$;function n$(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}o(n$,"arrayPush");var i$=n$,a$=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)i$(e,t$(t)),t=gb(t);return e}:KB,s$=a$;function o$(t,e){return dw(t,s$(t),e)}o(o$,"copySymbolsIn");var l$=o$;function c$(t,e,r){var n=e(t);return Lb(t)?n:i$(n,r(t))}o(c$,"baseGetAllKeys");var h$=c$;function u$(t){return h$(t,zB,t$)}o(u$,"getAllKeys");var d$=u$;function p$(t){return h$(t,Sw,s$)}o(p$,"getAllKeysIn");var g$=p$,f$=Object.prototype.hasOwnProperty;function m$(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&f$.call(t,"index")&&(r.index=t.index,r.input=t.input),r}o(m$,"initCloneArray");var y$=m$;function v$(t,e){var r=e?ib(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}o(v$,"cloneDataView");var x$=v$,b$=/\w*$/;function w$(t){var e=new t.constructor(t.source,b$.exec(t));return e.lastIndex=t.lastIndex,e}o(w$,"cloneRegExp");var k$=w$,T$=Xy?Xy.prototype:void 0,_$=T$?T$.valueOf:void 0;function E$(t){return _$?Object(_$.call(t)):{}}o(E$,"cloneSymbol");var C$=E$;function S$(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return ib(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return x$(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return sb(t,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return k$(t);case"[object Symbol]":return C$(t)}}o(S$,"initCloneByTag");var A$=S$;function L$(t){return wb(t)&&"[object Map]"==eL(t)}o(L$,"baseIsMap");var N$=L$,I$=nw&&nw.isMap,R$=I$?Jb(I$):N$;function M$(t){return wb(t)&&"[object Set]"==eL(t)}o(M$,"baseIsSet");var D$=M$,O$=nw&&nw.isSet,P$=O$?Jb(O$):D$,B$="[object Arguments]",$$="[object Function]",F$="[object Object]",z$={};function U$(t,e,r,n,i,a){var s,o=1&e,l=2&e,c=4&e;if(r&&(s=i?r(t,n,i,a):r(t)),void 0!==s)return s;if(!cv(t))return t;var h=Lb(t);if(h){if(s=y$(t),!o)return lb(t,s)}else{var u=eL(t),d=u==$$||"[object GeneratorFunction]"==u;if(Ub(t))return eb(t,o);if(u==F$||u==B$||d&&!i){if(s=l||d?{}:xb(t),!o)return l?l$(t,YB(s,t)):r$(t,jB(s,t))}else{if(!z$[u])return i?t:{};s=A$(t,u,o)}}a||(a=new Gx);var p=a.get(t);if(p)return p;a.set(t,s),P$(t)?t.forEach((function(n){s.add(U$(n,e,r,n,t,a))})):R$(t)&&t.forEach((function(n,i){s.set(i,U$(n,e,r,i,t,a))}));var g=h?void 0:(c?l?g$:d$:l?Sw:zB)(t);return GB(g||t,(function(n,i){g&&(n=t[i=n]),hw(s,i,U$(n,e,r,i,t,a))})),s}z$[B$]=z$["[object Array]"]=z$["[object ArrayBuffer]"]=z$["[object DataView]"]=z$["[object Boolean]"]=z$["[object Date]"]=z$["[object Float32Array]"]=z$["[object Float64Array]"]=z$["[object Int8Array]"]=z$["[object Int16Array]"]=z$["[object Int32Array]"]=z$["[object Map]"]=z$["[object Number]"]=z$[F$]=z$["[object RegExp]"]=z$["[object Set]"]=z$["[object String]"]=z$["[object Symbol]"]=z$["[object Uint8Array]"]=z$["[object Uint8ClampedArray]"]=z$["[object Uint16Array]"]=z$["[object Uint32Array]"]=!0,z$["[object Error]"]=z$[$$]=z$["[object WeakMap]"]=!1,o(U$,"baseClone");var G$=U$;function q$(t){return G$(t,4)}o(q$,"clone");var j$=q$,W$=Object.prototype,Y$=W$.hasOwnProperty,H$=Hw((function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Xw(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=Sw(a),o=-1,l=s.length;++o<l;){var c=s[o],h=t[c];(void 0===h||Kv(h,W$[c])&&!Y$.call(t,c))&&(t[c]=a[c])}return t})),V$=H$;function X$(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}o(X$,"last");var K$=X$;function Z$(t,e){return t&&Xx(t,e,zB)}o(Z$,"baseForOwn");var Q$=Z$;function J$(t,e){return function(r,n){if(null==r)return r;if(!Mb(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a<i)&&!1!==n(s[a],a,s););return r}}o(J$,"createBaseEach");var tF=J$(Q$);function eF(t){return"function"==typeof t?t:Ow}o(eF,"castFunction");var rF=eF;function nF(t,e){return(Lb(t)?GB:tF)(t,rF(e))}o(nF,"forEach");var iF=nF;function aF(t,e){var r=[];return tF(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}o(aF,"baseFilter");var sF=aF;function oF(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}o(oF,"setCacheAdd");var lF=oF;function cF(t){return this.__data__.has(t)}o(cF,"setCacheHas");var hF=cF;function uF(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Cx;++e<r;)this.add(t[e])}o(uF,"SetCache"),uF.prototype.add=uF.prototype.push=lF,uF.prototype.has=hF;var dF=uF;function pF(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}o(pF,"arraySome");var gF=pF;function fF(t,e){return t.has(e)}o(fF,"cacheHas");var mF=fF;function yF(t,e,r,n,i,a){var s=1&r,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))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&r?new dF:void 0;for(a.set(t,e),a.set(e,t);++u<o;){var g=t[u],f=e[u];if(n)var m=s?n(f,g,u,e,t,a):n(g,f,u,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!gF(e,(function(t,e){if(!mF(p,e)&&(g===t||i(g,t,r,n,a)))return p.push(e)}))){d=!1;break}}else if(g!==f&&!i(g,f,r,n,a)){d=!1;break}}return a.delete(t),a.delete(e),d}o(yF,"equalArrays");var vF=yF;function xF(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}o(xF,"mapToArray");var bF=xF;function wF(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}o(wF,"setToArray");var kF=wF,TF=Xy?Xy.prototype:void 0,_F=TF?TF.valueOf:void 0;function EF(t,e,r,n,i,a,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new rb(t),new rb(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Kv(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var o=bF;case"[object Set]":var l=1&n;if(o||(o=kF),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var h=vF(o(t),o(e),n,i,a,s);return s.delete(t),h;case"[object Symbol]":if(_F)return _F.call(t)==_F.call(e)}return!1}o(EF,"equalByTag");var CF=EF,SF=Object.prototype.hasOwnProperty;function AF(t,e,r,n,i,a){var s=1&r,o=d$(t),l=o.length;if(l!=d$(e).length&&!s)return!1;for(var c=l;c--;){var h=o[c];if(!(s?h in e:SF.call(e,h)))return!1}var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var g=s;++c<l;){var f=t[h=o[c]],m=e[h];if(n)var y=s?n(m,f,h,e,t,a):n(f,m,h,t,e,a);if(!(void 0===y?f===m||i(f,m,r,n,a):y)){p=!1;break}g||(g="constructor"==h)}if(p&&!g){var v=t.constructor,x=e.constructor;v==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(p=!1)}return a.delete(t),a.delete(e),p}o(AF,"equalObjects");var LF=AF,NF="[object Arguments]",IF="[object Array]",RF="[object Object]",MF=Object.prototype.hasOwnProperty;function DF(t,e,r,n,i,a){var s=Lb(t),o=Lb(e),l=s?IF:eL(t),c=o?IF:eL(e),h=(l=l==NF?RF:l)==RF,u=(c=c==NF?RF:c)==RF,d=l==c;if(d&&Ub(t)){if(!Ub(e))return!1;s=!0,h=!1}if(d&&!h)return a||(a=new Gx),s||aw(t)?vF(t,e,r,n,i,a):CF(t,e,l,r,n,i,a);if(!(1&r)){var p=h&&MF.call(t,"__wrapped__"),g=u&&MF.call(e,"__wrapped__");if(p||g){var f=p?t.value():t,m=g?e.value():e;return a||(a=new Gx),i(f,m,r,n,a)}}return!!d&&(a||(a=new Gx),LF(t,e,r,n,i,a))}o(DF,"baseIsEqualDeep");var OF=DF;function PF(t,e,r,n,i){return t===e||(null==t||null==e||!wb(t)&&!wb(e)?t!=t&&e!=e:OF(t,e,r,n,PF,i))}o(PF,"baseIsEqual");var BF=PF;function $F(t,e,r,n){var i=r.length,a=i,s=!n;if(null==t)return!a;for(t=Object(t);i--;){var o=r[i];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){var l=(o=r[i])[0],c=t[l],h=o[1];if(s&&o[2]){if(void 0===c&&!(l in t))return!1}else{var u=new Gx;if(n)var d=n(c,h,l,t,e,u);if(!(void 0===d?BF(h,c,3,n,u):d))return!1}}return!0}o($F,"baseIsMatch");var FF=$F;function zF(t){return t==t&&!cv(t)}o(zF,"isStrictComparable");var UF=zF;function GF(t){for(var e=zB(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,UF(i)]}return e}o(GF,"getMatchData");var qF=GF;function jF(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}o(jF,"matchesStrictComparable");var WF=jF;function YF(t){var e=qF(t);return 1==e.length&&e[0][2]?WF(e[0][0],e[0][1]):function(r){return r===t||FF(r,t,e)}}o(YF,"baseMatches");var HF=YF;function VF(t){return"symbol"==typeof t||wb(t)&&"[object Symbol]"==ov(t)}o(VF,"isSymbol");var XF=VF,KF=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZF=/^\w*$/;function QF(t,e){if(Lb(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!XF(t))||(ZF.test(t)||!KF.test(t)||null!=e&&t in Object(e))}o(QF,"isKey");var JF=QF;function tz(t){var e=Ax(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}o(tz,"memoizeCapped");var ez=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rz=/\\(\\)?/g,nz=tz((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ez,(function(t,r,n,i){e.push(n?i.replace(rz,"$1"):r||t)})),e})),iz=nz;function az(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}o(az,"arrayMap");var sz=az,oz=Xy?Xy.prototype:void 0,lz=oz?oz.toString:void 0;function cz(t){if("string"==typeof t)return t;if(Lb(t))return sz(t,cz)+"";if(XF(t))return lz?lz.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}o(cz,"baseToString");var hz=cz;function uz(t){return null==t?"":hz(t)}o(uz,"toString");var dz=uz;function pz(t,e){return Lb(t)?t:JF(t,e)?[t]:iz(dz(t))}o(pz,"castPath");var gz=pz;function fz(t){if("string"==typeof t||XF(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}o(fz,"toKey");var mz=fz;function yz(t,e){for(var r=0,n=(e=gz(e,t)).length;null!=t&&r<n;)t=t[mz(e[r++])];return r&&r==n?t:void 0}o(yz,"baseGet");var vz=yz;function xz(t,e,r){var n=null==t?void 0:vz(t,e);return void 0===n?r:n}o(xz,"get");var bz=xz;function wz(t,e){return null!=t&&e in Object(t)}o(wz,"baseHasIn");var kz=wz;function Tz(t,e,r){for(var n=-1,i=(e=gz(e,t)).length,a=!1;++n<i;){var s=mz(e[n]);if(!(a=null!=t&&r(t,s)))break;t=t[s]}return a||++n!=i?a:!!(i=null==t?0:t.length)&&Ib(i)&&yw(s,i)&&(Lb(t)||Ab(t))}o(Tz,"hasPath");var _z=Tz;function Ez(t,e){return null!=t&&_z(t,e,kz)}o(Ez,"hasIn");var Cz=Ez;function Sz(t,e){return JF(t)&&UF(e)?WF(mz(t),e):function(r){var n=bz(r,t);return void 0===n&&n===e?Cz(r,t):BF(e,n,3)}}o(Sz,"baseMatchesProperty");var Az=Sz;function Lz(t){return function(e){return null==e?void 0:e[t]}}o(Lz,"baseProperty");var Nz=Lz;function Iz(t){return function(e){return vz(e,t)}}o(Iz,"basePropertyDeep");var Rz=Iz;function Mz(t){return JF(t)?Nz(mz(t)):Rz(t)}o(Mz,"property");var Dz=Mz;function Oz(t){return"function"==typeof t?t:null==t?Ow:"object"==typeof t?Lb(t)?Az(t[0],t[1]):HF(t):Dz(t)}o(Oz,"baseIteratee");var Pz=Oz;function Bz(t,e){return(Lb(t)?VB:sF)(t,Pz(e))}o(Bz,"filter");var $z=Bz;function Fz(t,e){var r=-1,n=Mb(t)?Array(t.length):[];return tF(t,(function(t,i,a){n[++r]=e(t,i,a)})),n}o(Fz,"baseMap");var zz=Fz;function Uz(t,e){return(Lb(t)?sz:zz)(t,Pz(e))}o(Uz,"map");var Gz=Uz;function qz(t,e){return sz(e,(function(e){return t[e]}))}o(qz,"baseValues");var jz=qz;function Wz(t){return null==t?[]:jz(t,zB(t))}o(Wz,"values");var Yz=Wz;function Hz(t){return void 0===t}o(Hz,"isUndefined");var Vz=Hz;function Xz(t,e){var r={};return e=Pz(e),Q$(t,(function(t,n,i){Wx(r,n,e(t,n,i))})),r}o(Xz,"mapValues");var Kz=Xz;function Zz(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],s=e(a);if(null!=s&&(void 0===o?s==s&&!XF(s):r(s,o)))var o=s,l=a}return l}o(Zz,"baseExtremum");var Qz=Zz;function Jz(t,e){return t>e}o(Jz,"baseGt");var tU=Jz;function eU(t){return t&&t.length?Qz(t,Ow,tU):void 0}o(eU,"max");var rU=eU;function nU(t,e,r,n){if(!cv(t))return t;for(var i=-1,a=(e=gz(e,t)).length,s=a-1,o=t;null!=o&&++i<a;){var l=mz(e[i]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var h=o[l];void 0===(c=n?n(h,l,o):void 0)&&(c=cv(h)?h:yw(e[i+1])?[]:{})}hw(o,l,c),o=o[l]}return t}o(nU,"baseSet");var iU=nU;function aU(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=vz(t,s);r(o,s)&&iU(a,gz(s,t),o)}return a}o(aU,"basePickBy");var sU=aU;function oU(t,e){return sU(t,e,(function(e,r){return Cz(t,r)}))}o(oU,"basePick");var lU=oU,cU=Xy?Xy.isConcatSpreadable:void 0;function hU(t){return Lb(t)||Ab(t)||!!(cU&&t&&t[cU])}o(hU,"isFlattenable");var uU=hU;function dU(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=uU),i||(i=[]);++a<s;){var o=t[a];e>0&&r(o)?e>1?dU(o,e-1,r,n,i):i$(i,o):n||(i[i.length]=o)}return i}o(dU,"baseFlatten");var pU=dU;function gU(t){return(null==t?0:t.length)?pU(t,1):[]}o(gU,"flatten");var fU=gU;function mU(t){return Ww(zw(t,void 0,fU),t+"")}o(mU,"flatRest");var yU=mU((function(t,e){return null==t?{}:lU(t,e)})),vU=yU;function xU(t,e,r,n){var i=-1,a=null==t?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}o(xU,"arrayReduce");var bU=xU;function wU(t,e,r,n,i){return i(t,(function(t,i,a){r=n?(n=!1,t):e(r,t,i,a)})),r}o(wU,"baseReduce");var kU=wU;function TU(t,e,r){var n=Lb(t)?bU:kU,i=arguments.length<3;return n(t,Pz(e),r,i,tF)}o(TU,"reduce");var _U=TU;function EU(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}o(EU,"baseFindIndex");var CU=EU;function SU(t){return t!=t}o(SU,"baseIsNaN");var AU=SU;function LU(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}o(LU,"strictIndexOf");var NU=LU;function IU(t,e,r){return e==e?NU(t,e,r):CU(t,AU,r)}o(IU,"baseIndexOf");var RU=IU;function MU(t,e){return!!(null==t?0:t.length)&&RU(t,e,0)>-1}o(MU,"arrayIncludes");var DU=MU;function OU(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}o(OU,"arrayIncludesWith");var PU=OU;function BU(){}o(BU,"noop");var $U=BU,FU=GA&&1/kF(new GA([,-0]))[1]==1/0?function(t){return new GA(t)}:$U;function zU(t,e,r){var n=-1,i=DU,a=t.length,s=!0,o=[],l=o;if(r)s=!1,i=PU;else if(a>=200){var c=e?null:FU(t);if(c)return kF(c);s=!1,i=mF,l=new dF}else l=e?[]:o;t:for(;++n<a;){var h=t[n],u=e?e(h):h;if(h=r||0!==h?h:0,s&&u==u){for(var d=l.length;d--;)if(l[d]===u)continue t;e&&l.push(u),o.push(h)}else i(l,u,r)||(l!==o&&l.push(u),o.push(h))}return o}o(zU,"baseUniq");var UU=zU,GU=Hw((function(t){return UU(pU(t,1,Ob,!0))})),qU=/\s/;function jU(t){for(var e=t.length;e--&&qU.test(t.charAt(e)););return e}o(jU,"trimmedEndIndex");var WU=jU,YU=/^\s+/;function HU(t){return t?t.slice(0,WU(t)+1).replace(YU,""):t}o(HU,"baseTrim");var VU=HU,XU=/^[-+]0x[0-9a-f]+$/i,KU=/^0b[01]+$/i,ZU=/^0o[0-7]+$/i,QU=parseInt;function JU(t){if("number"==typeof t)return t;if(XF(t))return NaN;if(cv(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=cv(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=VU(t);var r=KU.test(t);return r||ZU.test(t)?QU(t.slice(2),r?2:8):XU.test(t)?NaN:+t}o(JU,"toNumber");var tG=JU,eG=1/0;function rG(t){return t?(t=tG(t))===eG||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}o(rG,"toFinite");var nG=rG;function iG(t){var e=nG(t),r=e%1;return e==e?r?e-r:e:0}o(iG,"toInteger");var aG=iG,sG=Object.prototype.hasOwnProperty,oG=Zw((function(t,e){if(yb(e)||Mb(e))dw(e,zB(e),t);else for(var r in e)sG.call(e,r)&&hw(t,r,e[r])})),lG=oG;function cG(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}o(cG,"baseSlice");var hG=cG,uG=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function dG(t){return uG.test(t)}o(dG,"hasUnicode");var pG=dG;function gG(t){return G$(t,5)}o(gG,"cloneDeep");var fG=gG;function mG(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}o(mG,"compact");var yG=mG;function vG(t,e,r,n){for(var i=-1,a=null==t?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}o(vG,"arrayAggregator");var xG=vG;function bG(t,e,r,n){return tF(t,(function(t,i,a){e(n,t,r(t),a)})),n}o(bG,"baseAggregator");var wG=bG;function kG(t,e){return function(r,n){var i=Lb(r)?xG:wG,a=e?e():{};return i(r,t,Pz(n),a)}}o(kG,"createAggregator");var TG=kG,_G=o((function(){return Vy.Date.now()}),"now");function EG(t,e,r,n){var i=-1,a=DU,s=!0,o=t.length,l=[],c=e.length;if(!o)return l;r&&(e=sz(e,Jb(r))),n?(a=PU,s=!1):e.length>=200&&(a=mF,s=!1,e=new dF(e));t:for(;++i<o;){var h=t[i],u=null==r?h:r(h);if(h=n||0!==h?h:0,s&&u==u){for(var d=c;d--;)if(e[d]===u)continue t;l.push(h)}else a(e,u,n)||l.push(h)}return l}o(EG,"baseDifference");var CG=EG,SG=Hw((function(t,e){return Ob(t)?CG(t,pU(e,1,Ob,!0)):[]})),AG=SG;function LG(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:aG(e),hG(t,e<0?0:e,n)):[]}o(LG,"drop");var NG=LG;function IG(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:aG(e),hG(t,0,(e=n-e)<0?0:e)):[]}o(IG,"dropRight");var RG=IG;function MG(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}o(MG,"arrayEvery");var DG=MG;function OG(t,e){var r=!0;return tF(t,(function(t,n,i){return r=!!e(t,n,i)})),r}o(OG,"baseEvery");var PG=OG;function BG(t,e,r){var n=Lb(t)?DG:PG;return r&&Xw(t,e,r)&&(e=void 0),n(t,Pz(e))}o(BG,"every");var $G=BG;function FG(t){return function(e,r,n){var i=Object(e);if(!Mb(e)){var a=Pz(r);e=zB(e),r=o((function(t){return a(i[t],t,i)}),"predicate")}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}o(FG,"createFind");var zG=FG,UG=Math.max;function GG(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:aG(r);return i<0&&(i=UG(n+i,0)),CU(t,Pz(e),i)}o(GG,"findIndex");var qG=zG(GG);function jG(t){return t&&t.length?t[0]:void 0}o(jG,"head");var WG=jG;function YG(t,e){return pU(Gz(t,e),1)}o(YG,"flatMap");var HG=YG;function VG(t,e){return null==t?t:Xx(t,rF(e),Sw)}o(VG,"forIn");var XG=VG;function KG(t,e){return t&&Q$(t,rF(e))}o(KG,"forOwn");var ZG=KG,QG=Object.prototype.hasOwnProperty,JG=TG((function(t,e,r){QG.call(t,r)?t[r].push(e):Wx(t,r,[e])})),tq=JG,eq=Object.prototype.hasOwnProperty;function rq(t,e){return null!=t&&eq.call(t,e)}o(rq,"baseHas");var nq=rq;function iq(t,e){return null!=t&&_z(t,e,nq)}o(iq,"has");var aq=iq;function sq(t){return"string"==typeof t||!Lb(t)&&wb(t)&&"[object String]"==ov(t)}o(sq,"isString");var oq=sq,lq=Math.max;function cq(t,e,r,n){t=Mb(t)?t:Yz(t),r=r&&!n?aG(r):0;var i=t.length;return r<0&&(r=lq(i+r,0)),oq(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&RU(t,e,r)>-1}o(cq,"includes");var hq=cq,uq=Math.max;function dq(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:aG(r);return i<0&&(i=uq(n+i,0)),RU(t,e,i)}o(dq,"indexOf");var pq=dq;function gq(t){return wb(t)&&"[object RegExp]"==ov(t)}o(gq,"baseIsRegExp");var fq=gq,mq=nw&&nw.isRegExp,yq=mq?Jb(mq):fq;function vq(t,e){return t<e}o(vq,"baseLt");var xq=vq;function bq(t){return t&&t.length?Qz(t,Ow,xq):void 0}o(bq,"min");var wq=bq;function kq(t,e){return t&&t.length?Qz(t,Pz(e),xq):void 0}o(kq,"minBy");var Tq=kq;function _q(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}o(_q,"negate");var Eq=_q;function Cq(t,e){if(null==t)return{};var r=sz(g$(t),(function(t){return[t]}));return e=Pz(e),sU(t,r,(function(t,r){return e(t,r[0])}))}o(Cq,"pickBy");var Sq=Cq;function Aq(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}o(Aq,"baseSortBy");var Lq=Aq;function Nq(t,e){if(t!==e){var r=void 0!==t,n=null===t,i=t==t,a=XF(t),s=void 0!==e,o=null===e,l=e==e,c=XF(e);if(!o&&!c&&!a&&t>e||a&&s&&l&&!o&&!c||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!c&&t<e||c&&r&&i&&!n&&!a||o&&r&&i||!s&&i||!l)return-1}return 0}o(Nq,"compareAscending");var Iq=Nq;function Rq(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,s=i.length,o=r.length;++n<s;){var l=Iq(i[n],a[n]);if(l)return n>=o?l:l*("desc"==r[n]?-1:1)}return t.index-e.index}o(Rq,"compareMultiple");var Mq=Rq;function Dq(t,e,r){e=e.length?sz(e,(function(t){return Lb(t)?function(e){return vz(e,1===t.length?t[0]:t)}:t})):[Ow];var n=-1;e=sz(e,Jb(Pz));var i=zz(t,(function(t,r,i){return{criteria:sz(e,(function(e){return e(t)})),index:++n,value:t}}));return Lq(i,(function(t,e){return Mq(t,e,r)}))}o(Dq,"baseOrderBy");var Oq=Dq,Pq=Nz("length"),Bq="[\\ud800-\\udfff]",$q="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Fq="\\ud83c[\\udffb-\\udfff]",zq="[^\\ud800-\\udfff]",Uq="(?:\\ud83c[\\udde6-\\uddff]){2}",Gq="[\\ud800-\\udbff][\\udc00-\\udfff]",qq="(?:"+$q+"|"+Fq+")"+"?",jq="[\\ufe0e\\ufe0f]?",Wq=jq+qq+("(?:\\u200d(?:"+[zq,Uq,Gq].join("|")+")"+jq+qq+")*"),Yq="(?:"+[zq+$q+"?",$q,Uq,Gq,Bq].join("|")+")",Hq=RegExp(Fq+"(?="+Fq+")|"+Yq+Wq,"g");function Vq(t){for(var e=Hq.lastIndex=0;Hq.test(t);)++e;return e}o(Vq,"unicodeSize");var Xq=Vq;function Kq(t){return pG(t)?Xq(t):Pq(t)}o(Kq,"stringSize");var Zq=Kq,Qq=Math.ceil,Jq=Math.max;function tj(t,e,r,n){for(var i=-1,a=Jq(Qq((e-t)/(r||1)),0),s=Array(a);a--;)s[n?a:++i]=t,t+=r;return s}o(tj,"baseRange");var ej=tj;function rj(t){return function(e,r,n){return n&&"number"!=typeof n&&Xw(e,r,n)&&(r=n=void 0),e=nG(e),void 0===r?(r=e,e=0):r=nG(r),n=void 0===n?e<r?1:-1:nG(n),ej(e,r,n,t)}}o(rj,"createRange");var nj=rj();function ij(t,e){return(Lb(t)?VB:sF)(t,Eq(Pz(e)))}o(ij,"reject");var aj=ij;function sj(t){if(null==t)return 0;if(Mb(t))return oq(t)?Zq(t):t.length;var e=eL(t);return"[object Map]"==e||"[object Set]"==e?t.size:FA(t).length}o(sj,"size");var oj=sj;function lj(t,e){var r;return tF(t,(function(t,n,i){return!(r=e(t,n,i))})),!!r}o(lj,"baseSome");var cj=lj;function hj(t,e,r){var n=Lb(t)?gF:cj;return r&&Xw(t,e,r)&&(e=void 0),n(t,Pz(e))}o(hj,"some");var uj=hj,dj=Hw((function(t,e){if(null==t)return[];var r=e.length;return r>1&&Xw(t,e[0],e[1])?e=[]:r>2&&Xw(e[0],e[1],e[2])&&(e=[e[0]]),Oq(t,pU(e,1),[])})),pj=dj;function gj(t){return t&&t.length?UU(t):[]}o(gj,"uniq");var fj=gj;function mj(t,e){return t&&t.length?UU(t,Pz(e)):[]}o(mj,"uniqBy");var yj=mj,vj=0;function xj(t){var e=++vj;return dz(t)+e}o(xj,"uniqueId");var bj=xj;function wj(t,e,r){for(var n=-1,i=t.length,a=e.length,s={};++n<i;){var o=n<a?e[n]:void 0;r(s,t[n],o)}return s}o(wj,"baseZipObject");var kj=wj;function Tj(t,e){return kj(t||[],e||[],hw)}o(Tj,"zipObject");var _j=Tj,Ej="\0",Cj=class{static{o(this,"Graph")}constructor(t={}){this._isDirected=!Object.prototype.hasOwnProperty.call(t,"directed")||t.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=Nx(void 0),this._defaultEdgeLabelFn=Nx(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return dv(t)||(t=Nx(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return zB(this._nodes)}sources(){var t=this;return $z(this.nodes(),(function(e){return iL(t._in[e])}))}sinks(){var t=this;return $z(this.nodes(),(function(e){return iL(t._out[e])}))}setNodes(t,e){var r=arguments,n=this;return iF(t,(function(t){r.length>1?n.setNode(t,e):n.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]=Ej,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=o((t=>this.removeEdge(this._edgeObjs[t])),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],iF(this.children(t),(t=>{this.setParent(t)})),delete this._children[t]),iF(zB(this._in[t]),e),delete this._in[t],delete this._preds[t],iF(zB(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(Vz(e))e=Ej;else{for(var r=e+="";!Vz(r);r=this.parent(r))if(r===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(e!==Ej)return e}}children(t){if(Vz(t)&&(t=Ej),this._isCompound){var e=this._children[t];if(e)return zB(e)}else{if(t===Ej)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return zB(e)}successors(t){var e=this._sucs[t];if(e)return zB(e)}neighbors(t){var e=this.predecessors(t);if(e)return GU(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 r=this;iF(this._nodes,(function(r,n){t(n)&&e.setNode(n,r)})),iF(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))}));var n={};function i(t){var a=r.parent(t);return void 0===a||e.hasNode(a)?(n[t]=a,a):a in n?n[a]:i(a)}return o(i,"findParent"),this._isCompound&&iF(e.nodes(),(function(t){e.setParent(t,i(t))})),e}setDefaultEdgeLabel(t){return dv(t)||(t=Nx(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Yz(this._edgeObjs)}setPath(t,e){var r=this,n=arguments;return _U(t,(function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i})),this}setEdge(){var t,e,r,n,i=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(t=a.v,e=a.w,r=a.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=a,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,Vz(r)||(r=""+r);var s=Lj(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return i&&(this._edgeLabels[s]=n),this;if(!Vz(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[s]=i?n:this._defaultEdgeLabelFn(t,e,r);var o=Nj(this._isDirected,t,e,r);return t=o.v,e=o.w,Object.freeze(o),this._edgeObjs[s]=o,Sj(this._preds[e],t),Sj(this._sucs[t],e),this._in[e][s]=o,this._out[t][s]=o,this._edgeCount++,this}edge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r);return this._edgeLabels[n]}hasEdge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(t,e,r){var n=1===arguments.length?Ij(this._isDirected,arguments[0]):Lj(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Aj(this._preds[e],t),Aj(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this}inEdges(t,e){var r=this._in[t];if(r){var n=Yz(r);return e?$z(n,(function(t){return t.v===e})):n}}outEdges(t,e){var r=this._out[t];if(r){var n=Yz(r);return e?$z(n,(function(t){return t.w===e})):n}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}};
/*! Bundled license information:
lodash-es/lodash.js:
(**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/function Sj(t,e){t[e]?t[e]++:t[e]=1}function Aj(t,e){--t[e]||delete t[e]}function Lj(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(Vz(n)?"\0":n)}function Nj(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function Ij(t,e){return Lj(t,e.v,e.w,e.name)}function Rj(t,e,r,n){var i;do{i=bj(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Mj(t){var e=(new Cj).setGraph(t.graph());return iF(t.nodes(),(function(r){e.setNode(r,t.node(r))})),iF(t.edges(),(function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})})),e}function Dj(t){var e=new Cj({multigraph:t.isMultigraph()}).setGraph(t.graph());return iF(t.nodes(),(function(r){t.children(r).length||e.setNode(r,t.node(r))})),iF(t.edges(),(function(r){e.setEdge(r,t.edge(r))})),e}function Oj(t,e){var r,n,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),r=c*s/o,n=c):(s<0&&(l=-l),r=l,n=l*o/s),{x:i+r,y:a+n}}function Pj(t){var e=Gz(nj(zj(t)+1),(function(){return[]}));return iF(t.nodes(),(function(r){var n=t.node(r),i=n.rank;Vz(i)||(e[i][n.order]=r)})),e}function Bj(t){var e=wq(Gz(t.nodes(),(function(e){return t.node(e).rank})));iF(t.nodes(),(function(r){var n=t.node(r);aq(n,"rank")&&(n.rank-=e)}))}function $j(t){var e=wq(Gz(t.nodes(),(function(e){return t.node(e).rank}))),r=[];iF(t.nodes(),(function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)}));var n=0,i=t.graph().nodeRankFactor;iF(r,(function(e,r){Vz(e)&&r%i!=0?--n:n&&iF(e,(function(e){t.node(e).rank+=n}))}))}function Fj(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Rj(t,"border",i,e)}function zj(t){return rU(Gz(t.nodes(),(function(e){var r=t.node(e).rank;if(!Vz(r))return r})))}function Uj(t,e){var r={lhs:[],rhs:[]};return iF(t,(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)})),r}function Gj(t,e){var r=_G();try{return e()}finally{console.log(t+" time: "+(_G()-r)+"ms")}}function qj(t,e){return e()}function jj(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&iF(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a<s;++a)Wj(t,"borderLeft","_bl",r,i,a),Wj(t,"borderRight","_br",r,i,a)}}o(e,"dfs"),iF(t.children(),e)}function Wj(t,e,r,n,i,a){var s={width:0,height:0,rank:a,borderType:e},o=i[e][a-1],l=Rj(t,"border",s,r);i[e][a]=l,t.setParent(l,n),o&&t.setEdge(o,l,{weight:1})}function Yj(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Vj(t)}function Hj(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||Kj(t),"lr"!==e&&"rl"!==e||(Qj(t),Vj(t))}function Vj(t){iF(t.nodes(),(function(e){Xj(t.node(e))})),iF(t.edges(),(function(e){Xj(t.edge(e))}))}function Xj(t){var e=t.width;t.width=t.height,t.height=e}function Kj(t){iF(t.nodes(),(function(e){Zj(t.node(e))})),iF(t.edges(),(function(e){var r=t.edge(e);iF(r.points,Zj),Object.prototype.hasOwnProperty.call(r,"y")&&Zj(r)}))}function Zj(t){t.y=-t.y}function Qj(t){iF(t.nodes(),(function(e){Jj(t.node(e))})),iF(t.edges(),(function(e){var r=t.edge(e);iF(r.points,Jj),Object.prototype.hasOwnProperty.call(r,"x")&&Jj(r)}))}function Jj(t){var e=t.x;t.x=t.y,t.y=e}Cj.prototype._nodeCount=0,Cj.prototype._edgeCount=0,o(Sj,"incrementOrInitEntry"),o(Aj,"decrementOrRemoveEntry"),o(Lj,"edgeArgsToId"),o(Nj,"edgeArgsToObj"),o(Ij,"edgeObjToId"),o(Rj,"addDummyNode"),o(Mj,"simplify"),o(Dj,"asNonCompoundGraph"),o(Oj,"intersectRect"),o(Pj,"buildLayerMatrix"),o(Bj,"normalizeRanks"),o($j,"removeEmptyRanks"),o(Fj,"addBorderNode"),o(zj,"maxRank"),o(Uj,"partition"),o(Gj,"time"),o(qj,"notime"),o(jj,"addBorderSegments"),o(Wj,"addBorderNode"),o(Yj,"adjust"),o(Hj,"undo"),o(Vj,"swapWidthHeight"),o(Xj,"swapWidthHeightOne"),o(Kj,"reverseY"),o(Zj,"reverseYOne"),o(Qj,"swapXY"),o(Jj,"swapXYOne");var tW=class{static{o(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,e=t._prev;if(e!==t)return eW(e),e}enqueue(t){var e=this._sentinel;t._prev&&t._next&&eW(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){for(var t=[],e=this._sentinel,r=e._prev;r!==e;)t.push(JSON.stringify(r,rW)),r=r._prev;return"["+t.join(", ")+"]"}};function eW(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function rW(t,e){if("_next"!==t&&"_prev"!==t)return e}o(eW,"unlink"),o(rW,"filterOutLinks");var nW=Nx(1);function iW(t,e){if(t.nodeCount()<=1)return[];var r=oW(t,e||nW),n=aW(r.graph,r.buckets,r.zeroIdx);return fU(Gz(n,(function(e){return t.outEdges(e.v,e.w)})))}function aW(t,e,r){for(var n,i=[],a=e[e.length-1],s=e[0];t.nodeCount();){for(;n=s.dequeue();)sW(t,e,r,n);for(;n=a.dequeue();)sW(t,e,r,n);if(t.nodeCount())for(var o=e.length-2;o>0;--o)if(n=e[o].dequeue()){i=i.concat(sW(t,e,r,n,!0));break}}return i}function sW(t,e,r,n,i){var a=i?[]:void 0;return iF(t.inEdges(n.v),(function(n){var s=t.edge(n),o=t.node(n.v);i&&a.push({v:n.v,w:n.w}),o.out-=s,lW(e,r,o)})),iF(t.outEdges(n.v),(function(n){var i=t.edge(n),a=n.w,s=t.node(a);s.in-=i,lW(e,r,s)})),t.removeNode(n.v),a}function oW(t,e){var r=new Cj,n=0,i=0;iF(t.nodes(),(function(t){r.setNode(t,{v:t,in:0,out:0})})),iF(t.edges(),(function(t){var a=r.edge(t.v,t.w)||0,s=e(t),o=a+s;r.setEdge(t.v,t.w,o),i=Math.max(i,r.node(t.v).out+=s),n=Math.max(n,r.node(t.w).in+=s)}));var a=nj(i+n+3).map((function(){return new tW})),s=n+1;return iF(r.nodes(),(function(t){lW(a,s,r.node(t))})),{graph:r,buckets:a,zeroIdx:s}}function lW(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function cW(t){var e="greedy"===t.graph().acyclicer?iW(t,r(t)):hW(t);function r(t){return function(e){return t.edge(e).weight}}iF(e,(function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,bj("rev"))})),o(r,"weightFn")}function hW(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,iF(t.outEdges(a),(function(t){Object.prototype.hasOwnProperty.call(r,t.w)?e.push(t):i(t.w)})),delete r[a])}return o(i,"dfs"),iF(t.nodes(),i),e}function uW(t){iF(t.edges(),(function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}}))}function dW(t){t.graph().dummyChains=[],iF(t.edges(),(function(e){pW(t,e)}))}function pW(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==n+1){t.removeEdge(e);var c,h,u=void 0;for(h=0,++n;n<a;++h,++n)o.points=[],c=Rj(t,"edge",u={width:0,height:0,edgeLabel:o,edgeObj:e,rank:n},"_d"),n===l&&(u.width=o.width,u.height=o.height,u.dummy="edge-label",u.labelpos=o.labelpos),t.setEdge(r,c,{weight:o.weight},s),0===h&&t.graph().dummyChains.push(c),r=c;t.setEdge(r,i,{weight:o.weight},s)}}function gW(t){iF(t.graph().dummyChains,(function(e){var r,n=t.node(e),i=n.edgeLabel;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)}))}function fW(t){var e={};function r(n){var i=t.node(n);if(Object.prototype.hasOwnProperty.call(e,n))return i.rank;e[n]=!0;var a=wq(Gz(t.outEdges(n),(function(e){return r(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),i.rank=a}o(r,"dfs"),iF(t.sources(),r)}function mW(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function yW(t){var e,r,n=new Cj({directed:!1}),i=t.nodes()[0],a=t.nodeCount();for(n.setNode(i,{});vW(n,t)<a;)e=xW(n,t),r=n.hasNode(e.v)?mW(t,e):-mW(t,e),bW(n,t,r);return n}function vW(t,e){function r(n){iF(e.nodeEdges(n),(function(i){var a=i.v,s=n===a?i.w:a;t.hasNode(s)||mW(e,i)||(t.setNode(s,{}),t.setEdge(n,s,{}),r(s))}))}return o(r,"dfs"),iF(t.nodes(),r),t.nodeCount()}function xW(t,e){return Tq(e.edges(),(function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return mW(e,r)}))}function bW(t,e,r){iF(t.nodes(),(function(t){e.node(t).rank+=r}))}function wW(t){var e={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new kW;Object.prototype.hasOwnProperty.call(e,a)||(r[a]=!0,e[a]=!0,iF(t.predecessors(a),i),delete r[a],n.push(a))}if(o(i,"visit"),iF(t.sinks(),i),oj(e)!==t.nodeCount())throw new kW;return n}function kW(){}function TW(t,e,r){Lb(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return iF(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);_W(t,e,"post"===r,a,n,i)})),i}function _W(t,e,r,n,i,a){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=!0,r||a.push(e),iF(i(e),(function(e){_W(t,e,r,n,i,a)})),r&&a.push(e))}function EW(t,e){return TW(t,e,"post")}function CW(t,e){return TW(t,e,"pre")}function SW(t){fW(t=Mj(t));var e,r=yW(t);for(IW(r),AW(r,t);e=MW(r);)OW(r,t,e,DW(r,t,e))}function AW(t,e){var r=EW(t,t.nodes());r=r.slice(0,r.length-1),iF(r,(function(r){LW(t,e,r)}))}function LW(t,e,r){var n=t.node(r).parent;t.edge(r,n).cutvalue=NW(t,e,r)}function NW(t,e,r){var n=t.node(r).parent,i=!0,a=e.edge(r,n),s=0;return a||(i=!1,a=e.edge(n,r)),s=a.weight,iF(e.nodeEdges(r),(function(a){var o=a.v===r,l=o?a.w:a.v;if(l!==n){var c=o===i,h=e.edge(a).weight;if(s+=c?h:-h,BW(t,r,l)){var u=t.edge(r,l).cutvalue;s+=c?-u:u}}})),s}function IW(t,e){arguments.length<2&&(e=t.nodes()[0]),RW(t,{},1,e)}function RW(t,e,r,n,i){var a=r,s=t.node(n);return e[n]=!0,iF(t.neighbors(n),(function(i){Object.prototype.hasOwnProperty.call(e,i)||(r=RW(t,e,r,i,n))})),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function MW(t){return qG(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function DW(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),s=t.node(i),o=a,l=!1;a.lim>s.lim&&(o=s,l=!0);var c=$z(e.edges(),(function(e){return l===$W(t,t.node(e.v),o)&&l!==$W(t,t.node(e.w),o)}));return Tq(c,(function(t){return mW(e,t)}))}function OW(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),IW(t),AW(t,e),PW(t,e)}function PW(t,e){var r=qG(t.nodes(),(function(t){return!e.node(t).parent})),n=CW(t,r);n=n.slice(1),iF(n,(function(r){var n=t.node(r).parent,i=e.edge(r,n),a=!1;i||(i=e.edge(n,r),a=!0),e.node(r).rank=e.node(n).rank+(a?i.minlen:-i.minlen)}))}function BW(t,e,r){return t.hasEdge(e,r)}function $W(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function FW(t){switch(t.graph().ranker){case"network-simplex":default:GW(t);break;case"tight-tree":UW(t);break;case"longest-path":zW(t)}}o(iW,"greedyFAS"),o(aW,"doGreedyFAS"),o(sW,"removeNode"),o(oW,"buildState"),o(lW,"assignBucket"),o(cW,"run"),o(hW,"dfsFAS"),o(uW,"undo"),o(dW,"run"),o(pW,"normalizeEdge"),o(gW,"undo"),o(fW,"longestPath"),o(mW,"slack"),o(yW,"feasibleTree"),o(vW,"tightTree"),o(xW,"findMinSlackEdge"),o(bW,"shiftRanks"),wW.CycleException=kW,o(wW,"topsort"),o(kW,"CycleException"),kW.prototype=new Error,o(TW,"dfs"),o(_W,"doDfs"),o(EW,"postorder"),o(CW,"preorder"),SW.initLowLimValues=IW,SW.initCutValues=AW,SW.calcCutValue=NW,SW.leaveEdge=MW,SW.enterEdge=DW,SW.exchangeEdges=OW,o(SW,"networkSimplex"),o(AW,"initCutValues"),o(LW,"assignCutValue"),o(NW,"calcCutValue"),o(IW,"initLowLimValues"),o(RW,"dfsAssignLowLim"),o(MW,"leaveEdge"),o(DW,"enterEdge"),o(OW,"exchangeEdges"),o(PW,"updateRanks"),o(BW,"isTreeEdge"),o($W,"isDescendant"),o(FW,"rank");var zW=fW;function UW(t){fW(t),yW(t)}function GW(t){SW(t)}function qW(t){var e=Rj(t,"root",{},"_root"),r=WW(t),n=rU(Yz(r))-1,i=2*n+1;t.graph().nestingRoot=e,iF(t.edges(),(function(e){t.edge(e).minlen*=i}));var a=YW(t)+1;iF(t.children(),(function(s){jW(t,e,i,a,n,r,s)})),t.graph().nodeRankFactor=i}function jW(t,e,r,n,i,a,s){var o=t.children(s);if(o.length){var l=Fj(t,"_bt"),c=Fj(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(c,s),h.borderBottom=c,iF(o,(function(o){jW(t,e,r,n,i,a,o);var h=t.node(o),u=h.borderTop?h.borderTop:o,d=h.borderBottom?h.borderBottom:o,p=h.borderTop?n:2*n,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:r})}function WW(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&iF(a,(function(t){r(t,i+1)})),e[n]=i}return o(r,"dfs"),iF(t.children(),(function(t){r(t,1)})),e}function YW(t){return _U(t.edges(),(function(e,r){return e+t.edge(r).weight}),0)}function HW(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,iF(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}function VW(t,e,r){var n,i={};iF(r,(function(r){for(var a,s,o=t.parent(r);o;){if((a=t.parent(o))?(s=i[a],i[a]=o):(s=n,n=o),s&&s!==o)return void e.setEdge(s,o);o=a}}))}function XW(t,e,r){var n=KW(t),i=new Cj({compound:!0}).setGraph({root:n}).setDefaultNodeLabel((function(e){return t.node(e)}));return iF(t.nodes(),(function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),iF(t[r](a),(function(e){var r=e.v===a?e.w:e.v,n=i.edge(r,a),s=Vz(n)?0:n.weight;i.setEdge(r,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 KW(t){for(var e;t.hasNode(e=bj("_root")););return e}function ZW(t,e){for(var r=0,n=1;n<e.length;++n)r+=QW(t,e[n-1],e[n]);return r}function QW(t,e,r){for(var n=_j(r,Gz(r,(function(t,e){return e}))),i=fU(Gz(e,(function(e){return pj(Gz(t.outEdges(e),(function(e){return{pos:n[e.w],weight:t.edge(e).weight}})),"pos")}))),a=1;a<r.length;)a<<=1;var s=2*a-1;a-=1;var o=Gz(new Array(s),(function(){return 0})),l=0;return iF(i.forEach((function(t){var e=t.pos+a;o[e]+=t.weight;for(var r=0;e>0;)e%2&&(r+=o[e+1]),o[e=e-1>>1]+=t.weight;l+=t.weight*r}))),l}function JW(t){var e={},r=$z(t.nodes(),(function(e){return!t.children(e).length})),n=rU(Gz(r,(function(e){return t.node(e).rank}))),i=Gz(nj(n+1),(function(){return[]}));function a(r){if(!aq(e,r)){e[r]=!0;var n=t.node(r);i[n.rank].push(r),iF(t.successors(r),a)}}o(a,"dfs");var s=pj(r,(function(e){return t.node(e).rank}));return iF(s,a),i}function tY(t,e){return Gz(e,(function(e){var r=t.inEdges(e);if(r.length){var n=_U(r,(function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}}),{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}}))}function eY(t,e){var r={};return iF(t,(function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Vz(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)})),iF(e.edges(),(function(t){var e=r[t.v],n=r[t.w];Vz(e)||Vz(n)||(n.indegree++,e.out.push(r[t.w]))})),rY($z(r,(function(t){return!t.indegree})))}function rY(t){var e=[];function r(t){return function(e){e.merged||(Vz(e.barycenter)||Vz(t.barycenter)||e.barycenter>=t.barycenter)&&nY(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(o(r,"handleIn"),o(n,"handleOut");t.length;){var i=t.pop();e.push(i),iF(i.in.reverse(),r(i)),iF(i.out,n(i))}return Gz($z(e,(function(t){return!t.merged})),(function(t){return vU(t,["vs","i","barycenter","weight"])}))}function nY(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function iY(t,e){var r=Uj(t,(function(t){return Object.prototype.hasOwnProperty.call(t,"barycenter")})),n=r.lhs,i=pj(r.rhs,(function(t){return-t.i})),a=[],s=0,o=0,l=0;n.sort(sY(!!e)),l=aY(a,i,l),iF(n,(function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,o+=t.weight,l=aY(a,i,l)}));var c={vs:fU(a)};return o&&(c.barycenter=s/o,c.weight=o),c}function aY(t,e,r){for(var n;e.length&&(n=K$(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function sY(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function oY(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=$z(i,(function(t){return t!==s&&t!==o})));var c=tY(t,i);iF(c,(function(e){if(t.children(e.v).length){var i=oY(t,e.v,r,n);l[e.v]=i,Object.prototype.hasOwnProperty.call(i,"barycenter")&&cY(e,i)}}));var h=eY(c,r);lY(h,l);var u=iY(h,n);if(s&&(u.vs=fU([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 lY(t,e){iF(t,(function(t){t.vs=fU(t.vs.map((function(t){return e[t]?e[t].vs:t})))}))}function cY(t,e){Vz(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 hY(t){var e=zj(t),r=uY(t,nj(1,e+1),"inEdges"),n=uY(t,nj(e-1,-1,-1),"outEdges"),i=JW(t);pY(t,i);for(var a,s=Number.POSITIVE_INFINITY,o=0,l=0;l<4;++o,++l){dY(o%2?r:n,o%4>=2);var c=ZW(t,i=Pj(t));c<s&&(l=0,a=fG(i),s=c)}pY(t,a)}function uY(t,e,r){return Gz(e,(function(e){return XW(t,e,r)}))}function dY(t,e){var r=new Cj;iF(t,(function(t){var n=t.graph().root,i=oY(t,n,r,e);iF(i.vs,(function(e,r){t.node(e).order=r})),VW(t,r,i.vs)}))}function pY(t,e){iF(e,(function(e){iF(e,(function(e,r){t.node(e).order=r}))}))}function gY(t){var e=mY(t);iF(t.graph().dummyChains,(function(r){for(var n=t.node(r),i=n.edgeObj,a=fY(t,e,i.v,i.w),s=a.path,o=a.lca,l=0,c=s[l],h=!0;r!==i.w;){if(n=t.node(r),h){for(;(c=s[l])!==o&&t.node(c).maxRank<n.rank;)l++;c===o&&(h=!1)}if(!h){for(;l<s.length-1&&t.node(c=s[l+1]).minRank<=n.rank;)l++;c=s[l]}t.setParent(r,c),r=t.successors(r)[0]}}))}function fY(t,e,r,n){var i,a,s=[],o=[],l=Math.min(e[r].low,e[n].low),c=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),s.push(i)}while(i&&(e[i].low>l||c>e[i].lim));for(a=i,i=n;(i=t.parent(i))!==a;)o.push(i);return{path:s.concat(o.reverse()),lca:a}}function mY(t){var e={},r=0;function n(i){var a=r;iF(t.children(i),n),e[i]={low:a,lim:r++}}return o(n,"dfs"),iF(t.children(),n),e}function yY(t,e){var r={};function n(e,n){var i=0,a=0,s=e.length,o=K$(n);return iF(n,(function(e,l){var c=xY(t,e),h=c?t.node(c).order:s;(c||e===o)&&(iF(n.slice(a,l+1),(function(e){iF(t.predecessors(e),(function(n){var a=t.node(n),s=a.order;!(s<i||h<s)||a.dummy&&t.node(e).dummy||bY(r,n,e)}))})),a=l+1,i=h)})),n}return o(n,"visitLayer"),_U(e,n),r}function vY(t,e){var r={};function n(e,n,i,a,s){var o;iF(nj(n,i),(function(n){o=e[n],t.node(o).dummy&&iF(t.predecessors(o),(function(e){var n=t.node(e);n.dummy&&(n.order<a||n.order>s)&&bY(r,e,o)}))}))}function i(e,r){var i,a=-1,s=0;return iF(r,(function(o,l){if("border"===t.node(o).dummy){var c=t.predecessors(o);c.length&&(i=t.node(c[0]).order,n(r,s,l,a,i),s=l,a=i)}n(r,s,r.length,i,e.length)})),r}return o(n,"scan"),o(i,"visitLayer"),_U(e,i),r}function xY(t,e){if(t.node(e).dummy)return qG(t.predecessors(e),(function(e){return t.node(e).dummy}))}function bY(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function wY(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function kY(t,e,r,n){var i={},a={},s={};return iF(e,(function(t){iF(t,(function(t,e){i[t]=t,a[t]=t,s[t]=e}))})),iF(e,(function(t){var e=-1;iF(t,(function(t){var o=n(t);if(o.length)for(var l=((o=pj(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<s[u]&&!wY(r,t,u)&&(a[u]=t,a[t]=i[t]=i[u],e=s[u])}}))})),{root:i,align:a}}function TY(t,e,r,n,i){var a={},s=_Y(t,e,r,i),l=i?"borderLeft":"borderRight";function c(t,e){for(var r=s.nodes(),n=r.pop(),i={};n;)i[n]?t(n):(i[n]=!0,r.push(n),r=r.concat(e(n))),n=r.pop()}function h(t){a[t]=s.inEdges(t).reduce((function(t,e){return Math.max(t,a[e.v]+s.edge(e))}),0)}function u(e){var r=s.outEdges(e).reduce((function(t,e){return Math.min(t,a[e.w]-s.edge(e))}),Number.POSITIVE_INFINITY),n=t.node(e);r!==Number.POSITIVE_INFINITY&&n.borderType!==l&&(a[e]=Math.max(a[e],r))}return o(c,"iterate"),o(h,"pass1"),o(u,"pass2"),c(h,s.predecessors.bind(s)),c(u,s.successors.bind(s)),iF(n,(function(t){a[t]=a[r[t]]})),a}function _Y(t,e,r,n){var i=new Cj,a=t.graph(),s=LY(a.nodesep,a.edgesep,n);return iF(e,(function(e){var n;iF(e,(function(e){var a=r[e];if(i.setNode(a),n){var o=r[n],l=i.edge(o,a);i.setEdge(o,a,Math.max(s(t,e,n),l||0))}n=e}))})),i}function EY(t,e){return Tq(Yz(e),(function(e){var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return XG(e,(function(e,i){var a=NY(t,i)/2;r=Math.max(e+a,r),n=Math.min(e-a,n)})),r-n}))}function CY(t,e){var r=Yz(e),n=wq(r),i=rU(r);iF(["u","d"],(function(r){iF(["l","r"],(function(a){var s,o=r+a,l=t[o];if(l!==e){var c=Yz(l);(s="l"===a?n-wq(c):i-rU(c))&&(t[o]=Kz(l,(function(t){return t+s})))}}))}))}function SY(t,e){return Kz(t.ul,(function(r,n){if(e)return t[e.toLowerCase()][n];var i=pj(Gz(t,n));return(i[1]+i[2])/2}))}function AY(t){var e,r=Pj(t),n=Jw(yY(t,r),vY(t,r)),i={};iF(["u","d"],(function(a){e="u"===a?r:Yz(r).reverse(),iF(["l","r"],(function(r){"r"===r&&(e=Gz(e,(function(t){return Yz(t).reverse()})));var s=("u"===a?t.predecessors:t.successors).bind(t),o=kY(0,e,n,s),l=TY(t,e,o.root,o.align,"r"===r);"r"===r&&(l=Kz(l,(function(t){return-t}))),i[a+r]=l}))}));var a=EY(t,i);return CY(i,a),SY(i,t.graph().align)}function LY(t,e,r){return function(n,i,a){var s,o=n.node(i),l=n.node(a),c=0;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2}if(s&&(c+=r?s:-s),s=0,c+=(o.dummy?e:t)/2,c+=(l.dummy?e:t)/2,c+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=l.width/2;break;case"r":s=-l.width/2}return s&&(c+=r?s:-s),s=0,c}}function NY(t,e){return t.node(e).width}function IY(t){RY(t=Dj(t)),ZG(AY(t),(function(e,r){t.node(r).x=e}))}function RY(t){var e=Pj(t),r=t.graph().ranksep,n=0;iF(e,(function(e){var i=rU(Gz(e,(function(e){return t.node(e).height})));iF(e,(function(e){t.node(e).y=n+i/2})),n+=i+r}))}function MY(t,e){var r=e&&e.debugTiming?Gj:qj;r("layout",(()=>{var e=r(" buildLayoutGraph",(()=>jY(t)));r(" runLayout",(()=>DY(e,r))),r(" updateInputGraph",(()=>OY(t,e)))}))}function DY(t,e){e(" makeSpaceForEdgeLabels",(()=>WY(t))),e(" removeSelfEdges",(()=>tH(t))),e(" acyclic",(()=>cW(t))),e(" nestingGraph.run",(()=>qW(t))),e(" rank",(()=>FW(Dj(t)))),e(" injectEdgeLabelProxies",(()=>YY(t))),e(" removeEmptyRanks",(()=>$j(t))),e(" nestingGraph.cleanup",(()=>HW(t))),e(" normalizeRanks",(()=>Bj(t))),e(" assignRankMinMax",(()=>HY(t))),e(" removeEdgeLabelProxies",(()=>VY(t))),e(" normalize.run",(()=>dW(t))),e(" parentDummyChains",(()=>gY(t))),e(" addBorderSegments",(()=>jj(t))),e(" order",(()=>hY(t))),e(" insertSelfEdges",(()=>eH(t))),e(" adjustCoordinateSystem",(()=>Yj(t))),e(" position",(()=>IY(t))),e(" positionSelfEdges",(()=>rH(t))),e(" removeBorderNodes",(()=>JY(t))),e(" normalize.undo",(()=>gW(t))),e(" fixupEdgeLabelCoords",(()=>ZY(t))),e(" undoCoordinateSystem",(()=>Hj(t))),e(" translateGraph",(()=>XY(t))),e(" assignNodeIntersects",(()=>KY(t))),e(" reversePoints",(()=>QY(t))),e(" acyclic.undo",(()=>uW(t)))}function OY(t,e){iF(t.nodes(),(function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))})),iF(t.edges(),(function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}o(UW,"tightTreeRanker"),o(GW,"networkSimplexRanker"),o(qW,"run"),o(jW,"dfs"),o(WW,"treeDepths"),o(YW,"sumWeights"),o(HW,"cleanup"),o(VW,"addSubgraphConstraints"),o(XW,"buildLayerGraph"),o(KW,"createRootNode"),o(ZW,"crossCount"),o(QW,"twoLayerCrossCount"),o(JW,"initOrder"),o(tY,"barycenter"),o(eY,"resolveConflicts"),o(rY,"doResolveConflicts"),o(nY,"mergeEntries"),o(iY,"sort"),o(aY,"consumeUnsortable"),o(sY,"compareWithBias"),o(oY,"sortSubgraph"),o(lY,"expandSubgraphs"),o(cY,"mergeBarycenters"),o(hY,"order"),o(uY,"buildLayerGraphs"),o(dY,"sweepLayerGraphs"),o(pY,"assignOrder"),o(gY,"parentDummyChains"),o(fY,"findPath"),o(mY,"postorder"),o(yY,"findType1Conflicts"),o(vY,"findType2Conflicts"),o(xY,"findOtherInnerSegmentNode"),o(bY,"addConflict"),o(wY,"hasConflict"),o(kY,"verticalAlignment"),o(TY,"horizontalCompaction"),o(_Y,"buildBlockGraph"),o(EY,"findSmallestWidthAlignment"),o(CY,"alignCoordinates"),o(SY,"balance"),o(AY,"positionX"),o(LY,"sep"),o(NY,"width"),o(IY,"position"),o(RY,"positionY"),o(MY,"layout"),o(DY,"runLayout"),o(OY,"updateInputGraph");var PY=["nodesep","edgesep","ranksep","marginx","marginy"],BY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$Y=["acyclicer","ranker","rankdir","align"],FY=["width","height"],zY={width:0,height:0},UY=["minlen","weight","width","height","labeloffset"],GY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},qY=["labelpos"];function jY(t){var e=new Cj({multigraph:!0,compound:!0}),r=iH(t.graph());return e.setGraph(Jw({},BY,nH(r,PY),vU(r,$Y))),iF(t.nodes(),(function(r){var n=iH(t.node(r));e.setNode(r,V$(nH(n,FY),zY)),e.setParent(r,t.parent(r))})),iF(t.edges(),(function(r){var n=iH(t.edge(r));e.setEdge(r,Jw({},GY,nH(n,UY),vU(n,qY)))})),e}function WY(t){var e=t.graph();e.ranksep/=2,iF(t.edges(),(function(r){var n=t.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}function YY(t){iF(t.edges(),(function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Rj(t,"edge-proxy",i,"_ep")}}))}function HY(t){var e=0;iF(t.nodes(),(function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=rU(e,n.maxRank))})),t.graph().maxRank=e}function VY(t){iF(t.nodes(),(function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))}))}function XY(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=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),r=Math.max(r,a+o/2),n=Math.min(n,s-l/2),i=Math.max(i,s+l/2)}o(c,"getExtremes"),iF(t.nodes(),(function(e){c(t.node(e))})),iF(t.edges(),(function(e){var r=t.edge(e);Object.prototype.hasOwnProperty.call(r,"x")&&c(r)})),e-=s,n-=l,iF(t.nodes(),(function(r){var i=t.node(r);i.x-=e,i.y-=n})),iF(t.edges(),(function(r){var i=t.edge(r);iF(i.points,(function(t){t.x-=e,t.y-=n})),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=e),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=n)})),a.width=r-e+s,a.height=i-n+l}function KY(t){iF(t.edges(),(function(e){var r,n,i=t.edge(e),a=t.node(e.v),s=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=a),i.points.unshift(Oj(a,r)),i.points.push(Oj(s,n))}))}function ZY(t){iF(t.edges(),(function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}}))}function QY(t){iF(t.edges(),(function(e){var r=t.edge(e);r.reversed&&r.points.reverse()}))}function JY(t){iF(t.nodes(),(function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(K$(r.borderLeft)),s=t.node(K$(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}})),iF(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}function tH(t){iF(t.edges(),(function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}function eH(t){var e=Pj(t);iF(e,(function(e){var r=0;iF(e,(function(e,n){var i=t.node(e);i.order=n+r,iF(i.selfEdges,(function(e){Rj(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:n+ ++r,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}function rH(t){iF(t.nodes(),(function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}}))}function nH(t,e){return Kz(vU(t,e),Number)}function iH(t){var e={};return iF(t,(function(t,r){e[r.toLowerCase()]=t})),e}function aH(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:sH(t),edges:oH(t)};return Vz(t.graph())||(e.value=j$(t.graph())),e}function sH(t){return Gz(t.nodes(),(function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Vz(r)||(i.value=r),Vz(n)||(i.parent=n),i}))}function oH(t){return Gz(t.edges(),(function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Vz(e.name)||(n.name=e.name),Vz(r)||(n.value=r),n}))}o(jY,"buildLayoutGraph"),o(WY,"makeSpaceForEdgeLabels"),o(YY,"injectEdgeLabelProxies"),o(HY,"assignRankMinMax"),o(VY,"removeEdgeLabelProxies"),o(XY,"translateGraph"),o(KY,"assignNodeIntersects"),o(ZY,"fixupEdgeLabelCoords"),o(QY,"reversePointsForReversedEdges"),o(JY,"removeBorderNodes"),o(tH,"removeSelfEdges"),o(eH,"insertSelfEdges"),o(rH,"positionSelfEdges"),o(nH,"selectNumberAttrs"),o(iH,"canonicalize"),o(aH,"write"),o(sH,"writeNodes"),o(oH,"writeEdges");var lH=new Map,cH=new Map,hH=new Map,uH=o((()=>{cH.clear(),hH.clear(),lH.clear()}),"clear"),dH=o(((t,e)=>{const r=cH.get(e)||[];return y.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)}),"isDescendant"),pH=o(((t,e)=>{const r=cH.get(e)||[];return y.info("Descendants of ",e," is ",r),y.info("Edge is ",t),t.v!==e&&t.w!==e&&(r?r.includes(t.v)||dH(t.v,e)||dH(t.w,e)||r.includes(t.w):(y.debug("Tilt, ",e,",not in descendants"),!1))}),"edgeInCluster"),gH=o(((t,e,r,n)=>{y.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),y.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach((i=>{if(e.children(i).length>0)gH(i,e,r,n);else{const a=e.node(i);y.info("cp ",i," to ",n," with parent ",t),r.setNode(i,a),n!==e.parent(i)&&(y.warn("Setting parent",i,e.parent(i)),r.setParent(i,e.parent(i))),t!==n&&i!==t?(y.debug("Setting parent",i,t),r.setParent(i,t)):(y.info("In copy ",t,"root",n,"data",e.node(t),n),y.debug("Not Setting parent for node=",i,"cluster!==rootId",t!==n,"node!==clusterId",i!==t));const s=e.edges(i);y.debug("Copying Edges",s),s.forEach((i=>{y.info("Edge",i);const a=e.edge(i.v,i.w,i.name);y.info("Edge data",a,n);try{pH(i,n)?(y.info("Copying as ",i.v,i.w,a,i.name),r.setEdge(i.v,i.w,a,i.name),y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):y.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",n," clusterId:",t)}catch(t){y.error(t)}}))}y.debug("Removing node",i),e.removeNode(i)}))}),"copy"),fH=o(((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)hH.set(i,t),n=[...n,...fH(i,e)];return n}),"extractDescendants"),mH=o(((t,e,r)=>{const n=t.edges().filter((t=>t.v===e||t.w===e)),i=t.edges().filter((t=>t.v===r||t.w===r)),a=n.map((t=>({v:t.v===e?r: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"),yH=o(((t,e,r)=>{const n=e.children(t);if(y.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const t of n){const n=yH(t,e,r),a=mH(e,r,n);if(n){if(!(a.length>0))return n;i=n}}return i}),"findNonClusterChild"),vH=o((t=>lH.has(t)&&lH.get(t).externalConnections&&lH.has(t)?lH.get(t).id:t),"getAnchorId"),xH=o(((t,e)=>{if(!t||e>10)y.debug("Opting out, no graph ");else{y.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(y.warn("Cluster identified",e," Replacement id in edges: ",yH(e,t,e)),cH.set(e,fH(e,t)),lH.set(e,{id:yH(e,t,e),clusterData:t.node(e)}))})),t.nodes().forEach((function(e){const r=t.children(e),n=t.edges();r.length>0?(y.debug("Cluster identified",e,cH),n.forEach((t=>{dH(t.v,e)^dH(t.w,e)&&(y.warn("Edge: ",t," leaves cluster ",e),y.warn("Descendants of XXX ",e,": ",cH.get(e)),lH.get(e).externalConnections=!0)}))):y.debug("Not a cluster ",e,cH)}));for(let e of lH.keys()){const r=lH.get(e).id,n=t.parent(r);n!==e&&lH.has(n)&&!lH.get(n).externalConnections&&(lH.get(e).id=n)}t.edges().forEach((function(e){const r=t.edge(e);y.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),y.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));let n=e.v,i=e.w;if(y.warn("Fix XXX",lH,"ids:",e.v,e.w,"Translating: ",lH.get(e.v)," --- ",lH.get(e.w)),lH.get(e.v)||lH.get(e.w)){if(y.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),n=vH(e.v),i=vH(e.w),t.removeEdge(e.v,e.w,e.name),n!==e.v){const i=t.parent(n);lH.get(i).externalConnections=!0,r.fromCluster=e.v}if(i!==e.w){const n=t.parent(i);lH.get(n).externalConnections=!0,r.toCluster=e.w}y.warn("Fix Replacing with XXX",n,i,e.name),t.setEdge(n,i,r,e.name)}})),y.warn("Adjusted Graph",aH(t)),bH(t,0),y.trace(lH)}}),"adjustClustersAndEdges"),bH=o(((t,e)=>{if(y.warn("extractor - ",e,aH(t),t.children("D")),e>10)return void y.error("Bailing out");let r=t.nodes(),n=!1;for(const e of r){const r=t.children(e);n=n||r.length>0}if(n){y.debug("Nodes = ",r,e);for(const n of r)if(y.debug("Extracting node",n,lH,lH.has(n)&&!lH.get(n).externalConnections,!t.parent(n),t.node(n),t.children("D")," Depth ",e),lH.has(n))if(!lH.get(n).externalConnections&&t.children(n)&&t.children(n).length>0){y.warn("Cluster without external connections, without a parent and with children",n,e);let r="TB"===t.graph().rankdir?"LR":"TB";lH.get(n)?.clusterData?.dir&&(r=lH.get(n).clusterData.dir,y.warn("Fixing dir",lH.get(n).clusterData.dir,r));const i=new Cj({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));y.warn("Old graph before copy",aH(t)),gH(n,t,i,n),t.setNode(n,{clusterNode:!0,id:n,clusterData:lH.get(n).clusterData,label:lH.get(n).label,graph:i}),y.warn("New graph after copy node: (",n,")",aH(i)),y.debug("Old graph after copy",aH(t))}else y.warn("Cluster ** ",n," **not meeting the criteria !externalConnections:",!lH.get(n).externalConnections," no parent: ",!t.parent(n)," children ",t.children(n)&&t.children(n).length>0,t.children("D"),e),y.debug(lH);else y.debug("Not a cluster",n,e);r=t.nodes(),y.warn("New list of nodes",r);for(const n of r){const r=t.node(n);y.warn(" Now next level",n,r),r?.clusterNode&&bH(r.graph,e+1)}}else y.debug("Done, no node has children",t.nodes())}),"extractor"),wH=o(((t,e)=>{if(0===e.length)return[];let r=Object.assign([],e);return e.forEach((e=>{const n=t.children(e),i=wH(t,n);r=[...r,...i]})),r}),"sorter"),kH=o((t=>wH(t,t.children())),"sortNodesByHierarchy"),TH=o((async(t,e,r,n,i,a)=>{y.warn("Graph in recursive render:XAX",aH(e),i);const s=e.graph().rankdir;y.trace("Dir in recursive render - dir:",s);const l=t.insert("g").attr("class","root");e.nodes()?y.info("Recursive render XXX",e.nodes()):y.info("No nodes found for",e),e.edges().length>0&&y.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 o=e.node(t);if(void 0!==i){const r=JSON.parse(JSON.stringify(i.clusterData));y.trace("Setting data for parent cluster XXX\n Node.id = ",t,"\n data=",r.height,"\nParent cluster",i.height),e.setNode(i.id,r),e.parent(t)||(y.trace("Setting parent",t,i.id),e.setParent(t,i.id,r))}if(y.info("(Insert) Node XXX"+t+": "+JSON.stringify(e.node(t))),o?.clusterNode){y.info("Cluster identified XBX",t,o.width,e.node(t));const{ranksep:i,nodesep:s}=e.graph();o.graph.setGraph({...o.graph.graph(),ranksep:i+25,nodesep:s});const l=await TH(d,o.graph,r,n,e.node(t),a),c=l.elem;w_(o,c),o.diff=l.diff||0,y.info("New compound node after recursive render XAX",t,"width",o.width,"height",o.height),qS(c,o)}else e.children(t).length>0?(y.trace("Cluster - the non recursive path XBX",t,o.id,o,o.width,"Graph:",e),y.trace(yH(o.id,e)),lH.set(o.id,{id:yH(o.id,e),node:o})):(y.trace("Node - the non recursive path XAX",t,d,e.node(t),s),await GS(d,e.node(t),{config:a,dir:s}))})));const p=o((async()=>{const t=e.edges().map((async function(t){const r=e.edge(t.v,t.w,t.name);y.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),y.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(e.edge(t))),y.info("Fix",lH,"ids:",t.v,t.w,"Translating: ",lH.get(t.v),lH.get(t.w)),await nA(u,r)}));await Promise.all(t)}),"processEdges");await p(),y.info("Graph before layout:",JSON.stringify(aH(e))),y.info("############################################# XXX"),y.info("### Layout ### XXX"),y.info("############################################# XXX"),MY(e),y.info("Graph after layout:",JSON.stringify(aH(e)));let g=0,{subGraphTitleTotalMargin:f}=qy(a);return await Promise.all(kH(e).map((async function(t){const r=e.node(t);if(y.info("Position XBX => "+t+": ("+r.x,","+r.y,") width: ",r.width," height: ",r.height),r?.clusterNode)r.y+=f,y.info("A tainted cluster node XBX1",t,r.id,r.width,r.height,r.x,r.y,e.parent(t)),lH.get(r.id).node=r,WS(r);else if(e.children(t).length>0){y.info("A pure cluster node XBX1",t,r.id,r.x,r.y,r.width,r.height,e.parent(t)),r.height+=f,e.node(r.parentId);const n=r?.padding/2||0,i=r?.labelBBox?.height||0,a=i-n||0;y.debug("OffsetY",a,"labelHeight",i,"halfPadding",n),await XE(c,r),lH.get(r.id).node=r}else{const t=e.node(r.parentId);r.y+=f/2,y.info("A regular node XBX1 - using the padding",r.id,"parent",r.parentId,r.width,r.height,r.x,r.y,"offsetY",r.offsetY,"parent",t,t?.offsetY,r),WS(r)}}))),e.edges().forEach((function(t){const i=e.edge(t);y.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=dA(h,i,lH,r,a,s,n);aA(i,o)})),e.nodes().forEach((function(t){const r=e.node(t);y.info(t,r.type,r.diff),r.isGroup&&(g=r.diff)})),y.warn("Returning from recursive render XAX",l,g),{elem:l,diff:g}}),"recursiveRender"),_H=o((async(t,e)=>{const r=new Cj({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{}})),n=e.select("g");NA(n,t.markers,t.type,t.diagramId),jS(),eA(),KE(),uH(),t.nodes.forEach((t=>{r.setNode(t.id,{...t}),t.parentId&&r.setParent(t.id,t.parentId)})),y.debug("Edges:",t.edges),t.edges.forEach((t=>{if(t.start===t.end){const e=t.start,n=e+"---"+e+"---1",i=e+"---"+e+"---2",a=r.node(e);r.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(n,a.parentId),r.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.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.arrowTypeStart="none",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",l.arrowTypeStart="none",r.setEdge(e,n,s,e+"-cyclic-special-0"),r.setEdge(n,i,o,e+"-cyclic-special-1"),r.setEdge(i,e,l,e+"-cyc<lic-special-2")}else r.setEdge(t.start,t.end,{...t},t.id)})),y.warn("Graph at first:",JSON.stringify(aH(r))),xH(r),y.warn("Graph after XAX:",JSON.stringify(aH(r)));const i=Qr();await TH(n,r,t.type,t.diagramId,void 0,i)}),"render"),EH=Object.freeze({__proto__:null,render:_H}),CH=p(Wy(),1),SH=o(((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)r.attr(t,e.attrs[t]);return e.class&&r.attr("class",e.class),r}),"drawRect"),AH=o(((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};SH(t,r).lower()}),"drawBackgroundRect"),LH=o(((t,e)=>{const r=e.text.replace(ir," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(r),n}),"drawText"),NH=o(((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=(0,CH.sanitizeUrl)(n);i.attr("xlink:href",a)}),"drawImage"),IH=o(((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=(0,CH.sanitizeUrl)(n);i.attr("xlink:href",`#${a}`)}),"drawEmbeddedImage"),RH=o((()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0})),"getNoteRect"),MH=o((()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0})),"getTextObj"),DH=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[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],R=[1,46],M=[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],W=[1,60],Y=[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],rt=[12,33],nt=[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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:n.setDirection("TB");break;case 4:n.setDirection("BT");break;case 5:n.setDirection("RL");break;case 6:n.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:n.setC4Type(a[o-3]);break;case 19:n.setTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 20:n.setAccDescription(a[o].substring(15)),this.$=a[o].substring(15);break;case 21:this.$=a[o].trim(),n.setTitle(this.$);break;case 22:case 23:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 28:a[o].splice(2,0,"ENTERPRISE"),n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 29:a[o].splice(2,0,"SYSTEM"),n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 30:n.addPersonOrSystemBoundary(...a[o]),this.$=a[o];break;case 31:a[o].splice(2,0,"CONTAINER"),n.addContainerBoundary(...a[o]),this.$=a[o];break;case 32:n.addDeploymentNode("node",...a[o]),this.$=a[o];break;case 33:n.addDeploymentNode("nodeL",...a[o]),this.$=a[o];break;case 34:n.addDeploymentNode("nodeR",...a[o]),this.$=a[o];break;case 35:n.popBoundaryParseStack();break;case 39:n.addPersonOrSystem("person",...a[o]),this.$=a[o];break;case 40:n.addPersonOrSystem("external_person",...a[o]),this.$=a[o];break;case 41:n.addPersonOrSystem("system",...a[o]),this.$=a[o];break;case 42:n.addPersonOrSystem("system_db",...a[o]),this.$=a[o];break;case 43:n.addPersonOrSystem("system_queue",...a[o]),this.$=a[o];break;case 44:n.addPersonOrSystem("external_system",...a[o]),this.$=a[o];break;case 45:n.addPersonOrSystem("external_system_db",...a[o]),this.$=a[o];break;case 46:n.addPersonOrSystem("external_system_queue",...a[o]),this.$=a[o];break;case 47:n.addContainer("container",...a[o]),this.$=a[o];break;case 48:n.addContainer("container_db",...a[o]),this.$=a[o];break;case 49:n.addContainer("container_queue",...a[o]),this.$=a[o];break;case 50:n.addContainer("external_container",...a[o]),this.$=a[o];break;case 51:n.addContainer("external_container_db",...a[o]),this.$=a[o];break;case 52:n.addContainer("external_container_queue",...a[o]),this.$=a[o];break;case 53:n.addComponent("component",...a[o]),this.$=a[o];break;case 54:n.addComponent("component_db",...a[o]),this.$=a[o];break;case 55:n.addComponent("component_queue",...a[o]),this.$=a[o];break;case 56:n.addComponent("external_component",...a[o]),this.$=a[o];break;case 57:n.addComponent("external_component_db",...a[o]),this.$=a[o];break;case 58:n.addComponent("external_component_queue",...a[o]),this.$=a[o];break;case 60:n.addRel("rel",...a[o]),this.$=a[o];break;case 61:n.addRel("birel",...a[o]),this.$=a[o];break;case 62:n.addRel("rel_u",...a[o]),this.$=a[o];break;case 63:n.addRel("rel_d",...a[o]),this.$=a[o];break;case 64:n.addRel("rel_l",...a[o]),this.$=a[o];break;case 65:n.addRel("rel_r",...a[o]),this.$=a[o];break;case 66:n.addRel("rel_b",...a[o]),this.$=a[o];break;case 67:a[o].splice(0,1),n.addRel("rel",...a[o]),this.$=a[o];break;case 68:n.updateElStyle("update_el_style",...a[o]),this.$=a[o];break;case 69:n.updateRelStyle("update_rel_style",...a[o]),this.$=a[o];break;case 70:n.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:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36: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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36: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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36: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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36: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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{14:[1,74]},t(Y,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W}),t(Y,[2,14]),t(H,[2,16],{12:[1,76]}),t(Y,[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:s,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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W},{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(Y,[2,15]),t(H,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(Y,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36: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:R,62:M,63:D,64:O,65:P,66:B,67:$,68:F,69:z,70:U,71:G,72:q,73:j,74:W}),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(rt,[2,28]),t(rt,[2,29]),t(rt,[2,30]),t(rt,[2,31]),t(rt,[2,32]),t(rt,[2,33]),t(rt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(H,[2,18]),t(Y,[2,38]),t(tt,[2,72]),t(et,[2,74]),t(J,[2,24]),t(J,[2,35]),t(nt,[2,25]),t(nt,[2,26],{12:[1,138]}),t(nt,[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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},at=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){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,o(st,"Parser"),st.prototype=it,it.Parser=st,new st}();DH.parser=DH;var OH,PH=DH,BH=[],$H=[""],FH="global",zH="",UH=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],GH=[],qH="",jH=!1,WH=4,YH=2,HH=o((function(){return OH}),"getC4Type"),VH=o((function(t){let e=hr(t,Qr());OH=e}),"setC4Type"),XH=o((function(t,e,r,n,i,a,s,o,l){if(null==t||null==e||null==r||null==n)return;let c={};const h=GH.find((t=>t.from===e&&t.to===r));if(h?c=h:GH.push(c),c.type=t,c.from=e,c.to=r,c.label={text:n},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=vV()}),"addRel"),KH=o((function(t,e,r,n,i,a,s){if(null===e||null===r)return;let o={};const l=BH.find((t=>t.alias===e));if(l&&e===l.alias?o=l:(o.alias=e,BH.push(o)),o.label=null==r?{text:""}:{text:r},null==n)o.descr={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]={text:e}}else o.descr={text:n};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=FH,o.wrap=vV()}),"addPersonOrSystem"),ZH=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=BH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,BH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.techn={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.techn={text:n};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=vV(),l.typeC4Shape={text:t},l.parentBoundary=FH}),"addContainer"),QH=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=BH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,BH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.techn={text:""};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.techn={text:n};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=vV(),l.typeC4Shape={text:t},l.parentBoundary=FH}),"addComponent"),JH=o((function(t,e,r,n,i){if(null===t||null===e)return;let a={};const s=UH.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,UH.push(a)),a.label=null==e?{text:""}:{text:e},null==r)a.type={text:"system"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]={text:e}}else a.type={text:r};if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]=e}else a.tags=n;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=FH,a.wrap=vV(),zH=FH,FH=t,$H.push(zH)}),"addPersonOrSystemBoundary"),tV=o((function(t,e,r,n,i){if(null===t||null===e)return;let a={};const s=UH.find((e=>e.alias===t));if(s&&t===s.alias?a=s:(a.alias=t,UH.push(a)),a.label=null==e?{text:""}:{text:e},null==r)a.type={text:"container"};else if("object"==typeof r){let[t,e]=Object.entries(r)[0];a[t]={text:e}}else a.type={text:r};if("object"==typeof n){let[t,e]=Object.entries(n)[0];a[t]=e}else a.tags=n;if("object"==typeof i){let[t,e]=Object.entries(i)[0];a[t]=e}else a.link=i;a.parentBoundary=FH,a.wrap=vV(),zH=FH,FH=t,$H.push(zH)}),"addContainerBoundary"),eV=o((function(t,e,r,n,i,a,s,o){if(null===e||null===r)return;let l={};const c=UH.find((t=>t.alias===e));if(c&&e===c.alias?l=c:(l.alias=e,UH.push(l)),l.label=null==r?{text:""}:{text:r},null==n)l.type={text:"node"};else if("object"==typeof n){let[t,e]=Object.entries(n)[0];l[t]={text:e}}else l.type={text:n};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=FH,l.wrap=vV(),zH=FH,FH=e,$H.push(zH)}),"addDeploymentNode"),rV=o((function(){FH=zH,$H.pop(),zH=$H.pop(),$H.push(zH)}),"popBoundaryParseStack"),nV=o((function(t,e,r,n,i,a,s,o,l,c,h){let u=BH.find((t=>t.alias===e));if(void 0!==u||(u=UH.find((t=>t.alias===e)),void 0!==u)){if(null!=r)if("object"==typeof r){let[t,e]=Object.entries(r)[0];u[t]=e}else u.bgColor=r;if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];u[t]=e}else u.fontColor=n;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"),iV=o((function(t,e,r,n,i,a,s){const o=GH.find((t=>t.from===e&&t.to===r));if(void 0!==o){if(null!=n)if("object"==typeof n){let[t,e]=Object.entries(n)[0];o[t]=e}else o.textColor=n;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"),aV=o((function(t,e,r){let n=WH,i=YH;if("object"==typeof e){const t=Object.values(e)[0];n=parseInt(t)}else n=parseInt(e);if("object"==typeof r){const t=Object.values(r)[0];i=parseInt(t)}else i=parseInt(r);n>=1&&(WH=n),i>=1&&(YH=i)}),"updateLayoutConfig"),sV=o((function(){return WH}),"getC4ShapeInRow"),oV=o((function(){return YH}),"getC4BoundaryInRow"),lV=o((function(){return FH}),"getCurrentBoundaryParse"),cV=o((function(){return zH}),"getParentBoundaryParse"),hV=o((function(t){return null==t?BH:BH.filter((e=>e.parentBoundary===t))}),"getC4ShapeArray"),uV=o((function(t){return BH.find((e=>e.alias===t))}),"getC4Shape"),dV=o((function(t){return Object.keys(hV(t))}),"getC4ShapeKeys"),pV=o((function(t){return null==t?UH:UH.filter((e=>e.parentBoundary===t))}),"getBoundaries"),gV=pV,fV=o((function(){return GH}),"getRels"),mV=o((function(){return qH}),"getTitle"),yV=o((function(t){jH=t}),"setWrap"),vV=o((function(){return jH}),"autoWrap"),xV=o((function(){BH=[],UH=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],zH="",FH="global",$H=[""],GH=[],$H=[""],qH="",jH=!1,WH=4,YH=2}),"clear"),bV=o((function(t){let e=hr(t,Qr());qH=e}),"setTitle"),wV={addPersonOrSystem:KH,addPersonOrSystemBoundary:JH,addContainer:ZH,addContainerBoundary:tV,addComponent:QH,addDeploymentNode:eV,popBoundaryParseStack:rV,addRel:XH,updateElStyle:nV,updateRelStyle:iV,updateLayoutConfig:aV,autoWrap:vV,setWrap:yV,getC4ShapeArray:hV,getC4Shape:uV,getC4ShapeKeys:dV,getBoundaries:pV,getBoundarys:gV,getCurrentBoundaryParse:lV,getParentBoundaryParse:cV,getRels:fV,getTitle:mV,getC4Type:HH,getC4ShapeInRow:sV,getC4BoundaryInRow:oV,setAccTitle:jr,getAccTitle:Wr,getAccDescription:Hr,setAccDescription:Yr,getConfig:o((()=>Qr().c4),"getConfig"),clear:xV,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:bV,setC4Type:VH},kV=p(Wy(),1),TV=o((function(t,e){return SH(t,e)}),"drawRect"),_V=o((function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:(0,kV.sanitizeUrl)(a);s.attr("xlink:href",o)}),"drawImage"),EV=o(((t,e,r)=>{const n=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=n.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=n.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=r.messageFont();BV(r)(t.label.text,n,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=r.messageFont(),BV(r)("["+t.techn.text+"]",n,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+r.messageFontSize+5+o,Math.max(t.label.width,t.techn.width),t.techn.height,{fill:e,"font-style":"italic"},c))}}),"drawRels"),CV=o((function(t,e,r){const n=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};TV(n,l);let c=r.boundaryFont();c.fontWeight="bold",c.fontSize=c.fontSize+2,c.fontColor=s,BV(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},c),e.type&&""!==e.type.text&&(c=r.boundaryFont(),c.fontColor=s,BV(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},c)),e.descr&&""!==e.descr.text&&(c=r.boundaryFont(),c.fontSize=c.fontSize-2,c.fontColor=s,BV(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},c))}),"drawBoundary"),SV=o((function(t,e,r){let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[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=RH();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=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},TV(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",n).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",n).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=PV(r,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":_V(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s)}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,BV(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&""!==e.techn?.text?BV(r)(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&&BV(r)(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=r.personFont(),h.fontColor=a,BV(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height}),"drawC4Shape"),AV=o((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"),LV=o((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"),NV=o((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"),IV=o((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"),RV=o((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"),MV=o((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"),DV=o((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"),OV=o((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"),PV=o(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"getC4ShapeFont"),BV=function(){function t(t,e,r,i,a,s,o){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l){const{fontSize:c,fontFamily:h,fontWeight:u}=l,d=t.split(Lr.lineBreakRegex);for(let t=0;t<d.length;t++){const s=t*c-c*(d.length-1)/2,l=e.append("text").attr("x",r+a/2).attr("y",i).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",c).style("font-weight",u).style("font-family",h);l.append("tspan").attr("dy",s).text(d[t]).attr("alignment-baseline","mathematical"),n(l,o)}}function r(t,r,i,a,s,o,l,c){const h=r.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,0,l,c),n(u,l)}function n(t,e){for(const r in e)e.hasOwnProperty(r)&&t.attr(r,e[r])}return o(t,"byText"),o(e,"byTspan"),o(r,"byFo"),o(n,"_setTextAttrs"),function(n){return"fo"===n.textPlacement?r:"old"===n.textPlacement?t:e}}(),$V={drawRect:TV,drawBoundary:CV,drawC4Shape:SV,drawRels:EV,drawImage:_V,insertArrowHead:IV,insertArrowEnd:RV,insertArrowFilledHead:MV,insertDynamicNumber:DV,insertArrowCrossHead:OV,insertDatabaseIcon:AV,insertComputerIcon:LV,insertClockIcon:NV},FV=0,zV=0,UV=4,GV=2;DH.yy=wV;var qV={},jV=class{static{o(this,"Bounds")}constructor(t){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,WV(t.db.getConfig())}setData(t,e,r,n){this.nextData.startx=this.data.startx=t,this.nextData.stopx=this.data.stopx=e,this.nextData.starty=this.data.starty=r,this.nextData.stopy=this.data.stopy=n}updateVal(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])}insert(t){this.nextData.cnt=this.nextData.cnt+1;let e=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+t.margin:this.nextData.stopx+2*t.margin,r=e+t.width,n=this.nextData.starty+2*t.margin,i=n+t.height;(e>=this.data.widthLimit||r>=this.data.widthLimit||this.nextData.cnt>UV)&&(e=this.nextData.startx+t.margin+qV.nextLinePaddingX,n=this.nextData.stopy+2*t.margin,this.nextData.stopx=r=e+t.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=i=n+t.height,this.nextData.cnt=1),t.x=e,t.y=n,this.updateVal(this.data,"startx",e,Math.min),this.updateVal(this.data,"starty",n,Math.min),this.updateVal(this.data,"stopx",r,Math.max),this.updateVal(this.data,"stopy",i,Math.max),this.updateVal(this.nextData,"startx",e,Math.min),this.updateVal(this.nextData,"starty",n,Math.min),this.updateVal(this.nextData,"stopx",r,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},WV(t.db.getConfig())}bumpLastMargin(t){this.data.stopx+=t,this.data.stopy+=t}},WV=o((function(t){N(qV,t),t.fontFamily&&(qV.personFontFamily=qV.systemFontFamily=qV.messageFontFamily=t.fontFamily),t.fontSize&&(qV.personFontSize=qV.systemFontSize=qV.messageFontSize=t.fontSize),t.fontWeight&&(qV.personFontWeight=qV.systemFontWeight=qV.messageFontWeight=t.fontWeight)}),"setConf"),YV=o(((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]})),"c4ShapeFont"),HV=o((t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight})),"boundaryFont"),VV=o((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");function XV(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=_k(e[t].text,i,n),e[t].textLines=e[t].text.split(Lr.lineBreakRegex).length,e[t].width=i,e[t].height=Ck(e[t].text,n);else{let r=e[t].text.split(Lr.lineBreakRegex);e[t].textLines=r.length;let i=0;e[t].height=0,e[t].width=0;for(const a of r)e[t].width=Math.max(Sk(a,n),e[t].width),i=Ck(a,n),e[t].height=e[t].height+i}}o(XV,"calcC4ShapeTextWH");var KV=o((function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=qV.c4ShapeMargin-35;let n=e.wrap&&qV.wrap,i=HV(qV);i.fontSize=i.fontSize+2,i.fontWeight="bold",XV("label",e,n,i,Sk(e.label.text,i)),$V.drawBoundary(t,e,qV)}),"drawBoundary"),ZV=o((function(t,e,r,n){let i=0;for(const a of n){i=0;const n=r[a];let s=YV(qV,n.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,n.typeC4Shape.width=Sk("«"+n.typeC4Shape.text+"»",s),n.typeC4Shape.height=s.fontSize+2,n.typeC4Shape.Y=qV.c4ShapePadding,i=n.typeC4Shape.Y+n.typeC4Shape.height-4,n.image={width:0,height:0,Y:0},n.typeC4Shape.text){case"person":case"external_person":n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height}n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let o=n.wrap&&qV.wrap,l=qV.width-2*qV.c4ShapePadding,c=YV(qV,n.typeC4Shape.text);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",XV("label",n,o,c,l),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&""!==n.type.text){n.type.text="["+n.type.text+"]",XV("type",n,o,YV(qV,n.typeC4Shape.text),l),n.type.Y=i+5,i=n.type.Y+n.type.height}else if(n.techn&&""!==n.techn.text){n.techn.text="["+n.techn.text+"]",XV("techn",n,o,YV(qV,n.techn.text),l),n.techn.Y=i+5,i=n.techn.Y+n.techn.height}let h=i,u=n.label.width;if(n.descr&&""!==n.descr.text){XV("descr",n,o,YV(qV,n.typeC4Shape.text),l),n.descr.Y=i+20,i=n.descr.Y+n.descr.height,u=Math.max(n.label.width,n.descr.width),h=i-5*n.descr.textLines}u+=qV.c4ShapePadding,n.width=Math.max(n.width||qV.width,u,qV.width),n.height=Math.max(n.height||qV.height,h,qV.height),n.margin=n.margin||qV.c4ShapeMargin,t.insert(n),$V.drawC4Shape(e,n,qV)}t.bumpLastMargin(qV.c4ShapeMargin)}),"drawC4ShapeArray"),QV=class{static{o(this,"Point")}constructor(t,e){this.x=t,this.y=e}},JV=o((function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),c=Math.abs(n-a),h=c/l,u=t.height/t.width,d=null;return n==a&&r<i?d=new QV(r+t.width,o):n==a&&r>i?d=new QV(r,o):r==i&&n<a?d=new QV(s,n+t.height):r==i&&n>a&&(d=new QV(s,n)),r>i&&n<a?d=u>=h?new QV(r,o+h*t.width/2):new QV(s-l/c*t.height/2,n+t.height):r<i&&n<a?d=u>=h?new QV(r+t.width,o+h*t.width/2):new QV(s+l/c*t.height/2,n+t.height):r<i&&n>a?d=u>=h?new QV(r+t.width,o-h*t.width/2):new QV(s+t.height/2*l/c,n):r>i&&n>a&&(d=u>=h?new QV(r,o-t.width/2*h):new QV(s-t.height/2*l/c,n)),d}),"getIntersectPoint"),tX=o((function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=JV(t,r);return r.x=t.x+t.width/2,r.y=t.y+t.height/2,{startPoint:n,endPoint:JV(e,r)}}),"getIntersectPoints"),eX=o((function(t,e,r,n){let i=0;for(let t of e){i+=1;let e=t.wrap&&qV.wrap,a=VV(qV);"C4Dynamic"===n.db.getC4Type()&&(t.label.text=i+": "+t.label.text);let s=Sk(t.label.text,a);XV("label",t,e,a,s),t.techn&&""!==t.techn.text&&(s=Sk(t.techn.text,a),XV("techn",t,e,a,s)),t.descr&&""!==t.descr.text&&(s=Sk(t.descr.text,a),XV("descr",t,e,a,s));let o=r(t.from),l=r(t.to),c=tX(o,l);t.startPoint=c.startPoint,t.endPoint=c.endPoint}$V.drawRels(t,e,qV)}),"drawRels");function rX(t,e,r,n,i){let a=new jV(i);a.data.widthLimit=r.data.widthLimit/Math.min(GV,n.length);for(let[s,o]of n.entries()){let n=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=n,n=o.image.Y+o.image.height);let l=o.wrap&&qV.wrap,c=HV(qV);if(c.fontSize=c.fontSize+2,c.fontWeight="bold",XV("label",o,l,c,a.data.widthLimit),o.label.Y=n+8,n=o.label.Y+o.label.height,o.type&&""!==o.type.text){o.type.text="["+o.type.text+"]",XV("type",o,l,HV(qV),a.data.widthLimit),o.type.Y=n+5,n=o.type.Y+o.type.height}if(o.descr&&""!==o.descr.text){let t=HV(qV);t.fontSize=t.fontSize-2,XV("descr",o,l,t,a.data.widthLimit),o.descr.Y=n+20,n=o.descr.Y+o.descr.height}if(0==s||s%GV==0){let t=r.data.startx+qV.diagramMarginX,e=r.data.stopy+qV.diagramMarginY+n;a.setData(t,t,e,e)}else{let t=a.data.stopx!==a.data.startx?a.data.stopx+qV.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&&ZV(a,t,h,u),e=o.alias;let d=i.db.getBoundarys(e);d.length>0&&rX(t,e,a,d,i),"global"!==o.alias&&KV(t,o,a),r.data.stopy=Math.max(a.data.stopy+qV.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+qV.c4ShapeMargin,r.data.stopx),FV=Math.max(FV,r.data.stopx),zV=Math.max(zV,r.data.stopy)}}o(rX,"drawInsideBoundary");var nX=o((function(t,e,r,n){qV=Qr().c4;const i=Qr().securityLevel;let a;"sandbox"===i&&(a=Ga("#i"+e));const s=Ga("sandbox"===i?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(qV.wrap),UV=o.getC4ShapeInRow(),GV=o.getC4BoundaryInRow(),y.debug(`C:${JSON.stringify(qV,null,2)}`);const l="sandbox"===i?s.select(`[id="${e}"]`):Ga(`[id="${e}"]`);$V.insertComputerIcon(l),$V.insertDatabaseIcon(l),$V.insertClockIcon(l);let c=new jV(n);c.setData(qV.diagramMarginX,qV.diagramMarginX,qV.diagramMarginY,qV.diagramMarginY),c.data.widthLimit=screen.availWidth,FV=qV.diagramMarginX,zV=qV.diagramMarginY;const h=n.db.getTitle();rX(l,"",c,n.db.getBoundarys(""),n),$V.insertArrowHead(l),$V.insertArrowEnd(l),$V.insertArrowCrossHead(l),$V.insertArrowFilledHead(l),eX(l,n.db.getRels(),n.db.getC4Shape,n),c.data.stopx=FV,c.data.stopy=zV;const u=c.data;let d=u.stopy-u.starty+2*qV.diagramMarginY;const p=u.stopx-u.startx+2*qV.diagramMarginX;h&&l.append("text").text(h).attr("x",(u.stopx-u.startx)/2-4*qV.diagramMarginX).attr("y",u.starty+qV.diagramMarginY),Rr(l,d,p,qV.useMaxWidth);const g=h?60:0;l.attr("viewBox",u.startx-qV.diagramMarginX+" -"+(qV.diagramMarginY+g)+" "+p+" "+(d+g)),y.debug("models:",u)}),"draw"),iX={drawPersonOrSystemArray:ZV,drawBoundary:KV,setConf:WV,draw:nX},aX={parser:PH,db:wV,renderer:iX,styles:o((t=>`.person {\n stroke: ${t.personBorder};\n fill: ${t.personBkg};\n }\n`),"getStyles"),init:o((({c4:t,wrap:e})=>{iX.setConf(t),wV.setWrap(e)}),"init")},sX=Object.freeze({__proto__:null,diagram:aX}),oX=o(((t,e)=>{let r;"sandbox"===e&&(r=Ga("#i"+t));return Ga("sandbox"===e?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)}),"getDiagramElement"),lX=o(((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=cX(t,e);Rr(t,a,i,n);const l=hX(s,o,i,a,e);t.attr("viewBox",l),y.debug(`viewBox configured: ${l} with padding: ${e}`)}),"setupViewPortForSVG"),cX=o(((t,e)=>{const r=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+2*e,height:r.height+2*e,x:r.x,y:r.y}}),"calculateDimensionsWithPadding"),hX=o(((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`),"createViewBox"),uX=class{constructor(){this.vertexCounter=0,this.config=Qr(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=jr,this.setAccDescription=Yr,this.setDiagramTitle=Vr,this.getAccTitle=Wr,this.getAccDescription=Hr,this.getDiagramTitle=Xr,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(t){return Lr.sanitizeText(t,this.config)}lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return e.domId;return t}addVertex(t,e,r,n,i,a,s={},o){if(!t||0===t.trim().length)return;let l;if(void 0!==o){let t;t=o.includes("\n")?o+"\n":"{\n"+o+"\n}",l=oy(t,{schema:sy})}const c=this.edges.find((e=>e.id===t));if(c){const t=l;return void 0!==t?.animate&&(c.animate=t.animate),void(void 0!==t?.animation&&(c.animation=t.animation))}let h,u=this.vertices.get(t);if(void 0===u&&(u={id:t,labelType:"text",domId:"flowchart-"+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,u)),this.vertexCounter++,void 0!==e?(this.config=Qr(),h=this.sanitizeText(e.text.trim()),u.labelType=e.type,h.startsWith('"')&&h.endsWith('"')&&(h=h.substring(1,h.length-1)),u.text=h):void 0===u.text&&(u.text=t),void 0!==r&&(u.type=r),null!=n&&n.forEach((t=>{u.styles.push(t)})),null!=i&&i.forEach((t=>{u.classes.push(t)})),void 0!==a&&(u.dir=a),void 0===u.props?u.props=s:void 0!==s&&Object.assign(u.props,s),void 0!==l){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_"))throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!zS(l.shape))throw new Error(`No such shape: ${l.shape}.`);u.type=l?.shape}l?.label&&(u.text=l?.label),l?.icon&&(u.icon=l?.icon,l.label?.trim()||u.text!==t||(u.text="")),l?.form&&(u.form=l?.form),l?.pos&&(u.pos=l?.pos),l?.img&&(u.img=l?.img,l.label?.trim()||u.text!==t||(u.text="")),l?.constraint&&(u.constraint=l.constraint),l.w&&(u.assetWidth=Number(l.w)),l.h&&(u.assetHeight=Number(l.h))}}addSingleLink(t,e,r,n){const i={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};y.info("abc78 Got edge...",i);const a=r.text;if(void 0!==a&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith('"')&&i.text.endsWith('"')&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=a.type),void 0!==r&&(i.type=r.type,i.stroke=r.stroke,i.length=r.length>10?10:r.length),n&&!this.edges.some((t=>t.id===n)))i.id=n,i.isUserDefinedId=!0;else{const t=this.edges.filter((t=>t.start===i.start&&t.end===i.end));0===t.length?i.id=Fk(i.start,i.end,{counter:0,prefix:"L"}):i.id=Fk(i.start,i.end,{counter:t.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.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.`);y.info("Pushing edge..."),this.edges.push(i)}isLinkData(t){return null!==t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id}addLink(t,e,r){const n=this.isLinkData(r)?r.id.replace("@",""):void 0;y.info("addLink",t,e,n);for(const i of t)for(const a of e){const s=i===t[t.length-1],o=a===e[0];s&&o?this.addSingleLink(i,a,r,n):this.addSingleLink(i,a,r,void 0)}}updateLinkInterpolate(t,e){t.forEach((t=>{"default"===t?this.edges.defaultInterpolate=e:this.edges[t].interpolate=e}))}updateLink(t,e){t.forEach((t=>{if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?this.edges.defaultStyle=e:(this.edges[t].style=e,(this.edges[t]?.style?.length??0)>0&&!this.edges[t]?.style?.some((t=>t?.startsWith("fill")))&&this.edges[t]?.style?.push("fill:none"))}))}addClass(t,e){const r=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((t=>{let e=this.classes.get(t);void 0===e&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e)),null!=r&&r.forEach((t=>{if(/color/.exec(t)){const r=t.replace("fill","bgFill");e.textStyles.push(r)}e.styles.push(t)}))}))}setDirection(t){this.direction=t,/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(t,e){for(const r of t.split(",")){const t=this.vertices.get(r);t&&t.classes.push(e);const n=this.edges.find((t=>t.id===r));n&&n.classes.push(e);const i=this.subGraphLookup.get(r);i&&i.classes.push(e)}}setTooltip(t,e){if(void 0!==e){e=this.sanitizeText(e);for(const r of t.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(r):r,e)}}setClickFun(t,e,r){const n=this.lookUpDomId(t);if("loose"!==Qr().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof r){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<i.length;t++){let e=i[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),i[t]=e}}0===i.length&&i.push(t);const a=this.vertices.get(t);a&&(a.haveCallback=!0,this.funs.push((()=>{const t=document.querySelector(`[id="${n}"]`);null!==t&&t.addEventListener("click",(()=>{Pk.runFunc(e,...i)}),!1)})))}setLink(t,e,r){t.split(",").forEach((t=>{const n=this.vertices.get(t);void 0!==n&&(n.link=Pk.formatUrl(e,this.config),n.linkTarget=r)})),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,e,r){t.split(",").forEach((t=>{this.setClickFun(t,e,r)})),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((e=>{e(t)}))}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let e=Ga(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Ga("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Ga(t).select("svg").selectAll("g.node").on("mouseover",(t=>{const r=Ga(t.currentTarget);if(null===r.attr("title"))return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(r.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),r.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);Ga(t.currentTarget).classed("hover",!1)}))}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=Qr(),qr()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,r){let n=t.text.trim(),i=r.text;t===r&&/\s/.exec(r.text)&&(n=void 0);const a=o((t=>{const e={boolean:{},number:{},string:{}},r=[];let n;const i=t.filter((function(t){const i=typeof t;return t.stmt&&"dir"===t.stmt?(n=t.value,!1):""!==t.trim()&&(i in e?!e[i].hasOwnProperty(t)&&(e[i][t]=!0):!r.includes(t)&&r.push(t))}));return{nodeList:i,dir:n}}),"uniq"),{nodeList:s,dir:l}=a(e.flat());if("gen-1"===this.version)for(let t=0;t<s.length;t++)s[t]=this.lookUpDomId(s[t]);n=n??"subGraph"+this.subCount,i=i||"",i=this.sanitizeText(i),this.subCount=this.subCount+1;const c={id:n,nodes:s,title:i.trim(),classes:[],dir:l,labelType:r.type};return y.info("Adding",c.id,c.nodes,c.dir),c.nodes=this.makeUniq(c,this.subGraphs).nodes,this.subGraphs.push(c),this.subGraphLookup.set(n,c),n}getPosForId(t){for(const[e,r]of this.subGraphs.entries())if(r.id===t)return e;return-1}indexNodes2(t,e){const r=this.subGraphs[e].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let n=0,i=1;for(;n<r.length;){const e=this.getPosForId(r[n]);if(e>=0){const r=this.indexNodes2(t,e);if(r.result)return{result:!0,count:i+r.count};i+=r.count}n+=1}return{result:!1,count:i}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}destructStartLink(t){let e=t.trim(),r="arrow_open";switch(e[0]){case"<":r="arrow_point",e=e.slice(1);break;case"x":r="arrow_cross",e=e.slice(1);break;case"o":r="arrow_circle",e=e.slice(1)}let n="normal";return e.includes("=")&&(n="thick"),e.includes(".")&&(n="dotted"),{type:r,stroke:n}}countChar(t,e){const r=e.length;let n=0;for(let i=0;i<r;++i)e[i]===t&&++n;return n}destructEndLink(t){const e=t.trim();let r=e.slice(0,-1),n="arrow_open";switch(e.slice(-1)){case"x":n="arrow_cross",e.startsWith("x")&&(n="double_"+n,r=r.slice(1));break;case">":n="arrow_point",e.startsWith("<")&&(n="double_"+n,r=r.slice(1));break;case"o":n="arrow_circle",e.startsWith("o")&&(n="double_"+n,r=r.slice(1))}let i="normal",a=r.length-1;r.startsWith("=")&&(i="thick"),r.startsWith("~")&&(i="invisible");const s=this.countChar(".",r);return s&&(i="dotted",a=s),{type:n,stroke:i,length:a}}destructLink(t,e){const r=this.destructEndLink(t);let n;if(e){if(n=this.destructStartLink(e),n.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===n.type)n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return"double_arrow"===n.type&&(n.type="double_arrow_point"),n.length=r.length,n}return r}exists(t,e){for(const r of t)if(r.nodes.includes(e))return!0;return!1}makeUniq(t,e){const r=[];return t.nodes.forEach(((n,i)=>{this.exists(e,n)||r.push(t.nodes[i])})),{nodes:r}}getTypeFromVertex(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}}findNode(t,e){return t.find((t=>t.id===e))}destructEdgeType(t){let e="none",r="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":r=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),r=e}return{arrowTypeStart:e,arrowTypeEnd:r}}addNodeFromVertex(t,e,r,n,i,a){const s=r.get(t.id),o=n.get(t.id)??!1,l=this.findNode(e,t.id);if(l)l.cssStyles=t.styles,l.cssCompiledStyles=this.getCompiledStyles(t.classes),l.cssClasses=t.classes.join(" ");else{const r={id:t.id,label:t.text,labelStyle:"",parentId:s,padding:i.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:a,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};o?e.push({...r,isGroup:!0,shape:"rect"}):e.push({...r,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let e=[];for(const r of t){const t=this.classes.get(r);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}getData(){const t=Qr(),e=[],r=[],n=this.getSubGraphs(),i=new Map,a=new Map;for(let t=n.length-1;t>=0;t--){const e=n[t];e.nodes.length>0&&a.set(e.id,!0);for(const t of e.nodes)i.set(t,e.id)}for(let r=n.length-1;r>=0;r--){const a=n[r];e.push({id:a.id,label:a.title,labelStyle:"",parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(" "),shape:"rect",dir:a.dir,isGroup:!0,look:t.look})}this.getVertices().forEach((r=>{this.addNodeFromVertex(r,e,i,a,t,t.look||"classic")}));const s=this.getEdges();return s.forEach(((e,n)=>{const{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(e.type),o=[...s.defaultStyle??[]];e.style&&o.push(...e.style);const l={id:Fk(e.start,e.end,{counter:n,prefix:"L"},e.id),isUserDefinedId:e.isUserDefinedId,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||"arrow_open"===e?.type?"none":i,arrowTypeEnd:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":a,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(e.classes),labelStyle:o,style:o,pattern:e.stroke,look:t.look,animate:e.animate,animation:e.animation,curve:e.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};r.push(l)})),{nodes:e,edges:r,other:{},config:t}}defaultConfig(){return tn.flowchart}},dX=o((function(t,e){return e.db.getClasses()}),"getClasses"),pX=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=Qr();let o;"sandbox"===i&&(o=Ga("#i"+e));const l="sandbox"===i?o.nodes()[0].contentDocument:document;y.debug("Before getData: ");const c=n.db.getData();y.debug("Data: ",c);const h=oX(e,i),u=n.db.getDirection();c.type=n.type,c.layoutAlgorithm=OA(s),"dagre"===c.layoutAlgorithm&&"elk"===s&&y.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,y.debug("REF1:",c),await DA(c,h);const d=c.config.flowchart?.diagramPadding??8;Pk.insertTitle(h,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),lX(h,d,"flowchart",a?.useMaxWidth||!1);for(const t of c.nodes){const r=Ga(`#${e} [id="${t.id}"]`);if(!r||!t.link)continue;const n=l.createElementNS("http://www.w3.org/2000/svg","a");n.setAttributeNS("http://www.w3.org/2000/svg","class",t.cssClasses),n.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),"sandbox"===i?n.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):t.linkTarget&&n.setAttributeNS("http://www.w3.org/2000/svg","target",t.linkTarget);const a=r.insert((function(){return n}),":first-child"),s=r.select(".label-container");s&&a.append((function(){return s.node()}));const o=r.select(".label");o&&a.append((function(){return o.node()}))}}),"draw"),gX={getClasses:dX,draw:pX},fX=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],a=[2,2],s=[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],R=[1,35],M=[1,36],D=[1,37],O=[1,57],P=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],B=[1,61],$=[1,60],F=[1,62],z=[8,9,11,75,77,78],U=[1,78],G=[1,91],q=[1,96],j=[1,95],W=[1,92],Y=[1,88],H=[1,94],V=[1,90],X=[1,97],K=[1,93],Z=[1,98],Q=[1,89],J=[8,9,10,11,40,75,77,78],tt=[8,9,10,11,40,46,75,77,78],et=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],rt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],nt=[44,60,89,102,105,106,109,111,114,115,116],it=[1,121],at=[1,122],st=[1,124],ot=[1,123],lt=[44,60,62,74,89,102,105,106,109,111,114,115,116],ct=[1,133],ht=[1,147],ut=[1,148],dt=[1,149],pt=[1,150],gt=[1,135],ft=[1,137],mt=[1,141],yt=[1,142],vt=[1,143],xt=[1,144],bt=[1,145],wt=[1,146],kt=[1,151],Tt=[1,152],_t=[1,131],Et=[1,132],Ct=[1,139],St=[1,134],At=[1,138],Lt=[1,136],Nt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124],It=[1,154],Rt=[1,156],Mt=[8,9,11],Dt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ot=[1,176],Pt=[1,172],Bt=[1,173],$t=[1,177],Ft=[1,174],zt=[1,175],Ut=[77,116,119],Gt=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],qt=[10,106],jt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Wt=[1,247],Yt=[1,245],Ht=[1,249],Vt=[1,243],Xt=[1,244],Kt=[1,246],Zt=[1,248],Qt=[1,250],Jt=[1,268],te=[8,9,11,106],ee=[8,9,10,11,60,84,105,106,109,110,111,112],re={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1]],performAction:o((function(t,e,r,n,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 183:case 44:case 54:case 76:case 181:this.$=a[o];break;case 11:n.setDirection("TB"),this.$="TB";break;case 12:n.setDirection(a[o-1]),this.$=a[o-1];break;case 27:this.$=a[o-1].nodes;break;case 33:this.$=n.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 34:this.$=n.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 35:this.$=n.addSubGraph(void 0,a[o-1],void 0);break;case 37:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 38:case 39:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 43:case 133:this.$=a[o-1]+a[o];break;case 45:n.addVertex(a[o-1][a[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[o]),n.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:n.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:n.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:n.addVertex(a[o-1][a[o-1].length-1],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 128:case 130:this.$=[a[o]];break;case 52:n.addVertex(a[o-5][a[o-5].length-1],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],n.setClass(a[o-2],a[o]);break;case 56:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"square");break;case 57:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"doublecircle");break;case 58:this.$=a[o-5],n.addVertex(a[o-5],a[o-2],"circle");break;case 59:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"ellipse");break;case 60:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"stadium");break;case 61:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"subroutine");break;case 62:this.$=a[o-7],n.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],n.addVertex(a[o-3],a[o-1],"cylinder");break;case 64:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"round");break;case 65:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"diamond");break;case 66:this.$=a[o-5],n.addVertex(a[o-5],a[o-2],"hexagon");break;case 67:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"odd");break;case 68:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"trapezoid");break;case 69:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 70:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"lean_right");break;case 71:this.$=a[o-3],n.addVertex(a[o-3],a[o-1],"lean_left");break;case 72:this.$=a[o],n.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=n.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1]};break;case 78:l=n.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[o-1],id:a[o-3]};break;case 79:case 86:case 101:case 103:this.$={text:a[o],type:"text"};break;case 80:case 87:case 102:this.$={text:a[o-1].text+""+a[o],type:a[o-1].type};break;case 81:case 88:this.$={text:a[o],type:"string"};break;case 82:case 89:case 104:this.$={text:a[o],type:"markdown"};break;case 83:l=n.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:l=n.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:a[o-1]};break;case 85:this.$=a[o-1];break;case 105:this.$=a[o-4],n.addClass(a[o-2],a[o]);break;case 106:this.$=a[o-4],n.setClass(a[o-2],a[o]);break;case 107:case 115:this.$=a[o-1],n.setClickEvent(a[o-1],a[o]);break;case 108:case 116:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-2]),n.setTooltip(a[o-3],a[o]);break;case 109:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 110:this.$=a[o-4],n.setClickEvent(a[o-4],a[o-3],a[o-2]),n.setTooltip(a[o-4],a[o]);break;case 111:this.$=a[o-2],n.setLink(a[o-2],a[o]);break;case 112:this.$=a[o-4],n.setLink(a[o-4],a[o-2]),n.setTooltip(a[o-4],a[o]);break;case 113:this.$=a[o-4],n.setLink(a[o-4],a[o-2],a[o]);break;case 114:this.$=a[o-6],n.setLink(a[o-6],a[o-4],a[o]),n.setTooltip(a[o-6],a[o-2]);break;case 117:this.$=a[o-1],n.setLink(a[o-1],a[o]);break;case 118:this.$=a[o-3],n.setLink(a[o-3],a[o-2]),n.setTooltip(a[o-3],a[o]);break;case 119:this.$=a[o-3],n.setLink(a[o-3],a[o-2],a[o]);break;case 120:this.$=a[o-5],n.setLink(a[o-5],a[o-4],a[o]),n.setTooltip(a[o-5],a[o-2]);break;case 121:this.$=a[o-4],n.addVertex(a[o-2],void 0,void 0,a[o]);break;case 122:this.$=a[o-4],n.updateLink([a[o-2]],a[o]);break;case 123:this.$=a[o-4],n.updateLink(a[o-2],a[o]);break;case 124:this.$=a[o-8],n.updateLinkInterpolate([a[o-6]],a[o-2]),n.updateLink([a[o-6]],a[o]);break;case 125:this.$=a[o-8],n.updateLinkInterpolate(a[o-6],a[o-2]),n.updateLink(a[o-6],a[o]);break;case 126:this.$=a[o-6],n.updateLinkInterpolate([a[o-4]],a[o]);break;case 127:this.$=a[o-6],n.updateLinkInterpolate(a[o-4],a[o]);break;case 129:case 131:a[o-2].push(a[o]),this.$=a[o-2];break;case 182:case 184:this.$=a[o-1]+""+a[o];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"}}}),"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9: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,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124: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,66],78:[1,65]},{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:$,11:F,21:71},{8:B,9:$,10:[1,72],11:F,21:73},t(P,[2,36]),{35:[1,74]},{37:[1,75]},t(P,[2,39]),t(z,[2,50],{18:76,39:77,10:O,40:U}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:G,44:q,60:j,80:[1,86],89:W,95:[1,83],97:[1,84],101:85,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},t(P,[2,185]),t(P,[2,186]),t(P,[2,187]),t(P,[2,188]),t(J,[2,51]),t(J,[2,54],{46:[1,99]}),t(tt,[2,72],{113:112,29:[1,100],44:f,48:[1,101],50:[1,102],52:[1,103],54:[1,104],56:[1,105],58:[1,106],60:m,63:[1,107],65:[1,108],67:[1,109],68:[1,110],70:[1,111],89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),t(et,[2,181]),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(et,[2,151]),t(et,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,113]},t(rt,[2,26],{18:114,10:O}),t(P,[2,27]),{42:115,43:38,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(P,[2,40]),t(P,[2,41]),t(P,[2,42]),t(nt,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:it,81:at,116:st,119:ot},{75:[1,125],77:[1,126]},t(lt,[2,83]),t(P,[2,28]),t(P,[2,29]),t(P,[2,30]),t(P,[2,31]),t(P,[2,32]),{10:ct,12:ht,14:ut,27:dt,28:127,32:pt,44:gt,60:ft,75:mt,80:[1,129],81:[1,130],83:140,84:yt,85:vt,86:xt,87:bt,88:wt,89:kt,90:Tt,91:128,105:_t,109:Et,111:Ct,114:St,115:At,116:Lt},t(Nt,a,{5:153}),t(P,[2,37]),t(P,[2,38]),t(z,[2,48],{44:It}),t(z,[2,49],{18:155,10:O,40:Rt}),t(J,[2,44]),{44:f,47:157,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{102:[1,158],103:159,105:[1,160]},{44:f,47:161,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{44:f,47:162,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(Mt,[2,115],{120:167,10:[1,166],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,117],{10:[1,168]}),t(Dt,[2,183]),t(Dt,[2,170]),t(Dt,[2,171]),t(Dt,[2,172]),t(Dt,[2,173]),t(Dt,[2,174]),t(Dt,[2,175]),t(Dt,[2,176]),t(Dt,[2,177]),t(Dt,[2,178]),t(Dt,[2,179]),t(Dt,[2,180]),{44:f,47:169,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{30:170,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:178,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:180,50:[1,179],67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:181,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:182,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:183,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{109:[1,184]},{30:185,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:186,65:[1,187],67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:188,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:189,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{30:190,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(et,[2,182]),t(i,[2,20]),t(rt,[2,25]),t(z,[2,46],{39:191,18:192,10:O,40:U}),t(nt,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{77:[1,196],79:197,116:st,119:ot},t(Ut,[2,79]),t(Ut,[2,81]),t(Ut,[2,82]),t(Ut,[2,168]),t(Ut,[2,169]),{76:198,79:120,80:it,81:at,116:st,119:ot},t(lt,[2,84]),{8:B,9:$,10:ct,11:F,12:ht,14:ut,21:200,27:dt,29:[1,199],32:pt,44:gt,60:ft,75:mt,83:140,84:yt,85:vt,86:xt,87:bt,88:wt,89:kt,90:Tt,91:201,105:_t,109:Et,111:Ct,114:St,115:At,116:Lt},t(Gt,[2,101]),t(Gt,[2,103]),t(Gt,[2,104]),t(Gt,[2,157]),t(Gt,[2,158]),t(Gt,[2,159]),t(Gt,[2,160]),t(Gt,[2,161]),t(Gt,[2,162]),t(Gt,[2,163]),t(Gt,[2,164]),t(Gt,[2,165]),t(Gt,[2,166]),t(Gt,[2,167]),t(Gt,[2,90]),t(Gt,[2,91]),t(Gt,[2,92]),t(Gt,[2,93]),t(Gt,[2,94]),t(Gt,[2,95]),t(Gt,[2,96]),t(Gt,[2,97]),t(Gt,[2,98]),t(Gt,[2,99]),t(Gt,[2,100]),{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,202],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},{10:O,18:203},{44:[1,204]},t(J,[2,43]),{10:[1,205],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{10:[1,206]},{10:[1,207],106:[1,208]},t(qt,[2,128]),{10:[1,209],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{10:[1,210],44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:112,114:A,115:L,116:N},{80:[1,211]},t(Mt,[2,109],{10:[1,212]}),t(Mt,[2,111],{10:[1,213]}),{80:[1,214]},t(Dt,[2,184]),{80:[1,215],98:[1,216]},t(J,[2,55],{113:112,44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),{31:[1,217],67:Ot,82:218,116:$t,117:Ft,118:zt},t(jt,[2,86]),t(jt,[2,88]),t(jt,[2,89]),t(jt,[2,153]),t(jt,[2,154]),t(jt,[2,155]),t(jt,[2,156]),{49:[1,219],67:Ot,82:218,116:$t,117:Ft,118:zt},{30:220,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{51:[1,221],67:Ot,82:218,116:$t,117:Ft,118:zt},{53:[1,222],67:Ot,82:218,116:$t,117:Ft,118:zt},{55:[1,223],67:Ot,82:218,116:$t,117:Ft,118:zt},{57:[1,224],67:Ot,82:218,116:$t,117:Ft,118:zt},{60:[1,225]},{64:[1,226],67:Ot,82:218,116:$t,117:Ft,118:zt},{66:[1,227],67:Ot,82:218,116:$t,117:Ft,118:zt},{30:228,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},{31:[1,229],67:Ot,82:218,116:$t,117:Ft,118:zt},{67:Ot,69:[1,230],71:[1,231],82:218,116:$t,117:Ft,118:zt},{67:Ot,69:[1,233],71:[1,232],82:218,116:$t,117:Ft,118:zt},t(z,[2,45],{18:155,10:O,40:Rt}),t(z,[2,47],{44:It}),t(nt,[2,75]),t(nt,[2,74]),{62:[1,234],67:Ot,82:218,116:$t,117:Ft,118:zt},t(nt,[2,77]),t(Ut,[2,80]),{77:[1,235],79:197,116:st,119:ot},{30:236,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(Nt,a,{5:237}),t(Gt,[2,102]),t(P,[2,35]),{43:238,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},{10:O,18:239},{10:Wt,60:Yt,84:Ht,92:240,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:251,104:[1,252],105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:253,104:[1,254],105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{105:[1,255]},{10:Wt,60:Yt,84:Ht,92:256,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{44:f,47:257,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(Mt,[2,116]),t(Mt,[2,118],{10:[1,261]}),t(Mt,[2,119]),t(tt,[2,56]),t(jt,[2,87]),t(tt,[2,57]),{51:[1,262],67:Ot,82:218,116:$t,117:Ft,118:zt},t(tt,[2,64]),t(tt,[2,59]),t(tt,[2,60]),t(tt,[2,61]),{109:[1,263]},t(tt,[2,63]),t(tt,[2,65]),{66:[1,264],67:Ot,82:218,116:$t,117:Ft,118:zt},t(tt,[2,67]),t(tt,[2,68]),t(tt,[2,70]),t(tt,[2,69]),t(tt,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(nt,[2,78]),{31:[1,265],67:Ot,82:218,116:$t,117:Ft,118:zt},{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,266],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},t(J,[2,53]),{43:267,44:f,45:39,47:40,60:m,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N},t(Mt,[2,121],{106:Jt}),t(te,[2,130],{108:269,10:Wt,60:Yt,84:Ht,105:Vt,109:Xt,110:Kt,111:Zt,112:Qt}),t(ee,[2,132]),t(ee,[2,134]),t(ee,[2,135]),t(ee,[2,136]),t(ee,[2,137]),t(ee,[2,138]),t(ee,[2,139]),t(ee,[2,140]),t(ee,[2,141]),t(Mt,[2,122],{106:Jt}),{10:[1,270]},t(Mt,[2,123],{106:Jt}),{10:[1,271]},t(qt,[2,129]),t(Mt,[2,105],{106:Jt}),t(Mt,[2,106],{113:112,44:f,60:m,89:k,102:T,105:_,106:E,109:C,111:S,114:A,115:L,116:N}),t(Mt,[2,110]),t(Mt,[2,112],{10:[1,272]}),t(Mt,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:B,9:$,11:F,21:277},t(P,[2,34]),t(J,[2,52]),{10:Wt,60:Yt,84:Ht,105:Vt,107:278,108:242,109:Xt,110:Kt,111:Zt,112:Qt},t(ee,[2,133]),{14:G,44:q,60:j,89:W,101:279,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},{14:G,44:q,60:j,89:W,101:280,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q,120:87},{98:[1,281]},t(Mt,[2,120]),t(tt,[2,58]),{30:282,67:Ot,80:Pt,81:Bt,82:171,116:$t,117:Ft,118:zt},t(tt,[2,66]),t(Nt,a,{5:283}),t(te,[2,131],{108:269,10:Wt,60:Yt,84:Ht,105:Vt,109:Xt,110:Kt,111:Zt,112:Qt}),t(Mt,[2,126],{120:167,10:[1,284],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,127],{120:167,10:[1,285],14:G,44:q,60:j,89:W,105:Y,106:H,109:V,111:X,114:K,115:Z,116:Q}),t(Mt,[2,114]),{31:[1,286],67:Ot,82:218,116:$t,117:Ft,118:zt},{6:11,7:12,8:s,9:l,10:c,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:u,32:[1,287],33:24,34:d,36:p,38:g,42:28,43:38,44:f,45:39,47:40,60:m,84:y,85:v,86:x,87:b,88:w,89:k,102:T,105:_,106:E,109:C,111:S,113:41,114:A,115:L,116:N,121:I,122:R,123:M,124:D},{10:Wt,60:Yt,84:Ht,92:288,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},{10:Wt,60:Yt,84:Ht,92:289,105:Vt,107:241,108:242,109:Xt,110:Kt,111:Zt,112:Qt},t(tt,[2,62]),t(P,[2,33]),t(Mt,[2,124],{106:Jt}),t(Mt,[2,125],{106:Jt})],defaultActions:{},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},ne=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){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 r=/\n\s*/g;return e.yytext=e.yytext.replace(r,"<br/>"),40;case 11:return 40;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 18:return 96;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 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 34:return 88;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 98;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 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:case 102:return 111;case 62:return 46;case 63:return 60;case 64:case 103:return 44;case 65:return 8;case 66:return 106;case 67:case 101:return 115;case 68:case 71:case 74:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:case 73:case 76:return 119;case 72:return this.pushState("thickEdgeText"),75;case 75:return this.pushState("dottedEdgeText"),75;case 77:return 77;case 78:return this.popState(),53;case 79:case 115:return"TEXT";case 80:return this.pushState("ellipseText"),52;case 81:return this.popState(),55;case 82:return this.pushState("text"),54;case 83:return this.popState(),57;case 84:return this.pushState("text"),56;case 85:return 58;case 86:return this.pushState("text"),67;case 87:return this.popState(),64;case 88:return this.pushState("text"),63;case 89:return this.popState(),49;case 90:return this.pushState("text"),48;case 91:return this.popState(),69;case 92:return this.popState(),71;case 93:return 117;case 94:return this.pushState("trapText"),68;case 95:return this.pushState("trapText"),70;case 96:return 118;case 97:return 67;case 98:return 90;case 99:return"SEP";case 100:return 89;case 104:return 109;case 105:return 114;case 106:return 116;case 107:return this.popState(),62;case 108:return this.pushState("text"),62;case 109:return this.popState(),51;case 110:return this.pushState("text"),50;case 111:return this.popState(),31;case 112:return this.pushState("text"),29;case 113:return this.popState(),66;case 114:return this.pushState("text"),65;case 116:return"QUOTE";case 117:return 9;case 118:return 10;case 119: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]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},href:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},click:{rules:[21,24,33,34,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dottedEdgeText:{rules:[21,24,74,76,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},thickEdgeText:{rules:[21,24,71,73,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},edgeText:{rules:[21,24,68,70,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},trapText:{rules:[21,24,77,80,82,84,88,90,91,92,93,94,95,108,110,112,114],inclusive:!1},ellipseText:{rules:[21,24,77,78,79,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},text:{rules:[21,24,77,80,81,82,83,84,87,88,89,90,94,95,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_descr:{rules:[3,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},acc_title:{rules:[1,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},md_string:{rules:[19,20,21,24,77,80,82,84,88,90,94,95,108,110,112,114],inclusive:!1},string:{rules:[21,22,23,24,77,80,82,84,88,90,94,95,108,110,112,114],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,69,71,72,74,75,77,80,82,84,85,86,88,90,94,95,96,97,98,99,100,101,102,103,104,105,106,108,110,112,114,116,117,118,119],inclusive:!0}}};return t}();function ie(){this.yy={}}return re.lexer=ne,o(ie,"Parser"),ie.prototype=re,re.Parser=ie,new ie}();fX.parser=fX;var mX=fX,yX=Object.assign({},mX);yX.parse=t=>{const e=t.replace(/}\s*\n/g,"}\n");return mX.parse(e)};var vX=yX,xX=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),bX={parser:vX,get db(){return new uX},renderer:gX,styles:o((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: ${xX(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:o((t=>{t.flowchart||(t.flowchart={}),t.layout&&Jr({layout:t.layout}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,Jr({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})}),"init")},wX=Object.freeze({__proto__:null,diagram:bX}),kX=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,20],l=[1,21],c=[1,22],h=[1,23],u=[1,24],d=[1,19],p=[1,25],g=[1,26],f=[1,18],m=[1,33],y=[1,34],v=[1,35],x=[1,36],b=[1,37],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],k=[1,42],T=[1,43],_=[1,52],E=[40,50,68,69],C=[1,63],S=[1,61],A=[1,58],L=[1,62],N=[1,64],I=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],R=[63,64,65,66,67],M=[1,81],D=[1,80],O=[1,78],P=[1,79],B=[6,10,42,47],$=[6,10,13,41,42,47,48,49],F=[1,89],z=[1,88],U=[1,87],G=[19,56],q=[1,98],j=[1,97],W=[19,56,58,60],Y={trace:o((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,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:o((function(t,e,r,n,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 55:case 78:case 62:case 63:case 66:this.$=a[o];break;case 8:n.addEntity(a[o-4]),n.addEntity(a[o-2]),n.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 9:n.addEntity(a[o-8]),n.addEntity(a[o-4]),n.addRelationship(a[o-8],a[o],a[o-4],a[o-5]),n.setClass([a[o-8]],a[o-6]),n.setClass([a[o-4]],a[o-2]);break;case 10:n.addEntity(a[o-6]),n.addEntity(a[o-2]),n.addRelationship(a[o-6],a[o],a[o-2],a[o-3]),n.setClass([a[o-6]],a[o-4]);break;case 11:n.addEntity(a[o-6]),n.addEntity(a[o-4]),n.addRelationship(a[o-6],a[o],a[o-4],a[o-5]),n.setClass([a[o-4]],a[o-2]);break;case 12:n.addEntity(a[o-3]),n.addAttributes(a[o-3],a[o-1]);break;case 13:n.addEntity(a[o-5]),n.addAttributes(a[o-5],a[o-1]),n.setClass([a[o-5]],a[o-3]);break;case 14:n.addEntity(a[o-2]);break;case 15:n.addEntity(a[o-4]),n.setClass([a[o-4]],a[o-2]);break;case 16:n.addEntity(a[o]);break;case 17:n.addEntity(a[o-2]),n.setClass([a[o-2]],a[o]);break;case 18:n.addEntity(a[o-6],a[o-4]),n.addAttributes(a[o-6],a[o-1]);break;case 19:n.addEntity(a[o-8],a[o-6]),n.addAttributes(a[o-8],a[o-1]),n.setClass([a[o-8]],a[o-3]);break;case 20:n.addEntity(a[o-5],a[o-3]);break;case 21:n.addEntity(a[o-7],a[o-5]),n.setClass([a[o-7]],a[o-2]);break;case 22:n.addEntity(a[o-3],a[o-1]);break;case 23:n.addEntity(a[o-5],a[o-3]),n.setClass([a[o-5]],a[o]);break;case 24:case 25:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=a[o-3],n.addClass(a[o-2],a[o-1]);break;case 37:case 38:case 56:case 64:case 43:this.$=[a[o]];break;case 39:case 40:this.$=a[o-2].concat([a[o]]);break;case 41:this.$=a[o-2],n.setClass(a[o-1],a[o]);break;case 42:this.$=a[o-3],n.addCssStyles(a[o-2],a[o-1]);break;case 44:case 65:a[o-2].push(a[o]),this.$=a[o-2];break;case 46:this.$=a[o-1]+a[o];break;case 54:case 76:case 77:case 67:this.$=a[o].replace(/"/g,"");break;case 57:a[o].push(a[o-1]),this.$=a[o];break;case 58:this.$={type:a[o-1],name:a[o]};break;case 59:this.$={type:a[o-2],name:a[o-1],keys:a[o]};break;case 60:this.$={type:a[o-2],name:a[o-1],comment:a[o]};break;case 61:this.$={type:a[o-3],name:a[o-2],keys:a[o-1],comment:a[o]};break;case 68:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.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,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:l,35:c,36:h,37:u,40:d,43:p,44:g,50:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:27,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:l,35:c,36:h,37:u,40:d,43:p,44:g,50:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:m,64:y,65:v,66:x,67:b}),{23:[1,38]},{25:[1,39]},{27:[1,40]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(w,[2,54]),t(w,[2,55]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:41,40:k,41:T},{16:44,40:k,41:T},{16:45,40:k,41:T},t(e,[2,4]),{11:46,40:d,50:f},{16:47,40:k,41:T},{18:48,19:[1,49],51:50,52:51,56:_},{11:53,40:d,50:f},{62:54,68:[1,55],69:[1,56]},t(E,[2,69]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:C,38:57,41:S,42:A,45:59,46:60,48:L,49:N},t(I,[2,37]),t(I,[2,38]),{16:65,40:k,41:T,42:A},{13:C,38:66,41:S,42:A,45:59,46:60,48:L,49:N},{13:[1,67],15:[1,68]},t(e,[2,17],{61:32,12:69,17:[1,70],42:A,63:m,64:y,65:v,66:x,67:b}),{19:[1,71]},t(e,[2,14]),{18:72,19:[2,56],51:50,52:51,56:_},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:m,64:y,65:v,66:x,67:b},t(R,[2,74]),t(R,[2,75]),{6:M,10:D,39:77,42:O,47:P},{40:[1,82],41:[1,83]},t(B,[2,43],{46:84,13:C,41:S,48:L,49:N}),t($,[2,45]),t($,[2,50]),t($,[2,51]),t($,[2,52]),t($,[2,53]),t(e,[2,41],{42:A}),{6:M,10:D,39:85,42:O,47:P},{14:86,40:F,50:z,70:U},{16:90,40:k,41:T},{11:91,40:d,50:f},{18:92,19:[1,93],51:50,52:51,56:_},t(e,[2,12]),{19:[2,57]},t(G,[2,58],{54:94,55:95,57:96,59:q,60:j}),t([19,56,59,60],[2,63]),t(e,[2,22],{15:[1,100],17:[1,99]}),t([40,50],[2,68]),t(e,[2,36]),{13:C,41:S,45:101,46:60,48:L,49:N},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(I,[2,39]),t(I,[2,40]),t($,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,76]),t(e,[2,77]),t(e,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},t(e,[2,15]),t(G,[2,59],{55:106,58:[1,107],60:j}),t(G,[2,60]),t(W,[2,64]),t(G,[2,67]),t(W,[2,66]),{18:108,19:[1,109],51:50,52:51,56:_},{16:110,40:k,41:T},t(B,[2,44],{46:84,13:C,41:S,48:L,49:N}),{14:111,40:F,50:z,70:U},{16:112,40:k,41:T},{14:113,40:F,50:z,70:U},t(e,[2,13]),t(G,[2,61]),{57:114,59:q},{19:[1,115]},t(e,[2,20]),t(e,[2,23],{17:[1,116],42:A}),t(e,[2,11]),{13:[1,117],42:A},t(e,[2,10]),t(W,[2,65]),t(e,[2,18]),{18:118,19:[1,119],51:50,52:51,56:_},{14:120,40:F,50:z,70:U},{19:[1,121]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},H=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;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 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 70;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 59;case 25:case 26:return 56;case 27:return 60;case 29:return this.popState(),19;case 30:case 73:return e.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 59:return 63;case 42:case 43:case 44:case 52:case 54:case 61:return 65;case 47:case 48:case 49:case 50:case 51:case 53:case 60:return 64;case 55:case 56:case 57:case 58:return 66;case 62:return 67;case 63:case 66:case 67:case 68:return 68;case 64:case 65:return 69;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 74:return 6}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/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,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,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,65,66,67,68,71,72,73,74],inclusive:!0}}};return t}();function V(){this.yy={}}return Y.lexer=H,o(V,"Parser"),V.prototype=Y,Y.Parser=V,new V}();kX.parser=kX;var TX=kX,_X=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().er),"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{o(this,"ErDB")}addEntity(t,e=""){return this.entities.has(t)?!this.entities.get(t)?.alias&&e&&(this.entities.get(t).alias=e,y.info(`Add alias '${e}' to entity '${t}'`)):(this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:Qr().look??"default",cssClasses:"default",cssStyles:[]}),y.info("Added new entity :",t)),this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const r=this.addEntity(t);let n;for(n=e.length-1;n>=0;n--)e[n].keys||(e[n].keys=[]),e[n].comment||(e[n].comment=""),r.attributes.push(e[n]),y.debug("Added attribute ",e[n].name)}addRelationship(t,e,r,n){const i=this.entities.get(t),a=this.entities.get(r);if(!i||!a)return;const s={entityA:i.id,roleA:e,entityB:a.id,relSpec:n};this.relationships.push(s),y.debug("Added new relationship :",s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const r of t){const t=this.classes.get(r);t?.styles&&(e=[...e,...t.styles??[]].map((t=>t.trim()))),t?.textStyles&&(e=[...e,...t.textStyles??[]].map((t=>t.trim())))}return e}addCssStyles(t,e){for(const r of t){const t=this.entities.get(r);if(!e||!t)return;for(const r of e)t.cssStyles.push(r)}}addClass(t,e){t.forEach((t=>{let r=this.classes.get(t);void 0===r&&(r={id:t,styles:[],textStyles:[]},this.classes.set(t,r)),e&&e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");r.textStyles.push(e)}r.styles.push(t)}))}))}setClass(t,e){for(const r of t){const t=this.entities.get(r);if(t)for(const r of e)t.cssClasses+=" "+r}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],qr()}getData(){const t=[],e=[],r=Qr();for(const e of this.entities.keys()){const r=this.entities.get(e);r&&(r.cssCompiledStyles=this.getCompiledStyles(r.cssClasses.split(" ")),t.push(r))}let n=0;for(const t of this.relationships){const i={id:Fk(t.entityA,t.entityB,{prefix:"id",counter:n++}),type:"normal",curve:"basis",start:t.entityA,end:t.entityB,label:t.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:t.relSpec.cardB.toLowerCase(),arrowTypeEnd:t.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==t.relSpec.relType?"solid":"dashed",look:r.look};e.push(i)}return{nodes:t,edges:e,other:{},config:r,direction:"TB"}}},EX={};h(EX,{draw:()=>CX});var CX=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.config.flowchart.nodeSpacing=a?.nodeSpacing||140,o.config.flowchart.rankSpacing=a?.rankSpacing||80,o.direction=n.db.getDirection(),o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await DA(o,l),"elk"===o.layoutAlgorithm&&l.select(".edges").lower();const c=l.selectAll('[id*="-background"]');Array.from(c).length>0&&c.each((function(){const t=Ga(this),e=t.attr("id").replace("-background",""),r=l.select(`#${CSS.escape(e)}`);if(!r.empty()){const e=r.attr("transform");t.attr("transform",e)}}));Pk.insertTitle(l,"erDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"erDiagram",a?.useMaxWidth??!0)}),"draw"),SX=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),AX={parser:TX,get db(){return new _X},renderer:EX,styles:o((t=>`\n .entityBox {\n fill: ${t.mainBkg};\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 .labelBkg {\n background-color: ${SX(t.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n`),"getStyles")},LX=Object.freeze({__proto__:null,diagram:AX}),NX=class{constructor(t){this.init=t,this.records=this.init()}static{o(this,"ImperativeState")}reset(){this.records=this.init()}};function IX(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}o(IX,"populateCommonDb");var RX=l({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){var e;function r(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}Object.defineProperty(t,"__esModule",{value:!0}),o(r,"RAL"),function(t){function r(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}o(r,"install"),t.install=r}(r||(r={})),t.default=r}}),MX=l({"../../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 r(t){return"string"==typeof t||t instanceof String}function n(t){return"number"==typeof t||t instanceof Number}function i(t){return t instanceof Error}function a(t){return"function"==typeof t}function s(t){return Array.isArray(t)}function l(t){return s(t)&&t.every((t=>r(t)))}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,o(e,"boolean"),t.boolean=e,o(r,"string"),t.string=r,o(n,"number"),t.number=n,o(i,"error"),t.error=i,o(a,"func"),t.func=a,o(s,"array"),t.array=s,o(l,"stringArray"),t.stringArray=l}}),DX=l({"../../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,r=RX();!function(t){const e={dispose(){}};t.None=function(){return e}}(e||(t.Event=e={}));var n=class{static{o(this,"CallbackList")}add(t,e=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(e),Array.isArray(r)&&r.push({dispose:o((()=>this.remove(t,e)),"dispose")})}remove(t,e=null){if(!this._callbacks)return;let r=!1;for(let n=0,i=this._callbacks.length;n<i;n++)if(this._callbacks[n]===t){if(this._contexts[n]===e)return this._callbacks.splice(n,1),void this._contexts.splice(n,1);r=!0}if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];const e=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,s=n.length;a<s;a++)try{e.push(n[a].apply(i[a],t))}catch(t){(0,r.default)().console.error(t)}return e}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class t{static{o(this,"Emitter")}constructor(t){this._options=t}get event(){return this._event||(this._event=(e,r,i)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);const a={dispose:o((()=>{this._callbacks&&(this._callbacks.remove(e,r),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(){}}}),OX=l({"../../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,r=RX(),n=MX(),i=DX();!function(t){function e(e){const r=e;return r&&(r===t.None||r===t.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),o(e,"is"),t.is=e}(e||(t.CancellationToken=e={}));var a=Object.freeze((function(t,e){const n=(0,r.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}})),s=class{static{o(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{o(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=e.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=e.None}};t.CancellationTokenSource=l}}),PX={};h(PX,{AbstractAstReflection:()=>GX,AbstractCstNode:()=>i7,AbstractLangiumParser:()=>d7,AbstractParserErrorMessageProvider:()=>g7,AbstractThreadedAsyncParser:()=>O9,AstUtils:()=>fQ,BiMap:()=>x8,Cancellation:()=>G7,CompositeCstNodeImpl:()=>s7,ContextCache:()=>C8,CstNodeBuilder:()=>n7,CstUtils:()=>BX,DEFAULT_TOKENIZE_OPTIONS:()=>J8,DONE_RESULT:()=>KX,DatatypeSymbol:()=>c7,DefaultAstNodeDescriptionProvider:()=>q8,DefaultAstNodeLocator:()=>W8,DefaultAsyncParser:()=>D9,DefaultCommentProvider:()=>M9,DefaultConfigurationProvider:()=>V8,DefaultDocumentBuilder:()=>X8,DefaultDocumentValidator:()=>F8,DefaultHydrator:()=>$9,DefaultIndexManager:()=>K8,DefaultJsonSerializer:()=>M8,DefaultLangiumDocumentFactory:()=>u8,DefaultLangiumDocuments:()=>d8,DefaultLexer:()=>t9,DefaultLexerErrorMessageProvider:()=>Q8,DefaultLinker:()=>g8,DefaultNameProvider:()=>m8,DefaultReferenceDescriptionProvider:()=>j8,DefaultReferences:()=>y8,DefaultScopeComputation:()=>b8,DefaultScopeProvider:()=>L8,DefaultServiceRegistry:()=>D8,DefaultTokenBuilder:()=>z7,DefaultValueConverter:()=>U7,DefaultWorkspaceLock:()=>B9,DefaultWorkspaceManager:()=>Z8,Deferred:()=>J7,Disposable:()=>H8,DisposableCache:()=>_8,DocumentCache:()=>S8,DocumentState:()=>o8,DocumentValidator:()=>P8,EMPTY_SCOPE:()=>T8,EMPTY_STREAM:()=>XX,EmptyFileSystem:()=>ett,EmptyFileSystemProvider:()=>ttt,ErrorWithLocation:()=>TK,GrammarAST:()=>EK,GrammarUtils:()=>kK,IndentationAwareLexer:()=>Q9,IndentationAwareTokenBuilder:()=>Z9,JSDocDocumentationProvider:()=>R9,LangiumCompletionParser:()=>m7,LangiumParser:()=>p7,LangiumParserErrorMessageProvider:()=>f7,LeafCstNodeImpl:()=>a7,LexingMode:()=>V9,MapScope:()=>k8,Module:()=>I9,MultiMap:()=>v8,OperationCancelled:()=>V7,ParserWorker:()=>P9,Reduction:()=>QX,RegExpUtils:()=>NQ,RootCstNodeImpl:()=>l7,SimpleCache:()=>E8,StreamImpl:()=>YX,StreamScope:()=>w8,TextDocument:()=>Z7,TreeStreamImpl:()=>eK,URI:()=>c8,UriUtils:()=>s8,ValidationCategory:()=>R8,ValidationRegistry:()=>$8,ValueConverter:()=>F7,WorkspaceCache:()=>A8,assertUnreachable:()=>_K,createCompletionParser:()=>P7,createDefaultCoreModule:()=>F9,createDefaultSharedCoreModule:()=>z9,createGrammarConfig:()=>UJ,createLangiumParser:()=>B7,createParser:()=>x7,delayNextTick:()=>q7,diagnosticData:()=>O8,eagerLoad:()=>q9,getDiagnosticRange:()=>z8,indentationBuilderDefaultOptions:()=>K9,inject:()=>U9,interruptAndCheck:()=>K7,isAstNode:()=>$X,isAstNodeDescription:()=>zX,isAstNodeWithComment:()=>N8,isCompositeCstNode:()=>qX,isIMultiModeLexerDefinition:()=>r9,isJSDoc:()=>a9,isLeafCstNode:()=>jX,isLinkingError:()=>UX,isNamed:()=>f8,isOperationCancelled:()=>X7,isReference:()=>FX,isRootCstNode:()=>WX,isTokenTypeArray:()=>e9,isTokenTypeDictionary:()=>n9,loadGrammarFromJson:()=>att,parseJSDoc:()=>i9,prepareLangiumParser:()=>$7,setInterruptionPeriod:()=>H7,startCancelableOperation:()=>Y7,stream:()=>ZX,toDiagnosticData:()=>G8,toDiagnosticSeverity:()=>U8});var BX={};function $X(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$type}function FX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.$refText}function zX(t){return"object"==typeof t&&null!==t&&"string"==typeof t.name&&"string"==typeof t.type&&"string"==typeof t.path}function UX(t){return"object"==typeof t&&null!==t&&$X(t.container)&&FX(t.reference)&&"string"==typeof t.message}h(BX,{DefaultNameRegexp:()=>cK,RangeComparison:()=>JX,compareRange:()=>oK,findCommentNode:()=>uK,findDeclarationNodeAtOffset:()=>hK,findLeafNodeAtOffset:()=>pK,findLeafNodeBeforeOffset:()=>gK,flattenCst:()=>nK,getInteriorNodes:()=>xK,getNextNode:()=>yK,getPreviousNode:()=>mK,getStartlineNode:()=>vK,inRange:()=>lK,isChildNode:()=>iK,isCommentNode:()=>dK,streamCst:()=>rK,toDocumentSegment:()=>sK,tokenToRange:()=>aK}),o($X,"isAstNode"),o(FX,"isReference"),o(zX,"isAstNodeDescription"),o(UX,"isLinkingError");var GX=class{static{o(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}isInstance(t,e){return $X(t)&&this.isSubtype(t.$type,e)}isSubtype(t,e){if(t===e)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});const n=r[e];if(void 0!==n)return n;{const n=this.computeIsSubtype(t,e);return r[e]=n,n}}getAllSubTypes(t){const e=this.allSubtypes[t];if(e)return e;{const e=this.getAllTypes(),r=[];for(const n of e)this.isSubtype(n,t)&&r.push(n);return this.allSubtypes[t]=r,r}}};function qX(t){return"object"==typeof t&&null!==t&&Array.isArray(t.content)}function jX(t){return"object"==typeof t&&null!==t&&"object"==typeof t.tokenType}function WX(t){return qX(t)&&"string"==typeof t.fullText}o(qX,"isCompositeCstNode"),o(jX,"isLeafCstNode"),o(WX,"isRootCstNode");var YX=class t{static{o(this,"StreamImpl")}constructor(t,e){this.startFn=t,this.nextFn=e}iterator(){const t={state:this.startFn(),next:o((()=>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,r=t.next();for(;!r.done;)e++,r=t.next();return e}toArray(){const t=[],e=this.iterator();let r;do{r=e.next(),void 0!==r.value&&t.push(r.value)}while(!r.done);return t}toSet(){return new Set(this)}toMap(t,e){const r=this.map((r=>[t?t(r):r,e?e(r):r]));return new Map(r)}toString(){return this.join()}concat(e){return new t((()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()})),(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=t.iterator.next(),!e.done)return e}while(!e.done);return KX}))}join(t=","){const e=this.iterator();let r,n="",i=!1;do{r=e.next(),r.done||(i&&(n+=t),n+=HX(r.value)),i=!0}while(!r.done);return n}indexOf(t,e=0){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(n>=e&&i.value===t)return n;i=r.next(),n++}return-1}every(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(!t(r.value))return!1;r=e.next()}return!0}some(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(t(r.value))return!0;r=e.next()}return!1}forEach(t){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)t(n.value,r),n=e.next(),r++}map(e){return new t(this.startFn,(t=>{const{done:r,value:n}=this.nextFn(t);return r?KX:{done:!1,value:e(n)}}))}filter(e){return new t(this.startFn,(t=>{let r;do{if(r=this.nextFn(t),!r.done&&e(r.value))return r}while(!r.done);return KX}))}nonNullable(){return this.filter((t=>null!=t))}reduce(t,e){const r=this.iterator();let n=e,i=r.next();for(;!i.done;)n=void 0===n?i.value:t(n,i.value),i=r.next();return n}reduceRight(t,e){return this.recursiveReduce(this.iterator(),t,e)}recursiveReduce(t,e,r){const n=t.next();if(n.done)return r;const i=this.recursiveReduce(t,e,r);return void 0===i?n.value:e(i,n.value)}find(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(t(r.value))return r.value;r=e.next()}}findIndex(t){const e=this.iterator();let r=0,n=e.next();for(;!n.done;){if(t(n.value))return r;n=e.next(),r++}return-1}includes(t){const e=this.iterator();let r=e.next();for(;!r.done;){if(r.value===t)return!0;r=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:r,value:n}=this.nextFn(t.this);if(!r){const r=e(n);if(!VX(r))return{done:!1,value:r};t.iterator=r[Symbol.iterator]()}}while(t.iterator);return KX}))}flat(e){if(void 0===e&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new t((()=>({this:r.startFn()})),(t=>{do{if(t.iterator){const e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}const{done:e,value:n}=r.nextFn(t.this);if(!e){if(!VX(n))return{done:!1,value:n};t.iterator=n[Symbol.iterator]()}}while(t.iterator);return KX}))}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new t((()=>{const t=this.startFn();for(let r=0;r<e;r++){if(this.nextFn(t).done)return t}return t}),this.nextFn)}limit(e){return new t((()=>({size:0,state:this.startFn()})),(t=>(t.size++,t.size>e?KX:this.nextFn(t.state))))}distinct(e){return new t((()=>({set:new Set,internalState:this.startFn()})),(t=>{let r;do{if(r=this.nextFn(t.internalState),!r.done){const n=e?e(r.value):r.value;if(!t.set.has(n))return t.set.add(n),r}}while(!r.done);return KX}))}exclude(t,e){const r=new Set;for(const n of t){const t=e?e(n):n;r.add(t)}return this.filter((t=>{const n=e?e(t):t;return!r.has(n)}))}};function HX(t){return"string"==typeof t?t:void 0===t?"undefined":"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}function VX(t){return!!t&&"function"==typeof t[Symbol.iterator]}o(HX,"toString"),o(VX,"isIterable");var XX=new YX((()=>{}),(()=>KX)),KX=Object.freeze({done:!0,value:void 0});function ZX(...t){if(1===t.length){const e=t[0];if(e instanceof YX)return e;if(VX(e))return new YX((()=>e[Symbol.iterator]()),(t=>t.next()));if("number"==typeof e.length)return new YX((()=>({index:0})),(t=>t.index<e.length?{done:!1,value:e[t.index++]}:KX))}return t.length>1?new YX((()=>({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<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];VX(r)?e.iterator=r[Symbol.iterator]():r&&"number"==typeof r.length&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return KX})):XX}o(ZX,"stream");var QX,JX,tK,eK=class extends YX{static{o(this,"TreeStreamImpl")}constructor(t,e,r){super((()=>({iterators:(null==r?void 0:r.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 r=t.iterators[t.iterators.length-1].next();if(!r.done)return t.iterators.push(e(r.value)[Symbol.iterator]()),r;t.iterators.pop()}return KX}))}iterator(){const t={state:this.startFn(),next:o((()=>this.nextFn(t.state)),"next"),prune:o((()=>{t.state.pruned=!0}),"prune"),[Symbol.iterator]:()=>t};return t}};function rK(t){return new eK(t,(t=>qX(t)?t.content:[]),{includeRoot:!0})}function nK(t){return rK(t).filter(jX)}function iK(t,e){for(;t.container;)if((t=t.container)===e)return!0;return!1}function aK(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function sK(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}function oK(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return JX.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return JX.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?JX.Inside:r?JX.OverlapBack:n?JX.OverlapFront:JX.Outside}function lK(t,e){return oK(t,e)>JX.After}!function(t){function e(t){return t.reduce(((t,e)=>t+e),0)}function r(t){return t.reduce(((t,e)=>t*e),0)}function n(t){return t.reduce(((t,e)=>Math.min(t,e)))}function i(t){return t.reduce(((t,e)=>Math.max(t,e)))}o(e,"sum"),t.sum=e,o(r,"product"),t.product=r,o(n,"min"),t.min=n,o(i,"max"),t.max=i}(QX||(QX={})),o(rK,"streamCst"),o(nK,"flattenCst"),o(iK,"isChildNode"),o(aK,"tokenToRange"),o(sK,"toDocumentSegment"),(tK=JX||(JX={}))[tK.Before=0]="Before",tK[tK.After=1]="After",tK[tK.OverlapFront=2]="OverlapFront",tK[tK.OverlapBack=3]="OverlapBack",tK[tK.Inside=4]="Inside",tK[tK.Outside=5]="Outside",o(oK,"compareRange"),o(lK,"inRange");var cK=/^[\w\p{L}]$/u;function hK(t,e,r=cK){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return pK(t,e)}}function uK(t,e){if(t){const r=mK(t,!0);if(r&&dK(r,e))return r;if(WX(t)){const r=t.content.findIndex((t=>!t.hidden));for(let n=r-1;n>=0;n--){const r=t.content[n];if(dK(r,e))return r}}}}function dK(t,e){return jX(t)&&e.includes(t.tokenType.name)}function pK(t,e){if(jX(t))return t;if(qX(t)){const r=fK(t,e,!1);if(r)return pK(r,e)}}function gK(t,e){if(jX(t))return t;if(qX(t)){const r=fK(t,e,!0);if(r)return gK(r,e)}}function fK(t,e,r){let n,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?(n=r?o:void 0,i=s+1):a=s-1}return n}function mK(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const t=r.content[n];if(e||!t.hidden)return t}t=r}}function yK(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;n<i;){n++;const t=r.content[n];if(e||!t.hidden)return t}t=r}}function vK(t){if(0===t.range.start.character)return t;const e=t.range.start.line;let r,n=t;for(;t.container;){const i=t.container,a=null!=r?r:i.content.indexOf(t);if(0===a?(t=i,r=void 0):(r=a-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function xK(t,e){const r=bK(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}function bK(t,e){const r=wK(t),n=wK(e);let i;for(let t=0;t<r.length&&t<n.length;t++){const e=r[t],a=n[t];if(e.parent!==a.parent)break;i={parent:e.parent,a:e.index,b:a.index}}return i}function wK(t){const e=[];for(;t.container;){const r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}o(hK,"findDeclarationNodeAtOffset"),o(uK,"findCommentNode"),o(dK,"isCommentNode"),o(pK,"findLeafNodeAtOffset"),o(gK,"findLeafNodeBeforeOffset"),o(fK,"binarySearch"),o(mK,"getPreviousNode"),o(yK,"getNextNode"),o(vK,"getStartlineNode"),o(xK,"getInteriorNodes"),o(bK,"getCommonParent"),o(wK,"getParentChain");var kK={};h(kK,{findAssignment:()=>fJ,findNameAssignment:()=>mJ,findNodeForKeyword:()=>pJ,findNodeForProperty:()=>hJ,findNodesForKeyword:()=>dJ,findNodesForKeywordInternal:()=>gJ,findNodesForProperty:()=>cJ,getActionAtElement:()=>vJ,getActionType:()=>AJ,getAllReachableRules:()=>aJ,getCrossReferenceTerminal:()=>oJ,getEntryRule:()=>nJ,getExplicitRuleType:()=>CJ,getHiddenRules:()=>iJ,getRuleType:()=>NJ,getRuleTypeName:()=>LJ,getTypeName:()=>SJ,isArrayCardinality:()=>bJ,isArrayOperator:()=>wJ,isCommentTerminal:()=>lJ,isDataType:()=>_J,isDataTypeRule:()=>kJ,isOptionalCardinality:()=>xJ,terminalRegex:()=>IJ});var TK=class extends Error{static{o(this,"ErrorWithLocation")}constructor(t,e){super(t?`${e} at ${t.range.start.line}:${t.range.start.character}`:e)}};function _K(t){throw new Error("Error! The input value was not handled.")}o(_K,"assertUnreachable");var EK={};h(EK,{AbstractElement:()=>FK,AbstractRule:()=>SK,AbstractType:()=>LK,Action:()=>MZ,Alternatives:()=>OZ,ArrayLiteral:()=>UK,ArrayType:()=>qK,Assignment:()=>BZ,BooleanLiteral:()=>WK,CharacterRange:()=>FZ,Condition:()=>IK,Conjunction:()=>HK,CrossReference:()=>UZ,Disjunction:()=>XK,EndOfFile:()=>qZ,Grammar:()=>ZK,GrammarImport:()=>JK,Group:()=>WZ,InferredType:()=>eZ,Interface:()=>nZ,Keyword:()=>HZ,LangiumGrammarAstReflection:()=>pQ,LangiumGrammarTerminals:()=>CK,NamedArgument:()=>aZ,NegatedToken:()=>XZ,Negation:()=>oZ,NumberLiteral:()=>cZ,Parameter:()=>uZ,ParameterReference:()=>pZ,ParserRule:()=>fZ,ReferenceType:()=>yZ,RegexToken:()=>ZZ,ReturnType:()=>xZ,RuleCall:()=>JZ,SimpleType:()=>wZ,StringLiteral:()=>TZ,TerminalAlternatives:()=>eQ,TerminalGroup:()=>nQ,TerminalRule:()=>EZ,TerminalRuleCall:()=>aQ,Type:()=>SZ,TypeAttribute:()=>LZ,TypeDefinition:()=>OK,UnionType:()=>IZ,UnorderedGroup:()=>oQ,UntilToken:()=>cQ,ValueLiteral:()=>BK,Wildcard:()=>uQ,isAbstractElement:()=>zK,isAbstractRule:()=>AK,isAbstractType:()=>NK,isAction:()=>DZ,isAlternatives:()=>PZ,isArrayLiteral:()=>GK,isArrayType:()=>jK,isAssignment:()=>$Z,isBooleanLiteral:()=>YK,isCharacterRange:()=>zZ,isCondition:()=>RK,isConjunction:()=>VK,isCrossReference:()=>GZ,isDisjunction:()=>KK,isEndOfFile:()=>jZ,isFeatureName:()=>MK,isGrammar:()=>QK,isGrammarImport:()=>tZ,isGroup:()=>YZ,isInferredType:()=>rZ,isInterface:()=>iZ,isKeyword:()=>VZ,isNamedArgument:()=>sZ,isNegatedToken:()=>KZ,isNegation:()=>lZ,isNumberLiteral:()=>hZ,isParameter:()=>dZ,isParameterReference:()=>gZ,isParserRule:()=>mZ,isPrimitiveType:()=>DK,isReferenceType:()=>vZ,isRegexToken:()=>QZ,isReturnType:()=>bZ,isRuleCall:()=>tQ,isSimpleType:()=>kZ,isStringLiteral:()=>_Z,isTerminalAlternatives:()=>rQ,isTerminalGroup:()=>iQ,isTerminalRule:()=>CZ,isTerminalRuleCall:()=>sQ,isType:()=>AZ,isTypeAttribute:()=>NZ,isTypeDefinition:()=>PK,isUnionType:()=>RZ,isUnorderedGroup:()=>lQ,isUntilToken:()=>hQ,isValueLiteral:()=>$K,isWildcard:()=>dQ,reflection:()=>gQ});var CK={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]*/},SK="AbstractRule";function AK(t){return gQ.isInstance(t,SK)}o(AK,"isAbstractRule");var LK="AbstractType";function NK(t){return gQ.isInstance(t,LK)}o(NK,"isAbstractType");var IK="Condition";function RK(t){return gQ.isInstance(t,IK)}function MK(t){return DK(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 DK(t){return"string"===t||"number"===t||"boolean"===t||"Date"===t||"bigint"===t}o(RK,"isCondition"),o(MK,"isFeatureName"),o(DK,"isPrimitiveType");var OK="TypeDefinition";function PK(t){return gQ.isInstance(t,OK)}o(PK,"isTypeDefinition");var BK="ValueLiteral";function $K(t){return gQ.isInstance(t,BK)}o($K,"isValueLiteral");var FK="AbstractElement";function zK(t){return gQ.isInstance(t,FK)}o(zK,"isAbstractElement");var UK="ArrayLiteral";function GK(t){return gQ.isInstance(t,UK)}o(GK,"isArrayLiteral");var qK="ArrayType";function jK(t){return gQ.isInstance(t,qK)}o(jK,"isArrayType");var WK="BooleanLiteral";function YK(t){return gQ.isInstance(t,WK)}o(YK,"isBooleanLiteral");var HK="Conjunction";function VK(t){return gQ.isInstance(t,HK)}o(VK,"isConjunction");var XK="Disjunction";function KK(t){return gQ.isInstance(t,XK)}o(KK,"isDisjunction");var ZK="Grammar";function QK(t){return gQ.isInstance(t,ZK)}o(QK,"isGrammar");var JK="GrammarImport";function tZ(t){return gQ.isInstance(t,JK)}o(tZ,"isGrammarImport");var eZ="InferredType";function rZ(t){return gQ.isInstance(t,eZ)}o(rZ,"isInferredType");var nZ="Interface";function iZ(t){return gQ.isInstance(t,nZ)}o(iZ,"isInterface");var aZ="NamedArgument";function sZ(t){return gQ.isInstance(t,aZ)}o(sZ,"isNamedArgument");var oZ="Negation";function lZ(t){return gQ.isInstance(t,oZ)}o(lZ,"isNegation");var cZ="NumberLiteral";function hZ(t){return gQ.isInstance(t,cZ)}o(hZ,"isNumberLiteral");var uZ="Parameter";function dZ(t){return gQ.isInstance(t,uZ)}o(dZ,"isParameter");var pZ="ParameterReference";function gZ(t){return gQ.isInstance(t,pZ)}o(gZ,"isParameterReference");var fZ="ParserRule";function mZ(t){return gQ.isInstance(t,fZ)}o(mZ,"isParserRule");var yZ="ReferenceType";function vZ(t){return gQ.isInstance(t,yZ)}o(vZ,"isReferenceType");var xZ="ReturnType";function bZ(t){return gQ.isInstance(t,xZ)}o(bZ,"isReturnType");var wZ="SimpleType";function kZ(t){return gQ.isInstance(t,wZ)}o(kZ,"isSimpleType");var TZ="StringLiteral";function _Z(t){return gQ.isInstance(t,TZ)}o(_Z,"isStringLiteral");var EZ="TerminalRule";function CZ(t){return gQ.isInstance(t,EZ)}o(CZ,"isTerminalRule");var SZ="Type";function AZ(t){return gQ.isInstance(t,SZ)}o(AZ,"isType");var LZ="TypeAttribute";function NZ(t){return gQ.isInstance(t,LZ)}o(NZ,"isTypeAttribute");var IZ="UnionType";function RZ(t){return gQ.isInstance(t,IZ)}o(RZ,"isUnionType");var MZ="Action";function DZ(t){return gQ.isInstance(t,MZ)}o(DZ,"isAction");var OZ="Alternatives";function PZ(t){return gQ.isInstance(t,OZ)}o(PZ,"isAlternatives");var BZ="Assignment";function $Z(t){return gQ.isInstance(t,BZ)}o($Z,"isAssignment");var FZ="CharacterRange";function zZ(t){return gQ.isInstance(t,FZ)}o(zZ,"isCharacterRange");var UZ="CrossReference";function GZ(t){return gQ.isInstance(t,UZ)}o(GZ,"isCrossReference");var qZ="EndOfFile";function jZ(t){return gQ.isInstance(t,qZ)}o(jZ,"isEndOfFile");var WZ="Group";function YZ(t){return gQ.isInstance(t,WZ)}o(YZ,"isGroup");var HZ="Keyword";function VZ(t){return gQ.isInstance(t,HZ)}o(VZ,"isKeyword");var XZ="NegatedToken";function KZ(t){return gQ.isInstance(t,XZ)}o(KZ,"isNegatedToken");var ZZ="RegexToken";function QZ(t){return gQ.isInstance(t,ZZ)}o(QZ,"isRegexToken");var JZ="RuleCall";function tQ(t){return gQ.isInstance(t,JZ)}o(tQ,"isRuleCall");var eQ="TerminalAlternatives";function rQ(t){return gQ.isInstance(t,eQ)}o(rQ,"isTerminalAlternatives");var nQ="TerminalGroup";function iQ(t){return gQ.isInstance(t,nQ)}o(iQ,"isTerminalGroup");var aQ="TerminalRuleCall";function sQ(t){return gQ.isInstance(t,aQ)}o(sQ,"isTerminalRuleCall");var oQ="UnorderedGroup";function lQ(t){return gQ.isInstance(t,oQ)}o(lQ,"isUnorderedGroup");var cQ="UntilToken";function hQ(t){return gQ.isInstance(t,cQ)}o(hQ,"isUntilToken");var uQ="Wildcard";function dQ(t){return gQ.isInstance(t,uQ)}o(dQ,"isWildcard");var pQ=class extends GX{static{o(this,"LangiumGrammarAstReflection")}getAllTypes(){return[FK,SK,LK,MZ,OZ,UK,qK,BZ,WK,FZ,IK,HK,UZ,XK,qZ,ZK,JK,WZ,eZ,nZ,HZ,aZ,XZ,oZ,cZ,uZ,pZ,fZ,yZ,ZZ,xZ,JZ,wZ,TZ,eQ,nQ,EZ,aQ,SZ,LZ,OK,IZ,oQ,cQ,BK,uQ]}computeIsSubtype(t,e){switch(t){case MZ:case OZ:case BZ:case FZ:case UZ:case qZ:case WZ:case HZ:case XZ:case ZZ:case JZ:case eQ:case nQ:case aQ:case oQ:case cQ:case uQ:return this.isSubtype(FK,e);case UK:case cZ:case TZ:return this.isSubtype(BK,e);case qK:case yZ:case wZ:case IZ:return this.isSubtype(OK,e);case WK:return this.isSubtype(IK,e)||this.isSubtype(BK,e);case HK:case XK:case oZ:case pZ:return this.isSubtype(IK,e);case eZ:case nZ:case SZ:return this.isSubtype(LK,e);case fZ:return this.isSubtype(SK,e)||this.isSubtype(LK,e);case EZ:return this.isSubtype(SK,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 LK;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return SK;case"Grammar:usedGrammars":return ZK;case"NamedArgument:parameter":case"ParameterReference:parameter":return uZ;case"TerminalRuleCall:rule":return EZ;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case FK:return{name:FK,properties:[{name:"cardinality"},{name:"lookahead"}]};case UK:return{name:UK,properties:[{name:"elements",defaultValue:[]}]};case qK:return{name:qK,properties:[{name:"elementType"}]};case WK:return{name:WK,properties:[{name:"true",defaultValue:!1}]};case HK:return{name:HK,properties:[{name:"left"},{name:"right"}]};case XK:return{name:XK,properties:[{name:"left"},{name:"right"}]};case ZK:return{name:ZK,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 JK:return{name:JK,properties:[{name:"path"}]};case eZ:return{name:eZ,properties:[{name:"name"}]};case nZ:return{name:nZ,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case aZ:return{name:aZ,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case oZ:return{name:oZ,properties:[{name:"value"}]};case cZ:return{name:cZ,properties:[{name:"value"}]};case uZ:return{name:uZ,properties:[{name:"name"}]};case pZ:return{name:pZ,properties:[{name:"parameter"}]};case fZ:return{name:fZ,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 yZ:return{name:yZ,properties:[{name:"referenceType"}]};case xZ:return{name:xZ,properties:[{name:"name"}]};case wZ:return{name:wZ,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case TZ:return{name:TZ,properties:[{name:"value"}]};case EZ:return{name:EZ,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case SZ:return{name:SZ,properties:[{name:"name"},{name:"type"}]};case LZ:return{name:LZ,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case IZ:return{name:IZ,properties:[{name:"types",defaultValue:[]}]};case MZ:return{name:MZ,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case OZ:return{name:OZ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case BZ:return{name:BZ,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case FZ:return{name:FZ,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case UZ:return{name:UZ,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qZ:return{name:qZ,properties:[{name:"cardinality"},{name:"lookahead"}]};case WZ:return{name:WZ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case HZ:return{name:HZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case XZ:return{name:XZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case ZZ:return{name:ZZ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case JZ:return{name:JZ,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case eQ:return{name:eQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case nQ:return{name:nQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case aQ:return{name:aQ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case oQ:return{name:oQ,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case cQ:return{name:cQ,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case uQ:return{name:uQ,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:t,properties:[]}}}},gQ=new pQ,fQ={};function mQ(t){for(const[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach(((r,n)=>{$X(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=n)})):$X(r)&&(r.$container=t,r.$containerProperty=e))}function yQ(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function vQ(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}function xQ(t){const e=bQ(t).$document;if(!e)throw new Error("AST node has no document.");return e}function bQ(t){for(;t.$container;)t=t.$container;return t}function wQ(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=null==e?void 0:e.range;return new YX((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const i=t[n];if($X(i)){if(e.keyIndex++,_Q(i,r))return{done:!1,value:i}}else if(Array.isArray(i)){for(;e.arrayIndex<i.length;){const t=i[e.arrayIndex++];if($X(t)&&_Q(t,r))return{done:!1,value:t}}e.arrayIndex=0}}e.keyIndex++}return KX}))}function kQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new eK(t,(t=>wQ(t,e)))}function TQ(t,e){if(!t)throw new Error("Root node must be an AstNode.");return(null==e?void 0:e.range)&&!_Q(t,e.range)?new eK(t,(()=>[])):new eK(t,(t=>wQ(t,e)),{includeRoot:!0})}function _Q(t,e){var r;if(!e)return!0;const n=null===(r=t.$cstNode)||void 0===r?void 0:r.range;return!!n&&lK(n,e)}function EQ(t){return new YX((()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0})),(e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(FX(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(FX(a))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return KX}))}function CQ(t,e=xQ(t).parseResult.value){const r=[];return TQ(e).forEach((e=>{EQ(e).forEach((e=>{e.reference.ref===t&&r.push(e.reference)}))})),ZX(r)}function SQ(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const t of r.properties)void 0!==t.defaultValue&&void 0===n[t.name]&&(n[t.name]=AQ(t.defaultValue))}function AQ(t){return Array.isArray(t)?[...t.map(AQ)]:t}function LQ(t,e){const r={$type:t.$type};for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if($X(i))r[n]=LQ(i,e);else if(FX(i))r[n]=e(r,n,i.$refNode,i.$refText);else if(Array.isArray(i)){const t=[];for(const a of i)$X(a)?t.push(LQ(a,e)):FX(a)?t.push(e(r,n,a.$refNode,a.$refText)):t.push(a);r[n]=t}else r[n]=i;return mQ(r),r}h(fQ,{assignMandatoryProperties:()=>SQ,copyAstNode:()=>LQ,findLocalReferences:()=>CQ,findRootNode:()=>bQ,getContainerOfType:()=>yQ,getDocument:()=>xQ,hasContainerOfType:()=>vQ,linkContentToContainer:()=>mQ,streamAllContents:()=>kQ,streamAst:()=>TQ,streamContents:()=>wQ,streamReferences:()=>EQ}),o(mQ,"linkContentToContainer"),o(yQ,"getContainerOfType"),o(vQ,"hasContainerOfType"),o(xQ,"getDocument"),o(bQ,"findRootNode"),o(wQ,"streamContents"),o(kQ,"streamAllContents"),o(TQ,"streamAst"),o(_Q,"isAstNodeInRange"),o(EQ,"streamReferences"),o(CQ,"findLocalReferences"),o(SQ,"assignMandatoryProperties"),o(AQ,"copyDefaultValue"),o(LQ,"copyAstNode");var NQ={};function IQ(t){return t.charCodeAt(0)}function RQ(t,e){Array.isArray(t)?t.forEach((function(t){e.push(t)})):e.push(t)}function MQ(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e],t[e]=!0}function DQ(t){if(void 0===t)throw Error("Internal Error - Should never get here!");return!0}function OQ(){throw Error("Internal Error - Should never get here!")}function PQ(t){return"Character"===t.type}h(NQ,{NEWLINE_REGEXP:()=>WQ,escapeRegExp:()=>JQ,getCaseInsensitivePattern:()=>tJ,getTerminalParts:()=>XQ,isMultilineComment:()=>KQ,isWhitespace:()=>QQ,partialMatches:()=>eJ,partialRegExp:()=>rJ,whitespaceCharacters:()=>ZQ}),o(IQ,"cc"),o(RQ,"insertToSet"),o(MQ,"addFlag"),o(DQ,"ASSERT_EXISTS"),o(OQ,"ASSERT_NEVER_REACH_HERE"),o(PQ,"isCharacter");var BQ=[];for(let t=IQ("0");t<=IQ("9");t++)BQ.push(t);var $Q=[IQ("_")].concat(BQ);for(let t=IQ("a");t<=IQ("z");t++)$Q.push(t);for(let t=IQ("A");t<=IQ("Z");t++)$Q.push(t);var FQ=[IQ(" "),IQ("\f"),IQ("\n"),IQ("\r"),IQ("\t"),IQ("\v"),IQ("\t"),IQ(" "),IQ(""),IQ(" "),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ(""),IQ("\u2028"),IQ("\u2029"),IQ(""),IQ(""),IQ(" "),IQ("\ufeff")],zQ=/[0-9a-fA-F]/,UQ=/[0-9]/,GQ=/[1-9]/,qQ=class{static{o(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 r={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":MQ(r,"global");break;case"i":MQ(r,"ignoreCase");break;case"m":MQ(r,"multiLine");break;case"u":MQ(r,"unicode");break;case"y":MQ(r,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,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"}DQ(e);const r=this.disjunction();return this.consumeChar(")"),{type:e,value:r,loc:this.loc(t)}}return OQ()}quantifier(t=!1){let e;const r=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 r=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:r,atMost:r};break;case",":let t;this.isDigit()?(t=this.integerIncludingZero(),e={atLeast:r,atMost:t}):e={atLeast:r,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;DQ(e)}if(!0!==t||void 0!==e)return DQ(e)?("?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e.loc=this.loc(r),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()),DQ(t))return t.loc=this.loc(e),this.isQuantifier()&&(t.quantifier=this.quantifier()),t}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[IQ("\n"),IQ("\r"),IQ("\u2028"),IQ("\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=BQ;break;case"D":t=BQ,e=!0;break;case"s":t=FQ;break;case"S":t=FQ,e=!0;break;case"w":t=$Q;break;case"W":t=$Q,e=!0}if(DQ(t))return{type:"Set",value:t,complement:e}}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=IQ("\f");break;case"n":t=IQ("\n");break;case"r":t=IQ("\r");break;case"t":t=IQ("\t");break;case"v":t=IQ("\v")}if(DQ(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:IQ("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:IQ(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:IQ(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,PQ(e)&&this.isRangeDash()){this.consumeChar("-");const r=this.classAtom();if(r.type,PQ(r)){if(r.value<e.value)throw Error("Range out of order in character class");t.push({from:e.value,to:r.value})}else RQ(e.value,t),t.push(IQ("-")),RQ(r.value,t)}else RQ(e.value,t)}return this.consumeChar("]"),{type:"Set",complement:e,value:t}}classAtom(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:IQ("\b")};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()}}group(){let t=!0;if(this.consumeChar("("),"?"===this.peekChar(0))this.consumeChar("?"),this.consumeChar(":"),t=!1;else this.groupIdx++;const e=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:t,value:e};return t&&(r.idx=this.groupIdx),r}positiveInteger(){let t=this.popChar();if(!1===GQ.test(t))throw Error("Expecting a positive integer");for(;UQ.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(!1===UQ.test(t))throw Error("Expecting an integer");for(;UQ.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){const t=this.popChar();switch(t){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:IQ(t)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return"-"===this.peekChar()&&this.isClassAtom(1)}isDigit(){return UQ.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}}isQuantifier(){const t=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(t)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let e="";for(let r=0;r<t;r++){const t=this.popChar();if(!1===zQ.test(t))throw Error("Expecting a HexDecimal digits");e+=t}return{type:"Character",value:parseInt(e,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){const t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(void 0!==t&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}},jQ=class{static{o(this,"BaseRegExpVisitor")}visitChildren(t){for(const e in t){const r=t[e];t.hasOwnProperty(e)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.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){}},WQ=/\r?\n/gm,YQ=new qQ,HQ=class extends jQ{static{o(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=JQ(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),r=new RegExp(e);this.multiline=Boolean("\n".match(r))}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)}},VQ=new HQ;function XQ(t){try{"string"!=typeof t&&(t=t.source),t=`/${t}/`;const e=YQ.pattern(t),r=[];for(const n of e.value.value)VQ.reset(t),VQ.visit(n),r.push({start:VQ.startRegexp,end:VQ.endRegex});return r}catch(t){return[]}}function KQ(t){try{return"string"==typeof t&&(t=new RegExp(t)),t=t.toString(),VQ.reset(t),VQ.visit(YQ.pattern(t)),VQ.multiline}catch(t){return!1}}o(XQ,"getTerminalParts"),o(KQ,"isMultilineComment");var ZQ="\f\n\r\t\v   \u2028\u2029 \ufeff".split("");function QQ(t){const e="string"==typeof t?new RegExp(t):t;return ZQ.some((t=>e.test(t)))}function JQ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tJ(t){return Array.prototype.map.call(t,(t=>/\w/.test(t)?`[${t.toLowerCase()}${t.toUpperCase()}]`:JQ(t))).join("")}function eJ(t,e){const r=rJ(t),n=e.match(r);return!!n&&n[0].length>0}function rJ(t){"string"==typeof t&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let t,a="";function s(t){a+=r.substr(n,t),n+=t}function l(t){a+="(?:"+r.substr(n,t)+"|$)",n+=t}for(o(s,"appendRaw"),o(l,"appendOptional");n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?"{"===r[n+2]?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2)}break;case"[":t=/\[(?:\\.|.)*?\]/g,t.lastIndex=n,t=t.exec(r)||[],l(t[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":t=/\{\d+,?\d*\}/g,t.lastIndex=n,t=t.exec(r),t?s(t[0].length):l(1);break;case"(":if("?"===r[n+1])switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":t=n,n+=3,i(),a+=r.substr(t,n-t);break;case"<":switch(r[n+3]){case"=":case"!":t=n,n+=4,i(),a+=r.substr(t,n-t);break;default:s(r.indexOf(">",n)-n+1),a+=i()+"|$)"}}else s(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1)}return a}return o(i,"process"),new RegExp(i(),t.flags)}function nJ(t){return t.rules.find((t=>mZ(t)&&t.entry))}function iJ(t){return t.rules.filter((t=>CZ(t)&&t.hidden))}function aJ(t,e){const r=new Set,n=nJ(t);if(!n)return new Set(t.rules);const i=[n].concat(iJ(t));for(const t of i)sJ(t,r,e);const a=new Set;for(const e of t.rules)(r.has(e.name)||CZ(e)&&e.hidden)&&a.add(e);return a}function sJ(t,e,r){e.add(t.name),kQ(t).forEach((t=>{if(tQ(t)||r&&sQ(t)){const n=t.rule.ref;n&&!e.has(n.name)&&sJ(n,e,r)}}))}function oJ(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=mJ(t.type.ref);return null==e?void 0:e.terminal}}function lJ(t){return t.hidden&&!QQ(IJ(t))}function cJ(t,e){return t&&e?uJ(t,e,t.astNode,!0):[]}function hJ(t,e,r){if(!t||!e)return;const n=uJ(t,e,t.astNode,!0);return 0!==n.length?n[r=void 0!==r?Math.max(0,Math.min(r,n.length-1)):0]:void 0}function uJ(t,e,r,n){if(!n){const r=yQ(t.grammarSource,$Z);if(r&&r.feature===e)return[t]}return qX(t)&&t.astNode===r?t.content.flatMap((t=>uJ(t,e,r,!1))):[]}function dJ(t,e){return t?gJ(t,e,null==t?void 0:t.astNode):[]}function pJ(t,e,r){if(!t)return;const n=gJ(t,e,null==t?void 0:t.astNode);return 0!==n.length?n[r=void 0!==r?Math.max(0,Math.min(r,n.length-1)):0]:void 0}function gJ(t,e,r){if(t.astNode!==r)return[];if(VZ(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=rK(t).iterator();let i;const a=[];do{if(i=n.next(),!i.done){const t=i.value;t.astNode===r?VZ(t.grammarSource)&&t.grammarSource.value===e&&a.push(t):n.prune()}}while(!i.done);return a}function fJ(t){var e;const r=t.astNode;for(;r===(null===(e=t.container)||void 0===e?void 0:e.astNode);){const e=yQ(t.grammarSource,$Z);if(e)return e;t=t.container}}function mJ(t){let e=t;return rZ(e)&&(DZ(e.$container)?e=e.$container.$container:mZ(e.$container)?e=e.$container:_K(e.$container)),yJ(t,e,new Map)}function yJ(t,e,r){var n;function i(e,n){let i;return yQ(e,$Z)||(i=yJ(n,n,r)),r.set(t,i),i}if(o(i,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of kQ(e)){if($Z(a)&&"name"===a.feature.toLowerCase())return r.set(t,a),a;if(tQ(a)&&mZ(a.rule.ref))return i(a,a.rule.ref);if(kZ(a)&&(null===(n=a.typeRef)||void 0===n?void 0:n.ref))return i(a,a.typeRef.ref)}}function vJ(t){const e=t.$container;if(YZ(e)){const r=e.elements;for(let e=r.indexOf(t)-1;e>=0;e--){const t=r[e];if(DZ(t))return t;{const t=kQ(r[e]).find(DZ);if(t)return t}}}return zK(e)?vJ(e):void 0}function xJ(t,e){return"?"===t||"*"===t||YZ(e)&&Boolean(e.guardCondition)}function bJ(t){return"*"===t||"+"===t}function wJ(t){return"+="===t}function kJ(t){return TJ(t,new Set)}function TJ(t,e){if(e.has(t))return!0;e.add(t);for(const r of kQ(t))if(tQ(r)){if(!r.rule.ref)return!1;if(mZ(r.rule.ref)&&!TJ(r.rule.ref,e))return!1}else{if($Z(r))return!1;if(DZ(r))return!1}return Boolean(t.definition)}function _J(t){return EJ(t.type,new Set)}function EJ(t,e){if(e.has(t))return!0;if(e.add(t),jK(t))return!1;if(vZ(t))return!1;if(RZ(t))return t.types.every((t=>EJ(t,e)));if(kZ(t)){if(void 0!==t.primitiveType)return!0;if(void 0!==t.stringType)return!0;if(void 0!==t.typeRef){const r=t.typeRef.ref;return!!AZ(r)&&EJ(r.type,e)}return!1}return!1}function CJ(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(mZ(e))return e.name;if(iZ(e)||AZ(e))return e.name}}}function SJ(t){var e;if(mZ(t))return kJ(t)?t.name:null!==(e=CJ(t))&&void 0!==e?e:t.name;if(iZ(t)||AZ(t)||bZ(t))return t.name;if(DZ(t)){const e=AJ(t);if(e)return e}else if(rZ(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function AJ(t){var e;return t.inferredType?t.inferredType.name:(null===(e=t.type)||void 0===e?void 0:e.ref)?SJ(t.type.ref):void 0}function LJ(t){var e,r,n;return CZ(t)?null!==(r=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==r?r:"string":kJ(t)?t.name:null!==(n=CJ(t))&&void 0!==n?n:t.name}function NJ(t){var e,r,n;return CZ(t)?null!==(r=null===(e=t.type)||void 0===e?void 0:e.name)&&void 0!==r?r:"string":null!==(n=CJ(t))&&void 0!==n?n:t.name}function IJ(t){const e={s:!1,i:!1,u:!1},r=MJ(t.definition,e),n=Object.entries(e).filter((([,t])=>t)).map((([t])=>t)).join("");return new RegExp(r,n)}o(QQ,"isWhitespace"),o(JQ,"escapeRegExp"),o(tJ,"getCaseInsensitivePattern"),o(eJ,"partialMatches"),o(rJ,"partialRegExp"),o(nJ,"getEntryRule"),o(iJ,"getHiddenRules"),o(aJ,"getAllReachableRules"),o(sJ,"ruleDfs"),o(oJ,"getCrossReferenceTerminal"),o(lJ,"isCommentTerminal"),o(cJ,"findNodesForProperty"),o(hJ,"findNodeForProperty"),o(uJ,"findNodesForPropertyInternal"),o(dJ,"findNodesForKeyword"),o(pJ,"findNodeForKeyword"),o(gJ,"findNodesForKeywordInternal"),o(fJ,"findAssignment"),o(mJ,"findNameAssignment"),o(yJ,"findNameAssignmentInternal"),o(vJ,"getActionAtElement"),o(xJ,"isOptionalCardinality"),o(bJ,"isArrayCardinality"),o(wJ,"isArrayOperator"),o(kJ,"isDataTypeRule"),o(TJ,"isDataTypeRuleInternal"),o(_J,"isDataType"),o(EJ,"isDataTypeInternal"),o(CJ,"getExplicitRuleType"),o(SJ,"getTypeName"),o(AJ,"getActionType"),o(LJ,"getRuleTypeName"),o(NJ,"getRuleType"),o(IJ,"terminalRegex");var RJ=/[\s\S]/.source;function MJ(t,e){if(rQ(t))return DJ(t);if(iQ(t))return OJ(t);if(zZ(t))return $J(t);if(sQ(t)){const e=t.rule.ref;if(!e)throw new Error("Missing rule reference.");return zJ(MJ(e.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}if(KZ(t))return BJ(t);if(hQ(t))return PJ(t);if(QZ(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),zJ(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}if(dQ(t))return zJ(RJ,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${null==t?void 0:t.$type}`)}function DJ(t){return zJ(t.elements.map((t=>MJ(t))).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function OJ(t){return zJ(t.elements.map((t=>MJ(t))).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function PJ(t){return zJ(`${RJ}*?${MJ(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function BJ(t){return zJ(`(?!${MJ(t.terminal)})${RJ}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function $J(t){return t.right?zJ(`[${FJ(t.left)}-${FJ(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):zJ(FJ(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function FJ(t){return JQ(t.value)}function zJ(t,e){var r;return(!1!==e.wrap||e.lookahead)&&(t=`(${null!==(r=e.lookahead)&&void 0!==r?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function UJ(t){const e=[],r=t.Grammar;for(const t of r.rules)CZ(t)&&lJ(t)&&KQ(IJ(t))&&e.push(t.name);return{multilineCommentRules:e,nameRegexp:cK}}function GJ(t){console&&console.error&&console.error(`Error: ${t}`)}function qJ(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function jJ(t){const e=(new Date).getTime(),r=t();return{time:(new Date).getTime()-e,value:r}}function WJ(t){function e(){}o(e,"FakeConstructor"),e.prototype=t;const r=new e;function n(){return typeof r.bar}return o(n,"fakeAccess"),n(),n(),t}function YJ(t){return HJ(t)?t.LABEL:t.name}function HJ(t){return oq(t.LABEL)&&""!==t.LABEL}o(MJ,"abstractElementToRegex"),o(DJ,"terminalAlternativesToRegex"),o(OJ,"terminalGroupToRegex"),o(PJ,"untilTokenToRegex"),o(BJ,"negateTokenToRegex"),o($J,"characterRangeToRegex"),o(FJ,"keywordToRegex"),o(zJ,"withCardinality"),o(UJ,"createGrammarConfig"),o(GJ,"PRINT_ERROR"),o(qJ,"PRINT_WARNING"),o(jJ,"timer"),o(WJ,"toFastProperties"),o(YJ,"tokenLabel"),o(HJ,"hasTokenLabel");var VJ=class{static{o(this,"AbstractProduction")}get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),iF(this.definition,(e=>{e.accept(t)}))}},XJ=class extends VJ{static{o(this,"NonTerminal")}constructor(t){super([]),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}set definition(t){}get definition(){return void 0!==this.referencedRule?this.referencedRule.definition:[]}accept(t){t.visit(this)}},KJ=class extends VJ{static{o(this,"Rule")}constructor(t){super(t.definition),this.orgText="",lG(this,Sq(t,(t=>void 0!==t)))}},ZJ=class extends VJ{static{o(this,"Alternative")}constructor(t){super(t.definition),this.ignoreAmbiguities=!1,lG(this,Sq(t,(t=>void 0!==t)))}},QJ=class extends VJ{static{o(this,"Option")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},JJ=class extends VJ{static{o(this,"RepetitionMandatory")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},t0=class extends VJ{static{o(this,"RepetitionMandatoryWithSeparator")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},e0=class extends VJ{static{o(this,"Repetition")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},r0=class extends VJ{static{o(this,"RepetitionWithSeparator")}constructor(t){super(t.definition),this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}},n0=class extends VJ{static{o(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,lG(this,Sq(t,(t=>void 0!==t)))}},i0=class{static{o(this,"Terminal")}constructor(t){this.idx=1,lG(this,Sq(t,(t=>void 0!==t)))}accept(t){t.visit(this)}};function a0(t){return Gz(t,s0)}function s0(t){function e(t){return Gz(t,s0)}if(o(e,"convertDefinition"),t instanceof XJ){const e={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return oq(t.label)&&(e.label=t.label),e}if(t instanceof ZJ)return{type:"Alternative",definition:e(t.definition)};if(t instanceof QJ)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof JJ)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof t0)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:s0(new i0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof r0)return{type:"RepetitionWithSeparator",idx:t.idx,separator:s0(new i0({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof e0)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof n0)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof i0){const e={type:"Terminal",name:t.terminalType.name,label:YJ(t.terminalType),idx:t.idx};oq(t.label)&&(e.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=yq(r)?r.source:r),e}if(t instanceof KJ)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}o(a0,"serializeGrammar"),o(s0,"serializeProduction");var o0=class{static{o(this,"GAstVisitor")}visit(t){const e=t;switch(e.constructor){case XJ:return this.visitNonTerminal(e);case ZJ:return this.visitAlternative(e);case QJ:return this.visitOption(e);case JJ:return this.visitRepetitionMandatory(e);case t0:return this.visitRepetitionMandatoryWithSeparator(e);case r0:return this.visitRepetitionWithSeparator(e);case e0:return this.visitRepetition(e);case n0:return this.visitAlternation(e);case i0:return this.visitTerminal(e);case KJ: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 l0(t){return t instanceof ZJ||t instanceof QJ||t instanceof e0||t instanceof JJ||t instanceof t0||t instanceof r0||t instanceof i0||t instanceof KJ}function c0(t,e=[]){return!!(t instanceof QJ||t instanceof e0||t instanceof r0)||(t instanceof n0?uj(t.definition,(t=>c0(t,e))):!(t instanceof XJ&&hq(e,t))&&(t instanceof VJ&&(t instanceof XJ&&e.push(t),$G(t.definition,(t=>c0(t,e))))))}function h0(t){return t instanceof n0}function u0(t){if(t instanceof XJ)return"SUBRULE";if(t instanceof QJ)return"OPTION";if(t instanceof n0)return"OR";if(t instanceof JJ)return"AT_LEAST_ONE";if(t instanceof t0)return"AT_LEAST_ONE_SEP";if(t instanceof r0)return"MANY_SEP";if(t instanceof e0)return"MANY";if(t instanceof i0)return"CONSUME";throw Error("non exhaustive match")}o(l0,"isSequenceProd"),o(c0,"isOptionalProd"),o(h0,"isBranchingProd"),o(u0,"getProductionDslName");var d0=class{static{o(this,"RestWalker")}walk(t,e=[]){iF(t.definition,((r,n)=>{const i=NG(t.definition,n+1);if(r instanceof XJ)this.walkProdRef(r,i,e);else if(r instanceof i0)this.walkTerminal(r,i,e);else if(r instanceof ZJ)this.walkFlat(r,i,e);else if(r instanceof QJ)this.walkOption(r,i,e);else if(r instanceof JJ)this.walkAtLeastOne(r,i,e);else if(r instanceof t0)this.walkAtLeastOneSep(r,i,e);else if(r instanceof r0)this.walkManySep(r,i,e);else if(r instanceof e0)this.walkMany(r,i,e);else{if(!(r instanceof n0))throw Error("non exhaustive match");this.walkOr(r,i,e)}}))}walkTerminal(t,e,r){}walkProdRef(t,e,r){}walkFlat(t,e,r){const n=e.concat(r);this.walk(t,n)}walkOption(t,e,r){const n=e.concat(r);this.walk(t,n)}walkAtLeastOne(t,e,r){const n=[new QJ({definition:t.definition})].concat(e,r);this.walk(t,n)}walkAtLeastOneSep(t,e,r){const n=p0(t,e,r);this.walk(t,n)}walkMany(t,e,r){const n=[new QJ({definition:t.definition})].concat(e,r);this.walk(t,n)}walkManySep(t,e,r){const n=p0(t,e,r);this.walk(t,n)}walkOr(t,e,r){const n=e.concat(r);iF(t.definition,(t=>{const e=new ZJ({definition:[t]});this.walk(e,n)}))}};function p0(t,e,r){return[new QJ({definition:[new i0({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function g0(t){if(t instanceof XJ)return g0(t.referencedRule);if(t instanceof i0)return y0(t);if(l0(t))return f0(t);if(h0(t))return m0(t);throw Error("non exhaustive match")}function f0(t){let e=[];const r=t.definition;let n,i=0,a=r.length>i,s=!0;for(;a&&s;)n=r[i],s=c0(n),e=e.concat(g0(n)),i+=1,a=r.length>i;return fj(e)}function m0(t){const e=Gz(t.definition,(t=>g0(t)));return fj(fU(e))}function y0(t){return[t.terminalType]}o(p0,"restForRepetitionWithSeparator"),o(g0,"first"),o(f0,"firstForSequence"),o(m0,"firstForBranching"),o(y0,"firstForTerminal");var v0="_~IN~_",x0=class extends d0{static{o(this,"ResyncFollowsWalker")}constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,e,r){}walkProdRef(t,e,r){const n=w0(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(r),a=g0(new ZJ({definition:i}));this.follows[n]=a}};function b0(t){const e={};return iF(t,(t=>{const r=new x0(t).startWalking();lG(e,r)})),e}function w0(t,e){return t.name+e+v0}o(b0,"computeAllProdsFollows"),o(w0,"buildBetweenProdsFollowPrefix");var k0={},T0=new qQ;function _0(t){const e=t.toString();if(k0.hasOwnProperty(e))return k0[e];{const t=T0.pattern(e);return k0[e]=t,t}}function E0(){k0={}}o(_0,"getRegExpAst"),o(E0,"clearRegExpParserCache");var C0="Complement Sets are not supported for first char optimization",S0='Unable to use "first char" lexer optimizations:\n';function A0(t,e=!1){try{const e=_0(t);return L0(e.value,{},e.flags.ignoreCase)}catch(r){if(r.message===C0)e&&qJ(`${S0}\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 r="";e&&(r="\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."),GJ(`${S0}\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`+r)}}return[]}function L0(t,e,r){switch(t.type){case"Disjunction":for(let n=0;n<t.value.length;n++)L0(t.value[n],e,r);break;case"Alternative":const n=t.value;for(let t=0;t<n.length;t++){const i=n[t];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=i;switch(a.type){case"Character":N0(a.value,e,r);break;case"Set":if(!0===a.complement)throw Error(C0);iF(a.value,(t=>{if("number"==typeof t)N0(t,e,r);else{const n=t;if(!0===r)for(let t=n.from;t<=n.to;t++)N0(t,e,r);else{for(let t=n.from;t<=n.to&&t<f1;t++)N0(t,e,r);if(n.to>=f1){const t=n.from>=f1?n.from:f1,r=n.to,i=y1(t),a=y1(r);for(let t=i;t<=a;t++)e[t]=t}}}}));break;case"Group":L0(a.value,e,r);break;default:throw Error("Non Exhaustive Match")}const s=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===M0(a)||"Group"!==a.type&&!1===s)break}break;default:throw Error("non exhaustive match!")}return Yz(e)}function N0(t,e,r){const n=y1(t);e[n]=n,!0===r&&I0(t,e)}function I0(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const t=y1(n.charCodeAt(0));e[t]=t}else{const t=r.toLowerCase();if(t!==r){const r=y1(t.charCodeAt(0));e[r]=r}}}function R0(t,e){return qG(t.value,(t=>{if("number"==typeof t)return hq(e,t);{const r=t;return void 0!==qG(e,(t=>r.from<=t&&t<=r.to))}}))}function M0(t){const e=t.quantifier;return!(!e||0!==e.atLeast)||!!t.value&&(Lb(t.value)?$G(t.value,M0):M0(t.value))}o(A0,"getOptimizedStartCodesIndices"),o(L0,"firstCharOptimizedIndices"),o(N0,"addOptimizedIdxToResult"),o(I0,"handleIgnoreCase"),o(R0,"findCode"),o(M0,"isWholeOptional");var D0=class extends jQ{static{o(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){hq(this.targetCharCodes,t.value)&&(this.found=!0)}visitSet(t){t.complement?void 0===R0(t,this.targetCharCodes)&&(this.found=!0):void 0!==R0(t,this.targetCharCodes)&&(this.found=!0)}};function O0(t,e){if(e instanceof RegExp){const r=_0(e),n=new D0(t);return n.visit(r),n.found}return void 0!==qG(e,(e=>hq(t,e.charCodeAt(0))))}o(O0,"canMatchCharCode");var P0="PATTERN",B0="defaultMode",$0="modes",F0="boolean"==typeof new RegExp("(?:)").sticky;function z0(t,e){const r=(e=V$(e,{useSticky:F0,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:o(((t,e)=>e()),"tracer")})).tracer;let n;r("initCharCodeToOptimizedIndexMap",(()=>{v1()})),r("Reject Lexer.NA",(()=>{n=aj(t,(t=>t.PATTERN===$1.NA))}));let i,a,s,l,c,h,u,d,p,g,f,m=!1;r("Transform Patterns",(()=>{m=!1,i=Gz(n,(t=>{const r=t.PATTERN;if(yq(r)){const t=r.source;return 1!==t.length||"^"===t||"$"===t||"."===t||r.ignoreCase?2!==t.length||"\\"!==t[0]||hq(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],t[1])?e.useSticky?i1(r):n1(r):t[1]:t}if(dv(r))return m=!0,{exec:r};if("object"==typeof r)return m=!0,r;if("string"==typeof r){if(1===r.length)return r;{const t=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),n=new RegExp(t);return e.useSticky?i1(n):n1(n)}}throw Error("non exhaustive match")}))})),r("misc mapping",(()=>{a=Gz(n,(t=>t.tokenTypeIdx)),s=Gz(n,(t=>{const e=t.GROUP;if(e!==$1.SKIPPED){if(oq(e))return e;if(Vz(e))return!1;throw Error("non exhaustive match")}})),l=Gz(n,(t=>{const e=t.LONGER_ALT;if(e){const t=Lb(e)?Gz(e,(t=>pq(n,t))):[pq(n,e)];return t}})),c=Gz(n,(t=>t.PUSH_MODE)),h=Gz(n,(t=>aq(t,"POP_MODE")))})),r("Line Terminator Handling",(()=>{const t=p1(e.lineTerminatorCharacters);u=Gz(n,(t=>!1)),"onlyOffset"!==e.positionTracking&&(u=Gz(n,(e=>aq(e,"LINE_BREAKS")?!!e.LINE_BREAKS:!1===u1(e,t)&&O0(t,e.PATTERN))))})),r("Misc Mapping #2",(()=>{d=Gz(n,l1),p=Gz(i,c1),g=_U(n,((t,e)=>{const r=e.GROUP;return oq(r)&&r!==$1.SKIPPED&&(t[r]=[]),t}),{}),f=Gz(i,((t,e)=>({pattern:i[e],longerAlt:l[e],canLineTerminator:u[e],isCustom:d[e],short:p[e],group:s[e],push:c[e],pop:h[e],tokenTypeIdx:a[e],tokenType:n[e]})))}));let y=!0,v=[];return e.safeMode||r("First Char Optimization",(()=>{v=_U(n,((t,r,n)=>{if("string"==typeof r.PATTERN){const e=y1(r.PATTERN.charCodeAt(0));g1(t,e,f[n])}else if(Lb(r.START_CHARS_HINT)){let e;iF(r.START_CHARS_HINT,(r=>{const i=y1("string"==typeof r?r.charCodeAt(0):r);e!==i&&(e=i,g1(t,i,f[n]))}))}else if(yq(r.PATTERN))if(r.PATTERN.unicode)y=!1,e.ensureOptimizations&&GJ(`${S0}\tUnable to analyze < ${r.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=A0(r.PATTERN,e.ensureOptimizations);iL(i)&&(y=!1),iF(i,(e=>{g1(t,e,f[n])}))}else e.ensureOptimizations&&GJ(`${S0}\tTokenType: <${r.name}> is using a custom token pattern without providing <start_chars_hint> 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 U0(t,e){let r=[];const n=q0(t);r=r.concat(n.errors);const i=j0(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(G0(a)),r=r.concat(Q0(a)),r=r.concat(J0(a,e)),r=r.concat(t1(a)),r}function G0(t){let e=[];const r=$z(t,(t=>yq(t.PATTERN)));return e=e.concat(Y0(r)),e=e.concat(X0(r)),e=e.concat(K0(r)),e=e.concat(Z0(r)),e=e.concat(H0(r)),e}function q0(t){const e=$z(t,(t=>!aq(t,P0)));return{errors:Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:D1.MISSING_PATTERN,tokenTypes:[t]}))),valid:AG(t,e)}}function j0(t){const e=$z(t,(t=>{const e=t.PATTERN;return!(yq(e)||dv(e)||aq(e,"exec")||oq(e))}));return{errors:Gz(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:D1.INVALID_PATTERN,tokenTypes:[t]}))),valid:AG(t,e)}}o(z0,"analyzeTokenTypes"),o(U0,"validatePatterns"),o(G0,"validateRegExpPattern"),o(q0,"findMissingPatterns"),o(j0,"findInvalidPatterns");var W0=/[^\\][$]/;function Y0(t){class e extends jQ{static{o(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(t){this.found=!0}}const r=$z(t,(t=>{const r=t.PATTERN;try{const t=_0(r),n=new e;return n.visit(t),n.found}catch(t){return W0.test(r.source)}}));return Gz(r,(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:D1.EOI_ANCHOR_FOUND,tokenTypes:[t]})))}function H0(t){const e=$z(t,(t=>t.PATTERN.test("")));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:D1.EMPTY_MATCH_PATTERN,tokenTypes:[t]})))}o(Y0,"findEndOfInputAnchor"),o(H0,"findEmptyMatchRegExps");var V0=/[^\\[][\^]|^\^/;function X0(t){class e extends jQ{static{o(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(t){this.found=!0}}const r=$z(t,(t=>{const r=t.PATTERN;try{const t=_0(r),n=new e;return n.visit(t),n.found}catch(t){return V0.test(r.source)}}));return Gz(r,(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:D1.SOI_ANCHOR_FOUND,tokenTypes:[t]})))}function K0(t){const e=$z(t,(t=>{const e=t.PATTERN;return e instanceof RegExp&&(e.multiline||e.global)}));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:D1.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]})))}function Z0(t){const e=[];let r=Gz(t,(r=>_U(t,((t,n)=>(r.PATTERN.source!==n.PATTERN.source||hq(e,n)||n.PATTERN===$1.NA||(e.push(n),t.push(n)),t)),[])));r=yG(r);const n=$z(r,(t=>t.length>1));return Gz(n,(t=>{const e=Gz(t,(t=>t.name));return{message:`The same RegExp pattern ->${WG(t).PATTERN}<-has been used in all of the following Token Types: ${e.join(", ")} <-`,type:D1.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}}))}function Q0(t){const e=$z(t,(t=>{if(!aq(t,"GROUP"))return!1;const e=t.GROUP;return e!==$1.SKIPPED&&e!==$1.NA&&!oq(e)}));return Gz(e,(t=>({message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:D1.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]})))}function J0(t,e){const r=$z(t,(t=>void 0!==t.PUSH_MODE&&!hq(e,t.PUSH_MODE)));return Gz(r,(t=>({message:`Token Type: ->${t.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${t.PUSH_MODE}<-which does not exist`,type:D1.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]})))}function t1(t){const e=[],r=_U(t,((t,e,r)=>{const n=e.PATTERN;return n===$1.NA||(oq(n)?t.push({str:n,idx:r,tokenType:e}):yq(n)&&r1(n)&&t.push({str:n.source,idx:r,tokenType:e})),t}),[]);return iF(t,((t,n)=>{iF(r,(({str:r,idx:i,tokenType:a})=>{if(n<i&&e1(r,t.PATTERN)){const r=`Token: ->${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:r,type:D1.UNREACHABLE_PATTERN,tokenTypes:[t,a]})}}))})),e}function e1(t,e){if(yq(e)){const r=e.exec(t);return null!==r&&0===r.index}if(dv(e))return e(t,0,[],{});if(aq(e,"exec"))return e.exec(t,0,[],{});if("string"==typeof e)return e===t;throw Error("non exhaustive match")}function r1(t){return void 0===qG([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(e=>-1!==t.source.indexOf(e)))}function n1(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function i1(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function a1(t,e,r){const n=[];return aq(t,B0)||n.push({message:"A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",type:D1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),aq(t,$0)||n.push({message:"A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",type:D1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),aq(t,$0)&&aq(t,B0)&&!aq(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a defaultMode: <${t.defaultMode}>which does not exist\n`,type:D1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),aq(t,$0)&&iF(t.modes,((t,e)=>{iF(t,((r,i)=>{if(Vz(r))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${e}> at index: <${i}>\n`,type:D1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(aq(r,"LONGER_ALT")){const i=Lb(r.LONGER_ALT)?r.LONGER_ALT:[r.LONGER_ALT];iF(i,(i=>{Vz(i)||hq(t,i)||n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${r.name}> outside of mode <${e}>\n`,type:D1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}))}}))})),n}function s1(t,e,r){const n=[];let i=!1;const a=yG(fU(Yz(t.modes))),s=aj(a,(t=>t.PATTERN===$1.NA)),o=p1(r);return e&&iF(s,(t=>{const e=u1(t,o);if(!1!==e){const r={message:d1(t,e),type:e.issue,tokenType:t};n.push(r)}else aq(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):O0(o,t.PATTERN)&&(i=!0)})),e&&!i&&n.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:D1.NO_LINE_BREAKS_FLAGS}),n}function o1(t){const e={},r=zB(t);return iF(r,(r=>{const n=t[r];if(!Lb(n))throw Error("non exhaustive match");e[r]=[]})),e}function l1(t){const e=t.PATTERN;if(yq(e))return!1;if(dv(e))return!0;if(aq(e,"exec"))return!0;if(oq(e))return!1;throw Error("non exhaustive match")}function c1(t){return!(!oq(t)||1!==t.length)&&t.charCodeAt(0)}o(X0,"findStartOfInputAnchor"),o(K0,"findUnsupportedFlags"),o(Z0,"findDuplicatePatterns"),o(Q0,"findInvalidGroupType"),o(J0,"findModesThatDoNotExist"),o(t1,"findUnreachablePatterns"),o(e1,"testTokenType"),o(r1,"noMetaChar"),o(n1,"addStartOfInput"),o(i1,"addStickyFlag"),o(a1,"performRuntimeChecks"),o(s1,"performWarningRuntimeChecks"),o(o1,"cloneEmptyGroups"),o(l1,"isCustomPattern"),o(c1,"isShortPattern");var h1={test:o((function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const e=t.charCodeAt(r);if(10===e)return this.lastIndex=r+1,!0;if(13===e)return 10===t.charCodeAt(r+1)?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1}),"test"),lastIndex:0};function u1(t,e){if(aq(t,"LINE_BREAKS"))return!1;if(yq(t.PATTERN)){try{O0(e,t.PATTERN)}catch(t){return{issue:D1.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(oq(t.PATTERN))return!1;if(l1(t))return{issue:D1.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function d1(t,e){if(e.issue===D1.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${t.name}> 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===D1.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> 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 p1(t){return Gz(t,(t=>oq(t)?t.charCodeAt(0):t))}function g1(t,e,r){void 0===t[e]?t[e]=[r]:t[e].push(r)}o(u1,"checkLineBreaksIssues"),o(d1,"buildLineBreakIssueMessage"),o(p1,"getCharCodes"),o(g1,"addToMapOfArrays");var f1=256,m1=[];function y1(t){return t<f1?t:m1[t]}function v1(){if(iL(m1)){m1=new Array(65536);for(let t=0;t<65536;t++)m1[t]=t>255?255+~~(t/255):t}}function x1(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[r]}function b1(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}o(y1,"charCodeToOptimizedIndex"),o(v1,"initCharCodeToOptimizedIndexMap"),o(x1,"tokenStructuredMatcher"),o(b1,"tokenStructuredMatcherNoCategories");var w1=1,k1={};function T1(t){const e=_1(t);E1(e),S1(e),C1(e),iF(e,(t=>{t.isParent=t.categoryMatches.length>0}))}function _1(t){let e=j$(t),r=t,n=!0;for(;n;){r=yG(fU(Gz(r,(t=>t.CATEGORIES))));const t=AG(r,e);e=e.concat(t),iL(t)?n=!1:r=t}return e}function E1(t){iF(t,(t=>{L1(t)||(k1[w1]=t,t.tokenTypeIdx=w1++),N1(t)&&!Lb(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),N1(t)||(t.CATEGORIES=[]),I1(t)||(t.categoryMatches=[]),R1(t)||(t.categoryMatchesMap={})}))}function C1(t){iF(t,(t=>{t.categoryMatches=[],iF(t.categoryMatchesMap,((e,r)=>{t.categoryMatches.push(k1[r].tokenTypeIdx)}))}))}function S1(t){iF(t,(t=>{A1([],t)}))}function A1(t,e){iF(t,(t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0})),iF(e.CATEGORIES,(r=>{const n=t.concat(e);hq(n,r)||A1(n,r)}))}function L1(t){return aq(t,"tokenTypeIdx")}function N1(t){return aq(t,"CATEGORIES")}function I1(t){return aq(t,"categoryMatches")}function R1(t){return aq(t,"categoryMatchesMap")}function M1(t){return aq(t,"tokenTypeIdx")}o(T1,"augmentTokenTypes"),o(_1,"expandCategories"),o(E1,"assignTokenDefaultProps"),o(C1,"assignCategoriesTokensProp"),o(S1,"assignCategoriesMapProp"),o(A1,"singleAssignCategoriesToksMap"),o(L1,"hasShortKeyProperty"),o(N1,"hasCategoriesProperty"),o(I1,"hasExtendingTokensTypesProperty"),o(R1,"hasExtendingTokensTypesMapProperty"),o(M1,"isTokenType");var D1,O1,P1={buildUnableToPopLexerModeMessage:t=>`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(t,e,r,n,i)=>`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`};(O1=D1||(D1={}))[O1.MISSING_PATTERN=0]="MISSING_PATTERN",O1[O1.INVALID_PATTERN=1]="INVALID_PATTERN",O1[O1.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",O1[O1.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",O1[O1.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",O1[O1.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",O1[O1.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",O1[O1.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",O1[O1.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",O1[O1.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",O1[O1.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",O1[O1.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",O1[O1.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",O1[O1.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",O1[O1.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",O1[O1.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",O1[O1.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",O1[O1.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";var B1={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:P1,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(B1);var $1=class{static{o(this,"Lexer")}constructor(t,e=B1){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 r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--\x3e <${t}>`);const{time:n,value:i}=jJ(e),a=n>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${t}> time: ${n}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=lG({},B1,e);const r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(()=>{let r,n=!0;this.TRACE_INIT("Lexer Config handling",(()=>{if(this.config.lineTerminatorsPattern===B1.lineTerminatorsPattern)this.config.lineTerminatorsPattern=h1;else if(this.config.lineTerminatorCharacters===B1.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> 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),Lb(t)?r={modes:{defaultMode:j$(t)},defaultMode:B0}:(n=!1,r=j$(t))})),!1===this.config.skipValidations&&(this.TRACE_INIT("performRuntimeChecks",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(a1(r,this.trackStartLines,this.config.lineTerminatorCharacters))})),this.TRACE_INIT("performWarningRuntimeChecks",(()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(s1(r,this.trackStartLines,this.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},iF(r.modes,((t,e)=>{r.modes[e]=aj(t,(t=>Vz(t)))}));const i=zB(r.modes);if(iF(r.modes,((t,r)=>{this.TRACE_INIT(`Mode: <${r}> processing`,(()=>{if(this.modes.push(r),!1===this.config.skipValidations&&this.TRACE_INIT("validatePatterns",(()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(U0(t,i))})),iL(this.lexerDefinitionErrors)){let n;T1(t),this.TRACE_INIT("analyzeTokenTypes",(()=>{n=z0(t,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:this.TRACE_INIT})})),this.patternIdxToConfig[r]=n.patternIdxToConfig,this.charCodeToPatternIdxToConfig[r]=n.charCodeToPatternIdxToConfig,this.emptyGroups=lG({},this.emptyGroups,n.emptyGroups),this.hasCustom=n.hasCustom||this.hasCustom,this.canModeBeOptimized[r]=n.canBeOptimized}}))})),this.defaultMode=r.defaultMode,!iL(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const t=Gz(this.lexerDefinitionErrors,(t=>t.message)),e=t.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+e)}iF(this.lexerDefinitionWarning,(t=>{qJ(t.message)})),this.TRACE_INIT("Choosing sub-methods implementations",(()=>{if(F0?(this.chopInput=Ow,this.match=this.matchWithTest):(this.updateLastIndex=$U,this.match=this.matchWithExec),n&&(this.handleModes=$U),!1===this.trackStartLines&&(this.computeNewColumn=Ow),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=$U),/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 <positionTracking> 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=_U(this.canModeBeOptimized,((t,e,r)=>(!1===e&&t.push(r),t)),[]);if(e.ensureOptimizations&&!iL(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",(()=>{E0()})),this.TRACE_INIT("toFastProperties",(()=>{WJ(this)}))}))}tokenize(t,e=this.defaultMode){if(!iL(this.lexerDefinitionErrors)){const t=Gz(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 r,n,i,a,s,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=o1(this.emptyGroups),A=this.trackStartLines,L=this.config.lineTerminatorsPattern;let N=0,I=[],R=[];const M=[],D=[];let O;function P(){return I}function B(t){const e=y1(t),r=R[e];return void 0===r?D:r}Object.freeze(D),o(P,"getPossiblePatternsSlow"),o(B,"getPossiblePatternsOptimized");const $=o((t=>{if(1===M.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{M.pop();const t=K$(M);I=this.patternIdxToConfig[t],R=this.charCodeToPatternIdxToConfig[t],N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=R&&e?B:P}}),"pop_mode");function F(t){M.push(t),R=this.charCodeToPatternIdxToConfig[t],I=this.patternIdxToConfig[t],N=I.length,N=I.length;const e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;O=R&&e?B:P}let z;o(F,"push_mode"),F.call(this,e);const U=this.config.recoveryEnabled;for(;b<x;){l=null;const e=v.charCodeAt(b),o=O(e),k=o.length;for(r=0;r<k;r++){z=o[r];const n=z.pattern;c=null;const u=z.short;if(!1!==u?e===u&&(l=n):!0===z.isCustom?(y=n.exec(v,b,T,S),null!==y?(l=y[0],void 0!==y.payload&&(c=y.payload)):l=null):(this.updateLastIndex(n,b),l=this.match(n,t,b)),null!==l){if(s=z.longerAlt,void 0!==s){const e=s.length;for(i=0;i<e;i++){const e=I[s[i]],r=e.pattern;if(h=null,!0===e.isCustom?(y=r.exec(v,b,T,S),null!==y?(a=y[0],void 0!==y.payload&&(h=y.payload)):a=null):(this.updateLastIndex(r,b),a=this.match(r,t,b)),a&&a.length>l.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,r=0;L.lastIndex=0;do{t=L.test(l),!0===t&&(e=L.lastIndex-1,r++)}while(!0===t);0!==r&&(E+=r,C=u-e,this.updateTokenEndLineColumnLocation(g,d,e,r,E,C,u))}this.handleModes(z,$,F,g)}else{const e=b,r=E,i=C;let a=!1===U;for(;!1===a&&b<x;)for(t=this.chopInput(t,1),b++,n=0;n<N;n++){const e=I[n],r=e.pattern,i=e.short;if(!1!==i?v.charCodeAt(b)===i&&(a=!0):!0===e.isCustom?a=null!==r.exec(v,b,T,S):(this.updateLastIndex(r,b),a=null!==r.exec(t)),!0===a)break}if(f=b-e,C=this.computeNewColumn(C,f),m=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,e,f,r,i),_.push({offset:e,line:r,column:i,length:f,message:m}),!1===U)break}}return this.hasCustom||(T.length=w),{tokens:T,groups:S,errors:_}}handleModes(t,e,r,n){if(!0===t.pop){const i=t.push;e(n),void 0!==i&&r.call(this,i)}else void 0!==t.push&&r.call(this,t.push)}chopInput(t,e){return t.substring(e)}updateLastIndex(t,e){t.lastIndex=e}updateTokenEndLineColumnLocation(t,e,r,n,i,a,s){let o,l;void 0!==e&&(o=r===s-1,l=o?-1:0,1===n&&!0===o||(t.endLine=i+l,t.endColumn=a-1-l))}computeNewColumn(t,e){return t+e}createOffsetOnlyToken(t,e,r,n){return{image:t,startOffset:e,tokenTypeIdx:r,tokenType:n}}createStartOnlyToken(t,e,r,n,i,a){return{image:t,startOffset:e,startLine:i,startColumn:a,tokenTypeIdx:r,tokenType:n}}createFullToken(t,e,r,n,i,a,s){return{image:t,startOffset:e,endOffset:e+s-1,startLine:i,endLine:i,startColumn:a,endColumn:a+s-1,tokenTypeIdx:r,tokenType:n}}addTokenUsingPush(t,e,r){return t.push(r),e}addTokenUsingMemberAccess(t,e,r){return t[e]=r,++e}handlePayloadNoCustom(t,e){}handlePayloadWithCustom(t,e){null!==e&&(t.payload=e)}matchWithTest(t,e,r){return!0===t.test(e)?e.substring(r,t.lastIndex):null}matchWithExec(t,e){const r=t.exec(e);return null!==r?r[0]:null}};function F1(t){return z1(t)?t.LABEL:t.name}function z1(t){return oq(t.LABEL)&&""!==t.LABEL}$1.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",$1.NA=/NOT_APPLICABLE/,o(F1,"tokenLabel"),o(z1,"hasTokenLabel");var U1="categories",G1="label",q1="group",j1="push_mode",W1="pop_mode",Y1="longer_alt",H1="line_breaks",V1="start_chars_hint";function X1(t){return K1(t)}function K1(t){const e=t.pattern,r={};if(r.name=t.name,Vz(e)||(r.PATTERN=e),aq(t,"parent"))throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";return aq(t,U1)&&(r.CATEGORIES=t.categories),T1([r]),aq(t,G1)&&(r.LABEL=t.label),aq(t,q1)&&(r.GROUP=t.group),aq(t,W1)&&(r.POP_MODE=t.pop_mode),aq(t,j1)&&(r.PUSH_MODE=t.push_mode),aq(t,Y1)&&(r.LONGER_ALT=t.longer_alt),aq(t,H1)&&(r.LINE_BREAKS=t.line_breaks),aq(t,V1)&&(r.START_CHARS_HINT=t.start_chars_hint),r}o(X1,"createToken"),o(K1,"createTokenInternal");var Z1=X1({name:"EOF",pattern:$1.NA});function Q1(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function J1(t,e){return x1(t,e)}T1([Z1]),o(Q1,"createTokenInstance"),o(J1,"tokenMatcher");var t2={buildMismatchTokenMessage:({expected:t,actual:e,previous:r,ruleName:n})=>`Expecting ${z1(t)?`--\x3e ${F1(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:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",s="\nbut found: '"+WG(e).image+"'";if(n)return a+n+s;{const e=_U(t,((t,e)=>t.concat(e)),[]),r=Gz(e,(t=>`[${Gz(t,(t=>F1(t))).join(", ")}]`));return a+`one of these possible Token sequences:\n${Gz(r,((t,e)=>` ${e+1}. ${t}`)).join("\n")}`+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",a="\nbut found: '"+WG(e).image+"'";if(r)return i+r+a;return i+`expecting at least one iteration which starts with one of these possible Token sequences::\n <${Gz(t,(t=>`[${Gz(t,(t=>F1(t))).join(",")}]`)).join(" ,")}>`+a}};Object.freeze(t2);var e2={buildRuleNotFoundError:(t,e)=>"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"},r2={buildDuplicateFoundError(t,e){function r(t){return t instanceof i0?t.terminalType.name:t instanceof XJ?t.nonTerminalName:""}o(r,"getExtraProductionArgument");const n=t.name,i=WG(e),a=i.idx,s=u0(i),l=r(i);let c=`->${s}${a>0?a:""}<- ${l?`with argument: ->${l}<-`:""}\n appears more than once (${e.length} times) in the top level rule: ->${n}<-. \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=Gz(t.prefixPath,(t=>F1(t))).join(", "),r=0===t.alternation.idx?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${r}> 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=Gz(t.prefixPath,(t=>F1(t))).join(", "),r=0===t.alternation.idx?"":t.alternation.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",n},buildEmptyRepetitionError(t){let e=u0(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 <OR${t.alternation.idx}> 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<OR${t.alternation.idx}> 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 ${Gz(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 KJ?t.topLevelRule.name:t.topLevelRule;return`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function n2(t,e){const r=new s2(t,e);return r.resolveRefs(),r.errors}o(n2,"resolveGrammar");var i2,a2,s2=class extends o0{static{o(this,"GastRefResolverVisitor")}constructor(t,e){super(),this.nameToTopRule=t,this.errMsgProvider=e,this.errors=[]}resolveRefs(){iF(Yz(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:n5.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}},o2=class extends d0{static{o(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=j$(this.path.ruleStack).reverse(),this.occurrenceStack=j$(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,r){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){const n=e.concat(r);this.updateExpectedNext(),this.walk(t.referencedRule,n)}}updateExpectedNext(){iL(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},l2=class extends o2{static{o(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,r){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){const t=e.concat(r),n=new ZJ({definition:t});this.possibleTokTypes=g0(n),this.found=!0}}},c2=class extends d0{static{o(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}},h2=class extends c2{static{o(this,"NextTerminalAfterManyWalker")}walkMany(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkMany(t,e,r)}},u2=class extends c2{static{o(this,"NextTerminalAfterManySepWalker")}walkManySep(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkManySep(t,e,r)}},d2=class extends c2{static{o(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOne(t,e,r)}},p2=class extends c2{static{o(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(t,e,r){if(t.idx===this.occurrence){const t=WG(e.concat(r));this.result.isEndOfRule=void 0===t,t instanceof i0&&(this.result.token=t.terminalType,this.result.occurrence=t.idx)}else super.walkAtLeastOneSep(t,e,r)}};function g2(t,e,r=[]){r=j$(r);let n=[],i=0;function a(e){return e.concat(NG(t,i+1))}function s(t){const i=g2(a(t),e,r);return n.concat(i)}for(o(a,"remainingPathWith"),o(s,"getAlternativesForProd");r.length<e&&i<t.length;){const e=t[i];if(e instanceof ZJ)return s(e.definition);if(e instanceof XJ)return s(e.definition);if(e instanceof QJ)n=s(e.definition);else{if(e instanceof JJ){return s(e.definition.concat([new e0({definition:e.definition})]))}if(e instanceof t0){return s([new ZJ({definition:e.definition}),new e0({definition:[new i0({terminalType:e.separator})].concat(e.definition)})])}if(e instanceof r0){const t=e.definition.concat([new e0({definition:[new i0({terminalType:e.separator})].concat(e.definition)})]);n=s(t)}else if(e instanceof e0){const t=e.definition.concat([new e0({definition:e.definition})]);n=s(t)}else{if(e instanceof n0)return iF(e.definition,(t=>{!1===iL(t.definition)&&(n=s(t.definition))})),n;if(!(e instanceof i0))throw Error("non exhaustive match");r.push(e.terminalType)}}i++}return n.push({partialPath:r,suffixDef:NG(t,i)}),n}function f2(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-n-1,h=[],u=[];for(u.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!iL(u);){const t=u.pop();if(t===s){o&&K$(u).idx<=c&&u.pop();continue}const n=t.def,d=t.idx,p=t.ruleStack,g=t.occurrenceStack;if(iL(n))continue;const f=n[0];if(f===i){const t={idx:d,def:NG(n),ruleStack:RG(p),occurrenceStack:RG(g)};u.push(t)}else if(f instanceof i0)if(d<l-1){const t=d+1;if(r(e[t],f.terminalType)){const e={idx:t,def:NG(n),ruleStack:p,occurrenceStack:g};u.push(e)}}else{if(d!==l-1)throw Error("non exhaustive match");h.push({nextTokenType:f.terminalType,nextTokenOccurrence:f.idx,ruleStack:p,occurrenceStack:g}),o=!0}else if(f instanceof XJ){const t=j$(p);t.push(f.nonTerminalName);const e=j$(g);e.push(f.idx);const r={idx:d,def:f.definition.concat(a,NG(n)),ruleStack:t,occurrenceStack:e};u.push(r)}else if(f instanceof QJ){const t={idx:d,def:NG(n),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e={idx:d,def:f.definition.concat(NG(n)),ruleStack:p,occurrenceStack:g};u.push(e)}else if(f instanceof JJ){const t=new e0({definition:f.definition,idx:f.idx}),e={idx:d,def:f.definition.concat([t],NG(n)),ruleStack:p,occurrenceStack:g};u.push(e)}else if(f instanceof t0){const t=new i0({terminalType:f.separator}),e=new e0({definition:[t].concat(f.definition),idx:f.idx}),r={idx:d,def:f.definition.concat([e],NG(n)),ruleStack:p,occurrenceStack:g};u.push(r)}else if(f instanceof r0){const t={idx:d,def:NG(n),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e=new i0({terminalType:f.separator}),r=new e0({definition:[e].concat(f.definition),idx:f.idx}),i={idx:d,def:f.definition.concat([r],NG(n)),ruleStack:p,occurrenceStack:g};u.push(i)}else if(f instanceof e0){const t={idx:d,def:NG(n),ruleStack:p,occurrenceStack:g};u.push(t),u.push(s);const e=new e0({definition:f.definition,idx:f.idx}),r={idx:d,def:f.definition.concat([e],NG(n)),ruleStack:p,occurrenceStack:g};u.push(r)}else if(f instanceof n0)for(let t=f.definition.length-1;t>=0;t--){const e={idx:d,def:f.definition[t].definition.concat(NG(n)),ruleStack:p,occurrenceStack:g};u.push(e),u.push(s)}else if(f instanceof ZJ)u.push({idx:d,def:f.definition.concat(NG(n)),ruleStack:p,occurrenceStack:g});else{if(!(f instanceof KJ))throw Error("non exhaustive match");u.push(m2(f,d,p,g))}}return h}function m2(t,e,r,n){const i=j$(r);i.push(t.name);const a=j$(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}function y2(t){if(t instanceof QJ||"Option"===t)return i2.OPTION;if(t instanceof e0||"Repetition"===t)return i2.REPETITION;if(t instanceof JJ||"RepetitionMandatory"===t)return i2.REPETITION_MANDATORY;if(t instanceof t0||"RepetitionMandatoryWithSeparator"===t)return i2.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof r0||"RepetitionWithSeparator"===t)return i2.REPETITION_WITH_SEPARATOR;if(t instanceof n0||"Alternation"===t)return i2.ALTERNATION;throw Error("non exhaustive match")}function v2(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=y2(n);return a===i2.ALTERNATION?L2(e,r,i):N2(e,r,a,i)}function x2(t,e,r,n,i,a){const s=L2(t,e,r);return a(s,n,M2(s)?b1:x1,i)}function b2(t,e,r,n,i,a){const s=N2(t,e,i,r),o=M2(s)?b1:x1;return a(s[0],o,n)}function w2(t,e,r,n){const i=t.length,a=$G(t,(t=>$G(t,(t=>1===t.length))));if(e)return function(e){const n=Gz(e,(t=>t.GATE));for(let e=0;e<i;e++){const i=t[e],a=i.length,s=n[e];if(void 0===s||!1!==s.call(this))t:for(let t=0;t<a;t++){const n=i[t],a=n.length;for(let t=0;t<a;t++){const e=this.LA(t+1);if(!1===r(e,n[t]))continue t}return e}}};if(a&&!n){const e=Gz(t,(t=>fU(t))),r=_U(e,((t,e,r)=>(iF(e,(e=>{aq(t,e.tokenTypeIdx)||(t[e.tokenTypeIdx]=r),iF(e.categoryMatches,(e=>{aq(t,e)||(t[e]=r)}))})),t)),{});return function(){const t=this.LA(1);return r[t.tokenTypeIdx]}}return function(){for(let e=0;e<i;e++){const n=t[e],i=n.length;t:for(let t=0;t<i;t++){const i=n[t],a=i.length;for(let t=0;t<a;t++){const e=this.LA(t+1);if(!1===r(e,i[t]))continue t}return e}}}}function k2(t,e,r){const n=$G(t,(t=>1===t.length)),i=t.length;if(n&&!r){const e=fU(t);if(1===e.length&&iL(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=_U(e,((t,e,r)=>(t[e.tokenTypeIdx]=!0,iF(e.categoryMatches,(e=>{t[e]=!0})),t)),[]);return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){t:for(let r=0;r<i;r++){const n=t[r],i=n.length;for(let t=0;t<i;t++){const r=this.LA(t+1);if(!1===e(r,n[t]))continue t}return!0}return!1}}o(g2,"possiblePathsFrom"),o(f2,"nextPossibleTokensAfter"),o(m2,"expandTopLevelRule"),(a2=i2||(i2={}))[a2.OPTION=0]="OPTION",a2[a2.REPETITION=1]="REPETITION",a2[a2.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",a2[a2.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",a2[a2.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",a2[a2.ALTERNATION=5]="ALTERNATION",o(y2,"getProdType"),o(v2,"getLookaheadPaths"),o(x2,"buildLookaheadFuncForOr"),o(b2,"buildLookaheadFuncForOptionalProd"),o(w2,"buildAlternativesLookAheadFunc"),o(k2,"buildSingleAlternativeLookaheadFunction");var T2=class extends d0{static{o(this,"RestDefinitionFinderWalker")}constructor(t,e,r){super(),this.topProd=t,this.targetOccurrence=e,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,e,r,n){return t.idx===this.targetOccurrence&&this.targetProdType===e&&(this.restDef=r.concat(n),!0)}walkOption(t,e,r){this.checkIsTarget(t,i2.OPTION,e,r)||super.walkOption(t,e,r)}walkAtLeastOne(t,e,r){this.checkIsTarget(t,i2.REPETITION_MANDATORY,e,r)||super.walkOption(t,e,r)}walkAtLeastOneSep(t,e,r){this.checkIsTarget(t,i2.REPETITION_MANDATORY_WITH_SEPARATOR,e,r)||super.walkOption(t,e,r)}walkMany(t,e,r){this.checkIsTarget(t,i2.REPETITION,e,r)||super.walkOption(t,e,r)}walkManySep(t,e,r){this.checkIsTarget(t,i2.REPETITION_WITH_SEPARATOR,e,r)||super.walkOption(t,e,r)}},_2=class extends o0{static{o(this,"InsideDefinitionFinderVisitor")}constructor(t,e,r){super(),this.targetOccurrence=t,this.targetProdType=e,this.targetRef=r,this.result=[]}checkIsTarget(t,e){t.idx!==this.targetOccurrence||this.targetProdType!==e||void 0!==this.targetRef&&t!==this.targetRef||(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,i2.OPTION)}visitRepetition(t){this.checkIsTarget(t,i2.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,i2.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,i2.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,i2.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,i2.ALTERNATION)}};function E2(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function C2(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let t=0;t<e.length;t++){const r=e[t];i.push(r+"_"+n.tokenTypeIdx);for(let t=0;t<n.categoryMatches.length;t++){const e="_"+n.categoryMatches[t];i.push(r+e)}}e=i}return e}function S2(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let t=0;t<e.length;t++){if(!0===i[e[t]])return!1}}return!0}function A2(t,e){const r=Gz(t,(t=>g2([t],1))),n=E2(r.length),i=Gz(r,(t=>{const e={};return iF(t,(t=>{const r=C2(t.partialPath);iF(r,(t=>{e[t]=!0}))})),e}));let a=r;for(let t=1;t<=e;t++){const r=a;a=E2(r.length);for(let s=0;s<r.length;s++){const o=r[s];for(let r=0;r<o.length;r++){const l=o[r].partialPath,c=o[r].suffixDef,h=C2(l);if(S2(i,h,s)||iL(c)||l.length===e){const t=n[s];if(!1===I2(t,l)){t.push(l);for(let t=0;t<h.length;t++){const e=h[t];i[s][e]=!0}}}else{const e=g2(c,t+1,l);a[s]=a[s].concat(e),iF(e,(t=>{const e=C2(t.partialPath);iF(e,(t=>{i[s][t]=!0}))}))}}}}return n}function L2(t,e,r,n){const i=new _2(t,i2.ALTERNATION,n);return e.accept(i),A2(i.result,r)}function N2(t,e,r,n){const i=new _2(t,r);e.accept(i);const a=i.result,s=new T2(e,t,r).startWalking();return A2([new ZJ({definition:a}),new ZJ({definition:s})],n)}function I2(t,e){t:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let t=0;t<n.length;t++){const r=e[t],i=n[t];if(!1===(r===i||void 0!==i.categoryMatchesMap[r.tokenTypeIdx]))continue t}return!0}}return!1}function R2(t,e){return t.length<e.length&&$G(t,((t,r)=>{const n=e[r];return t===n||n.categoryMatchesMap[t.tokenTypeIdx]}))}function M2(t){return $G(t,(t=>$G(t,(t=>$G(t,(t=>iL(t.categoryMatches)))))))}function D2(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Gz(e,(t=>Object.assign({type:n5.CUSTOM_LOOKAHEAD_VALIDATION},t)))}function O2(t,e,r,n){const i=HG(t,(t=>P2(t,r))),a=Q2(t,e,r),s=HG(t,(t=>V2(t,r))),o=HG(t,(e=>z2(e,t,n,r)));return i.concat(a,s,o)}function P2(t,e){const r=new F2;t.accept(r);const n=r.allProductions,i=tq(n,B2),a=Sq(i,(t=>t.length>1));return Gz(Yz(a),(r=>{const n=WG(r),i=e.buildDuplicateFoundError(t,r),a=u0(n),s={message:i,type:n5.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:n.idx},o=$2(n);return o&&(s.parameter=o),s}))}function B2(t){return`${u0(t)}_#_${t.idx}_#_${$2(t)}`}function $2(t){return t instanceof i0?t.terminalType.name:t instanceof XJ?t.nonTerminalName:""}o(E2,"initializeArrayOfArrays"),o(C2,"pathToHashKeys"),o(S2,"isUniquePrefixHash"),o(A2,"lookAheadSequenceFromAlternatives"),o(L2,"getLookaheadPathsForOr"),o(N2,"getLookaheadPathsForOptionalProd"),o(I2,"containsPath"),o(R2,"isStrictPrefixOfPath"),o(M2,"areTokenCategoriesNotUsed"),o(D2,"validateLookahead"),o(O2,"validateGrammar"),o(P2,"validateDuplicateProductions"),o(B2,"identifyProductionForDuplicates"),o($2,"getExtraProductionArgument");var F2=class extends o0{static{o(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 z2(t,e,r,n){const i=[];if(_U(e,((e,r)=>r.name===t.name?e+1:e),0)>1){const e=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:e,type:n5.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function U2(t,e,r){const n=[];let i;return hq(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:n5.INVALID_RULE_OVERRIDE,ruleName:t})),n}function G2(t,e,r,n=[]){const i=[],a=q2(e.definition);if(iL(a))return[];{const e=t.name;hq(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:n5.LEFT_RECURSION,ruleName:e});const s=AG(a,n.concat([t])),o=HG(s,(e=>{const i=j$(n);return i.push(e),G2(t,e,r,i)}));return i.concat(o)}}function q2(t){let e=[];if(iL(t))return e;const r=WG(t);if(r instanceof XJ)e.push(r.referencedRule);else if(r instanceof ZJ||r instanceof QJ||r instanceof JJ||r instanceof t0||r instanceof r0||r instanceof e0)e=e.concat(q2(r.definition));else if(r instanceof n0)e=fU(Gz(r.definition,(t=>q2(t.definition))));else if(!(r instanceof i0))throw Error("non exhaustive match");const n=c0(r),i=t.length>1;if(n&&i){const r=NG(t);return e.concat(q2(r))}return e}o(z2,"validateRuleDoesNotAlreadyExist"),o(U2,"validateRuleIsOverridden"),o(G2,"validateNoLeftRecursion"),o(q2,"getFirstNoneTerminal");var j2=class extends o0{static{o(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function W2(t,e){const r=new j2;t.accept(r);const n=r.alternations;return HG(n,(r=>{const n=RG(r.definition);return HG(n,((n,i)=>{const a=f2([n],[],x1,1);return iL(a)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:r,emptyChoiceIdx:i}),type:n5.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:r.idx,alternative:i+1}]:[]}))}))}function Y2(t,e,r){const n=new j2;t.accept(n);let i=n.alternations;i=aj(i,(t=>!0===t.ignoreAmbiguities));return HG(i,(n=>{const i=n.idx,a=n.maxLookahead||e,s=L2(i,t,a,n),o=K2(s,n,t,r),l=Z2(s,n,t,r);return o.concat(l)}))}o(W2,"validateEmptyOrAlternative"),o(Y2,"validateAmbiguousAlternationAlternatives");var H2=class extends o0{static{o(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 V2(t,e){const r=new j2;t.accept(r);const n=r.alternations;return HG(n,(r=>r.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:n5.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}]:[]))}function X2(t,e,r){const n=[];return iF(t,(t=>{const i=new H2;t.accept(i);const a=i.allProductions;iF(a,(i=>{const a=y2(i),s=i.maxLookahead||e,o=N2(i.idx,t,a,s)[0];if(iL(fU(o))){const e=r.buildEmptyRepetitionError({topLevelRule:t,repetition:i});n.push({message:e,type:n5.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}}))})),n}function K2(t,e,r,n){const i=[],a=_U(t,((r,n,a)=>(!0===e.definition[a].ignoreAmbiguities||iF(n,(n=>{const s=[a];iF(t,((t,r)=>{a!==r&&I2(t,n)&&!0!==e.definition[r].ignoreAmbiguities&&s.push(r)})),s.length>1&&!I2(i,n)&&(i.push(n),r.push({alts:s,path:n}))})),r)),[]);return Gz(a,(t=>{const i=Gz(t.alts,(t=>t+1));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:n5.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:t.alts}}))}function Z2(t,e,r,n){const i=_U(t,((t,e,r)=>{const n=Gz(e,(t=>({idx:r,path:t})));return t.concat(n)}),[]);return yG(HG(i,(t=>{if(!0===e.definition[t.idx].ignoreAmbiguities)return[];const a=t.idx,s=t.path,o=$z(i,(t=>!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx<a&&R2(t.path,s)));return Gz(o,(t=>{const i=[t.idx+1,a+1],s=0===e.idx?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:n5.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:s,alternatives:i}}))})))}function Q2(t,e,r){const n=[],i=Gz(e,(t=>t.name));return iF(t,(t=>{const e=t.name;if(hq(i,e)){const i=r.buildNamespaceConflictError(t);n.push({message:i,type:n5.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}})),n}function J2(t){const e=V$(t,{errMsgProvider:e2}),r={};return iF(t.rules,(t=>{r[t.name]=t})),n2(r,e.errMsgProvider)}function t4(t){return O2((t=V$(t,{errMsgProvider:r2})).rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}o(V2,"validateTooManyAlts"),o(X2,"validateSomeNonEmptyLookaheadPath"),o(K2,"checkAlternativesAmbiguities"),o(Z2,"checkPrefixAlternativesAmbiguities"),o(Q2,"checkTerminalAndNoneTerminalsNameSpace"),o(J2,"resolveGrammar"),o(t4,"validateGrammar");var e4="MismatchedTokenException",r4="NoViableAltException",n4="EarlyExitException",i4="NotAllInputParsedException",a4=[e4,r4,n4,i4];function s4(t){return hq(a4,t.name)}Object.freeze(a4),o(s4,"isRecognitionException");var o4=class extends Error{static{o(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)}},l4=class extends o4{static{o(this,"MismatchedTokenException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=e4}},c4=class extends o4{static{o(this,"NoViableAltException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=r4}},h4=class extends o4{static{o(this,"NotAllInputParsedException")}constructor(t,e){super(t,e),this.name=i4}},u4=class extends o4{static{o(this,"EarlyExitException")}constructor(t,e,r){super(t,e),this.previousToken=r,this.name=n4}},d4={},p4="InRuleRecoveryException",g4=class extends Error{static{o(this,"InRuleRecoveryException")}constructor(t){super(t),this.name=p4}},f4=class{static{o(this,"Recoverable")}initRecoverable(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=aq(t,"recoveryEnabled")?t.recoveryEnabled:a5.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=m4)}getTokenToInsert(t){const e=Q1(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,e,r,n){const i=this.findReSyncTokenType(),a=this.exportLexerState(),s=[];let l=!1;const c=this.LA(1);let h=this.LA(1);const u=o((()=>{const t=this.LA(0),e=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:c,previous:t,ruleName:this.getCurrRuleFullName()}),r=new l4(e,c,this.LA(0));r.resyncedTokens=RG(s),this.SAVE_ERROR(r)}),"generateErrorMessage");for(;!l;){if(this.tokenMatcher(h,n))return void u();if(r.call(this))return u(),void t.apply(this,e);this.tokenMatcher(h,i)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,s))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(t,e,r){return!1!==r&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e))))}getFollowsForInRuleRecovery(t,e){const r=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(r)}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 g4("sad sad panda")}canPerformInRuleRecovery(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,e){if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(iL(e))return!1;const r=this.LA(1);return void 0!==qG(e,(t=>this.tokenMatcher(r,t)))}canRecoverWithSingleTokenDeletion(t){if(!this.canTokenTypeBeDeletedInRecovery(t))return!1;return this.tokenMatcher(this.LA(2),t)}isInCurrentRuleReSyncSet(t){const e=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(e);return hq(r,t)}findReSyncTokenType(){const t=this.flattenFollowSet();let e=this.LA(1),r=2;for(;;){const n=qG(t,(t=>J1(e,t)));if(void 0!==n)return n;e=this.LA(r),r++}}getCurrFollowKey(){if(1===this.RULE_STACK.length)return d4;const t=this.getLastExplicitRuleShortName(),e=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:e,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const t=this.RULE_STACK,e=this.RULE_OCCURRENCE_STACK;return Gz(t,((r,n)=>0===n?d4:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:e[n],inRule:this.shortRuleNameToFullName(t[n-1])}))}flattenFollowSet(){const t=Gz(this.buildFullFollowKeyStack(),(t=>this.getFollowSetFromFollowKey(t)));return fU(t)}getFollowSetFromFollowKey(t){if(t===d4)return[Z1];const e=t.ruleName+t.idxInCallingRule+v0+t.inRule;return this.resyncFollows[e]}addToResyncTokens(t,e){return this.tokenMatcher(t,Z1)||e.push(t),e}reSyncTo(t){const e=[];let r=this.LA(1);for(;!1===this.tokenMatcher(r,t);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,e);return RG(e)}attemptInRepetitionRecovery(t,e,r,n,i,a,s){}getCurrentGrammarPath(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:j$(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}}getHumanReadableRuleStack(){return Gz(this.RULE_STACK,(t=>this.shortRuleNameToFullName(t)))}};function m4(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,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=Z1,h=1),void 0!==c&&void 0!==h&&this.shouldInRepetitionRecoveryBeTried(c,h,s)&&this.tryInRepetitionRecovery(t,e,r,c)}o(m4,"attemptInRepetitionRecovery");var y4=1024,v4=1280,x4=1536;function b4(t,e,r){return r|e|t}o(b4,"getKeyForAutomaticLookahead");var w4=class{static{o(this,"LLkLookaheadStrategy")}constructor(t){var e;this.maxLookahead=null!==(e=null==t?void 0:t.maxLookahead)&&void 0!==e?e:a5.maxLookahead}validate(t){const e=this.validateNoLeftRecursion(t.rules);if(iL(e)){const r=this.validateEmptyOrAlternatives(t.rules),n=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...e,...r,...n,...i]}return e}validateNoLeftRecursion(t){return HG(t,(t=>G2(t,t,r2)))}validateEmptyOrAlternatives(t){return HG(t,(t=>W2(t,r2)))}validateAmbiguousAlternationAlternatives(t,e){return HG(t,(t=>Y2(t,e,r2)))}validateSomeNonEmptyLookaheadPath(t,e){return X2(t,e,r2)}buildLookaheadForAlternation(t){return x2(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,w2)}buildLookaheadForOptional(t){return b2(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,y2(t.prodType),k2)}},k4=class{static{o(this,"LooksAhead")}initLooksAhead(t){this.dynamicTokensEnabled=aq(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:a5.dynamicTokensEnabled,this.maxLookahead=aq(t,"maxLookahead")?t.maxLookahead:a5.maxLookahead,this.lookaheadStrategy=aq(t,"lookaheadStrategy")?t.lookaheadStrategy:new w4({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(t){iF(t,(t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,(()=>{const{alternation:e,repetition:r,option:n,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:s}=E4(t);iF(e,(e=>{const r=0===e.idx?"":e.idx;this.TRACE_INIT(`${u0(e)}${r}`,(()=>{const r=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:e.idx,rule:t,maxLookahead:e.maxLookahead||this.maxLookahead,hasPredicates:e.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),n=b4(this.fullRuleNameToShort[t.name],256,e.idx);this.setLaFuncCache(n,r)}))})),iF(r,(e=>{this.computeLookaheadFunc(t,e.idx,768,"Repetition",e.maxLookahead,u0(e))})),iF(n,(e=>{this.computeLookaheadFunc(t,e.idx,512,"Option",e.maxLookahead,u0(e))})),iF(i,(e=>{this.computeLookaheadFunc(t,e.idx,y4,"RepetitionMandatory",e.maxLookahead,u0(e))})),iF(a,(e=>{this.computeLookaheadFunc(t,e.idx,x4,"RepetitionMandatoryWithSeparator",e.maxLookahead,u0(e))})),iF(s,(e=>{this.computeLookaheadFunc(t,e.idx,v4,"RepetitionWithSeparator",e.maxLookahead,u0(e))}))}))}))}computeLookaheadFunc(t,e,r,n,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:n}),s=b4(this.fullRuleNameToShort[t.name],r,e);this.setLaFuncCache(s,a)}))}getKeyForAutomaticLookahead(t,e){return b4(this.getLastExplicitRuleShortName(),t,e)}getLaFuncFromCache(t){return this.lookAheadFuncsCache.get(t)}setLaFuncCache(t,e){this.lookAheadFuncsCache.set(t,e)}},T4=class extends o0{static{o(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)}},_4=new T4;function E4(t){_4.reset(),t.accept(_4);const e=_4.dslMethods;return _4.reset(),e}function C4(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset==!0&&(t.endOffset=e.endOffset)}function S4(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset==!0&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function A4(t,e,r){void 0===t.children[r]?t.children[r]=[e]:t.children[r].push(e)}function L4(t,e,r){void 0===t.children[e]?t.children[e]=[r]:t.children[e].push(r)}o(E4,"collectMethods"),o(C4,"setNodeLocationOnlyOffset"),o(S4,"setNodeLocationFull"),o(A4,"addTerminalToCst"),o(L4,"addNoneTerminalToCst");var N4,I4;function R4(t,e){Object.defineProperty(t,"name",{enumerable:!1,configurable:!0,writable:!1,value:e})}function M4(t,e){const r=zB(t),n=r.length;for(let i=0;i<n;i++){const n=t[r[i]],a=n.length;for(let t=0;t<a;t++){const r=n[t];void 0===r.tokenTypeIdx&&this[r.name](r.children,e)}}}function D4(t,e){const r=o((function(){}),"derivedConstructor");R4(r,t+"BaseSemantics");const n={visit:o((function(t,e){if(Lb(t)&&(t=t[0]),!Vz(t))return this[t.name](t.children,e)}),"visit"),validateVisitor:o((function(){const t=P4(this,e);if(!iL(t)){const e=Gz(t,(t=>t.msg));throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${e.join("\n\n").replace(/\n/g,"\n\t")}`)}}),"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function O4(t,e,r){const n=o((function(){}),"derivedConstructor");R4(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return iF(e,(t=>{i[t]=M4})),n.prototype=i,n.prototype.constructor=n,n}function P4(t,e){return B4(t,e)}function B4(t,e){const r=$z(e,(e=>!1===dv(t[e]))),n=Gz(r,(e=>({msg:`Missing visitor method: <${e}> on ${t.constructor.name} CST Visitor.`,type:N4.MISSING_METHOD,methodName:e})));return yG(n)}o(R4,"defineNameProp"),o(M4,"defaultVisit"),o(D4,"createBaseSemanticVisitorConstructor"),o(O4,"createBaseVisitorConstructorWithDefaults"),(I4=N4||(N4={}))[I4.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",I4[I4.MISSING_METHOD=1]="MISSING_METHOD",o(P4,"validateVisitor"),o(B4,"validateMissingCstMethods");var $4=class{static{o(this,"TreeBuilder")}initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=aq(t,"nodeLocationTracking")?t.nodeLocationTracking:a5.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=S4,this.setNodeLocationFromNode=S4,this.cstPostRule=$U,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=C4,this.setNodeLocationFromNode=C4,this.cstPostRule=$U,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`);this.setNodeLocationFromToken=$U,this.setNodeLocationFromNode=$U,this.cstPostRule=$U,this.setInitialNodeLocation=$U}else this.cstInvocationStateUpdate=$U,this.cstFinallyStateUpdate=$U,this.cstPostTerminal=$U,this.cstPostNonTerminal=$U,this.cstPostRule=$U}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),r=t.location;r.startOffset<=e.startOffset==!0?(r.endOffset=e.endOffset,r.endLine=e.endLine,r.endColumn=e.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(t){const e=this.LA(0),r=t.location;r.startOffset<=e.startOffset==!0?r.endOffset=e.endOffset:r.startOffset=NaN}cstPostTerminal(t,e){const r=this.CST_STACK[this.CST_STACK.length-1];A4(r,e,t),this.setNodeLocationFromToken(r.location,e)}cstPostNonTerminal(t,e){const r=this.CST_STACK[this.CST_STACK.length-1];L4(r,e,t),this.setNodeLocationFromNode(r.location,t.location)}getBaseCstVisitorConstructor(){if(Vz(this.baseCstVisitorConstructor)){const t=D4(this.className,zB(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Vz(this.baseCstVisitorWithDefaultsConstructor)){const t=O4(this.className,zB(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]}},F4=class{static{o(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> 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)):r5}LA(t){const e=this.currIdx+t;return e<0||this.tokVectorLength<=e?r5: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()}},z4=class{static{o(this,"RecognizerApi")}ACTION(t){return t.call(this)}consume(t,e,r){return this.consumeInternal(e,t,r)}subrule(t,e,r){return this.subruleInternal(e,t,r)}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,r=s5){if(hq(this.definedRulesNames,t)){const e={message:r2.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:n5.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(e)}this.definedRulesNames.push(t);const n=this.defineRule(t,e,r);return this[t]=n,n}OVERRIDE_RULE(t,e,r=s5){const n=U2(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const i=this.defineRule(t,e,r);return this[t]=i,i}BACKTRACK(t,e){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(s4(t))return!1;throw t}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return a0(Yz(this.gastProductionsCache))}},U4=class{static{o(this,"RecognizerEngine")}initRecognizerEngine(t,e){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=b1,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},aq(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Lb(t)){if(iL(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(Lb(t))this.tokensMap=_U(t,((t,e)=>(t[e.name]=e,t)),{});else if(aq(t,"modes")&&$G(fU(Yz(t.modes)),M1)){const e=fU(Yz(t.modes)),r=fj(e);this.tokensMap=_U(r,((t,e)=>(t[e.name]=e,t)),{})}else{if(!cv(t))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=j$(t)}this.tokensMap.EOF=Z1;const r=aq(t,"modes")?fU(Yz(t.modes)):Yz(t),n=$G(r,(t=>iL(t.categoryMatches)));this.tokenMatcher=n?b1:x1,T1(Yz(this.tokensMap))}defineRule(t,e,r){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 n=aq(r,"resyncEnabled")?r.resyncEnabled:s5.resyncEnabled,i=aq(r,"recoveryValueFunc")?r.recoveryValueFunc:s5.recoveryValueFunc,a=this.ruleShortNameIdx<<12;let s;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=t,this.fullRuleNameToShort[t]=a,s=!0===this.outputCst?o((function(...r){try{this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,r);const n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}catch(t){return this.invokeRuleCatch(t,n,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTry"):o((function(...r){try{return this.ruleInvocationStateUpdate(a,t,this.subruleIdx),e.apply(this,r)}catch(t){return this.invokeRuleCatch(t,n,i)}finally{this.ruleFinallyStateUpdate()}}),"invokeRuleWithTryCst");return Object.assign(s,{ruleName:t,originalGrammarAction:e})}invokeRuleCatch(t,e,r){const n=1===this.RULE_STACK.length,i=e&&!this.isBackTracking()&&this.recoveryEnabled;if(s4(t)){const e=t;if(i){const n=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(n)){if(e.resyncedTokens=this.reSyncTo(n),this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];return t.recoveredNode=!0,t}return r(t)}if(this.outputCst){const t=this.CST_STACK[this.CST_STACK.length-1];t.recoveredNode=!0,e.partialCstResult=t}throw e}if(n)return this.moveToTerminatedState(),r(t);throw e}throw t}optionInternal(t,e){const r=this.getKeyForAutomaticLookahead(512,e);return this.optionInternalLogic(t,e,r)}optionInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof t){n=t.DEF;const e=t.GATE;if(void 0!==e){const t=i;i=o((()=>e.call(this)&&t.call(this)),"lookAheadFunc")}}else n=t;if(!0===i.call(this))return n.call(this)}atLeastOneInternal(t,e){const r=this.getKeyForAutomaticLookahead(y4,t);return this.atLeastOneInternalLogic(t,e,r)}atLeastOneInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=o((()=>t.call(this)&&e.call(this)),"lookAheadFunc")}}else n=e;if(!0!==i.call(this))throw this.raiseEarlyExitException(t,i2.REPETITION_MANDATORY,e.ERR_MSG);{let t=this.doSingleRepetition(n);for(;!0===i.call(this)&&!0===t;)t=this.doSingleRepetition(n)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,e],i,y4,t,d2)}atLeastOneSepFirstInternal(t,e){const r=this.getKeyForAutomaticLookahead(x4,t);this.atLeastOneSepFirstInternalLogic(t,e,r)}atLeastOneSepFirstInternalLogic(t,e,r){const n=e.DEF,i=e.SEP;if(!0!==this.getLaFuncFromCache(r).call(this))throw this.raiseEarlyExitException(t,i2.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG);{n.call(this);const e=o((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,n,p2],e,x4,t,p2)}}manyInternal(t,e){const r=this.getKeyForAutomaticLookahead(768,t);return this.manyInternalLogic(t,e,r)}manyInternalLogic(t,e,r){let n,i=this.getLaFuncFromCache(r);if("function"!=typeof e){n=e.DEF;const t=e.GATE;if(void 0!==t){const e=i;i=o((()=>t.call(this)&&e.call(this)),"lookaheadFunction")}}else n=e;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(n);this.attemptInRepetitionRecovery(this.manyInternal,[t,e],i,768,t,h2,a)}manySepFirstInternal(t,e){const r=this.getKeyForAutomaticLookahead(v4,t);this.manySepFirstInternalLogic(t,e,r)}manySepFirstInternalLogic(t,e,r){const n=e.DEF,i=e.SEP;if(!0===this.getLaFuncFromCache(r).call(this)){n.call(this);const e=o((()=>this.tokenMatcher(this.LA(1),i)),"separatorLookAheadFunc");for(;!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,i,e,n,u2],e,v4,t,u2)}}repetitionSepSecondInternal(t,e,r,n,i){for(;r();)this.CONSUME(e),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,e,r,n,i],r,x4,t,i)}doSingleRepetition(t){const e=this.getLexerPosition();t.call(this);return this.getLexerPosition()>e}orInternal(t,e){const r=this.getKeyForAutomaticLookahead(256,e),n=Lb(t)?t:t.DEF,i=this.getLaFuncFromCache(r).call(this,n);if(void 0!==i){return n[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 h4(e,t))}}subruleInternal(t,e,r){let n;try{const i=void 0!==r?r.ARGS:void 0;return this.subruleIdx=e,n=t.apply(this,i),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:t.ruleName),n}catch(e){throw this.subruleInternalError(e,r,t.ruleName)}}subruleInternalError(t,e,r){throw s4(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:r),delete t.partialCstResult),t}consumeInternal(t,e,r){let n;try{const e=this.LA(1);!0===this.tokenMatcher(e,t)?(this.consumeToken(),n=e):this.consumeInternalError(t,e,r)}catch(r){n=this.consumeInternalRecovery(t,e,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:t.name,n),n}consumeInternalError(t,e,r){let n;const i=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new l4(n,e,i))}consumeInternalRecovery(t,e,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;{const n=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,n)}catch(t){throw t.name===p4?r:t}}}saveRecogState(){const t=this.errors,e=j$(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,r){this.RULE_OCCURRENCE_STACK.push(r),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),Z1)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},G4=class{static{o(this,"ErrorHandler")}initErrorHandler(t){this._errors=[],this.errorMessageProvider=aq(t,"errorMessageProvider")?t.errorMessageProvider:a5.errorMessageProvider}SAVE_ERROR(t){if(s4(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:j$(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return j$(this._errors)}set errors(t){this._errors=t}raiseEarlyExitException(t,e,r){const n=this.getCurrRuleFullName(),i=N2(t,this.getGAstProductions()[n],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:r,ruleName:n});throw this.SAVE_ERROR(new u4(s,this.LA(1),this.LA(0)))}raiseNoAltException(t,e){const r=this.getCurrRuleFullName(),n=L2(t,this.getGAstProductions()[r],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:n,actual:i,previous:a,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new c4(s,this.LA(1),a))}},q4=class{static{o(this,"ContentAssist")}initContentAssist(){}computeContentAssist(t,e){const r=this.gastProductionsCache[t];if(Vz(r))throw Error(`Rule ->${t}<- does not exist in this grammar.`);return f2([r],e,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(t){const e=WG(t.ruleStack),r=this.getGAstProductions()[e];return new l2(r,t).startWalking()}},j4={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(j4);var W4=Math.pow(2,8)-1,Y4=X1({name:"RECORDING_PHASE_TOKEN",pattern:$1.NA});T1([Y4]);var H4=Q1(Y4,"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(H4);var V4={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}},X4=class{static{o(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,r){return this.consumeInternalRecord(e,t,r)},this[`SUBRULE${e}`]=function(e,r){return this.subruleInternalRecord(e,t,r)},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,r){return this.consumeInternalRecord(e,t,r)},this.subrule=function(t,e,r){return this.subruleInternalRecord(e,t,r)},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 r=e>0?e:"";delete t[`CONSUME${r}`],delete t[`SUBRULE${r}`],delete t[`OPTION${r}`],delete t[`OR${r}`],delete t[`MANY${r}`],delete t[`MANY_SEP${r}`],delete t[`AT_LEAST_ONE${r}`],delete t[`AT_LEAST_ONE_SEP${r}`]}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 r5}topLevelRuleRecord(t,e){try{const r=new KJ({definition:[],name:t});return r.name=t,this.recordingProdStack.push(r),e.call(this),this.recordingProdStack.pop(),r}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 K4.call(this,QJ,t,e)}atLeastOneInternalRecord(t,e){K4.call(this,JJ,e,t)}atLeastOneSepFirstInternalRecord(t,e){K4.call(this,t0,e,t,true)}manyInternalRecord(t,e){K4.call(this,e0,e,t)}manySepFirstInternalRecord(t,e){K4.call(this,r0,e,t,true)}orInternalRecord(t,e){return Z4.call(this,t,e)}subruleInternalRecord(t,e,r){if(J4(e),!t||!1===aq(t,"ruleName")){const r=new Error(`<SUBRULE${Q4(e)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=K$(this.recordingProdStack),i=t.ruleName,a=new XJ({idx:e,nonTerminalName:i,label:null==r?void 0:r.LABEL,referencedRule:void 0});return n.definition.push(a),this.outputCst?V4:j4}consumeInternalRecord(t,e,r){if(J4(e),!L1(t)){const r=new Error(`<CONSUME${Q4(e)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw r.KNOWN_RECORDER_ERROR=!0,r}const n=K$(this.recordingProdStack),i=new i0({idx:e,terminalType:t,label:null==r?void 0:r.LABEL});return n.definition.push(i),H4}};function K4(t,e,r,n=!1){J4(r);const i=K$(this.recordingProdStack),a=dv(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),aq(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),j4}function Z4(t,e){J4(e);const r=K$(this.recordingProdStack),n=!1===Lb(t),i=!1===n?t:t.DEF,a=new n0({definition:[],idx:e,ignoreAmbiguities:n&&!0===t.IGNORE_AMBIGUITIES});aq(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=uj(i,(t=>dv(t.GATE)));return a.hasPredicates=s,r.definition.push(a),iF(i,(t=>{const e=new ZJ({definition:[]});a.definition.push(e),aq(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:aq(t,"GATE")&&(e.ignoreAmbiguities=!0),this.recordingProdStack.push(e),t.ALT.call(this),this.recordingProdStack.pop()})),j4}function Q4(t){return 0===t?"":`${t}`}function J4(t){if(t<0||t>W4){const e=new Error(`Invalid DSL Method idx value: <${t}>\n\tIdx value must be a none negative value smaller than ${W4+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}o(K4,"recordProd"),o(Z4,"recordOrProd"),o(Q4,"getIdxSuffix"),o(J4,"assertMethodIdxIsValid");var t5=class{static{o(this,"PerformanceTracer")}initPerformanceTracer(t){if(aq(t,"traceInitPerf")){const e=t.traceInitPerf,r="number"==typeof e;this.traceInitMaxIdent=r?e:1/0,this.traceInitPerf=r?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=a5.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--\x3e <${t}>`);const{time:n,value:i}=jJ(e),a=n>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${t}> time: ${n}ms`),this.traceInitIndent--,i}return e()}};function e5(t,e){e.forEach((e=>{const r=e.prototype;Object.getOwnPropertyNames(r).forEach((n=>{if("constructor"===n)return;const i=Object.getOwnPropertyDescriptor(r,n);i&&(i.get||i.set)?Object.defineProperty(t.prototype,n,i):t.prototype[n]=e.prototype[n]}))}))}o(e5,"applyMixins");var r5=Q1(Z1,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(r5);var n5,i5,a5=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:t2,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),s5=Object.freeze({recoveryValueFunc:o((()=>{}),"recoveryValueFunc"),resyncEnabled:!0});function o5(t){return function(){return t}}(i5=n5||(n5={}))[i5.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",i5[i5.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",i5[i5.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",i5[i5.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",i5[i5.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",i5[i5.LEFT_RECURSION=5]="LEFT_RECURSION",i5[i5.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",i5[i5.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",i5[i5.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",i5[i5.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",i5[i5.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",i5[i5.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",i5[i5.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",i5[i5.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION",o(o5,"EMPTY_ALT");var l5=class t{static{o(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 r=this.className;this.TRACE_INIT("toFastProps",(()=>{WJ(this)})),this.TRACE_INIT("Grammar Recording",(()=>{try{this.enableRecording(),iF(this.definedRulesNames,(t=>{const e=this[t].originalGrammarAction;let r;this.TRACE_INIT(`${t} Rule`,(()=>{r=this.topLevelRuleRecord(t,e)})),this.gastProductionsCache[t]=r}))}finally{this.disableRecording()}}));let n=[];if(this.TRACE_INIT("Grammar Resolving",(()=>{n=J2({rules:Yz(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)})),this.TRACE_INIT("Grammar Validations",(()=>{if(iL(n)&&!1===this.skipValidations){const t=t4({rules:Yz(this.gastProductionsCache),tokenTypes:Yz(this.tokensMap),errMsgProvider:r2,grammarName:r}),e=D2({lookaheadStrategy:this.lookaheadStrategy,rules:Yz(this.gastProductionsCache),tokenTypes:Yz(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(t,e)}})),iL(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",(()=>{const t=b0(Yz(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:Yz(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Yz(this.gastProductionsCache))}))),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!iL(this.definitionErrors))throw e=Gz(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 r=this;if(r.initErrorHandler(e),r.initLexerAdapter(),r.initLooksAhead(e),r.initRecognizerEngine(t,e),r.initRecoverable(e),r.initTreeBuilder(e),r.initContentAssist(),r.initGastRecorder(e),r.initPerformanceTracer(e),aq(e,"ignoredIssues"))throw new Error("The <ignoredIssues> IParserConfig property has been deprecated.\n\tPlease use the <IGNORE_AMBIGUITIES> 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=aq(e,"skipValidations")?e.skipValidations:a5.skipValidations}};l5.DEFER_DEFINITION_ERRORS_HANDLING=!1,e5(l5,[f4,k4,$4,F4,U4,z4,G4,q4,X4,t5]);var c5=class extends l5{static{o(this,"EmbeddedActionsParser")}constructor(t,e=a5){const r=j$(e);r.outputCst=!1,super(t,r)}};function h5(t,e,r){return`${t.name}_${e}_${r}`}o(h5,"buildATNKey");var u5=class{static{o(this,"AbstractTransition")}constructor(t){this.target=t}isEpsilon(){return!1}},d5=class extends u5{static{o(this,"AtomTransition")}constructor(t,e){super(t),this.tokenType=e}},p5=class extends u5{static{o(this,"EpsilonTransition")}constructor(t){super(t)}isEpsilon(){return!0}},g5=class extends u5{static{o(this,"RuleTransition")}constructor(t,e,r){super(t),this.rule=e,this.followState=r}isEpsilon(){return!0}};function f5(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};m5(e,t);const r=t.length;for(let n=0;n<r;n++){const r=t[n],i=_5(e,r,r);void 0!==i&&D5(e,r,i)}return e}function m5(t,e){const r=e.length;for(let n=0;n<r;n++){const r=e[n],i=P5(t,r,void 0,{type:2}),a=P5(t,r,void 0,{type:7});i.stop=a,t.ruleToStartState.set(r,i),t.ruleToStopState.set(r,a)}}function y5(t,e,r){return r instanceof i0?R5(t,e,r.terminalType,r):r instanceof XJ?M5(t,e,r):r instanceof n0?k5(t,e,r):r instanceof QJ?T5(t,e,r):r instanceof e0?v5(t,e,r):r instanceof r0?x5(t,e,r):r instanceof JJ?b5(t,e,r):r instanceof t0?w5(t,e,r):_5(t,e,r)}function v5(t,e,r){const n=P5(t,e,r,{type:5});A5(t,n);return C5(t,e,r,L5(t,e,n,r,_5(t,e,r)))}function x5(t,e,r){const n=P5(t,e,r,{type:5});A5(t,n);return C5(t,e,r,L5(t,e,n,r,_5(t,e,r)),R5(t,e,r.separator,r))}function b5(t,e,r){const n=P5(t,e,r,{type:4});A5(t,n);return E5(t,e,r,L5(t,e,n,r,_5(t,e,r)))}function w5(t,e,r){const n=P5(t,e,r,{type:4});A5(t,n);return E5(t,e,r,L5(t,e,n,r,_5(t,e,r)),R5(t,e,r.separator,r))}function k5(t,e,r){const n=P5(t,e,r,{type:1});A5(t,n);const i=Gz(r.definition,(r=>y5(t,e,r)));return L5(t,e,n,r,...i)}function T5(t,e,r){const n=P5(t,e,r,{type:1});A5(t,n);return S5(t,e,r,L5(t,e,n,r,_5(t,e,r)))}function _5(t,e,r){const n=$z(Gz(r.definition,(r=>y5(t,e,r))),(t=>void 0!==t));return 1===n.length?n[0]:0===n.length?void 0:I5(t,n)}function E5(t,e,r,n,i){const a=n.left,s=n.right,o=P5(t,e,r,{type:11});A5(t,o);const l=P5(t,e,r,{type:12});return a.loopback=o,l.loopback=o,t.decisionMap[h5(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,O5(s,o),void 0===i?(O5(o,a),O5(o,l)):(O5(o,l),O5(o,i.left),O5(i.right,a)),{left:a,right:l}}function C5(t,e,r,n,i){const a=n.left,s=n.right,o=P5(t,e,r,{type:10});A5(t,o);const l=P5(t,e,r,{type:12}),c=P5(t,e,r,{type:9});return o.loopback=c,l.loopback=c,O5(o,a),O5(o,l),O5(s,c),void 0!==i?(O5(c,l),O5(c,i.left),O5(i.right,a)):O5(c,o),t.decisionMap[h5(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}function S5(t,e,r,n){const i=n.left;return O5(i,n.right),t.decisionMap[h5(e,"Option",r.idx)]=i,n}function A5(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function L5(t,e,r,n,...i){const a=P5(t,e,n,{type:8,start:r});r.end=a;for(const t of i)void 0!==t?(O5(r,t.left),O5(t.right,a)):O5(r,a);const s={left:r,right:a};return t.decisionMap[h5(e,N5(n),n.idx)]=r,s}function N5(t){if(t instanceof n0)return"Alternation";if(t instanceof QJ)return"Option";if(t instanceof e0)return"Repetition";if(t instanceof r0)return"RepetitionWithSeparator";if(t instanceof JJ)return"RepetitionMandatory";if(t instanceof t0)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function I5(t,e){const r=e.length;for(let n=0;n<r-1;n++){const r=e[n];let i;1===r.left.transitions.length&&(i=r.left.transitions[0]);const a=i instanceof g5,s=i,o=e[n+1].left;1===r.left.type&&1===r.right.type&&void 0!==i&&(a&&s.followState===r.right||i.target===r.right)?(a?s.followState=o:i.target=o,$5(t,r.right)):O5(r.right,o)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function R5(t,e,r,n){const i=P5(t,e,n,{type:1}),a=P5(t,e,n,{type:1});return B5(i,new d5(a,r)),{left:i,right:a}}function M5(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=P5(t,e,r,{type:1}),s=P5(t,e,r,{type:1});return B5(a,new g5(i,n,s)),{left:a,right:s}}function D5(t,e,r){const n=t.ruleToStartState.get(e);O5(n,r.left);const i=t.ruleToStopState.get(e);O5(r.right,i);return{left:n,right:i}}function O5(t,e){B5(t,new p5(e))}function P5(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function B5(t,e){0===t.transitions.length&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function $5(t,e){t.states.splice(t.states.indexOf(e),1)}o(f5,"createATN"),o(m5,"createRuleStartAndStopATNStates"),o(y5,"atom"),o(v5,"repetition"),o(x5,"repetitionSep"),o(b5,"repetitionMandatory"),o(w5,"repetitionMandatorySep"),o(k5,"alternation"),o(T5,"option"),o(_5,"block"),o(E5,"plus"),o(C5,"star"),o(S5,"optional"),o(A5,"defineDecisionState"),o(L5,"makeAlts"),o(N5,"getProdType"),o(I5,"makeBlock"),o(R5,"tokenRef"),o(M5,"ruleRef"),o(D5,"buildRuleHandle"),o(O5,"epsilon"),o(P5,"newState"),o(B5,"addTransition"),o($5,"removeState");var F5={},z5=class{static{o(this,"ATNConfigSet")}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){const e=U5(t);e in this.map||(this.map[e]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return Gz(this.configs,(t=>t.alt))}get key(){let t="";for(const e in this.map)t+=e+":";return t}};function U5(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map((t=>t.stateNumber.toString())).join("_")}`}function G5(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return void 0!==a||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}o(U5,"getATNConfigKey"),o(G5,"createDFACache");var q5,j5,W5,Y5,H5,V5,X5,K5,Z5,Q5,J5,t3,e3,r3,n3,i3,a3,s3,o3,l3,c3,h3,u3,d3,p3,g3,f3,m3,y3,v3,x3,b3,w3,k3,T3,_3,E3,C3,S3,A3,L3,N3,I3,R3,M3,D3,O3,P3,B3,$3,F3,z3,U3,G3,q3,j3,W3,Y3,H3,V3,X3,K3,Z3,Q3,J3,t6,e6,r6,n6,i6,a6,s6,o6,l6,c6,h6,u6,d6,p6,g6,f6,m6,y6,v6,x6,b6,w6,k6,T6,_6,E6,C6,S6=class{static{o(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 r=0;r<e;r++)t+=!0===this.predicates[r]?"1":"0";return t}},A6=new S6,L6=class extends w4{static{o(this,"LLStarLookaheadStrategy")}constructor(t){var e;super(),this.logging=null!==(e=null==t?void 0:t.logging)&&void 0!==e?e:t=>console.log(t)}initialize(t){this.atn=f5(t.rules),this.dfas=I6(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){const{prodOccurrence:e,rule:r,hasPredicates:n,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=h5(r,"Alternation",e),l=this.atn.decisionMap[o].decision,c=Gz(v2({maxLookahead:1,occurrence:e,prodType:"Alternation",rule:r}),(t=>Gz(t,(t=>t[0]))));if(N6(c,!1)&&!i){const t=_U(c,((t,e,r)=>(iF(e,(e=>{e&&(t[e.tokenTypeIdx]=r,iF(e.categoryMatches,(e=>{t[e]=r})))})),t)),{});return n?function(e){var r;const n=this.LA(1),i=t[n.tokenTypeIdx];if(void 0!==e&&void 0!==i){const t=null===(r=e[i])||void 0===r?void 0:r.GATE;if(void 0!==t&&!1===t.call(this))return}return i}:function(){const e=this.LA(1);return t[e.tokenTypeIdx]}}return n?function(t){const e=new S6,r=void 0===t?0:t.length;for(let n=0;n<r;n++){const r=null==t?void 0:t[n].GATE;e.set(n,void 0===r||r.call(this))}const n=R6.call(this,a,l,e,s);return"number"==typeof n?n:void 0}:function(){const t=R6.call(this,a,l,A6,s);return"number"==typeof t?t:void 0}}buildLookaheadForOptional(t){const{prodOccurrence:e,rule:r,prodType:n,dynamicTokensEnabled:i}=t,a=this.dfas,s=this.logging,o=h5(r,n,e),l=this.atn.decisionMap[o].decision,c=Gz(v2({maxLookahead:1,occurrence:e,prodType:n,rule:r}),(t=>Gz(t,(t=>t[0]))));if(N6(c)&&c[0][0]&&!i){const t=c[0],e=fU(t);if(1===e.length&&iL(e[0].categoryMatches)){const t=e[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===t}}{const t=_U(e,((t,e)=>(void 0!==e&&(t[e.tokenTypeIdx]=!0,iF(e.categoryMatches,(e=>{t[e]=!0}))),t)),{});return function(){const e=this.LA(1);return!0===t[e.tokenTypeIdx]}}}return function(){const t=R6.call(this,a,l,A6,s);return"object"!=typeof t&&0===t}}};function N6(t,e=!0){const r=new Set;for(const n of t){const t=new Set;for(const i of n){if(void 0===i){if(e)break;return!1}const n=[i.tokenTypeIdx].concat(i.categoryMatches);for(const e of n)if(r.has(e)){if(!t.has(e))return!1}else r.add(e),t.add(e)}}return!0}function I6(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=G5(t.decisionStates[n],n);return r}function R6(t,e,r,n){const i=t[e](r);let a=i.start;if(void 0===a){a=W6(i,q6(Y6(i.atnStartState))),i.start=a}return M6.apply(this,[i,a,r,n])}function M6(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let e=F6(i,o);if(void 0===e&&(e=D6.apply(this,[t,i,o,a,r,n])),e===F5)return $6(s,i,o);if(!0===e.isAcceptState)return e.prediction;i=e,s.push(o),o=this.LA(a++)}}function D6(t,e,r,n,i,a){const s=z6(e.configs,r,i);if(0===s.size)return j6(t,e,r,F5),F5;let o=q6(s);const l=G6(s,i);if(void 0!==l)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(Z6(s)){const e=wq(s.alts);o.isAcceptState=!0,o.prediction=e,o.configs.uniqueAlt=e,O6.apply(this,[t,n,s.alts,a])}return o=j6(t,e,r,o),o}function O6(t,e,r,n){const i=[];for(let t=1;t<=e;t++)i.push(this.LA(t).tokenType);const a=t.atnStartState;n(P6({topLevelRule:a.rule,ambiguityIndices:r,production:a.production,prefixPath:i}))}function P6(t){const e=Gz(t.prefixPath,(t=>F1(t))).join(", "),r=0===t.production.idx?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${B6(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,\n<${e}> may appears as a prefix path in all these alternatives.\n`;return n+="See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",n}function B6(t){if(t instanceof XJ)return"SUBRULE";if(t instanceof QJ)return"OPTION";if(t instanceof n0)return"OR";if(t instanceof JJ)return"AT_LEAST_ONE";if(t instanceof t0)return"AT_LEAST_ONE_SEP";if(t instanceof r0)return"MANY_SEP";if(t instanceof e0)return"MANY";if(t instanceof i0)return"CONSUME";throw Error("non exhaustive match")}function $6(t,e,r){const n=HG(e.configs.elements,(t=>t.state.transitions)),i=yj(n.filter((t=>t instanceof d5)).map((t=>t.tokenType)),(t=>t.tokenTypeIdx));return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function F6(t,e){return t.edges[e.tokenTypeIdx]}function z6(t,e,r){const n=new z5,i=[];for(const a of t.elements){if(!1===r.is(a.alt))continue;if(7===a.state.type){i.push(a);continue}const t=a.state.transitions.length;for(let r=0;r<t;r++){const t=U6(a.state.transitions[r],e);void 0!==t&&n.add({state:t,alt:a.alt,stack:a.stack})}}let a;if(0===i.length&&1===n.size&&(a=n),void 0===a){a=new z5;for(const t of n.elements)H6(t,a)}if(i.length>0&&!X6(a))for(const t of i)a.add(t);return a}function U6(t,e){if(t instanceof d5&&J1(e,t.tokenType))return t.target}function G6(t,e){let r;for(const n of t.elements)if(!0===e.is(n.alt))if(void 0===r)r=n.alt;else if(r!==n.alt)return;return r}function q6(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function j6(t,e,r,n){return n=W6(t,n),e.edges[r.tokenTypeIdx]=n,n}function W6(t,e){if(e===F5)return e;const r=e.configs.key,n=t.states[r];return void 0!==n?n:(e.configs.finalize(),t.states[r]=e,e)}function Y6(t){const e=new z5,r=t.transitions.length;for(let n=0;n<r;n++){H6({state:t.transitions[n].target,alt:n,stack:[]},e)}return e}function H6(t,e){const r=t.state;if(7===r.type){if(t.stack.length>0){const r=[...t.stack];H6({state:r.pop(),alt:t.alt,stack:r},e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const n=V6(t,r.transitions[i]);void 0!==n&&H6(n,e)}}function V6(t,e){if(e instanceof p5)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof g5){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function X6(t){for(const e of t.elements)if(7===e.state.type)return!0;return!1}function K6(t){for(const e of t.elements)if(7!==e.state.type)return!1;return!0}function Z6(t){if(K6(t))return!0;const e=Q6(t.elements);return J6(e)&&!t7(e)}function Q6(t){const e=new Map;for(const r of t){const t=U5(r,!1);let n=e.get(t);void 0===n&&(n={},e.set(t,n)),n[r.alt]=!0}return e}function J6(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function t7(t){for(const e of Array.from(t.values()))if(1===Object.keys(e).length)return!0;return!1}o(N6,"isLL1Sequence"),o(I6,"initATNSimulator"),o(R6,"adaptivePredict"),o(M6,"performLookahead"),o(D6,"computeLookaheadTarget"),o(O6,"reportLookaheadAmbiguity"),o(P6,"buildAmbiguityError"),o(B6,"getProductionDslName"),o($6,"buildAdaptivePredictError"),o(F6,"getExistingTargetState"),o(z6,"computeReachSet"),o(U6,"getReachableTarget"),o(G6,"getUniqueAlt"),o(q6,"newDFAState"),o(j6,"addDFAEdge"),o(W6,"addDFAState"),o(Y6,"computeStartState"),o(H6,"closure"),o(V6,"getEpsilonTarget"),o(X6,"hasConfigInRuleStopState"),o(K6,"allConfigsInRuleStopStates"),o(Z6,"hasConflictTerminatingPrediction"),o(Q6,"getConflictingAltSets"),o(J6,"hasConflictingAltSet"),o(t7,"hasStateAssociatedWithOneAlt"),function(t){function e(t){return"string"==typeof t}o(e,"is"),t.is=e}(q5||(q5={})),function(t){function e(t){return"string"==typeof t}o(e,"is"),t.is=e}(j5||(j5={})),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,o(e,"is"),t.is=e}(W5||(W5={})),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,o(e,"is"),t.is=e}(Y5||(Y5={})),function(t){function e(t,e){return t===Number.MAX_VALUE&&(t=Y5.MAX_VALUE),e===Number.MAX_VALUE&&(e=Y5.MAX_VALUE),{line:t,character:e}}function r(t){let e=t;return e7.objectLiteral(e)&&e7.uinteger(e.line)&&e7.uinteger(e.character)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(H5||(H5={})),function(t){function e(t,e,r,n){if(e7.uinteger(t)&&e7.uinteger(e)&&e7.uinteger(r)&&e7.uinteger(n))return{start:H5.create(t,e),end:H5.create(r,n)};if(H5.is(t)&&H5.is(e))return{start:t,end:e};throw new Error(`Range#create called with invalid arguments[${t}, ${e}, ${r}, ${n}]`)}function r(t){let e=t;return e7.objectLiteral(e)&&H5.is(e.start)&&H5.is(e.end)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(V5||(V5={})),function(t){function e(t,e){return{uri:t,range:e}}function r(t){let e=t;return e7.objectLiteral(e)&&V5.is(e.range)&&(e7.string(e.uri)||e7.undefined(e.uri))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(X5||(X5={})),function(t){function e(t,e,r,n){return{targetUri:t,targetRange:e,targetSelectionRange:r,originSelectionRange:n}}function r(t){let e=t;return e7.objectLiteral(e)&&V5.is(e.targetRange)&&e7.string(e.targetUri)&&V5.is(e.targetSelectionRange)&&(V5.is(e.originSelectionRange)||e7.undefined(e.originSelectionRange))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(K5||(K5={})),function(t){function e(t,e,r,n){return{red:t,green:e,blue:r,alpha:n}}function r(t){const e=t;return e7.objectLiteral(e)&&e7.numberRange(e.red,0,1)&&e7.numberRange(e.green,0,1)&&e7.numberRange(e.blue,0,1)&&e7.numberRange(e.alpha,0,1)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(Z5||(Z5={})),function(t){function e(t,e){return{range:t,color:e}}function r(t){const e=t;return e7.objectLiteral(e)&&V5.is(e.range)&&Z5.is(e.color)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(Q5||(Q5={})),function(t){function e(t,e,r){return{label:t,textEdit:e,additionalTextEdits:r}}function r(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.label)&&(e7.undefined(e.textEdit)||u3.is(e))&&(e7.undefined(e.additionalTextEdits)||e7.typedArray(e.additionalTextEdits,u3.is))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(J5||(J5={})),(e3=t3||(t3={})).Comment="comment",e3.Imports="imports",e3.Region="region",function(t){function e(t,e,r,n,i,a){const s={startLine:t,endLine:e};return e7.defined(r)&&(s.startCharacter=r),e7.defined(n)&&(s.endCharacter=n),e7.defined(i)&&(s.kind=i),e7.defined(a)&&(s.collapsedText=a),s}function r(t){const e=t;return e7.objectLiteral(e)&&e7.uinteger(e.startLine)&&e7.uinteger(e.startLine)&&(e7.undefined(e.startCharacter)||e7.uinteger(e.startCharacter))&&(e7.undefined(e.endCharacter)||e7.uinteger(e.endCharacter))&&(e7.undefined(e.kind)||e7.string(e.kind))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(r3||(r3={})),function(t){function e(t,e){return{location:t,message:e}}function r(t){let e=t;return e7.defined(e)&&X5.is(e.location)&&e7.string(e.message)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(n3||(n3={})),(a3=i3||(i3={})).Error=1,a3.Warning=2,a3.Information=3,a3.Hint=4,(o3=s3||(s3={})).Unnecessary=1,o3.Deprecated=2,function(t){function e(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.href)}o(e,"is"),t.is=e}(l3||(l3={})),function(t){function e(t,e,r,n,i,a){let s={range:t,message:e};return e7.defined(r)&&(s.severity=r),e7.defined(n)&&(s.code=n),e7.defined(i)&&(s.source=i),e7.defined(a)&&(s.relatedInformation=a),s}function r(t){var e;let r=t;return e7.defined(r)&&V5.is(r.range)&&e7.string(r.message)&&(e7.number(r.severity)||e7.undefined(r.severity))&&(e7.integer(r.code)||e7.string(r.code)||e7.undefined(r.code))&&(e7.undefined(r.codeDescription)||e7.string(null===(e=r.codeDescription)||void 0===e?void 0:e.href))&&(e7.string(r.source)||e7.undefined(r.source))&&(e7.undefined(r.relatedInformation)||e7.typedArray(r.relatedInformation,n3.is))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(c3||(c3={})),function(t){function e(t,e,...r){let n={title:t,command:e};return e7.defined(r)&&r.length>0&&(n.arguments=r),n}function r(t){let e=t;return e7.defined(e)&&e7.string(e.title)&&e7.string(e.command)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(h3||(h3={})),function(t){function e(t,e){return{range:t,newText:e}}function r(t,e){return{range:{start:t,end:t},newText:e}}function n(t){return{range:t,newText:""}}function i(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.newText)&&V5.is(e.range)}o(e,"replace"),t.replace=e,o(r,"insert"),t.insert=r,o(n,"del"),t.del=n,o(i,"is"),t.is=i}(u3||(u3={})),function(t){function e(t,e,r){const n={label:t};return void 0!==e&&(n.needsConfirmation=e),void 0!==r&&(n.description=r),n}function r(t){const e=t;return e7.objectLiteral(e)&&e7.string(e.label)&&(e7.boolean(e.needsConfirmation)||void 0===e.needsConfirmation)&&(e7.string(e.description)||void 0===e.description)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(d3||(d3={})),function(t){function e(t){const e=t;return e7.string(e)}o(e,"is"),t.is=e}(p3||(p3={})),function(t){function e(t,e,r){return{range:t,newText:e,annotationId:r}}function r(t,e,r){return{range:{start:t,end:t},newText:e,annotationId:r}}function n(t,e){return{range:t,newText:"",annotationId:e}}function i(t){const e=t;return u3.is(e)&&(d3.is(e.annotationId)||p3.is(e.annotationId))}o(e,"replace"),t.replace=e,o(r,"insert"),t.insert=r,o(n,"del"),t.del=n,o(i,"is"),t.is=i}(g3||(g3={})),function(t){function e(t,e){return{textDocument:t,edits:e}}function r(t){let e=t;return e7.defined(e)&&k3.is(e.textDocument)&&Array.isArray(e.edits)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(f3||(f3={})),function(t){function e(t,e,r){let n={kind:"create",uri:t};return void 0===e||void 0===e.overwrite&&void 0===e.ignoreIfExists||(n.options=e),void 0!==r&&(n.annotationId=r),n}function r(t){let e=t;return e&&"create"===e.kind&&e7.string(e.uri)&&(void 0===e.options||(void 0===e.options.overwrite||e7.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||e7.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(m3||(m3={})),function(t){function e(t,e,r,n){let i={kind:"rename",oldUri:t,newUri:e};return void 0===r||void 0===r.overwrite&&void 0===r.ignoreIfExists||(i.options=r),void 0!==n&&(i.annotationId=n),i}function r(t){let e=t;return e&&"rename"===e.kind&&e7.string(e.oldUri)&&e7.string(e.newUri)&&(void 0===e.options||(void 0===e.options.overwrite||e7.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||e7.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(y3||(y3={})),function(t){function e(t,e,r){let n={kind:"delete",uri:t};return void 0===e||void 0===e.recursive&&void 0===e.ignoreIfNotExists||(n.options=e),void 0!==r&&(n.annotationId=r),n}function r(t){let e=t;return e&&"delete"===e.kind&&e7.string(e.uri)&&(void 0===e.options||(void 0===e.options.recursive||e7.boolean(e.options.recursive))&&(void 0===e.options.ignoreIfNotExists||e7.boolean(e.options.ignoreIfNotExists)))&&(void 0===e.annotationId||p3.is(e.annotationId))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(v3||(v3={})),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=>e7.string(t.kind)?m3.is(t)||y3.is(t)||v3.is(t):f3.is(t))))}o(e,"is"),t.is=e}(x3||(x3={})),function(t){function e(t){return{uri:t}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(b3||(b3={})),function(t){function e(t,e){return{uri:t,version:e}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&e7.integer(e.version)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(w3||(w3={})),function(t){function e(t,e){return{uri:t,version:e}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&(null===e.version||e7.integer(e.version))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(k3||(k3={})),function(t){function e(t,e,r,n){return{uri:t,languageId:e,version:r,text:n}}function r(t){let e=t;return e7.defined(e)&&e7.string(e.uri)&&e7.string(e.languageId)&&e7.integer(e.version)&&e7.string(e.text)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(T3||(T3={})),function(t){function e(e){const r=e;return r===t.PlainText||r===t.Markdown}t.PlainText="plaintext",t.Markdown="markdown",o(e,"is"),t.is=e}(_3||(_3={})),function(t){function e(t){const e=t;return e7.objectLiteral(t)&&_3.is(e.kind)&&e7.string(e.value)}o(e,"is"),t.is=e}(E3||(E3={})),(S3=C3||(C3={})).Text=1,S3.Method=2,S3.Function=3,S3.Constructor=4,S3.Field=5,S3.Variable=6,S3.Class=7,S3.Interface=8,S3.Module=9,S3.Property=10,S3.Unit=11,S3.Value=12,S3.Enum=13,S3.Keyword=14,S3.Snippet=15,S3.Color=16,S3.File=17,S3.Reference=18,S3.Folder=19,S3.EnumMember=20,S3.Constant=21,S3.Struct=22,S3.Event=23,S3.Operator=24,S3.TypeParameter=25,(L3=A3||(A3={})).PlainText=1,L3.Snippet=2,(N3||(N3={})).Deprecated=1,function(t){function e(t,e,r){return{newText:t,insert:e,replace:r}}function r(t){const e=t;return e&&e7.string(e.newText)&&V5.is(e.insert)&&V5.is(e.replace)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(I3||(I3={})),(M3=R3||(R3={})).asIs=1,M3.adjustIndentation=2,function(t){function e(t){const e=t;return e&&(e7.string(e.detail)||void 0===e.detail)&&(e7.string(e.description)||void 0===e.description)}o(e,"is"),t.is=e}(D3||(D3={})),function(t){function e(t){return{label:t}}o(e,"create"),t.create=e}(O3||(O3={})),function(t){function e(t,e){return{items:t||[],isIncomplete:!!e}}o(e,"create"),t.create=e}(P3||(P3={})),function(t){function e(t){return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function r(t){const e=t;return e7.string(e)||e7.objectLiteral(e)&&e7.string(e.language)&&e7.string(e.value)}o(e,"fromPlainText"),t.fromPlainText=e,o(r,"is"),t.is=r}(B3||(B3={})),function(t){function e(t){let e=t;return!!e&&e7.objectLiteral(e)&&(E3.is(e.contents)||B3.is(e.contents)||e7.typedArray(e.contents,B3.is))&&(void 0===t.range||V5.is(t.range))}o(e,"is"),t.is=e}($3||($3={})),function(t){function e(t,e){return e?{label:t,documentation:e}:{label:t}}o(e,"create"),t.create=e}(F3||(F3={})),function(t){function e(t,e,...r){let n={label:t};return e7.defined(e)&&(n.documentation=e),e7.defined(r)?n.parameters=r:n.parameters=[],n}o(e,"create"),t.create=e}(z3||(z3={})),(G3=U3||(U3={})).Text=1,G3.Read=2,G3.Write=3,function(t){function e(t,e){let r={range:t};return e7.number(e)&&(r.kind=e),r}o(e,"create"),t.create=e}(q3||(q3={})),(W3=j3||(j3={})).File=1,W3.Module=2,W3.Namespace=3,W3.Package=4,W3.Class=5,W3.Method=6,W3.Property=7,W3.Field=8,W3.Constructor=9,W3.Enum=10,W3.Interface=11,W3.Function=12,W3.Variable=13,W3.Constant=14,W3.String=15,W3.Number=16,W3.Boolean=17,W3.Array=18,W3.Object=19,W3.Key=20,W3.Null=21,W3.EnumMember=22,W3.Struct=23,W3.Event=24,W3.Operator=25,W3.TypeParameter=26,(Y3||(Y3={})).Deprecated=1,function(t){function e(t,e,r,n,i){let a={name:t,kind:e,location:{uri:n,range:r}};return i&&(a.containerName=i),a}o(e,"create"),t.create=e}(H3||(H3={})),function(t){function e(t,e,r,n){return void 0!==n?{name:t,kind:e,location:{uri:r,range:n}}:{name:t,kind:e,location:{uri:r}}}o(e,"create"),t.create=e}(V3||(V3={})),function(t){function e(t,e,r,n,i,a){let s={name:t,detail:e,kind:r,range:n,selectionRange:i};return void 0!==a&&(s.children=a),s}function r(t){let e=t;return e&&e7.string(e.name)&&e7.number(e.kind)&&V5.is(e.range)&&V5.is(e.selectionRange)&&(void 0===e.detail||e7.string(e.detail))&&(void 0===e.deprecated||e7.boolean(e.deprecated))&&(void 0===e.children||Array.isArray(e.children))&&(void 0===e.tags||Array.isArray(e.tags))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(X3||(X3={})),(Z3=K3||(K3={})).Empty="",Z3.QuickFix="quickfix",Z3.Refactor="refactor",Z3.RefactorExtract="refactor.extract",Z3.RefactorInline="refactor.inline",Z3.RefactorRewrite="refactor.rewrite",Z3.Source="source",Z3.SourceOrganizeImports="source.organizeImports",Z3.SourceFixAll="source.fixAll",(J3=Q3||(Q3={})).Invoked=1,J3.Automatic=2,function(t){function e(t,e,r){let n={diagnostics:t};return null!=e&&(n.only=e),null!=r&&(n.triggerKind=r),n}function r(t){let e=t;return e7.defined(e)&&e7.typedArray(e.diagnostics,c3.is)&&(void 0===e.only||e7.typedArray(e.only,e7.string))&&(void 0===e.triggerKind||e.triggerKind===Q3.Invoked||e.triggerKind===Q3.Automatic)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(t6||(t6={})),function(t){function e(t,e,r){let n={title:t},i=!0;return"string"==typeof e?(i=!1,n.kind=e):h3.is(e)?n.command=e:n.edit=e,i&&void 0!==r&&(n.kind=r),n}function r(t){let e=t;return e&&e7.string(e.title)&&(void 0===e.diagnostics||e7.typedArray(e.diagnostics,c3.is))&&(void 0===e.kind||e7.string(e.kind))&&(void 0!==e.edit||void 0!==e.command)&&(void 0===e.command||h3.is(e.command))&&(void 0===e.isPreferred||e7.boolean(e.isPreferred))&&(void 0===e.edit||x3.is(e.edit))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(e6||(e6={})),function(t){function e(t,e){let r={range:t};return e7.defined(e)&&(r.data=e),r}function r(t){let e=t;return e7.defined(e)&&V5.is(e.range)&&(e7.undefined(e.command)||h3.is(e.command))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(r6||(r6={})),function(t){function e(t,e){return{tabSize:t,insertSpaces:e}}function r(t){let e=t;return e7.defined(e)&&e7.uinteger(e.tabSize)&&e7.boolean(e.insertSpaces)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(n6||(n6={})),function(t){function e(t,e,r){return{range:t,target:e,data:r}}function r(t){let e=t;return e7.defined(e)&&V5.is(e.range)&&(e7.undefined(e.target)||e7.string(e.target))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(i6||(i6={})),function(t){function e(t,e){return{range:t,parent:e}}function r(e){let r=e;return e7.objectLiteral(r)&&V5.is(r.range)&&(void 0===r.parent||t.is(r.parent))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(a6||(a6={})),(o6=s6||(s6={})).namespace="namespace",o6.type="type",o6.class="class",o6.enum="enum",o6.interface="interface",o6.struct="struct",o6.typeParameter="typeParameter",o6.parameter="parameter",o6.variable="variable",o6.property="property",o6.enumMember="enumMember",o6.event="event",o6.function="function",o6.method="method",o6.macro="macro",o6.keyword="keyword",o6.modifier="modifier",o6.comment="comment",o6.string="string",o6.number="number",o6.regexp="regexp",o6.operator="operator",o6.decorator="decorator",(c6=l6||(l6={})).declaration="declaration",c6.definition="definition",c6.readonly="readonly",c6.static="static",c6.deprecated="deprecated",c6.abstract="abstract",c6.async="async",c6.modification="modification",c6.documentation="documentation",c6.defaultLibrary="defaultLibrary",function(t){function e(t){const e=t;return e7.objectLiteral(e)&&(void 0===e.resultId||"string"==typeof e.resultId)&&Array.isArray(e.data)&&(0===e.data.length||"number"==typeof e.data[0])}o(e,"is"),t.is=e}(h6||(h6={})),function(t){function e(t,e){return{range:t,text:e}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&e7.string(e.text)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(u6||(u6={})),function(t){function e(t,e,r){return{range:t,variableName:e,caseSensitiveLookup:r}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&e7.boolean(e.caseSensitiveLookup)&&(e7.string(e.variableName)||void 0===e.variableName)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(d6||(d6={})),function(t){function e(t,e){return{range:t,expression:e}}function r(t){const e=t;return null!=e&&V5.is(e.range)&&(e7.string(e.expression)||void 0===e.expression)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(p6||(p6={})),function(t){function e(t,e){return{frameId:t,stoppedLocation:e}}function r(t){const e=t;return e7.defined(e)&&V5.is(t.stoppedLocation)}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(g6||(g6={})),function(t){function e(t){return 1===t||2===t}t.Type=1,t.Parameter=2,o(e,"is"),t.is=e}(f6||(f6={})),function(t){function e(t){return{value:t}}function r(t){const e=t;return e7.objectLiteral(e)&&(void 0===e.tooltip||e7.string(e.tooltip)||E3.is(e.tooltip))&&(void 0===e.location||X5.is(e.location))&&(void 0===e.command||h3.is(e.command))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(m6||(m6={})),function(t){function e(t,e,r){const n={position:t,label:e};return void 0!==r&&(n.kind=r),n}function r(t){const e=t;return e7.objectLiteral(e)&&H5.is(e.position)&&(e7.string(e.label)||e7.typedArray(e.label,m6.is))&&(void 0===e.kind||f6.is(e.kind))&&void 0===e.textEdits||e7.typedArray(e.textEdits,u3.is)&&(void 0===e.tooltip||e7.string(e.tooltip)||E3.is(e.tooltip))&&(void 0===e.paddingLeft||e7.boolean(e.paddingLeft))&&(void 0===e.paddingRight||e7.boolean(e.paddingRight))}o(e,"create"),t.create=e,o(r,"is"),t.is=r}(y6||(y6={})),function(t){function e(t){return{kind:"snippet",value:t}}o(e,"createSnippet"),t.createSnippet=e}(v6||(v6={})),function(t){function e(t,e,r,n){return{insertText:t,filterText:e,range:r,command:n}}o(e,"create"),t.create=e}(x6||(x6={})),function(t){function e(t){return{items:t}}o(e,"create"),t.create=e}(b6||(b6={})),(k6=w6||(w6={})).Invoked=0,k6.Automatic=1,function(t){function e(t,e){return{range:t,text:e}}o(e,"create"),t.create=e}(T6||(T6={})),function(t){function e(t,e){return{triggerKind:t,selectedCompletionInfo:e}}o(e,"create"),t.create=e}(_6||(_6={})),function(t){function e(t){const e=t;return e7.objectLiteral(e)&&j5.is(e.uri)&&e7.string(e.name)}o(e,"is"),t.is=e}(E6||(E6={})),function(t){function e(t,e,r,n){return new r7(t,e,r,n)}function r(t){let e=t;return!!(e7.defined(e)&&e7.string(e.uri)&&(e7.undefined(e.languageId)||e7.string(e.languageId))&&e7.uinteger(e.lineCount)&&e7.func(e.getText)&&e7.func(e.positionAt)&&e7.func(e.offsetAt))}function n(t,e){let r=t.getText(),n=i(e,((t,e)=>{let r=t.range.start.line-e.range.start.line;return 0===r?t.range.start.character-e.range.start.character:r})),a=r.length;for(let e=n.length-1;e>=0;e--){let i=n[e],s=t.offsetAt(i.range.start),o=t.offsetAt(i.range.end);if(!(o<=a))throw new Error("Overlapping edit");r=r.substring(0,s)+i.newText+r.substring(o,r.length),a=s}return r}function i(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),a=t.slice(r);i(n,e),i(a,e);let s=0,o=0,l=0;for(;s<n.length&&o<a.length;){let r=e(n[s],a[o]);t[l++]=r<=0?n[s++]:a[o++]}for(;s<n.length;)t[l++]=n[s++];for(;o<a.length;)t[l++]=a[o++];return t}o(e,"create"),t.create=e,o(r,"is"),t.is=r,o(n,"applyEdits"),t.applyEdits=n,o(i,"mergeSort")}(C6||(C6={}));var e7,r7=class{static{o(this,"FullTextDocument")}constructor(t,e,r,n){this._uri=t,this._languageId=e,this._version=r,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let e=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(e,r)}return this._content}update(t,e){this._content=t.text,this._version=e,this._lineOffsets=void 0}getLineOffsets(){if(void 0===this._lineOffsets){let t=[],e=this._content,r=!0;for(let n=0;n<e.length;n++){r&&(t.push(n),r=!1);let i=e.charAt(n);r="\r"===i||"\n"===i,"\r"===i&&n+1<e.length&&"\n"===e.charAt(n+1)&&n++}r&&e.length>0&&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(),r=0,n=e.length;if(0===n)return H5.create(0,t);for(;r<n;){let i=Math.floor((r+n)/2);e[i]>t?n=i:r=i+1}let i=r-1;return H5.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 r=e[t.line],n=t.line+1<e.length?e[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,n),r)}get lineCount(){return this.getLineOffsets().length}};!function(t){const e=Object.prototype.toString;function r(t){return void 0!==t}function n(t){return void 0===t}function i(t){return!0===t||!1===t}function a(t){return"[object String]"===e.call(t)}function s(t){return"[object Number]"===e.call(t)}function l(t,r,n){return"[object Number]"===e.call(t)&&r<=t&&t<=n}function c(t){return"[object Number]"===e.call(t)&&-2147483648<=t&&t<=2147483647}function h(t){return"[object Number]"===e.call(t)&&0<=t&&t<=2147483647}function u(t){return"[object Function]"===e.call(t)}function d(t){return null!==t&&"object"==typeof t}function p(t,e){return Array.isArray(t)&&t.every(e)}o(r,"defined"),t.defined=r,o(n,"undefined"),t.undefined=n,o(i,"boolean"),t.boolean=i,o(a,"string"),t.string=a,o(s,"number"),t.number=s,o(l,"numberRange"),t.numberRange=l,o(c,"integer"),t.integer=c,o(h,"uinteger"),t.uinteger=h,o(u,"func"),t.func=u,o(d,"objectLiteral"),t.objectLiteral=d,o(p,"typedArray"),t.typedArray=p}(e7||(e7={}));var n7=class{static{o(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){var t;return null!==(t=this.nodeStack[this.nodeStack.length-1])&&void 0!==t?t:this.rootNode}buildRootNode(t){return this.rootNode=new l7(t),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(t){const e=new s7;return e.grammarSource=t,e.root=this.rootNode,this.current.content.push(e),this.nodeStack.push(e),e}buildLeafNode(t,e){const r=new a7(t.startOffset,t.image.length,aK(t),t.tokenType,!e);return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),r}removeNode(t){const e=t.container;if(e){const r=e.content.indexOf(t);r>=0&&e.content.splice(r,1)}}addHiddenNodes(t){const e=[];for(const r of t){const t=new a7(r.startOffset,r.image.length,aK(r),r.tokenType,!0);t.root=this.rootNode,e.push(t)}let r=this.current,n=!1;if(r.content.length>0)r.content.push(...e);else{for(;r.container;){const t=r.container.content.indexOf(r);if(t>0){r.container.content.splice(t,0,...e),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...e)}}construct(t){const e=this.current;"string"==typeof t.$type&&(this.current.astNode=t),t.$cstNode=e;const r=this.nodeStack.pop();0===(null==r?void 0:r.content.length)&&this.removeNode(r)}},i7=class{static{o(this,"AbstractCstNode")}get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var t,e;const r="string"==typeof(null===(t=this._astNode)||void 0===t?void 0:t.$type)?this._astNode:null===(e=this.container)||void 0===e?void 0:e.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(t){this._astNode=t}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}},a7=class extends i7{static{o(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(t,e,r,n,i=!1){super(),this._hidden=i,this._offset=t,this._tokenType=n,this._length=e,this._range=r}},s7=class extends i7{static{o(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new o7(this)}get children(){return this.content}get offset(){var t,e;return null!==(e=null===(t=this.firstNonHiddenNode)||void 0===t?void 0:t.offset)&&void 0!==e?e:0}get length(){return this.end-this.offset}get end(){var t,e;return null!==(e=null===(t=this.lastNonHiddenNode)||void 0===t?void 0:t.end)&&void 0!==e?e:0}get range(){const t=this.firstNonHiddenNode,e=this.lastNonHiddenNode;if(t&&e){if(void 0===this._rangeCache){const{range:r}=t,{range:n}=e;this._rangeCache={start:r.start,end:n.end.line<r.start.line?r.start:n.end}}return this._rangeCache}return{start:H5.create(0,0),end:H5.create(0,0)}}get firstNonHiddenNode(){for(const t of this.content)if(!t.hidden)return t;return this.content[0]}get lastNonHiddenNode(){for(let t=this.content.length-1;t>=0;t--){const e=this.content[t];if(!e.hidden)return e}return this.content[this.content.length-1]}},o7=class t extends Array{static{o(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,...r){return this.addParents(r),super.splice(t,e,...r)}addParents(t){for(const e of t)e.container=this.parent}},l7=class extends s7{static{o(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:""}},c7=Symbol("Datatype");function h7(t){return t.$type===c7}o(h7,"isDataTypeNode");var u7=o((t=>t.endsWith("")?t:t+""),"withRuleSuffix"),d7=class{static{o(this,"AbstractLangiumParser")}constructor(t){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=t.parser.Lexer;const e=this.lexer.definition,r="production"===t.LanguageMetaData.mode;this.wrapper=new v7(e,Object.assign(Object.assign({},t.parser.ParserConfig),{skipValidations:r,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)}getRule(t){return this.allRules.get(t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},p7=class extends d7{static{o(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(t){super(t),this.nodeBuilder=new n7,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 r=this.computeRuleType(t),n=this.wrapper.DEFINE_RULE(u7(t.name),this.startImplementation(r,e).bind(this));return this.allRules.set(t.name,n),t.entry&&(this.mainRule=n),n}computeRuleType(t){if(!t.fragment){if(kJ(t))return c7;{const e=CJ(t);return null!=e?e:t.name}}}parse(t,e={}){this.nodeBuilder.buildRootNode(t);const r=this.lexerResult=this.lexer.tokenize(t);this.wrapper.input=r.tokens;const n=e.rule?this.allRules.get(e.rule):this.mainRule;if(!n)throw new Error(e.rule?`No rule found with name '${e.rule}'`:"No main rule available.");const i=n.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:i,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(t,e){return r=>{const n=!this.isRecording()&&void 0!==t;if(n){const e={$type:t};this.stack.push(e),t===c7&&(e.value="")}let i;try{i=e(r)}catch(t){i=void 0}return void 0===i&&n&&(i=this.construct()),i}}extractHiddenTokens(t){const e=this.lexerResult.hidden;if(!e.length)return[];const r=t.startOffset;for(let t=0;t<e.length;t++){if(e[t].startOffset>r)return e.splice(0,t)}return e.splice(0,e.length)}consume(t,e,r){const n=this.wrapper.wrapConsume(t,e);if(!this.isRecording()&&this.isValidToken(n)){const t=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(t);const e=this.nodeBuilder.buildLeafNode(n,r),{assignment:i,isCrossRef:a}=this.getAssignment(r),s=this.current;if(i){const t=VZ(r)?n.image:this.converter.convert(n.image,e);this.assign(i.operator,i.feature,t,e,a)}else if(h7(s)){let t=n.image;VZ(r)||(t=this.converter.convert(t,e).toString()),s.value+=t}}}isValidToken(t){return!t.isInsertedInRecovery&&!isNaN(t.startOffset)&&"number"==typeof t.endOffset&&!isNaN(t.endOffset)}subrule(t,e,r,n,i){let a;this.isRecording()||r||(a=this.nodeBuilder.buildCompositeNode(n));const s=this.wrapper.wrapSubrule(t,e,i);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(s,n,a)}performSubruleAssignment(t,e,r){const{assignment:n,isCrossRef:i}=this.getAssignment(e);if(n)this.assign(n.operator,n.feature,t,r,i);else if(!n){const e=this.current;if(h7(e))e.value+=t.toString();else if("object"==typeof t&&t){const r=this.assignWithoutOverride(t,e);this.stack.pop(),this.stack.push(r)}}}action(t,e){if(!this.isRecording()){let r=this.current;if(e.feature&&e.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode);this.nodeBuilder.buildCompositeNode(e).content.push(r.$cstNode);const n={$type:t};this.stack.push(n),this.assign(e.operator,e.feature,r,r.$cstNode,!1)}else r.$type=t}}construct(){if(this.isRecording())return;const t=this.current;return mQ(t),this.nodeBuilder.construct(t),this.stack.pop(),h7(t)?this.converter.convert(t.value,t.$cstNode):(SQ(this.astReflection,t),t)}getAssignment(t){if(!this.assignmentMap.has(t)){const e=yQ(t,$Z);this.assignmentMap.set(t,{assignment:e,isCrossRef:!!e&&GZ(e.terminal)})}return this.assignmentMap.get(t)}assign(t,e,r,n,i){const a=this.current;let s;switch(s=i&&"string"==typeof r?this.linker.buildReference(a,e,n,r):r,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[r,n]of Object.entries(e)){const e=t[r];void 0===e?t[r]=n:Array.isArray(e)&&Array.isArray(n)&&(n.push(...e),t[r]=n)}const r=t.$cstNode;return r&&(r.astNode=void 0,t.$cstNode=void 0),t}get definitionErrors(){return this.wrapper.definitionErrors}},g7=class{static{o(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(t){return t2.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return t2.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return t2.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return t2.buildEarlyExitMessage(t)}},f7=class extends g7{static{o(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}\`.`}},m7=class extends d7{static{o(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,{mode:"partial"});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 r=this.wrapper.DEFINE_RULE(u7(t.name),this.startImplementation(e).bind(this));return this.allRules.set(t.name,r),t.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return e=>{const r=this.keepStackSize();try{t(e)}finally{this.resetStackSize(r)}}}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,r){this.wrapper.wrapConsume(t,e),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(t,e,r,n,i){this.before(n),this.wrapper.wrapSubrule(t,e,i),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}},y7={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new f7},v7=class extends c5{static{o(this,"ChevrotainWrapper")}constructor(t,e){const r=e&&"maxLookahead"in e;super(t,Object.assign(Object.assign(Object.assign({},y7),{lookaheadStrategy:r?new w4({maxLookahead:e.maxLookahead}):new L6({logging:e.skipValidations?()=>{}:void 0})}),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,r){return this.subrule(t,e,{ARGS:[r]})}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 x7(t,e,r){return b7({parser:e,tokens:r,ruleNames:new Map},t),e}function b7(t,e){const r=aJ(e,!1),n=ZX(e.rules).filter(mZ).filter((t=>r.has(t)));for(const e of n){const r=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(e,w7(r,e.definition))}}function w7(t,e,r=!1){let n;if(VZ(e))n=I7(t,e);else if(DZ(e))n=k7(t,e);else if($Z(e))n=w7(t,e.terminal);else if(GZ(e))n=N7(t,e);else if(tQ(e))n=T7(t,e);else if(PZ(e))n=C7(t,e);else if(lQ(e))n=S7(t,e);else if(YZ(e))n=A7(t,e);else{if(!jZ(e))throw new TK(e.$cstNode,`Unexpected element type: ${e.$type}`);{const r=t.consume++;n=o((()=>t.parser.consume(r,Z1,e)),"method")}}return R7(t,r?void 0:L7(e),n,e.cardinality)}function k7(t,e){const r=SJ(e);return()=>t.parser.action(r,e)}function T7(t,e){const r=e.rule.ref;if(mZ(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?_7(r,e.arguments):()=>({});return s=>t.parser.subrule(n,M7(t,r),i,e,a(s))}if(CZ(r)){const n=t.consume++,i=O7(t,r.name);return()=>t.parser.consume(n,i,e)}if(!r)throw new TK(e.$cstNode,`Undefined rule: ${e.rule.$refText}`);_K()}function _7(t,e){const r=e.map((t=>E7(t.value)));return e=>{const n={};for(let i=0;i<r.length;i++){const a=t.parameters[i],s=r[i];n[a.name]=s(e)}return n}}function E7(t){if(KK(t)){const e=E7(t.left),r=E7(t.right);return t=>e(t)||r(t)}if(VK(t)){const e=E7(t.left),r=E7(t.right);return t=>e(t)&&r(t)}if(lZ(t)){const e=E7(t.value);return t=>!e(t)}if(gZ(t)){const e=t.parameter.ref.name;return t=>void 0!==t&&!0===t[e]}if(YK(t)){const e=Boolean(t.true);return()=>e}_K()}function C7(t,e){if(1===e.elements.length)return w7(t,e.elements[0]);{const r=[];for(const n of e.elements){const e={ALT:w7(t,n,!0)},i=L7(n);i&&(e.GATE=E7(i)),r.push(e)}const n=t.or++;return e=>t.parser.alternatives(n,r.map((t=>{const r={ALT:o((()=>t.ALT(e)),"ALT")},n=t.GATE;return n&&(r.GATE=()=>n(e)),r})))}}function S7(t,e){if(1===e.elements.length)return w7(t,e.elements[0]);const r=[];for(const n of e.elements){const e={ALT:w7(t,n,!0)},i=L7(n);i&&(e.GATE=E7(i)),r.push(e)}const n=t.or++,i=o(((t,e)=>`uGroup_${t}_${e.getRuleStack().join("-")}`),"idFunc"),a=o((e=>t.parser.alternatives(n,r.map(((r,a)=>{const s={ALT:o((()=>!0),"ALT")},l=t.parser;s.ALT=()=>{if(r.ALT(e),!l.isRecording()){const t=i(n,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=r.GATE;return s.GATE=c?()=>c(e):()=>{const t=l.unorderedGroups.get(i(n,l));return!(null==t?void 0:t[a])},s})))),"alternatives"),s=R7(t,L7(e),a,"*");return e=>{s(e),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function A7(t,e){const r=e.elements.map((e=>w7(t,e)));return t=>r.forEach((e=>e(t)))}function L7(t){if(YZ(t))return t.guardCondition}function N7(t,e,r=e.terminal){if(r){if(tQ(r)&&mZ(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return r=>t.parser.subrule(i,M7(t,n),!1,e,r)}if(tQ(r)&&CZ(r.rule.ref)){const n=t.consume++,i=O7(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}if(VZ(r)){const n=t.consume++,i=O7(t,r.value);return()=>t.parser.consume(n,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 r=mJ(e.type.ref),n=null==r?void 0:r.terminal;if(!n)throw new Error("Could not find name assignment for type: "+SJ(e.type.ref));return N7(t,e,n)}}function I7(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function R7(t,e,r,n){const i=e&&E7(e);if(!n){if(i){const e=t.or++;return n=>t.parser.alternatives(e,[{ALT:o((()=>r(n)),"ALT"),GATE:o((()=>i(n)),"GATE")},{ALT:o5(),GATE:o((()=>!i(n)),"GATE")}])}return r}if("*"===n){const e=t.many++;return n=>t.parser.many(e,{DEF:o((()=>r(n)),"DEF"),GATE:i?()=>i(n):void 0})}if("+"===n){const e=t.many++;if(i){const n=t.or++;return a=>t.parser.alternatives(n,[{ALT:o((()=>t.parser.atLeastOne(e,{DEF:o((()=>r(a)),"DEF")})),"ALT"),GATE:o((()=>i(a)),"GATE")},{ALT:o5(),GATE:o((()=>!i(a)),"GATE")}])}return n=>t.parser.atLeastOne(e,{DEF:o((()=>r(n)),"DEF")})}if("?"===n){const e=t.optional++;return n=>t.parser.optional(e,{DEF:o((()=>r(n)),"DEF"),GATE:i?()=>i(n):void 0})}_K()}function M7(t,e){const r=D7(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function D7(t,e){if(mZ(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!mZ(n);){if(YZ(n)||PZ(n)||lQ(n)){i=n.elements.indexOf(r).toString()+":"+i}r=n,n=n.$container}return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function O7(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function P7(t){const e=t.Grammar,r=t.parser.Lexer,n=new m7(t);return x7(e,n,r.definition),n.finalize(),n}function B7(t){const e=$7(t);return e.finalize(),e}function $7(t){const e=t.Grammar,r=t.parser.Lexer;return x7(e,new p7(t),r.definition)}o(x7,"createParser"),o(b7,"buildRules"),o(w7,"buildElement"),o(k7,"buildAction"),o(T7,"buildRuleCall"),o(_7,"buildRuleCallPredicate"),o(E7,"buildPredicate"),o(C7,"buildAlternatives"),o(S7,"buildUnorderedGroup"),o(A7,"buildGroup"),o(L7,"getGuardCondition"),o(N7,"buildCrossReference"),o(I7,"buildKeyword"),o(R7,"wrap"),o(M7,"getRule"),o(D7,"getRuleName"),o(O7,"getToken"),o(P7,"createCompletionParser"),o(B7,"createLangiumParser"),o($7,"prepareLangiumParser");var F7,z7=class{static{o(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(t,e){const r=ZX(aJ(t,!1)),n=this.buildTerminalTokens(r),i=this.buildKeywordTokens(r,n,e);return n.forEach((t=>{const e=t.PATTERN;"object"==typeof e&&e&&"test"in e&&QQ(e)?i.unshift(t):i.push(t)})),i}flushLexingReport(t){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const t=[...this.diagnostics];return this.diagnostics=[],t}buildTerminalTokens(t){return t.filter(CZ).filter((t=>!t.fragment)).map((t=>this.buildTerminalToken(t))).toArray()}buildTerminalToken(t){const e=IJ(t),r=this.requiresCustomPattern(e)?this.regexPatternFunction(e):e,n={name:t.name,PATTERN:r};return"function"==typeof r&&(n.LINE_BREAKS=!0),t.hidden&&(n.GROUP=QQ(e)?$1.SKIPPED:"hidden"),n}requiresCustomPattern(t){return!(!t.flags.includes("u")&&!t.flags.includes("s"))||!(!t.source.includes("?<=")&&!t.source.includes("?<!"))}regexPatternFunction(t){const e=new RegExp(t,t.flags+"y");return(t,r)=>{e.lastIndex=r;return e.exec(t)}}buildKeywordTokens(t,e,r){return t.filter(mZ).flatMap((t=>kQ(t).filter(VZ))).distinct((t=>t.value)).toArray().sort(((t,e)=>e.value.length-t.value.length)).map((t=>this.buildKeywordToken(t,e,Boolean(null==r?void 0:r.caseInsensitive))))}buildKeywordToken(t,e,r){const n=this.buildKeywordPattern(t,r),i={name:t.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(t,e)};return"function"==typeof n&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(t,e){return e?new RegExp(tJ(t.value)):t.value}findLongerAlt(t,e){return e.reduce(((e,r)=>{const n=null==r?void 0:r.PATTERN;return(null==n?void 0:n.source)&&eJ("^"+n.source+"$",t.value)&&e.push(r),e}),[])}},U7=class{static{o(this,"DefaultValueConverter")}convert(t,e){let r=e.grammarSource;if(GZ(r)&&(r=oJ(r)),tQ(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,t,e)}return t}runConverter(t,e,r){var n;switch(t.name.toUpperCase()){case"INT":return F7.convertInt(e);case"STRING":return F7.convertString(e);case"ID":return F7.convertID(e)}switch(null===(n=NJ(t))||void 0===n?void 0:n.toLowerCase()){case"number":return F7.convertNumber(e);case"boolean":return F7.convertBoolean(e);case"bigint":return F7.convertBigint(e);case"date":return F7.convertDate(e);default:return e}}};!function(t){function e(t){let e="";for(let n=1;n<t.length-1;n++){const i=t.charAt(n);if("\\"===i){e+=r(t.charAt(++n))}else e+=i}return e}function r(t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"0":return"\0";default:return t}}function n(t){return"^"===t.charAt(0)?t.substring(1):t}function i(t){return parseInt(t)}function a(t){return BigInt(t)}function s(t){return new Date(t)}function l(t){return Number(t)}function c(t){return"true"===t.toLowerCase()}o(e,"convertString"),t.convertString=e,o(r,"convertEscapeCharacter"),o(n,"convertID"),t.convertID=n,o(i,"convertInt"),t.convertInt=i,o(a,"convertBigint"),t.convertBigint=a,o(s,"convertDate"),t.convertDate=s,o(l,"convertNumber"),t.convertNumber=l,o(c,"convertBoolean"),t.convertBoolean=c}(F7||(F7={}));var G7={};function q7(){return new Promise((t=>{"undefined"==typeof setImmediate?setTimeout(t,0):setImmediate(t)}))}d(G7,p(OX(),1)),o(q7,"delayNextTick");var j7=0,W7=10;function Y7(){return j7=performance.now(),new G7.CancellationTokenSource}function H7(t){W7=t}o(Y7,"startCancelableOperation"),o(H7,"setInterruptionPeriod");var V7=Symbol("OperationCancelled");function X7(t){return t===V7}async function K7(t){if(t===G7.CancellationToken.None)return;const e=performance.now();if(e-j7>=W7&&(j7=e,await q7(),j7=performance.now()),t.isCancellationRequested)throw V7}o(X7,"isOperationCancelled"),o(K7,"interruptAndCheck");var Z7,Q7,J7=class{static{o(this,"Deferred")}constructor(){this.promise=new Promise(((t,e)=>{this.resolve=e=>(t(e),this),this.reject=t=>(e(t),this)}))}},t8=class t{static{o(this,"FullTextDocument")}constructor(t,e,r,n){this._uri=t,this._languageId=e,this._version=r,this._content=n,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),r=this.offsetAt(t.end);return this._content.substring(e,r)}return this._content}update(e,r){for(const r of e)if(t.isIncremental(r)){const t=i8(r.range),e=this.offsetAt(t.start),n=this.offsetAt(t.end);this._content=this._content.substring(0,e)+r.text+this._content.substring(n,this._content.length);const i=Math.max(t.start.line,0),a=Math.max(t.end.line,0);let s=this._lineOffsets;const o=r8(r.text,!1,e);if(a-i===o.length)for(let t=0,e=o.length;t<e;t++)s[t+i+1]=o[t];else o.length<1e4?s.splice(i+1,a-i,...o):this._lineOffsets=s=s.slice(0,i+1).concat(o,s.slice(a+1));const l=r.text.length-(n-e);if(0!==l)for(let t=i+1+o.length,e=s.length;t<e;t++)s[t]=s[t]+l}else{if(!t.isFull(r))throw new Error("Unknown change event received");this._content=r.text,this._lineOffsets=void 0}this._version=r}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=r8(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);const e=this.getLineOffsets();let r=0,n=e.length;if(0===n)return{line:0,character:t};for(;r<n;){const i=Math.floor((r+n)/2);e[i]>t?n=i:r=i+1}const i=r-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 r=e[t.line];if(t.character<=0)return r;const n=t.line+1<e.length?e[t.line+1]:this._content.length,i=Math.min(r+t.character,n);return this.ensureBeforeEOL(i,r)}ensureBeforeEOL(t,e){for(;t>e&&n8(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 e8(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);e8(n,e),e8(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;){const r=e(n[a],i[s]);t[o++]=r<=0?n[a++]:i[s++]}for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function r8(t,e,r=0){const n=e?[r]:[];for(let e=0;e<t.length;e++){const i=t.charCodeAt(e);n8(i)&&(13===i&&e+1<t.length&&10===t.charCodeAt(e+1)&&e++,n.push(r+e+1))}return n}function n8(t){return 13===t||10===t}function i8(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function a8(t){const e=i8(t.range);return e!==t.range?{newText:t.newText,range:e}:t}!function(t){function e(t,e,r,n){return new t8(t,e,r,n)}function r(t,e,r){if(t instanceof t8)return t.update(e,r),t;throw new Error("TextDocument.update: document must be created by TextDocument.create")}function n(t,e){const r=t.getText(),n=e8(e.map(a8),((t,e)=>{const r=t.range.start.line-e.range.start.line;return 0===r?t.range.start.character-e.range.start.character:r}));let i=0;const a=[];for(const e of n){const n=t.offsetAt(e.range.start);if(n<i)throw new Error("Overlapping edit");n>i&&a.push(r.substring(i,n)),e.newText.length&&a.push(e.newText),i=t.offsetAt(e.range.end)}return a.push(r.substr(i)),a.join("")}o(e,"create"),t.create=e,o(r,"update"),t.update=r,o(n,"applyEdits"),t.applyEdits=n}(Z7||(Z7={})),o(e8,"mergeSort"),o(r8,"computeLineOffsets"),o(n8,"isEOL"),o(i8,"getWellformedRange"),o(a8,"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 r(t,e){for(var r,n="",i=0,a=-1,s=0,o=0;o<=t.length;++o){if(o<t.length)r=t.charCodeAt(o);else{if(47===r)break;r=47}if(47===r){if(a===o-1||1===s);else if(a!==o-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),a=o,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,a=o,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(a+1,o):n=t.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===r&&-1!==s?++s:s=-1}return n}o(e,"e"),o(r,"r");var n={resolve:o((function(){for(var t,n="",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&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."}),"resolve"),normalize:o((function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t}),"normalize"),isAbsolute:o((function(t){return e(t),t.length>0&&47===t.charCodeAt(0)}),"isAbsolute"),join:o((function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":n.normalize(t)}),"join"),relative:o((function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var a=t.length,s=a-i,o=1;o<r.length&&47===r.charCodeAt(o);++o);for(var l=r.length-o,c=s<l?s:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(o+u))return r.slice(o+u+1);if(0===u)return r.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!==r.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+r.slice(o+h):(o+=h,47===r.charCodeAt(o)&&++o,r.slice(o))}),"relative"),_makeLong:o((function(t){return t}),"_makeLong"),dirname:o((function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,i=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(r=t.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)}),"dirname"),basename:o((function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,i=0,a=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var o=r.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),o>=0&&(c===r.charCodeAt(o)?-1==--o&&(a=n):(o=-1,a=l))}return i===a?a=l:-1===a&&(a=t.length),t.slice(i,a)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===a&&(s=!1,a=n+1);return-1===a?"":t.slice(i,a)}),"basename"),extname:o((function(t){e(t);for(var r=-1,n=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===r?r=o:1!==s&&(s=1):-1!==r&&(s=-1);else if(!a){n=o+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":t.slice(r,i)}),"extname"),format:o((function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return r=(e=t).dir||e.root,n=e.base||(e.name||"")+(e.ext||""),r?r===e.root?r+n:r+"/"+n:n;var e,r,n}),"format"),parse:o((function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,i=t.charCodeAt(0),a=47===i;a?(r.root="/",n=1):n=0;for(var s=-1,o=0,l=-1,c=!0,h=t.length-1,u=0;h>=n;--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&&(r.base=r.name=0===o&&a?t.slice(1,l):t.slice(o,l)):(0===o&&a?(r.name=t.slice(1,s),r.base=t.slice(1,l)):(r.name=t.slice(o,s),r.base=t.slice(o,l)),r.ext=t.slice(s,l)),o>0?r.dir=t.slice(0,o-1):a&&(r.dir="/"),r}),"parse"),sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}o(r,"r"),r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{let t;if(r.r(n),r.d(n,{URI:o((()=>u),"URI"),Utils:o((()=>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 s(t,r){if(!t.scheme&&r)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 ("//")')}o(s,"s");const l="",c="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class u{static{o(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,r,n,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,r||l),this.query=n||l,this.fragment=i||l,s(this,a))}get fsPath(){return y(this,!1)}with(t){if(!t)return this;let{scheme:e,authority:r,path:n,query:i,fragment:a}=t;return void 0===e?e=this.scheme:null===e&&(e=l),void 0===r?r=this.authority:null===r&&(r=l),void 0===n?n=this.path:null===n&&(n=l),void 0===i?i=this.query:null===i&&(i=l),void 0===a?a=this.fragment:null===a&&(a=l),e===this.scheme&&r===this.authority&&n===this.path&&i===this.query&&a===this.fragment?this:new p(e,r,n,i,a)}static parse(t,e=!1){const r=h.exec(t);return r?new p(r[2]||l,w(r[4]||l),w(r[5]||l),w(r[7]||l),w(r[9]||l),e):new p(l,l,l,l,l)}static file(e){let r=l;if(t&&(e=e.replace(/\\/g,c)),e[0]===c&&e[1]===c){const t=e.indexOf(c,2);-1===t?(r=e.substring(2),e=c):(r=e.substring(2,t),e=e.substring(t)||c)}return new p("file",r,e,l,l)}static from(t){const e=new p(t.scheme,t.authority,t.path,t.query,t.fragment);return s(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{o(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,r){let n,i=-1;for(let a=0;a<t.length;a++){const s=t.charCodeAt(a);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||e&&47===s||r&&91===s||r&&93===s||r&&58===s)-1!==i&&(n+=encodeURIComponent(t.substring(i,a)),i=-1),void 0!==n&&(n+=t.charAt(a));else{void 0===n&&(n=t.substr(0,a));const e=g[s];void 0!==e?(-1!==i&&(n+=encodeURIComponent(t.substring(i,a)),i=-1),n+=e):-1===i&&(i=a)}}return-1!==i&&(n+=encodeURIComponent(t.substring(i))),void 0!==n?n:t}function m(t){let e;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);35===n||63===n?(void 0===e&&(e=t.substr(0,r)),e+=g[n]):void 0!==e&&(e+=t[r])}return void 0!==e?e:t}function y(e,r){let n;return n=e.authority&&e.path.length>1&&"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)?r?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,t&&(n=n.replace(/\//g,"\\")),n}function v(t,e){const r=e?m:f;let n="",{scheme:i,authority:a,path:s,query:o,fragment:l}=t;if(i&&(n+=i,n+=":"),(a||"file"===i)&&(n+=c,n+=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?n+=r(e,!1,!1):(n+=r(e.substr(0,t),!1,!1),n+=":",n+=r(e.substr(t+1),!1,!0)),n+="@"}a=a.toLowerCase(),t=a.lastIndexOf(":"),-1===t?n+=r(a,!1,!0):(n+=r(a.substr(0,t),!1,!0),n+=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)}`)}n+=r(s,!0,!1)}return o&&(n+="?",n+=r(o,!1,!1)),l&&(n+="#",n+=e?l:f(l,!1,!1)),n}function x(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+x(t.substr(3)):t}}o(f,"d"),o(m,"p"),o(y,"m"),o(v,"y"),o(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}o(w,"C");var k=r(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 r=t.path,n=!1;r[0]!==_&&(r=_+r,n=!0);let i=T.resolve(r,...e);return n&&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={}))})(),Q7=n})();var s8,o8,l8,{URI:c8,Utils:h8}=Q7;!function(t){function e(t,e){return(null==t?void 0:t.toString())===(null==e?void 0:e.toString())}function r(t,e){const r="string"==typeof t?t:t.path,n="string"==typeof e?e:e.path,i=r.split("/").filter((t=>t.length>0)),a=n.split("/").filter((t=>t.length>0));let s=0;for(;s<i.length&&i[s]===a[s];s++);return"../".repeat(i.length-s)+a.slice(s).join("/")}function n(t){return c8.parse(t.toString()).toString()}t.basename=h8.basename,t.dirname=h8.dirname,t.extname=h8.extname,t.joinPath=h8.joinPath,t.resolvePath=h8.resolvePath,o(e,"equals"),t.equals=e,o(r,"relative"),t.relative=r,o(n,"normalize"),t.normalize=n}(s8||(s8={})),(l8=o8||(o8={}))[l8.Changed=0]="Changed",l8[l8.Parsed=1]="Parsed",l8[l8.IndexedContent=2]="IndexedContent",l8[l8.ComputedScopes=3]="ComputedScopes",l8[l8.Linked=4]="Linked",l8[l8.IndexedReferences=5]="IndexedReferences",l8[l8.Validated=6]="Validated";var u8=class{static{o(this,"DefaultLangiumDocumentFactory")}constructor(t){this.serviceRegistry=t.ServiceRegistry,this.textDocuments=t.workspace.TextDocuments,this.fileSystemProvider=t.workspace.FileSystemProvider}async fromUri(t,e=G7.CancellationToken.None){const r=await this.fileSystemProvider.readFile(t);return this.createAsync(t,r,e)}fromTextDocument(t,e,r){return e=null!=e?e:c8.parse(t.uri),G7.CancellationToken.is(r)?this.createAsync(e,t,r):this.create(e,t,r)}fromString(t,e,r){return G7.CancellationToken.is(r)?this.createAsync(e,t,r):this.create(e,t,r)}fromModel(t,e){return this.create(e,{$model:t})}create(t,e,r){if("string"==typeof e){const n=this.parse(t,e,r);return this.createLangiumDocument(n,t,void 0,e)}if("$model"in e){const r={value:e.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(r,t)}{const n=this.parse(t,e.getText(),r);return this.createLangiumDocument(n,t,e)}}async createAsync(t,e,r){if("string"==typeof e){const n=await this.parseAsync(t,e,r);return this.createLangiumDocument(n,t,void 0,e)}{const n=await this.parseAsync(t,e.getText(),r);return this.createLangiumDocument(n,t,e)}}createLangiumDocument(t,e,r,n){let i;if(r)i={parseResult:t,uri:e,state:o8.Parsed,references:[],textDocument:r};else{const r=this.createTextDocumentGetter(e,n);i={parseResult:t,uri:e,state:o8.Parsed,references:[],get textDocument(){return r()}}}return t.value.$document=i,i}async update(t,e){var r,n;const i=null===(r=t.parseResult.value.$cstNode)||void 0===r?void 0:r.root.fullText,a=null===(n=this.textDocuments)||void 0===n?void 0:n.get(t.uri.toString()),s=a?a.getText():await this.fileSystemProvider.readFile(t.uri);if(a)Object.defineProperty(t,"textDocument",{value:a});else{const e=this.createTextDocumentGetter(t.uri,s);Object.defineProperty(t,"textDocument",{get:e})}return i!==s&&(t.parseResult=await this.parseAsync(t.uri,s,e),t.parseResult.value.$document=t),t.state=o8.Parsed,t}parse(t,e,r){return this.serviceRegistry.getServices(t).parser.LangiumParser.parse(e,r)}parseAsync(t,e,r){return this.serviceRegistry.getServices(t).parser.AsyncParser.parse(e,r)}createTextDocumentGetter(t,e){const r=this.serviceRegistry;let n;return()=>null!=n?n:n=Z7.create(t.toString(),r.getServices(t).LanguageMetaData.languageId,0,null!=e?e:"")}},d8=class{static{o(this,"DefaultLangiumDocuments")}constructor(t){this.documentMap=new Map,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.serviceRegistry=t.ServiceRegistry}get all(){return ZX(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 r=this.getDocument(t);return r||(r=await this.langiumDocumentFactory.fromUri(t,e),this.addDocument(r),r)}createDocument(t,e,r){if(r)return this.langiumDocumentFactory.fromString(e,t,r).then((t=>(this.addDocument(t),t)));{const r=this.langiumDocumentFactory.fromString(e,t);return this.addDocument(r),r}}hasDocument(t){return this.documentMap.has(t.toString())}invalidateDocument(t){const e=t.toString(),r=this.documentMap.get(e);if(r){this.serviceRegistry.getServices(t).references.Linker.unlink(r),r.state=o8.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0}return r}deleteDocument(t){const e=t.toString(),r=this.documentMap.get(e);return r&&(r.state=o8.Changed,this.documentMap.delete(e)),r}},p8=Symbol("ref_resolving"),g8=class{static{o(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=G7.CancellationToken.None){for(const r of TQ(t.parseResult.value))await K7(e),EQ(r).forEach((e=>this.doLink(e,t)))}doLink(t,e){var r;const n=t.reference;if(void 0===n._ref){n._ref=p8;try{const e=this.getCandidate(t);if(UX(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)}else n._ref=void 0}catch(e){console.error(`An error occurred while resolving reference to '${n.$refText}':`,e);const i=null!==(r=e.message)&&void 0!==r?r:String(e);n._ref=Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${n.$refText}': ${i}`})}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,r,n){const i=this,a={$refNode:r,$refText:n,get ref(){var r;if($X(this._ref))return this._ref;if(zX(this._nodeDescription)){const r=i.loadAstNode(this._nodeDescription);this._ref=null!=r?r:i.createLinkingError({reference:a,container:t,property:e},this._nodeDescription)}else if(void 0===this._ref){this._ref=p8;const n=bQ(t).$document,s=i.getLinkedNode({reference:a,container:t,property:e});if(s.error&&n&&n.state<o8.ComputedScopes)return this._ref=void 0;this._ref=null!==(r=s.node)&&void 0!==r?r:s.error,this._nodeDescription=s.descr,null==n||n.references.push(this)}else if(this._ref===p8)throw new Error(`Cyclic reference resolution detected: ${i.astNodeLocator.getAstNodePath(t)}/${e} (symbol '${n}')`);return $X(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return UX(this._ref)?this._ref:void 0}};return a}getLinkedNode(t){var e;try{const e=this.getCandidate(t);if(UX(e))return{error:e};const r=this.loadAstNode(e);return r?{node:r,descr:e}:{descr:e,error:this.createLinkingError(t,e)}}catch(r){console.error(`An error occurred while resolving reference to '${t.reference.$refText}':`,r);const n=null!==(e=r.message)&&void 0!==e?e:String(r);return{error:Object.assign(Object.assign({},t),{message:`An error occurred while resolving reference to '${t.reference.$refText}': ${n}`})}}}loadAstNode(t){if(t.node)return t.node;const e=this.langiumDocuments().getDocument(t.documentUri);return e?this.astNodeLocator.getAstNode(e.parseResult.value,t.path):void 0}createLinkingError(t,e){const r=bQ(t.container).$document;r&&r.state<o8.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const n=this.reflection.getReferenceType(t);return Object.assign(Object.assign({},t),{message:`Could not resolve reference to ${n} named '${t.reference.$refText}'.`,targetDescription:e})}};function f8(t){return"string"==typeof t.name}o(f8,"isNamed");var m8=class{static{o(this,"DefaultNameProvider")}getName(t){if(f8(t))return t.name}getNameNode(t){return hJ(t.$cstNode,"name")}},y8=class{static{o(this,"DefaultReferences")}constructor(t){this.nameProvider=t.references.NameProvider,this.index=t.shared.workspace.IndexManager,this.nodeLocator=t.workspace.AstNodeLocator}findDeclaration(t){if(t){const e=fJ(t),r=t.astNode;if(e&&r){const n=r[e.feature];if(FX(n))return n.ref;if(Array.isArray(n))for(const e of n)if(FX(e)&&e.$refNode&&e.$refNode.offset<=t.offset&&e.$refNode.end>=t.end)return e.ref}if(r){const e=this.nameProvider.getNameNode(r);if(e&&(e===t||iK(t,e)))return r}}}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 r=[];if(e.includeDeclaration){const e=this.getReferenceToSelf(t);e&&r.push(e)}let n=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return e.documentUri&&(n=n.filter((t=>s8.equals(t.sourceUri,e.documentUri)))),r.push(...n),ZX(r)}getReferenceToSelf(t){const e=this.nameProvider.getNameNode(t);if(e){const r=xQ(t),n=this.nodeLocator.getAstNodePath(t);return{sourceUri:r.uri,sourcePath:n,targetUri:r.uri,targetPath:n,segment:sK(e),local:!0}}}},v8=class{static{o(this,"MultiMap")}constructor(t){if(this.map=new Map,t)for(const[e,r]of t)this.add(e,r)}get size(){return QX.sum(ZX(this.map.values()).map((t=>t.length)))}clear(){this.map.clear()}delete(t,e){if(void 0===e)return this.map.delete(t);{const r=this.map.get(t);if(r){const n=r.indexOf(e);if(n>=0)return 1===r.length?this.map.delete(t):r.splice(n,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 r=this.map.get(t);return!!r&&r.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,r)=>e.forEach((e=>t(e,r,this)))))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ZX(this.map.entries()).flatMap((([t,e])=>e.map((e=>[t,e]))))}keys(){return ZX(this.map.keys())}values(){return ZX(this.map.values()).flat()}entriesGroupedByKey(){return ZX(this.map.entries())}},x8=class{static{o(this,"BiMap")}get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(const[e,r]of t)this.set(e,r)}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)}},b8=class{static{o(this,"DefaultScopeComputation")}constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async computeExports(t,e=G7.CancellationToken.None){return this.computeExportsForNode(t.parseResult.value,t,void 0,e)}async computeExportsForNode(t,e,r=wQ,n=G7.CancellationToken.None){const i=[];this.exportNode(t,i,e);for(const a of r(t))await K7(n),this.exportNode(a,i,e);return i}exportNode(t,e,r){const n=this.nameProvider.getName(t);n&&e.push(this.descriptions.createDescription(t,n,r))}async computeLocalScopes(t,e=G7.CancellationToken.None){const r=t.parseResult.value,n=new v8;for(const i of kQ(r))await K7(e),this.processNode(i,t,n);return n}processNode(t,e,r){const n=t.$container;if(n){const i=this.nameProvider.getName(t);i&&r.add(n,this.descriptions.createDescription(t,i,e))}}},w8=class{static{o(this,"StreamScope")}constructor(t,e,r){var n;this.elements=t,this.outerScope=e,this.caseInsensitive=null!==(n=null==r?void 0:r.caseInsensitive)&&void 0!==n&&n}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)}},k8=class{static{o(this,"MapScope")}constructor(t,e,r){var n;this.elements=new Map,this.caseInsensitive=null!==(n=null==r?void 0:r.caseInsensitive)&&void 0!==n&&n;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,r=this.elements.get(e);return r||(this.outerScope?this.outerScope.getElement(t):void 0)}getAllElements(){let t=ZX(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}},T8={getElement(){},getAllElements:()=>XX},_8=class{static{o(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")}},E8=class extends _8{static{o(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 r=e();return this.cache.set(t,r),r}}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},C8=class extends _8{static{o(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,r){this.throwIfDisposed(),this.cacheForContext(t).set(e,r)}get(t,e,r){this.throwIfDisposed();const n=this.cacheForContext(t);if(n.has(e))return n.get(e);if(r){const t=r();return n.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 r=this.cache.get(e);return r||(r=new Map,this.cache.set(e,r)),r}},S8=class extends C8{static{o(this,"DocumentCache")}constructor(t,e){super((t=>t.toString())),e?(this.toDispose.push(t.workspace.DocumentBuilder.onDocumentPhase(e,(t=>{this.clear(t.uri.toString())}))),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{for(const t of e)this.clear(t)})))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{const r=t.concat(e);for(const t of r)this.clear(t)})))}},A8=class extends E8{static{o(this,"WorkspaceCache")}constructor(t,e){super(),e?(this.toDispose.push(t.workspace.DocumentBuilder.onBuildPhase(e,(()=>{this.clear()}))),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(((t,e)=>{e.length>0&&this.clear()})))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate((()=>{this.clear()})))}},L8=class{static{o(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 A8(t.shared)}getScope(t){const e=[],r=this.reflection.getReferenceType(t),n=xQ(t.container).precomputedScopes;if(n){let i=t.container;do{const t=n.get(i);t.length>0&&e.push(ZX(t).filter((t=>this.reflection.isSubtype(t.type,r)))),i=i.$container}while(i)}let i=this.getGlobalScope(r,t);for(let t=e.length-1;t>=0;t--)i=this.createScope(e[t],i);return i}createScope(t,e,r){return new w8(ZX(t),e,r)}createScopeForNodes(t,e,r){const n=ZX(t).map((t=>{const e=this.nameProvider.getName(t);if(e)return this.descriptions.createDescription(t,e)})).nonNullable();return new w8(n,e,r)}getGlobalScope(t,e){return this.globalScopeCache.get(t,(()=>new k8(this.indexManager.allElements(t))))}};function N8(t){return"string"==typeof t.$comment}function I8(t){return"object"==typeof t&&!!t&&("$ref"in t||"$error"in t)}o(N8,"isAstNodeWithComment"),o(I8,"isIntermediateReference");var R8,M8=class{static{o(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 r=null!=e?e:{},n=null==e?void 0:e.replacer,i=o(((t,e)=>this.replacer(t,e,r)),"defaultReplacer"),a=n?(t,e)=>n(t,e,i):i;try{return this.currentDocument=xQ(t),JSON.stringify(t,a,null==e?void 0:e.space)}finally{this.currentDocument=void 0}}deserialize(t,e){const r=null!=e?e:{},n=JSON.parse(t);return this.linkNode(n,n,r),n}replacer(t,e,{refText:r,sourceText:n,textRegions:i,comments:a,uriConverter:s}){var o,l,c,h;if(!this.ignoreProperties.has(t)){if(FX(e)){const t=e.ref,n=r?e.$refText:void 0;if(t){const r=xQ(t);let i="";this.currentDocument&&this.currentDocument!==r&&(i=s?s(r.uri,e):r.uri.toString());return{$ref:`${i}#${this.astNodeLocator.getAstNodePath(t)}`,$refText:n}}return{$error:null!==(l=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==l?l:"Could not resolve reference",$refText:n}}if($X(e)){let r;if(i&&(r=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},e)),t&&!e.$document||!(null==r?void 0:r.$textRegion)||(r.$textRegion.documentURI=null===(c=this.currentDocument)||void 0===c?void 0:c.uri.toString())),n&&!t&&(null!=r||(r=Object.assign({},e)),r.$sourceText=null===(h=e.$cstNode)||void 0===h?void 0:h.text),a){null!=r||(r=Object.assign({},e));const t=this.commentProvider.getComment(e);t&&(r.$comment=t.replace(/\r/g,""))}return null!=r?r:e}return e}}addAstNodeRegionWithAssignmentsTo(t){const e=o((t=>({offset:t.offset,end:t.end,length:t.length,range:t.range})),"createDocumentSegment");if(t.$cstNode){const r=(t.$textRegion=e(t.$cstNode)).assignments={};return Object.keys(t).filter((t=>!t.startsWith("$"))).forEach((n=>{const i=cJ(t.$cstNode,n).map(e);0!==i.length&&(r[n]=i)})),t}}linkNode(t,e,r,n,i,a){for(const[n,i]of Object.entries(t))if(Array.isArray(i))for(let a=0;a<i.length;a++){const s=i[a];I8(s)?i[a]=this.reviveReference(t,n,e,s,r):$X(s)&&this.linkNode(s,e,r,t,n,a)}else I8(i)?t[n]=this.reviveReference(t,n,e,i,r):$X(i)&&this.linkNode(i,e,r,t,n);const s=t;s.$container=n,s.$containerProperty=i,s.$containerIndex=a}reviveReference(t,e,r,n,i){let a=n.$refText,s=n.$error;if(n.$ref){const t=this.getRefNode(r,n.$ref,i.uriConverter);if($X(t))return a||(a=this.nameProvider.getName(t)),{$refText:null!=a?a:"",ref:t};s=t}if(s){const r={$refText:null!=a?a:""};return r.error={container:t,property:e,message:s,reference:r},r}}getRefNode(t,e,r){try{const n=e.indexOf("#");if(0===n){const r=this.astNodeLocator.getAstNode(t,e.substring(1));return r||"Could not resolve path: "+e}if(n<0){const t=r?r(e):c8.parse(e),n=this.langiumDocuments.getDocument(t);return n?n.parseResult.value:"Could not find document for URI: "+e}const i=r?r(e.substring(0,n)):c8.parse(e.substring(0,n)),a=this.langiumDocuments.getDocument(i);if(!a)return"Could not find document for URI: "+e;if(n===e.length-1)return a.parseResult.value;const s=this.astNodeLocator.getAstNode(a.parseResult.value,e.substring(n+1));return s||"Could not resolve URI: "+e}catch(t){return String(t)}}},D8=class{static{o(this,"DefaultServiceRegistry")}get map(){return this.fileExtensionMap}constructor(t){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=null==t?void 0:t.workspace.TextDocuments}register(t){const e=t.LanguageMetaData;for(const r of e.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${e.languageId}'.`),this.fileExtensionMap.set(r,t);this.languageIdMap.set(e.languageId,t),1===this.languageIdMap.size?this.singleton=t:this.singleton=void 0}getServices(t){var e,r;if(void 0!==this.singleton)return this.singleton;if(0===this.languageIdMap.size)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const n=null===(r=null===(e=this.textDocuments)||void 0===e?void 0:e.get(t))||void 0===r?void 0:r.languageId;if(void 0!==n){const t=this.languageIdMap.get(n);if(t)return t}const i=s8.extname(t),a=this.fileExtensionMap.get(i);if(!a)throw n?new Error(`The service registry contains no services for the extension '${i}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${i}'.`);return a}hasServices(t){try{return this.getServices(t),!0}catch(t){return!1}}get all(){return Array.from(this.languageIdMap.values())}};function O8(t){return{code:t}}o(O8,"diagnosticData"),(R8||(R8={})).all=["fast","slow","built-in"];var P8,B8,$8=class{static{o(this,"ValidationRegistry")}constructor(t){this.entries=new v8,this.entriesBefore=[],this.entriesAfter=[],this.reflection=t.shared.AstReflection}register(t,e=this,r="fast"){if("built-in"===r)throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[n,i]of Object.entries(t)){const t=i;if(Array.isArray(t))for(const i of t){const t={check:this.wrapValidationException(i,e),category:r};this.addEntry(n,t)}else if("function"==typeof t){const i={check:this.wrapValidationException(t,e),category:r};this.addEntry(n,i)}else _K()}}wrapValidationException(t,e){return async(r,n,i)=>{await this.handleException((()=>t.call(e,r,n,i)),"An error occurred during validation",n,r)}}async handleException(t,e,r,n){try{await t()}catch(t){if(X7(t))throw t;console.error(`${e}:`,t),t instanceof Error&&t.stack&&console.error(t.stack);r("error",`${e}: ${t instanceof Error?t.message:String(t)}`,{node:n})}}addEntry(t,e){if("AstNode"!==t)for(const r of this.reflection.getAllSubTypes(t))this.entries.add(r,e);else this.entries.add("AstNode",e)}getChecks(t,e){let r=ZX(this.entries.get(t)).concat(this.entries.get("AstNode"));return e&&(r=r.filter((t=>e.includes(t.category)))),r.map((t=>t.check))}registerBeforeDocument(t,e=this){this.entriesBefore.push(this.wrapPreparationException(t,"An error occurred during set-up of the validation",e))}registerAfterDocument(t,e=this){this.entriesAfter.push(this.wrapPreparationException(t,"An error occurred during tear-down of the validation",e))}wrapPreparationException(t,e,r){return async(n,i,a,s)=>{await this.handleException((()=>t.call(r,n,i,a,s)),e,i,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}},F8=class{static{o(this,"DefaultDocumentValidator")}constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData}async validateDocument(t,e={},r=G7.CancellationToken.None){const n=t.parseResult,i=[];if(await K7(r),!e.categories||e.categories.includes("built-in")){if(this.processLexingErrors(n,i,e),e.stopAfterLexingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===P8.LexingError})))return i;if(this.processParsingErrors(n,i,e),e.stopAfterParsingErrors&&i.some((t=>{var e;return(null===(e=t.data)||void 0===e?void 0:e.code)===P8.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)===P8.LinkingError})))return i}try{i.push(...await this.validateAst(n.value,e,r))}catch(t){if(X7(t))throw t;console.error("An error occurred during validation:",t)}return await K7(r),i}processLexingErrors(t,e,r){var n,i,a;const s=[...t.lexerErrors,...null!==(i=null===(n=t.lexerReport)||void 0===n?void 0:n.diagnostics)&&void 0!==i?i:[]];for(const t of s){const r=null!==(a=t.severity)&&void 0!==a?a:"error",n={severity:U8(r),range:{start:{line:t.line-1,character:t.column-1},end:{line:t.line-1,character:t.column+t.length-1}},message:t.message,data:G8(r),source:this.getSource()};e.push(n)}}processParsingErrors(t,e,r){for(const r of t.parserErrors){let t;if(isNaN(r.token.startOffset)){if("previousToken"in r){const e=r.previousToken;if(isNaN(e.startOffset)){const e={line:0,character:0};t={start:e,end:e}}else{const r={line:e.endLine-1,character:e.endColumn};t={start:r,end:r}}}}else t=aK(r.token);if(t){const n={severity:U8("error"),range:t,message:r.message,data:O8(P8.ParsingError),source:this.getSource()};e.push(n)}}}processLinkingErrors(t,e,r){for(const r of t.references){const t=r.error;if(t){const r={node:t.container,property:t.property,index:t.index,data:{code:P8.LinkingError,containerType:t.container.$type,property:t.property,refText:t.reference.$refText}};e.push(this.toDiagnostic("error",t.message,r))}}}async validateAst(t,e,r=G7.CancellationToken.None){const n=[],i=o(((t,e,r)=>{n.push(this.toDiagnostic(t,e,r))}),"acceptor");return await this.validateAstBefore(t,e,i,r),await this.validateAstNodes(t,e,i,r),await this.validateAstAfter(t,e,i,r),n}async validateAstBefore(t,e,r,n=G7.CancellationToken.None){var i;const a=this.validationRegistry.checksBefore;for(const s of a)await K7(n),await s(t,r,null!==(i=e.categories)&&void 0!==i?i:[],n)}async validateAstNodes(t,e,r,n=G7.CancellationToken.None){await Promise.all(TQ(t).map((async t=>{await K7(n);const i=this.validationRegistry.getChecks(t.$type,e.categories);for(const e of i)await e(t,r,n)})))}async validateAstAfter(t,e,r,n=G7.CancellationToken.None){var i;const a=this.validationRegistry.checksAfter;for(const s of a)await K7(n),await s(t,r,null!==(i=e.categories)&&void 0!==i?i:[],n)}toDiagnostic(t,e,r){return{message:e,range:z8(r),severity:U8(t),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function z8(t){if(t.range)return t.range;let e;return"string"==typeof t.property?e=hJ(t.node.$cstNode,t.property,t.index):"string"==typeof t.keyword&&(e=pJ(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 U8(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)}}function G8(t){switch(t){case"error":return O8(P8.LexingError);case"warning":return O8(P8.LexingWarning);case"info":return O8(P8.LexingInfo);case"hint":return O8(P8.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}o(z8,"getDiagnosticRange"),o(U8,"toDiagnosticSeverity"),o(G8,"toDiagnosticData"),(B8=P8||(P8={})).LexingError="lexing-error",B8.LexingWarning="lexing-warning",B8.LexingInfo="lexing-info",B8.LexingHint="lexing-hint",B8.ParsingError="parsing-error",B8.LinkingError="linking-error";var q8=class{static{o(this,"DefaultAstNodeDescriptionProvider")}constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,e,r){const n=null!=r?r:xQ(t);null!=e||(e=this.nameProvider.getName(t));const i=this.astNodeLocator.getAstNodePath(t);if(!e)throw new Error(`Node at path ${i} has no name.`);let a;const s=o((()=>{var e;return null!=a?a:a=sK(null!==(e=this.nameProvider.getNameNode(t))&&void 0!==e?e:t.$cstNode)}),"nameSegmentGetter");return{node:t,name:e,get nameSegment(){return s()},selectionSegment:sK(t.$cstNode),type:t.$type,documentUri:n.uri,path:i}}},j8=class{static{o(this,"DefaultReferenceDescriptionProvider")}constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,e=G7.CancellationToken.None){const r=[],n=t.parseResult.value;for(const t of TQ(n))await K7(e),EQ(t).filter((t=>!UX(t))).forEach((t=>{const e=this.createDescription(t);e&&r.push(e)}));return r}createDescription(t){const e=t.reference.$nodeDescription,r=t.reference.$refNode;if(!e||!r)return;const n=xQ(t.container).uri;return{sourceUri:n,sourcePath:this.nodeLocator.getAstNodePath(t.container),targetUri:e.documentUri,targetPath:e.path,segment:sK(r),local:s8.equals(e.documentUri,n)}}},W8=class{static{o(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){const e=this.getAstNodePath(t.$container),r=this.getPathSegment(t);return e+this.segmentSeparator+r}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 r=e.indexOf(this.indexSeparator);if(r>0){const n=e.substring(0,r),i=parseInt(e.substring(r+1)),a=t[n];return null==a?void 0:a[i]}return t[e]}),t)}},Y8={};d(Y8,p(DX(),1));var H8,V8=class{static{o(this,"DefaultConfigurationProvider")}constructor(t){this._ready=new J7,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Y8.Emitter,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){var e,r;this.workspaceConfig=null!==(r=null===(e=t.capabilities.workspace)||void 0===e?void 0:e.configuration)&&void 0!==r&&r}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)}))),r=await t.fetchConfiguration(e);e.forEach(((t,e)=>{this.updateSectionConfiguration(t.section,r[e])}))}}this._ready.resolve()}updateConfiguration(t){t.settings&&Object.keys(t.settings).forEach((e=>{const r=t.settings[e];this.updateSectionConfiguration(e,r),this.onConfigurationSectionUpdateEmitter.fire({section:e,configuration:r})}))}updateSectionConfiguration(t,e){this.settings[t]=e}async getConfiguration(t,e){await this.ready;const r=this.toSectionName(t);if(this.settings[r])return this.settings[r][e]}toSectionName(t){return`${t}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};!function(t){function e(t){return{dispose:o((async()=>await t()),"dispose")}}o(e,"create"),t.create=e}(H8||(H8={}));var X8=class{static{o(this,"DefaultDocumentBuilder")}constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new v8,this.documentPhaseListeners=new v8,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=o8.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.textDocuments=t.workspace.TextDocuments,this.indexManager=t.workspace.IndexManager,this.serviceRegistry=t.ServiceRegistry}async build(t,e={},r=G7.CancellationToken.None){var n,i;for(const r of t){const t=r.uri.toString();if(r.state===o8.Validated){if("boolean"==typeof e.validation&&e.validation)r.state=o8.IndexedReferences,r.diagnostics=void 0,this.buildState.delete(t);else if("object"==typeof e.validation){const a=this.buildState.get(t),s=null===(n=null==a?void 0:a.result)||void 0===n?void 0:n.validationChecks;if(s){const n=(null!==(i=e.validation.categories)&&void 0!==i?i:R8.all).filter((t=>!s.includes(t)));n.length>0&&(this.buildState.set(t,{completed:!1,options:{validation:Object.assign(Object.assign({},e.validation),{categories:n})},result:a.result}),r.state=o8.IndexedReferences)}}}else this.buildState.delete(t)}this.currentState=o8.Changed,await this.emitUpdate(t.map((t=>t.uri)),[]),await this.buildDocuments(t,e,r)}async update(t,e,r=G7.CancellationToken.None){this.currentState=o8.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=o8.Changed,this.langiumDocuments.addDocument(t)}this.buildState.delete(e.toString())}const n=ZX(t).concat(e).map((t=>t.toString())).toSet();this.langiumDocuments.all.filter((t=>!n.has(t.uri.toString())&&this.shouldRelink(t,n))).forEach((t=>{this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t),t.state=Math.min(t.state,o8.ComputedScopes),t.diagnostics=void 0})),await this.emitUpdate(t,e),await K7(r);const i=this.sortDocuments(this.langiumDocuments.all.filter((t=>{var e;return t.state<o8.Linked||!(null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.completed)})).toArray());await this.buildDocuments(i,this.updateBuildOptions,r)}async emitUpdate(t,e){await Promise.all(this.updateListeners.map((r=>r(t,e))))}sortDocuments(t){let e=0,r=t.length-1;for(;e<r;){for(;e<t.length&&this.hasTextDocument(t[e]);)e++;for(;r>=0&&!this.hasTextDocument(t[r]);)r--;e<r&&([t[e],t[r]]=[t[r],t[e]])}return t}hasTextDocument(t){var e;return Boolean(null===(e=this.textDocuments)||void 0===e?void 0:e.get(t.uri))}shouldRelink(t,e){return!!t.references.some((t=>void 0!==t.error))||this.indexManager.isAffected(t,e)}onUpdate(t){return this.updateListeners.push(t),H8.create((()=>{const e=this.updateListeners.indexOf(t);e>=0&&this.updateListeners.splice(e,1)}))}async buildDocuments(t,e,r){this.prepareBuild(t,e),await this.runCancelable(t,o8.Parsed,r,(t=>this.langiumDocumentFactory.update(t,r))),await this.runCancelable(t,o8.IndexedContent,r,(t=>this.indexManager.updateContent(t,r))),await this.runCancelable(t,o8.ComputedScopes,r,(async t=>{const e=this.serviceRegistry.getServices(t.uri).references.ScopeComputation;t.precomputedScopes=await e.computeLocalScopes(t,r)})),await this.runCancelable(t,o8.Linked,r,(t=>this.serviceRegistry.getServices(t.uri).references.Linker.link(t,r))),await this.runCancelable(t,o8.IndexedReferences,r,(t=>this.indexManager.updateReferences(t,r)));const n=t.filter((t=>this.shouldValidate(t)));await this.runCancelable(n,o8.Validated,r,(t=>this.validate(t,r)));for(const e of t){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}}prepareBuild(t,e){for(const r of t){const t=r.uri.toString(),n=this.buildState.get(t);n&&!n.completed||this.buildState.set(t,{completed:!1,options:e,result:null==n?void 0:n.result})}}async runCancelable(t,e,r,n){const i=t.filter((t=>t.state<e));for(const t of i)await K7(r),await n(t),t.state=e,await this.notifyDocumentPhase(t,e,r);const a=t.filter((t=>t.state===e));await this.notifyBuildPhase(a,e,r),this.currentState=e}onBuildPhase(t,e){return this.buildPhaseListeners.add(t,e),H8.create((()=>{this.buildPhaseListeners.delete(t,e)}))}onDocumentPhase(t,e){return this.documentPhaseListeners.add(t,e),H8.create((()=>{this.documentPhaseListeners.delete(t,e)}))}waitUntil(t,e,r){let n;if(e&&"path"in e?n=e:r=e,null!=r||(r=G7.CancellationToken.None),n){const e=this.langiumDocuments.getDocument(n);if(e&&e.state>t)return Promise.resolve(n)}return this.currentState>=t?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(V7):new Promise(((e,i)=>{const a=this.onBuildPhase(t,(()=>{if(a.dispose(),s.dispose(),n){const t=this.langiumDocuments.getDocument(n);e(null==t?void 0:t.uri)}else e(void 0)})),s=r.onCancellationRequested((()=>{a.dispose(),s.dispose(),i(V7)}))}))}async notifyDocumentPhase(t,e,r){const n=this.documentPhaseListeners.get(e).slice();for(const e of n)try{await e(t,r)}catch(t){if(!X7(t))throw t}}async notifyBuildPhase(t,e,r){if(0===t.length)return;const n=this.buildPhaseListeners.get(e).slice();for(const e of n)await K7(r),await e(t,r)}shouldValidate(t){return Boolean(this.getBuildOptions(t).validation)}async validate(t,e){var r,n;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!==(r=l.result)&&void 0!==r||(l.result={});const t=null!==(n=null==s?void 0:s.categories)&&void 0!==n?n:R8.all;l.result.validationChecks?l.result.validationChecks.push(...t):l.result.validationChecks=[...t]}}getBuildOptions(t){var e,r;return null!==(r=null===(e=this.buildState.get(t.uri.toString()))||void 0===e?void 0:e.options)&&void 0!==r?r:{}}},K8=class{static{o(this,"DefaultIndexManager")}constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new C8,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,e){const r=xQ(t).uri,n=[];return this.referenceIndex.forEach((t=>{t.forEach((t=>{s8.equals(t.targetUri,r)&&t.targetPath===e&&n.push(t)}))})),ZX(n)}allElements(t,e){let r=ZX(this.symbolIndex.keys());return e&&(r=r.filter((t=>!e||e.has(t)))),r.map((e=>this.getFileDescriptions(e,t))).flat()}getFileDescriptions(t,e){var r;if(!e)return null!==(r=this.symbolIndex.get(t))&&void 0!==r?r:[];const n=this.symbolByTypeIndex.get(t,e,(()=>{var r;return(null!==(r=this.symbolIndex.get(t))&&void 0!==r?r:[]).filter((t=>this.astReflection.isSubtype(t.type,e)))}));return n}remove(t){const e=t.toString();this.symbolIndex.delete(e),this.symbolByTypeIndex.clear(e),this.referenceIndex.delete(e)}async updateContent(t,e=G7.CancellationToken.None){const r=this.serviceRegistry.getServices(t.uri),n=await r.references.ScopeComputation.computeExports(t,e),i=t.uri.toString();this.symbolIndex.set(i,n),this.symbolByTypeIndex.clear(i)}async updateReferences(t,e=G7.CancellationToken.None){const r=this.serviceRegistry.getServices(t.uri),n=await r.workspace.ReferenceDescriptionProvider.createDescriptions(t,e);this.referenceIndex.set(t.uri.toString(),n)}isAffected(t,e){const r=this.referenceIndex.get(t.uri.toString());return!!r&&r.some((t=>!t.local&&e.has(t.targetUri.toString())))}},Z8=class{static{o(this,"DefaultWorkspaceManager")}constructor(t){this.initialBuildOptions={},this._ready=new J7,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}get workspaceFolders(){return this.folders}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=G7.CancellationToken.None){const r=await this.performStartup(t);await K7(e),await this.documentBuilder.build(r,this.initialBuildOptions,e)}async performStartup(t){const e=this.serviceRegistry.all.flatMap((t=>t.LanguageMetaData.fileExtensions)),r=[],n=o((t=>{r.push(t),this.langiumDocuments.hasDocument(t.uri)||this.langiumDocuments.addDocument(t)}),"collector");return await this.loadAdditionalDocuments(t,n),await Promise.all(t.map((t=>[t,this.getRootFolder(t)])).map((async t=>this.traverseFolder(...t,e,n)))),this._ready.resolve(),r}loadAdditionalDocuments(t,e){return Promise.resolve()}getRootFolder(t){return c8.parse(t.uri)}async traverseFolder(t,e,r,n){const i=await this.fileSystemProvider.readDirectory(e);await Promise.all(i.map((async e=>{if(this.includeEntry(t,e,r))if(e.isDirectory)await this.traverseFolder(t,e.uri,r,n);else if(e.isFile){const t=await this.langiumDocuments.getOrCreateDocument(e.uri);n(t)}})))}includeEntry(t,e,r){const n=s8.basename(e.uri);if(n.startsWith("."))return!1;if(e.isDirectory)return"node_modules"!==n&&"out"!==n;if(e.isFile){const t=s8.extname(e.uri);return r.includes(t)}return!1}},Q8=class{static{o(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(t,e,r,n,i){return P1.buildUnexpectedCharactersMessage(t,e,r,n,i)}buildUnableToPopLexerModeMessage(t){return P1.buildUnableToPopLexerModeMessage(t)}},J8={mode:"full"},t9=class{static{o(this,"DefaultLexer")}constructor(t){this.errorMessageProvider=t.parser.LexerErrorMessageProvider,this.tokenBuilder=t.parser.TokenBuilder;const e=this.tokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(e);const r=n9(e)?Object.values(e):e,n="production"===t.LanguageMetaData.mode;this.chevrotainLexer=new $1(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(t,e=J8){var r,n,i;const a=this.chevrotainLexer.tokenize(t);return{tokens:a.tokens,errors:a.errors,hidden:null!==(r=a.groups.hidden)&&void 0!==r?r:[],report:null===(i=(n=this.tokenBuilder).flushLexingReport)||void 0===i?void 0:i.call(n,t)}}toTokenTypeDictionary(t){if(n9(t))return t;const e=r9(t)?Object.values(t.modes).flat():t,r={};return e.forEach((t=>r[t.name]=t)),r}};function e9(t){return Array.isArray(t)&&(0===t.length||"name"in t[0])}function r9(t){return t&&"modes"in t&&"defaultMode"in t}function n9(t){return!e9(t)&&!r9(t)}function i9(t,e,r){let n,i;"string"==typeof t?(i=e,n=r):(i=t.range.start,n=e),i||(i=H5.create(0,0));return f9({index:0,tokens:c9({lines:s9(t),position:i,options:k9(n)}),position:i})}function a9(t,e){const r=k9(e),n=s9(t);if(0===n.length)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return Boolean(null==s?void 0:s.exec(i))&&Boolean(null==o?void 0:o.exec(a))}function s9(t){let e="";e="string"==typeof t?t:t.text;return e.split(WQ)}o(e9,"isTokenTypeArray"),o(r9,"isIMultiModeLexerDefinition"),o(n9,"isTokenTypeDictionary"),o(i9,"parseJSDoc"),o(a9,"isJSDoc"),o(s9,"getLines");var o9=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,l9=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function c9(t){var e,r,n;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o<t.lines.length;o++){const l=0===o,c=o===t.lines.length-1;let h=t.lines[o],u=0;if(l&&t.options.start){const r=null===(e=t.options.start)||void 0===e?void 0:e.exec(h);r&&(u=r.index+r[0].length)}else{const e=null===(r=t.options.line)||void 0===r?void 0:r.exec(h);e&&(u=e.index+e[0].length)}if(c){const e=null===(n=t.options.end)||void 0===n?void 0:n.exec(h);e&&(h=h.substring(0,e.index))}h=h.substring(0,g9(h));if(p9(h,u)>=h.length){if(i.length>0){const t=H5.create(a,s);i.push({type:"break",content:"",range:V5.create(t,t)})}}else{o9.lastIndex=u;const t=o9.exec(h);if(t){const e=t[0],r=t[1],n=H5.create(a,s+u),o=H5.create(a,s+u+e.length);i.push({type:"tag",content:r,range:V5.create(n,o)}),u+=e.length,u=p9(h,u)}if(u<h.length){const t=h.substring(u),e=Array.from(t.matchAll(l9));i.push(...h9(e,t,a,s+u))}}a++,s=0}return i.length>0&&"break"===i[i.length-1].type?i.slice(0,-1):i}function h9(t,e,r,n){const i=[];if(0===t.length){const t=H5.create(r,n),a=H5.create(r,n+e.length);i.push({type:"text",content:e,range:V5.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:V5.create(H5.create(r,a+n),H5.create(r,t+n))});let l=o.length+1;const c=s[1];if(i.push({type:"inline-tag",content:c,range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+c.length+n))}),l+=c.length,4===s.length){l+=s[2].length;const t=s[3];i.push({type:"text",content:t,range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+t.length+n))})}else i.push({type:"text",content:"",range:V5.create(H5.create(r,a+l+n),H5.create(r,a+l+n))});a=t+s[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:V5.create(H5.create(r,a+n),H5.create(r,a+n+s.length))})}return i}o(c9,"tokenize"),o(h9,"buildInlineTokens");var u9=/\S/,d9=/\s*$/;function p9(t,e){const r=t.substring(e).match(u9);return r?e+r.index:t.length}function g9(t){const e=t.match(d9);if(e&&"number"==typeof e.index)return e.index}function f9(t){var e,r,n,i;const a=H5.create(t.position.line,t.position.character);if(0===t.tokens.length)return new _9([],V5.create(a,a));const s=[];for(;t.index<t.tokens.length;){const e=m9(t,s[s.length-1]);e&&s.push(e)}const o=null!==(r=null===(e=s[0])||void 0===e?void 0:e.range.start)&&void 0!==r?r:a,l=null!==(i=null===(n=s[s.length-1])||void 0===n?void 0:n.range.end)&&void 0!==i?i:a;return new _9(s,V5.create(o,l))}function m9(t,e){const r=t.tokens[t.index];return"tag"===r.type?b9(t,!1):"text"===r.type||"inline-tag"===r.type?v9(t):(y9(r,e),void t.index++)}function y9(t,e){if(e){const r=new L9("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function v9(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&"break"!==e.type&&"tag"!==e.type;)i.push(x9(t)),n=e,e=t.tokens[t.index];return new A9(i,V5.create(r.range.start,n.range.end))}function x9(t){return"inline-tag"===t.tokens[t.index].type?b9(t,!0):w9(t)}function b9(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if("text"===(null==i?void 0:i.type)){if(e){const i=w9(t);return new E9(n,new A9([i],i.range),e,V5.create(r.range.start,i.range.end))}{const i=v9(t);return new E9(n,i,e,V5.create(r.range.start,i.range.end))}}{const t=r.range;return new E9(n,new A9([],t),e,t)}}function w9(t){const e=t.tokens[t.index++];return new L9(e.content,e.range)}function k9(t){if(!t)return k9({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:T9(e,!0),end:T9(r,!1),line:T9(n,!0)}}function T9(t,e){if("string"==typeof t||"object"==typeof t){const r="string"==typeof t?JQ(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}return t}o(p9,"skipWhitespace"),o(g9,"lastCharacter"),o(f9,"parseJSDocComment"),o(m9,"parseJSDocElement"),o(y9,"appendEmptyLine"),o(v9,"parseJSDocText"),o(x9,"parseJSDocInline"),o(b9,"parseJSDocTag"),o(w9,"parseJSDocLine"),o(k9,"normalizeOptions"),o(T9,"normalizeOption");var _9=class{static{o(this,"JSDocCommentImpl")}constructor(t,e){this.elements=t,this.range=e}getTag(t){return this.getAllTags().find((e=>e.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 r=e.toString();t+=N9(t)+r}return t.trim()}toMarkdown(t){let e="";for(const r of this.elements)if(0===e.length)e=r.toMarkdown(t);else{const n=r.toMarkdown(t);e+=N9(e)+n}return e.trim()}},E9=class{static{o(this,"JSDocTagImpl")}constructor(t,e,r,n){this.name=t,this.content=e,this.inline=r,this.range=n}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,r;return null!==(r=null===(e=null==t?void 0:t.renderTag)||void 0===e?void 0:e.call(t,this))&&void 0!==r?r:this.toMarkdownDefault(t)}toMarkdownDefault(t){const e=this.content.toMarkdown(t);if(this.inline){const r=C9(this.name,e,null!=t?t:{});if("string"==typeof r)return r}let r="";"italic"===(null==t?void 0:t.tag)||void 0===(null==t?void 0:t.tag)?r="*":"bold"===(null==t?void 0:t.tag)?r="**":"bold-italic"===(null==t?void 0:t.tag)&&(r="***");let n=`${r}@${this.name}${r}`;return 1===this.content.inlines.length?n=`${n} — ${e}`:this.content.inlines.length>1&&(n=`${n}\n${e}`),this.inline?`{${n}}`:n}};function C9(t,e,r){var n,i;if("linkplain"===t||"linkcode"===t||"link"===t){const a=e.indexOf(" ");let s=e;if(a>0){const t=p9(e,a);s=e.substring(t),e=e.substring(0,a)}("linkcode"===t||"link"===t&&"code"===r.link)&&(s=`\`${s}\``);return null!==(i=null===(n=r.renderLink)||void 0===n?void 0:n.call(r,e,s))&&void 0!==i?i:S9(e,s)}}function S9(t,e){try{return c8.parse(t,!0),`[${e}](${t})`}catch(e){return t}}o(C9,"renderInlineTag"),o(S9,"renderLinkDefault");var A9=class{static{o(this,"JSDocTextImpl")}constructor(t,e){this.inlines=t,this.range=e}toString(){let t="";for(let e=0;e<this.inlines.length;e++){const r=this.inlines[e],n=this.inlines[e+1];t+=r.toString(),n&&n.range.start.line>r.range.start.line&&(t+="\n")}return t}toMarkdown(t){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toMarkdown(t),i&&i.range.start.line>n.range.start.line&&(e+="\n")}return e}},L9=class{static{o(this,"JSDocLineImpl")}constructor(t,e){this.text=t,this.range=e}toString(){return this.text}toMarkdown(){return this.text}};function N9(t){return t.endsWith("\n")?"\n":"\n\n"}o(N9,"fillNewlines");var I9,R9=class{static{o(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&&a9(e)){return i9(e).toMarkdown({renderLink:o(((e,r)=>this.documentationLinkRenderer(t,e,r)),"renderLink"),renderTag:o((e=>this.documentationTagRenderer(t,e)),"renderTag")})}}documentationLinkRenderer(t,e,r){var n;const i=null!==(n=this.findNameInPrecomputedScopes(t,e))&&void 0!==n?n:this.findNameInGlobalScope(t,e);if(i&&i.nameSegment){const t=i.nameSegment.range.start.line+1,e=i.nameSegment.range.start.character+1;return`[${r}](${i.documentUri.with({fragment:`L${t},${e}`}).toString()})`}}documentationTagRenderer(t,e){}findNameInPrecomputedScopes(t,e){const r=xQ(t).precomputedScopes;if(!r)return;let n=t;do{const t=r.get(n).find((t=>t.name===e));if(t)return t;n=n.$container}while(n)}findNameInGlobalScope(t,e){const r=this.indexManager.allElements().find((t=>t.name===e));return r}},M9=class{static{o(this,"DefaultCommentProvider")}constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){var e;return N8(t)?t.$comment:null===(e=uK(t.$cstNode,this.grammarConfig().multilineCommentRules))||void 0===e?void 0:e.text}},D9=class{static{o(this,"DefaultAsyncParser")}constructor(t){this.syncParser=t.parser.LangiumParser}parse(t,e){return Promise.resolve(this.syncParser.parse(t))}},O9=class{static{o(this,"AbstractThreadedAsyncParser")}constructor(t){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=t.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){const t=this.createWorker();t.onReady((()=>{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 r=await this.acquireParserWorker(e),n=new J7;let i;const a=e.onCancellationRequested((()=>{i=setTimeout((()=>{this.terminateWorker(r)}),this.terminationDelay)}));return r.parse(t).then((t=>{const e=this.hydrator.hydrate(t);n.resolve(e)})).catch((t=>{n.reject(t)})).finally((()=>{a.dispose(),clearTimeout(i)})),n.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 J7;return t.onCancellationRequested((()=>{const t=this.queue.indexOf(e);t>=0&&this.queue.splice(t,1),e.reject(V7)})),this.queue.push(e),e.promise}},P9=class{static{o(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(t,e,r,n){this.onReadyEmitter=new Y8.Emitter,this.deferred=new J7,this._ready=!0,this._parsing=!1,this.sendMessage=t,this._terminate=n,e((t=>{const e=t;this.deferred.resolve(e),this.unlock()})),r((t=>{this.deferred.reject(t),this.unlock()}))}terminate(){this.deferred.reject(V7),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 J7,this.sendMessage(t),this.deferred.promise}},B9=class{static{o(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new G7.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(t){this.cancelWrite();const e=Y7();return this.previousTokenSource=e,this.enqueue(this.writeQueue,t,e.token)}read(t){return this.enqueue(this.readQueue,t)}enqueue(t,e,r=G7.CancellationToken.None){const n=new J7,i={action:e,deferred:n,cancellationToken:r};return t.push(i),this.performNextOperation(),n.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:r})=>{try{const n=await Promise.resolve().then((()=>t(r)));e.resolve(n)}catch(t){X7(t)?e.resolve(void 0):e.reject(t)}}))),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$9=class{static{o(this,"DefaultHydrator")}constructor(t){this.grammarElementIdMap=new x8,this.tokenTypeIdMap=new x8,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport?this.dehydrateLexerReport(t.lexerReport):void 0,parserErrors:t.parserErrors.map((t=>Object.assign(Object.assign({},t),{message:t.message}))),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}dehydrateLexerReport(t){return t}createDehyrationContext(t){const e=new Map,r=new Map;for(const r of TQ(t))e.set(r,{});if(t.$cstNode)for(const e of rK(t.$cstNode))r.set(e,{});return{astNodes:e,cstNodes:r}}dehydrateAstNode(t,e){const r=e.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,void 0!==t.$cstNode&&(r.$cstNode=this.dehydrateCstNode(t.$cstNode,e));for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Array.isArray(i)){const t=[];r[n]=t;for(const r of i)$X(r)?t.push(this.dehydrateAstNode(r,e)):FX(r)?t.push(this.dehydrateReference(r,e)):t.push(r)}else $X(i)?r[n]=this.dehydrateAstNode(i,e):FX(i)?r[n]=this.dehydrateReference(i,e):void 0!==i&&(r[n]=i);return r}dehydrateReference(t,e){const r={};return r.$refText=t.$refText,t.$refNode&&(r.$refNode=e.cstNodes.get(t.$refNode)),r}dehydrateCstNode(t,e){const r=e.cstNodes.get(t);return WX(t)?r.fullText=t.fullText:r.grammarSource=this.getGrammarElementId(t.grammarSource),r.hidden=t.hidden,r.astNode=e.astNodes.get(t.astNode),qX(t)?r.content=t.content.map((t=>this.dehydrateCstNode(t,e))):jX(t)&&(r.tokenType=t.tokenType.name,r.offset=t.offset,r.length=t.length,r.startLine=t.range.start.line,r.startColumn=t.range.start.character,r.endLine=t.range.end.line,r.endColumn=t.range.end.character),r}hydrate(t){const e=t.value,r=this.createHydrationContext(e);return"$cstNode"in e&&this.hydrateCstNode(e.$cstNode,r),{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport,parserErrors:t.parserErrors,value:this.hydrateAstNode(e,r)}}createHydrationContext(t){const e=new Map,r=new Map;for(const r of TQ(t))e.set(r,{});let n;if(t.$cstNode)for(const e of rK(t.$cstNode)){let t;"fullText"in e?(t=new l7(e.fullText),n=t):"content"in e?t=new s7:"tokenType"in e&&(t=this.hydrateCstLeafNode(e)),t&&(r.set(e,t),t.root=n)}return{astNodes:e,cstNodes:r}}hydrateAstNode(t,e){const r=e.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode&&(r.$cstNode=e.cstNodes.get(t.$cstNode));for(const[n,i]of Object.entries(t))if(!n.startsWith("$"))if(Array.isArray(i)){const t=[];r[n]=t;for(const a of i)$X(a)?t.push(this.setParent(this.hydrateAstNode(a,e),r)):FX(a)?t.push(this.hydrateReference(a,r,n,e)):t.push(a)}else $X(i)?r[n]=this.setParent(this.hydrateAstNode(i,e),r):FX(i)?r[n]=this.hydrateReference(i,r,n,e):void 0!==i&&(r[n]=i);return r}setParent(t,e){return t.$container=e,t}hydrateReference(t,e,r,n){return this.linker.buildReference(e,r,n.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,e,r=0){const n=e.cstNodes.get(t);if("number"==typeof t.grammarSource&&(n.grammarSource=this.getGrammarElement(t.grammarSource)),n.astNode=e.astNodes.get(t.astNode),qX(n))for(const i of t.content){const t=this.hydrateCstNode(i,e,r++);n.content.push(t)}return n}hydrateCstLeafNode(t){const e=this.getTokenType(t.tokenType),r=t.offset,n=t.length,i=t.startLine,a=t.startColumn,s=t.endLine,o=t.endColumn,l=t.hidden;return new a7(r,n,{start:{line:i,character:a},end:{line:s,character:o}},e,l)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){if(t)return 0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){0===this.grammarElementIdMap.size&&this.createGrammarElementIdMap();return this.grammarElementIdMap.getKey(t)}createGrammarElementIdMap(){let t=0;for(const e of TQ(this.grammar))zK(e)&&this.grammarElementIdMap.set(e,t++)}};function F9(t){return{documentation:{CommentProvider:o((t=>new M9(t)),"CommentProvider"),DocumentationProvider:o((t=>new R9(t)),"DocumentationProvider")},parser:{AsyncParser:o((t=>new D9(t)),"AsyncParser"),GrammarConfig:o((t=>UJ(t)),"GrammarConfig"),LangiumParser:o((t=>B7(t)),"LangiumParser"),CompletionParser:o((t=>P7(t)),"CompletionParser"),ValueConverter:o((()=>new U7),"ValueConverter"),TokenBuilder:o((()=>new z7),"TokenBuilder"),Lexer:o((t=>new t9(t)),"Lexer"),ParserErrorMessageProvider:o((()=>new f7),"ParserErrorMessageProvider"),LexerErrorMessageProvider:o((()=>new Q8),"LexerErrorMessageProvider")},workspace:{AstNodeLocator:o((()=>new W8),"AstNodeLocator"),AstNodeDescriptionProvider:o((t=>new q8(t)),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:o((t=>new j8(t)),"ReferenceDescriptionProvider")},references:{Linker:o((t=>new g8(t)),"Linker"),NameProvider:o((()=>new m8),"NameProvider"),ScopeProvider:o((t=>new L8(t)),"ScopeProvider"),ScopeComputation:o((t=>new b8(t)),"ScopeComputation"),References:o((t=>new y8(t)),"References")},serializer:{Hydrator:o((t=>new $9(t)),"Hydrator"),JsonSerializer:o((t=>new M8(t)),"JsonSerializer")},validation:{DocumentValidator:o((t=>new F8(t)),"DocumentValidator"),ValidationRegistry:o((t=>new $8(t)),"ValidationRegistry")},shared:o((()=>t.shared),"shared")}}function z9(t){return{ServiceRegistry:o((t=>new D8(t)),"ServiceRegistry"),workspace:{LangiumDocuments:o((t=>new d8(t)),"LangiumDocuments"),LangiumDocumentFactory:o((t=>new u8(t)),"LangiumDocumentFactory"),DocumentBuilder:o((t=>new X8(t)),"DocumentBuilder"),IndexManager:o((t=>new K8(t)),"IndexManager"),WorkspaceManager:o((t=>new Z8(t)),"WorkspaceManager"),FileSystemProvider:o((e=>t.fileSystemProvider(e)),"FileSystemProvider"),WorkspaceLock:o((()=>new B9),"WorkspaceLock"),ConfigurationProvider:o((t=>new V8(t)),"ConfigurationProvider")}}}function U9(t,e,r,n,i,a,s,o,l){return j9([t,e,r,n,i,a,s,o,l].reduce(H9,{}))}o(F9,"createDefaultCoreModule"),o(z9,"createDefaultSharedCoreModule"),(I9||(I9={})).merge=(t,e)=>H9(H9({},t),e),o(U9,"inject");var G9=Symbol("isProxy");function q9(t){if(t&&t[G9])for(const e of Object.values(t))q9(e);return t}function j9(t,e){const r=new Proxy({},{deleteProperty:o((()=>!1),"deleteProperty"),set:o((()=>{throw new Error("Cannot set property on injected service container")}),"set"),get:o(((n,i)=>i===G9||Y9(n,i,t,e||r)),"get"),getOwnPropertyDescriptor:o(((n,i)=>(Y9(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i))),"getOwnPropertyDescriptor"),has:o(((e,r)=>r in t),"has"),ownKeys:o((()=>[...Object.getOwnPropertyNames(t)]),"ownKeys")});return r}o(q9,"eagerLoad"),o(j9,"_inject");var W9=Symbol();function Y9(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===W9)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}if(e in r){const i=r[e];t[e]=W9;try{t[e]="function"==typeof i?i(n):j9(i,n)}catch(r){throw t[e]=r instanceof Error?r:void 0,r}return t[e]}}function H9(t,e){if(e)for(const[r,n]of Object.entries(e))if(void 0!==n){const e=t[r];t[r]=null!==e&&null!==n&&"object"==typeof e&&"object"==typeof n?H9(e,n):n}return t}o(Y9,"_resolve"),o(H9,"_merge");var V9,X9,K9={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]};(X9=V9||(V9={})).REGULAR="indentation-sensitive",X9.IGNORE_INDENTATION="ignore-indentation";var Z9=class extends z7{static{o(this,"IndentationAwareTokenBuilder")}constructor(t=K9){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options=Object.assign(Object.assign({},K9),t),this.indentTokenType=X1({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=X1({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(t,e){const r=super.buildTokens(t,e);if(!e9(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:a,ignoreIndentationDelimiters:s}=this.options;let o,l,c;const h=[];for(const t of r){for(const[e,r]of s)t.name===e?t.PUSH_MODE=V9.IGNORE_INDENTATION:t.name===r&&(t.POP_MODE=!0);t.name===i?o=t:t.name===n?l=t:t.name===a?c=t:h.push(t)}if(!o||!l||!c)throw new Error("Some indentation/whitespace tokens not found!");if(s.length>0){return{modes:{[V9.REGULAR]:[o,l,...h,c],[V9.IGNORE_INDENTATION]:[...h,c]},defaultMode:V9.REGULAR}}return[o,l,c,...h]}flushLexingReport(t){const e=super.flushLexingReport(t);return Object.assign(Object.assign({},e),{remainingDedents:this.flushRemainingDedents(t)})}isStartOfLine(t,e){return 0===e||"\r\n".includes(t[e-1])}matchWhitespace(t,e,r,n){var i;this.whitespaceRegExp.lastIndex=e;const a=this.whitespaceRegExp.exec(t);return{currIndentLevel:null!==(i=null==a?void 0:a[0].length)&&void 0!==i?i:0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(t,e,r,n){const i=this.getLineNumber(e,n);return Q1(t,r,n,n+r.length,i,i,1,r.length)}getLineNumber(t,e){return t.substring(0,e).split(/\r\n|\r|\n/).length}indentMatcher(t,e,r,n){if(!this.isStartOfLine(t,e))return null;const{currIndentLevel:i,prevIndentLevel:a,match:s}=this.matchWhitespace(t,e,r,n);return i<=a?null:(this.indentationStack.push(i),s)}dedentMatcher(t,e,r,n){var i,a,s,o;if(!this.isStartOfLine(t,e))return null;const{currIndentLevel:l,prevIndentLevel:c,match:h}=this.matchWhitespace(t,e,r,n);if(l>=c)return null;const u=this.indentationStack.lastIndexOf(l);if(-1===u)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${l} at offset: ${e}. Current indentation stack: ${this.indentationStack}`,offset:e,length:null!==(a=null===(i=null==h?void 0:h[0])||void 0===i?void 0:i.length)&&void 0!==a?a:0,line:this.getLineNumber(t,e),column:1}),null;const d=this.indentationStack.length-u-1,p=null!==(o=null===(s=t.substring(0,e).match(/[\r\n]+$/))||void 0===s?void 0:s[0].length)&&void 0!==o?o:1;for(let n=0;n<d;n++){const n=this.createIndentationTokenInstance(this.dedentTokenType,t,"",e-(p-1));r.push(n),this.indentationStack.pop()}return null}buildTerminalToken(t){const e=super.buildTerminalToken(t),{indentTokenName:r,dedentTokenName:n,whitespaceTokenName:i}=this.options;return e.name===r?this.indentTokenType:e.name===n?this.dedentTokenType:e.name===i?X1({name:i,pattern:this.whitespaceRegExp,group:$1.SKIPPED}):e}flushRemainingDedents(t){const e=[];for(;this.indentationStack.length>1;)e.push(this.createIndentationTokenInstance(this.dedentTokenType,t,"",t.length)),this.indentationStack.pop();return this.indentationStack=[0],e}},Q9=class extends t9{static{o(this,"IndentationAwareLexer")}constructor(t){if(super(t),!(t.parser.TokenBuilder instanceof Z9))throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder");this.indentationTokenBuilder=t.parser.TokenBuilder}tokenize(t,e=J8){const r=super.tokenize(t),n=r.report;"full"===(null==e?void 0:e.mode)&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:i,dedentTokenType:a}=this.indentationTokenBuilder,s=i.tokenTypeIdx,o=a.tokenTypeIdx,l=[],c=r.tokens.length-1;for(let t=0;t<c;t++){const e=r.tokens[t],n=r.tokens[t+1];e.tokenTypeIdx!==s||n.tokenTypeIdx!==o?l.push(e):t++}return c>=0&&l.push(r.tokens[c]),r.tokens=l,r}},J9={};h(J9,{AstUtils:()=>fQ,BiMap:()=>x8,Cancellation:()=>G7,ContextCache:()=>C8,CstUtils:()=>BX,DONE_RESULT:()=>KX,Deferred:()=>J7,Disposable:()=>H8,DisposableCache:()=>_8,DocumentCache:()=>S8,EMPTY_STREAM:()=>XX,ErrorWithLocation:()=>TK,GrammarUtils:()=>kK,MultiMap:()=>v8,OperationCancelled:()=>V7,Reduction:()=>QX,RegExpUtils:()=>NQ,SimpleCache:()=>E8,StreamImpl:()=>YX,TreeStreamImpl:()=>eK,URI:()=>c8,UriUtils:()=>s8,WorkspaceCache:()=>A8,assertUnreachable:()=>_K,delayNextTick:()=>q7,interruptAndCheck:()=>K7,isOperationCancelled:()=>X7,loadGrammarFromJson:()=>att,setInterruptionPeriod:()=>H7,startCancelableOperation:()=>Y7,stream:()=>ZX}),d(J9,Y8);var ttt=class{static{o(this,"EmptyFileSystemProvider")}readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}},ett={fileSystemProvider:o((()=>new ttt),"fileSystemProvider")},rtt={Grammar:o((()=>{}),"Grammar"),LanguageMetaData:o((()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})),"LanguageMetaData")},ntt={AstReflection:o((()=>new pQ),"AstReflection")};function itt(){const t=U9(z9(ett),ntt),e=U9(F9({shared:t}),rtt);return t.ServiceRegistry.register(e),e}function att(t){var e;const r=itt(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,c8.parse(`memory://${null!==(e=n.name)&&void 0!==e?e:"grammar"}.langium`)),n}o(itt,"createMinimalGrammarServices"),o(att,"loadGrammarFromJson"),d(PX,J9);var stt=Object.defineProperty,ott=o(((t,e)=>stt(t,"name",{value:e,configurable:!0})),"__name"),ltt="Statement",ctt="Architecture";function htt(t){return Ktt.isInstance(t,ctt)}o(htt,"isArchitecture"),ott(htt,"isArchitecture");var utt="Axis",dtt="Branch";function ptt(t){return Ktt.isInstance(t,dtt)}o(ptt,"isBranch"),ott(ptt,"isBranch");var gtt="Checkout",ftt="CherryPicking",mtt="Commit";function ytt(t){return Ktt.isInstance(t,mtt)}o(ytt,"isCommit"),ott(ytt,"isCommit");var vtt="Common";function xtt(t){return Ktt.isInstance(t,vtt)}o(xtt,"isCommon"),ott(xtt,"isCommon");var btt="Curve",wtt="Edge",ktt="Entry",Ttt="GitGraph";function _tt(t){return Ktt.isInstance(t,Ttt)}o(_tt,"isGitGraph"),ott(_tt,"isGitGraph");var Ett="Group",Ctt="Info";function Stt(t){return Ktt.isInstance(t,Ctt)}o(Stt,"isInfo"),ott(Stt,"isInfo");var Att="Junction",Ltt="Merge";function Ntt(t){return Ktt.isInstance(t,Ltt)}o(Ntt,"isMerge"),ott(Ntt,"isMerge");var Itt="Option",Rtt="Packet";function Mtt(t){return Ktt.isInstance(t,Rtt)}o(Mtt,"isPacket"),ott(Mtt,"isPacket");var Dtt="PacketBlock";function Ott(t){return Ktt.isInstance(t,Dtt)}o(Ott,"isPacketBlock"),ott(Ott,"isPacketBlock");var Ptt="Pie";function Btt(t){return Ktt.isInstance(t,Ptt)}o(Btt,"isPie"),ott(Btt,"isPie");var $tt="PieSection";function Ftt(t){return Ktt.isInstance(t,$tt)}o(Ftt,"isPieSection"),ott(Ftt,"isPieSection");var ztt,Utt,Gtt,qtt,jtt,Wtt,Ytt="Radar",Htt="Service",Vtt="Direction",Xtt=class extends GX{static{o(this,"MermaidAstReflection")}static{ott(this,"MermaidAstReflection")}getAllTypes(){return[ctt,utt,dtt,gtt,ftt,mtt,vtt,btt,Vtt,wtt,ktt,Ttt,Ett,Ctt,Att,Ltt,Itt,Rtt,Dtt,Ptt,$tt,Ytt,Htt,ltt]}computeIsSubtype(t,e){switch(t){case dtt:case gtt:case ftt:case mtt:case Ltt:return this.isSubtype(ltt,e);case Vtt:return this.isSubtype(Ttt,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;if("Entry:axis"===e)return utt;throw new Error(`${e} is not a valid reference id.`)}getTypeMetaData(t){switch(t){case ctt:return{name:ctt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case utt:return{name:utt,properties:[{name:"label"},{name:"name"}]};case dtt:return{name:dtt,properties:[{name:"name"},{name:"order"}]};case gtt:return{name:gtt,properties:[{name:"branch"}]};case ftt:return{name:ftt,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case mtt:return{name:mtt,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case vtt:return{name:vtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case btt:return{name:btt,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case wtt:return{name:wtt,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 ktt:return{name:ktt,properties:[{name:"axis"},{name:"value"}]};case Ttt:return{name:Ttt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case Ett:return{name:Ett,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Ctt:return{name:Ctt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case Att:return{name:Att,properties:[{name:"id"},{name:"in"}]};case Ltt:return{name:Ltt,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case Itt:return{name:Itt,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Rtt:return{name:Rtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case Dtt:return{name:Dtt,properties:[{name:"end"},{name:"label"},{name:"start"}]};case Ptt:return{name:Ptt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case $tt:return{name:$tt,properties:[{name:"label"},{name:"value"}]};case Ytt:return{name:Ytt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case Htt:return{name:Htt,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case Vtt:return{name:Vtt,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:t,properties:[]}}}},Ktt=new Xtt,Ztt=ott((()=>ztt??(ztt=att('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","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","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","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"),Qtt=ott((()=>Utt??(Utt=att('{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),Jtt=ott((()=>Gtt??(Gtt=att('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),tet=ott((()=>qtt??(qtt=att('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","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","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","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","fragment":true,"name":"RightPort","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","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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"),eet=ott((()=>jtt??(jtt=att('{"$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","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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","entry":true,"name":"GitGraph","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"),ret=ott((()=>Wtt??(Wtt=att('{"$type":"Grammar","isDeclared":true,"name":"Radar","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":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","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","fragment":true,"name":"EOL","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","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|\'[^\']*\'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}'))),"RadarGrammar"),net={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iet={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},aet={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},set={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},oet={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},cet={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},het={AstReflection:ott((()=>new Xtt),"AstReflection")},uet={Grammar:ott((()=>Ztt()),"Grammar"),LanguageMetaData:ott((()=>net),"LanguageMetaData"),parser:{}},det={Grammar:ott((()=>Qtt()),"Grammar"),LanguageMetaData:ott((()=>iet),"LanguageMetaData"),parser:{}},pet={Grammar:ott((()=>Jtt()),"Grammar"),LanguageMetaData:ott((()=>aet),"LanguageMetaData"),parser:{}},get={Grammar:ott((()=>tet()),"Grammar"),LanguageMetaData:ott((()=>set),"LanguageMetaData"),parser:{}},fet={Grammar:ott((()=>eet()),"Grammar"),LanguageMetaData:ott((()=>oet),"LanguageMetaData"),parser:{}},met={Grammar:ott((()=>ret()),"Grammar"),LanguageMetaData:ott((()=>cet),"LanguageMetaData"),parser:{}},yet={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},vet=class extends U7{static{o(this,"AbstractMermaidValueConverter")}static{ott(this,"AbstractMermaidValueConverter")}runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return void 0===n&&(n=this.runCustomConverter(t,e,r)),void 0===n?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){const n=yet[t.name];if(void 0===n)return;const i=n.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}},xet=class extends vet{static{o(this,"CommonValueConverter")}static{ott(this,"CommonValueConverter")}runCustomConverter(t,e,r){}},bet=class extends z7{static{o(this,"AbstractMermaidTokenBuilder")}static{ott(this,"AbstractMermaidTokenBuilder")}constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){const n=super.buildKeywordTokens(t,e,r);return n.forEach((t=>{this.keywords.has(t.name)&&void 0!==t.PATTERN&&(t.PATTERN=new RegExp(t.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))})),n}};(class extends bet{static{o(this,"CommonTokenBuilder")}static{ott(this,"CommonTokenBuilder")}});var wet={},ket={info:ott((async()=>{const{createInfoServices:t}=await Promise.resolve().then((function(){return NRt})),e=t().Info.parser.LangiumParser;wet.info=e}),"info"),packet:ott((async()=>{const{createPacketServices:t}=await Promise.resolve().then((function(){return IRt})),e=t().Packet.parser.LangiumParser;wet.packet=e}),"packet"),pie:ott((async()=>{const{createPieServices:t}=await Promise.resolve().then((function(){return RRt})),e=t().Pie.parser.LangiumParser;wet.pie=e}),"pie"),architecture:ott((async()=>{const{createArchitectureServices:t}=await Promise.resolve().then((function(){return MRt})),e=t().Architecture.parser.LangiumParser;wet.architecture=e}),"architecture"),gitGraph:ott((async()=>{const{createGitGraphServices:t}=await Promise.resolve().then((function(){return DRt})),e=t().GitGraph.parser.LangiumParser;wet.gitGraph=e}),"gitGraph"),radar:ott((async()=>{const{createRadarServices:t}=await Promise.resolve().then((function(){return ORt})),e=t().Radar.parser.LangiumParser;wet.radar=e}),"radar")};async function Tet(t,e){const r=ket[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);wet[t]||await r();const n=wet[t].parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new _et(n);return n.value}o(Tet,"parse"),ott(Tet,"parse");var _et=class extends Error{static{o(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{ott(this,"MermaidParseError")}},Eet=class extends bet{static{o(this,"PieTokenBuilder")}static{ott(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},Cet=class extends vet{static{o(this,"PieValueConverter")}static{ott(this,"PieValueConverter")}runCustomConverter(t,e,r){if("PIE_SECTION_LABEL"===t.name)return e.replace(/"/g,"").trim()}},Aet={parser:{TokenBuilder:ott((()=>new Eet),"TokenBuilder"),ValueConverter:ott((()=>new Cet),"ValueConverter")}};function Let(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),pet,Aet);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}o(Let,"createPieServices"),ott(Let,"createPieServices");var Net=class extends bet{static{o(this,"ArchitectureTokenBuilder")}static{ott(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Iet=class extends vet{static{o(this,"ArchitectureValueConverter")}static{ott(this,"ArchitectureValueConverter")}runCustomConverter(t,e,r){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}},Ret={parser:{TokenBuilder:ott((()=>new Net),"TokenBuilder"),ValueConverter:ott((()=>new Iet),"ValueConverter")}};function Met(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),get,Ret);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}o(Met,"createArchitectureServices"),ott(Met,"createArchitectureServices");var Det=class extends bet{static{o(this,"GitGraphTokenBuilder")}static{ott(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},Oet={parser:{TokenBuilder:ott((()=>new Det),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Pet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),fet,Oet);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}o(Pet,"createGitGraphServices"),ott(Pet,"createGitGraphServices");var Bet=class extends bet{static{o(this,"RadarTokenBuilder")}static{ott(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},$et={parser:{TokenBuilder:ott((()=>new Bet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Fet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),met,$et);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}o(Fet,"createRadarServices"),ott(Fet,"createRadarServices");var zet=class extends bet{static{o(this,"InfoTokenBuilder")}static{ott(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},Uet={parser:{TokenBuilder:ott((()=>new zet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Get(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),uet,Uet);return e.ServiceRegistry.register(r),{shared:e,Info:r}}o(Get,"createInfoServices"),ott(Get,"createInfoServices");var qet=class extends bet{static{o(this,"PacketTokenBuilder")}static{ott(this,"PacketTokenBuilder")}constructor(){super(["packet-beta"])}},jet={parser:{TokenBuilder:ott((()=>new qet),"TokenBuilder"),ValueConverter:ott((()=>new xet),"ValueConverter")}};function Wet(t=ett){const e=U9(z9(t),het),r=U9(F9({shared:e}),det,jet);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}o(Wet,"createPacketServices"),ott(Wet,"createPacketServices");var Yet={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Het=Lt.gitGraph,Vet=o((()=>Ok({...Het,...Gt().gitGraph})),"getConfig"),Xet=new NX((()=>{const t=Vet(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function Ket(){return wk({length:7})}function Zet(t,e){const r=Object.create(null);return t.reduce(((t,n)=>{const i=e(n);return r[i]||(r[i]=!0,t.push(n)),t}),[])}o(Ket,"getID"),o(Zet,"uniqBy");var Qet=o((function(t){Xet.records.direction=t}),"setDirection"),Jet=o((function(t){y.debug("options str",t),t=t?.trim(),t=t||"{}";try{Xet.records.options=JSON.parse(t)}catch(t){y.error("error while parsing gitGraph options",t.message)}}),"setOptions"),trt=o((function(){return Xet.records.options}),"getOptions"),ert=o((function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;y.info("commit",e,r,n,i),y.debug("Entering commit:",e,r,n,i);const a=Vet();r=Lr.sanitizeText(r,a),e=Lr.sanitizeText(e,a),i=i?.map((t=>Lr.sanitizeText(t,a)));const s={id:r||Xet.records.seq+"-"+Ket(),message:e,seq:Xet.records.seq++,type:n??Yet.NORMAL,tags:i??[],parents:null==Xet.records.head?[]:[Xet.records.head.id],branch:Xet.records.currBranch};Xet.records.head=s,y.info("main branch",a.mainBranchName),Xet.records.commits.set(s.id,s),Xet.records.branches.set(Xet.records.currBranch,s.id),y.debug("in pushCommit "+s.id)}),"commit"),rrt=o((function(t){let e=t.name;const r=t.order;if(e=Lr.sanitizeText(e,Vet()),Xet.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}")`);Xet.records.branches.set(e,null!=Xet.records.head?Xet.records.head.id:null),Xet.records.branchConfig.set(e,{name:e,order:r}),art(e),y.debug("in createBranch")}),"branch"),nrt=o((t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Vet();e=Lr.sanitizeText(e,a),r&&(r=Lr.sanitizeText(r,a));const s=Xet.records.branches.get(Xet.records.currBranch),o=Xet.records.branches.get(e),l=s?Xet.records.commits.get(s):void 0,c=o?Xet.records.commits.get(o):void 0;if(l&&c&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Xet.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 (${Xet.records.currBranch})has no commits`);throw t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},t}if(!Xet.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(r&&Xet.records.commits.has(r)){const t=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom Id");throw t.hash={text:`merge ${e} ${r} ${n} ${i?.join(" ")}`,token:`merge ${e} ${r} ${n} ${i?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i?.join(" ")}`]},t}const h=o||"",u={id:r||`${Xet.records.seq}-${Ket()}`,message:`merged branch ${e} into ${Xet.records.currBranch}`,seq:Xet.records.seq++,parents:null==Xet.records.head?[]:[Xet.records.head.id,h],branch:Xet.records.currBranch,type:Yet.MERGE,customType:n,customId:!!r,tags:i??[]};Xet.records.head=u,Xet.records.commits.set(u.id,u),Xet.records.branches.set(Xet.records.currBranch,u.id),y.debug(Xet.records.branches),y.debug("in mergeBranch")}),"merge"),irt=o((function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;y.debug("Entering cherryPick:",e,r,n);const a=Vet();if(e=Lr.sanitizeText(e,a),r=Lr.sanitizeText(r,a),n=n?.map((t=>Lr.sanitizeText(t,a))),i=Lr.sanitizeText(i,a),!e||!Xet.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} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const s=Xet.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===Yet.MERGE&&!i){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!r||!Xet.records.commits.has(r)){if(o===Xet.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const t=Xet.records.branches.get(Xet.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Xet.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const a=Xet.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${Xet.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},t}const l={id:Xet.records.seq+"-"+Ket(),message:`cherry-picked ${s?.message} into ${Xet.records.currBranch}`,seq:Xet.records.seq++,parents:null==Xet.records.head?[]:[Xet.records.head.id,s.id],branch:Xet.records.currBranch,type:Yet.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Yet.MERGE?`|parent:${i}`:""}`]};Xet.records.head=l,Xet.records.commits.set(l.id,l),Xet.records.branches.set(Xet.records.currBranch,l.id),y.debug(Xet.records.branches),y.debug("in cherryPick")}}),"cherryPick"),art=o((function(t){if(t=Lr.sanitizeText(t,Vet()),!Xet.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}{Xet.records.currBranch=t;const e=Xet.records.branches.get(Xet.records.currBranch);Xet.records.head=void 0!==e&&e?Xet.records.commits.get(e)??null:null}}),"checkout");function srt(t,e,r){const n=t.indexOf(e);-1===n?t.push(r):t.splice(n,1,r)}function ort(t){const e=t.reduce(((t,e)=>t.seq>e.seq?t:e),t[0]);let r="";t.forEach((function(t){r+=t===e?"\t*":"\t|"}));const n=[r,e.id,e.seq];for(const t in Xet.records.branches)Xet.records.branches.get(t)===e.id&&n.push(t);if(y.debug(n.join(" ")),e.parents&&2==e.parents.length&&e.parents[0]&&e.parents[1]){const r=Xet.records.commits.get(e.parents[0]);srt(t,e,r),e.parents[1]&&t.push(Xet.records.commits.get(e.parents[1]))}else{if(0==e.parents.length)return;if(e.parents[0]){const r=Xet.records.commits.get(e.parents[0]);srt(t,e,r)}}ort(t=Zet(t,(t=>t.id)))}o(srt,"upsert"),o(ort,"prettyPrintCommitHistory");var lrt=o((function(){y.debug(Xet.records.commits);ort([prt()[0]])}),"prettyPrint"),crt=o((function(){Xet.reset(),qr()}),"clear"),hrt=o((function(){const t=[...Xet.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"),urt=o((function(){return Xet.records.branches}),"getBranches"),drt=o((function(){return Xet.records.commits}),"getCommits"),prt=o((function(){const t=[...Xet.records.commits.values()];return t.forEach((function(t){y.debug(t.id)})),t.sort(((t,e)=>t.seq-e.seq)),t}),"getCommitsArray"),grt={commitType:Yet,getConfig:Vet,setDirection:Qet,setOptions:Jet,getOptions:trt,commit:ert,branch:rrt,merge:nrt,cherryPick:irt,checkout:art,prettyPrint:lrt,clear:crt,getBranchesAsObjArray:hrt,getBranches:urt,getCommits:drt,getCommitsArray:prt,getCurrentBranch:o((function(){return Xet.records.currBranch}),"getCurrentBranch"),getDirection:o((function(){return Xet.records.direction}),"getDirection"),getHead:o((function(){return Xet.records.head}),"getHead"),setAccTitle:jr,getAccTitle:Wr,getAccDescription:Hr,setAccDescription:Yr,setDiagramTitle:Vr,getDiagramTitle:Xr},frt=o(((t,e)=>{IX(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)mrt(r,e)}),"populate"),mrt=o(((t,e)=>{const r={Commit:o((t=>e.commit(yrt(t))),"Commit"),Branch:o((t=>e.branch(vrt(t))),"Branch"),Merge:o((t=>e.merge(xrt(t))),"Merge"),Checkout:o((t=>e.checkout(brt(t))),"Checkout"),CherryPicking:o((t=>e.cherryPick(wrt(t))),"CherryPicking")}[t.$type];r?r(t):y.error(`Unknown statement type: ${t.$type}`)}),"parseStatement"),yrt=o((t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?Yet[t.type]:Yet.NORMAL,tags:t.tags??void 0})),"parseCommit"),vrt=o((t=>({name:t.name,order:t.order??0})),"parseBranch"),xrt=o((t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?Yet[t.type]:void 0,tags:t.tags??void 0})),"parseMerge"),brt=o((t=>t.branch),"parseCheckout"),wrt=o((t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent})),"parseCherryPicking"),krt={parse:o((async t=>{const e=await Tet("gitGraph",t);y.debug(e),frt(e,grt)}),"parse")},Trt=Qr()?.gitGraph,_rt=10,Ert=40,Crt=new Map,Srt=new Map,Art=new Map,Lrt=[],Nrt=0,Irt="LR",Rrt=o((()=>{Crt.clear(),Srt.clear(),Art.clear(),Nrt=0,Lrt=[],Irt="LR"}),"clear"),Mrt=o((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach((t=>{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"),r.setAttribute("class","row"),r.textContent=t.trim(),e.appendChild(r)})),e}),"drawText"),Drt=o((t=>{let e,r,n;return"BT"===Irt?(r=o(((t,e)=>t<=e),"comparisonFunc"),n=1/0):(r=o(((t,e)=>t>=e),"comparisonFunc"),n=0),t.forEach((t=>{const i="TB"===Irt||"BT"==Irt?Srt.get(t)?.y:Srt.get(t)?.x;void 0!==i&&r(i,n)&&(e=t,n=i)})),e}),"findClosestParent"),Ort=o((t=>{let e="",r=1/0;return t.forEach((t=>{const n=Srt.get(t).y;n<=r&&(e=t,r=n)})),e||void 0}),"findClosestParentBT"),Prt=o(((t,e,r)=>{let n=r,i=r;const a=[];t.forEach((t=>{const r=e.get(t);if(!r)throw new Error(`Commit not found for key ${t}`);r.parents.length?(n=$rt(r),i=Math.max(n,i)):a.push(r),Frt(r,n)})),n=i,a.forEach((t=>{zrt(t,n,r)})),t.forEach((t=>{const r=e.get(t);if(r?.parents.length){const t=Ort(r.parents);n=Srt.get(t).y-Ert,n<=i&&(i=n);const e=Crt.get(r.branch).pos,a=n-_rt;Srt.set(r.id,{x:e,y:a})}}))}),"setParallelBTPos"),Brt=o((t=>{const e=Drt(t.parents.filter((t=>null!==t)));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=Srt.get(e)?.y;if(void 0===r)throw new Error(`Closest parent position not found for commit ${t.id}`);return r}),"findClosestParentPos"),$rt=o((t=>Brt(t)+Ert),"calculateCommitPosition"),Frt=o(((t,e)=>{const r=Crt.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+_rt;return Srt.set(t.id,{x:n,y:i}),{x:n,y:i}}),"setCommitPosition"),zrt=o(((t,e,r)=>{const n=Crt.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;Srt.set(t.id,{x:a,y:i})}),"setRootPosition"),Urt=o(((t,e,r,n,i,a)=>{if(a===Yet.HIGHLIGHT)t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${i%8} ${n}-outer`),t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${i%8} ${n}-inner`);else if(a===Yet.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${n}`);else{const s=t.append("circle");if(s.attr("cx",r.x),s.attr("cy",r.y),s.attr("r",e.type===Yet.MERGE?9:10),s.attr("class",`commit ${e.id} commit${i%8}`),a===Yet.MERGE){const a=t.append("circle");a.attr("cx",r.x),a.attr("cy",r.y),a.attr("r",6),a.attr("class",`commit ${n} ${e.id} commit${i%8}`)}if(a===Yet.REVERSE){t.append("path").attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${n} ${e.id} commit${i%8}`)}}}),"drawCommitBullet"),Grt=o(((t,e,r,n)=>{if(e.type!==Yet.CHERRY_PICK&&(e.customId&&e.type===Yet.MERGE||e.type!==Yet.MERGE)&&Trt?.showCommitLabel){const i=t.append("g"),a=i.insert("rect").attr("class","commit-label-bkg"),s=i.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),o=s.node()?.getBBox();if(o&&(a.attr("x",r.posWithOffset-o.width/2-2).attr("y",r.y+13.5).attr("width",o.width+4).attr("height",o.height+4),"TB"===Irt||"BT"===Irt?(a.attr("x",r.x-(o.width+16+5)).attr("y",r.y-12),s.attr("x",r.x-(o.width+16)).attr("y",r.y+o.height-12)):s.attr("x",r.posWithOffset-o.width/2),Trt.rotateCommitLabel))if("TB"===Irt||"BT"===Irt)s.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),a.attr("transform","rotate(-45, "+r.x+", "+r.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, "+n+", "+r.y+")")}}}),"drawCommitLabel"),qrt=o(((t,e,r,n)=>{if(e.tags.length>0){let i=0,a=0,s=0;const o=[];for(const n of e.tags.reverse()){const e=t.insert("polygon"),l=t.append("circle"),c=t.append("text").attr("y",r.y-16-i).attr("class","tag-label").text(n),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",r.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=r.y-19.2-l;if(i.attr("class","tag-label-bkg").attr("points",`\n ${n-a/2-2},${c+2} \n ${n-a/2-2},${c-2}\n ${r.posWithOffset-a/2-4},${c-o-2}\n ${r.posWithOffset+a/2+4},${c-o-2}\n ${r.posWithOffset+a/2+4},${c+o+2}\n ${r.posWithOffset-a/2-4},${c+o+2}`),e.attr("cy",c).attr("cx",n-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Irt||"BT"===Irt){const s=n+l;i.attr("class","tag-label-bkg").attr("points",`\n ${r.x},${s+2}\n ${r.x},${s-2}\n ${r.x+_rt},${s-o-2}\n ${r.x+_rt+a+4},${s-o-2}\n ${r.x+_rt+a+4},${s+o+2}\n ${r.x+_rt},${s+o+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),e.attr("cx",r.x+2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),t.attr("x",r.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}}),"drawCommitTags"),jrt=o((t=>{switch(t.customType??t.type){case Yet.NORMAL:return"commit-normal";case Yet.REVERSE:return"commit-reverse";case Yet.HIGHLIGHT:return"commit-highlight";case Yet.MERGE:return"commit-merge";case Yet.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType"),Wrt=o(((t,e,r,n)=>{const i={x:0,y:0};if(!(t.parents.length>0)){if("TB"===e)return 30;if("BT"===e){return(n.get(t.id)??i).y-Ert}return 0}{const r=Drt(t.parents);if(r){const a=n.get(r)??i;if("TB"===e)return a.y+Ert;if("BT"===e){return(n.get(t.id)??i).y-Ert}return a.x+Ert}}return 0}),"calculatePosition"),Yrt=o(((t,e,r)=>{const n="BT"===Irt&&r?e:e+_rt,i="TB"===Irt||"BT"===Irt?n:Crt.get(t.branch)?.pos,a="TB"===Irt||"BT"===Irt?Crt.get(t.branch)?.pos:n;if(void 0===a||void 0===i)throw new Error(`Position were undefined for commit ${t.id}`);return{x:a,y:i,posWithOffset:n}}),"getCommitPosition"),Hrt=o(((t,e,r)=>{if(!Trt)throw new Error("GitGraph config not found");const n=t.append("g").attr("class","commit-bullets"),i=t.append("g").attr("class","commit-labels");let a="TB"===Irt||"BT"===Irt?30:0;const s=[...e.keys()],l=Trt?.parallelCommits??!1,c=o(((t,r)=>{const n=e.get(t)?.seq,i=e.get(r)?.seq;return void 0!==n&&void 0!==i?n-i:0}),"sortKeys");let h=s.sort(c);"BT"===Irt&&(l&&Prt(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=Wrt(s,Irt,a,Srt));const o=Yrt(s,a,l);if(r){const t=jrt(s),e=s.customType??s.type,r=Crt.get(s.branch)?.index??0;Urt(n,s,o,t,r,e),Grt(i,s,o,a),qrt(i,s,o,a)}"TB"===Irt||"BT"===Irt?Srt.set(s.id,{x:o.x,y:o.posWithOffset}):Srt.set(s.id,{x:o.posWithOffset,y:o.y}),a="BT"===Irt&&l?a+Ert:a+Ert+_rt,a>Nrt&&(Nrt=a)}))}),"drawCommits"),Vrt=o(((t,e,r,n,i)=>{const a=("TB"===Irt||"BT"===Irt?r.x<n.x:r.y<n.y)?e.branch:t.branch,s=o((t=>t.branch===a),"isOnBranchToGetCurve"),l=o((r=>r.seq>t.seq&&r.seq<e.seq),"isBetweenCommits");return[...i.values()].some((t=>l(t)&&s(t)))}),"shouldRerouteArrow"),Xrt=o(((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(Lrt.every((t=>Math.abs(t-n)>=10)))return Lrt.push(n),n;const i=Math.abs(t-e);return Xrt(t,e-i/5,r+1)}),"findLane"),Krt=o(((t,e,r,n)=>{const i=Srt.get(e.id),a=Srt.get(r.id);if(void 0===i||void 0===a)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const s=Vrt(e,r,i,a,n);let o,l="",c="",h=0,u=0,d=Crt.get(r.branch)?.index;if(r.type===Yet.MERGE&&e.id!==r.parents[0]&&(d=Crt.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.y<a.y?Xrt(i.y,a.y):Xrt(a.y,i.y),r=i.x<a.x?Xrt(i.x,a.x):Xrt(a.x,i.x);"TB"===Irt?i.x<a.x?o=`M ${i.x} ${i.y} L ${r-h} ${i.y} ${c} ${r} ${i.y+u} L ${r} ${a.y-h} ${l} ${r+u} ${a.y} L ${a.x} ${a.y}`:(d=Crt.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${r+h} ${i.y} ${l} ${r} ${i.y+u} L ${r} ${a.y-h} ${c} ${r-u} ${a.y} L ${a.x} ${a.y}`):"BT"===Irt?i.x<a.x?o=`M ${i.x} ${i.y} L ${r-h} ${i.y} ${l} ${r} ${i.y-u} L ${r} ${a.y+h} ${c} ${r+u} ${a.y} L ${a.x} ${a.y}`:(d=Crt.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${r+h} ${i.y} ${c} ${r} ${i.y-u} L ${r} ${a.y+h} ${l} ${r-u} ${a.y} L ${a.x} ${a.y}`):i.y<a.y?o=`M ${i.x} ${i.y} L ${i.x} ${t-h} ${l} ${i.x+u} ${t} L ${a.x-h} ${t} ${c} ${a.x} ${t+u} L ${a.x} ${a.y}`:(d=Crt.get(e.branch)?.index,o=`M ${i.x} ${i.y} L ${i.x} ${t+h} ${c} ${i.x+u} ${t} L ${a.x-h} ${t} ${l} ${a.x} ${t-u} L ${a.x} ${a.y}`)}else l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,"TB"===Irt?(i.x<a.x&&(o=r.type===Yet.MERGE&&e.id!==r.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} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`),i.x>a.x&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=r.type===Yet.MERGE&&e.id!==r.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"===Irt?(i.x<a.x&&(o=r.type===Yet.MERGE&&e.id!==r.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&&(l="A 20 20, 0, 0, 0,",c="A 20 20, 0, 0, 1,",h=20,u=20,o=r.type===Yet.MERGE&&e.id!==r.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.y<a.y&&(o=r.type===Yet.MERGE&&e.id!==r.parents[0]?`M ${i.x} ${i.y} L ${a.x-h} ${i.y} ${c} ${a.x} ${i.y+u} L ${a.x} ${a.y}`:`M ${i.x} ${i.y} L ${i.x} ${a.y-h} ${l} ${i.x+u} ${a.y} L ${a.x} ${a.y}`),i.y>a.y&&(o=r.type===Yet.MERGE&&e.id!==r.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"),Zrt=o(((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const n=e.get(t);n.parents&&n.parents.length>0&&n.parents.forEach((t=>{Krt(r,e.get(t),n,e)}))}))}),"drawArrows"),Qrt=o(((t,e)=>{const r=t.append("g");e.forEach(((t,e)=>{const n=e%8,i=Crt.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const a=r.append("line");a.attr("x1",0),a.attr("y1",i),a.attr("x2",Nrt),a.attr("y2",i),a.attr("class","branch branch"+n),"TB"===Irt?(a.attr("y1",30),a.attr("x1",i),a.attr("y2",Nrt),a.attr("x2",i)):"BT"===Irt&&(a.attr("y1",Nrt),a.attr("x1",i),a.attr("y2",30),a.attr("x2",i)),Lrt.push(i);const s=t.name,o=Mrt(s),l=r.insert("rect"),c=r.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+n);c.node().appendChild(o);const h=o.getBBox();l.attr("class","branchLabelBkg label"+n).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(!0===Trt?.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===Trt?.rotateCommitLabel?30:0))+", "+(i-h.height/2-1)+")"),"TB"===Irt?(l.attr("x",i-h.width/2-10).attr("y",0),c.attr("transform","translate("+(i-h.width/2-5)+", 0)")):"BT"===Irt?(l.attr("x",i-h.width/2-10).attr("y",Nrt),c.attr("transform","translate("+(i-h.width/2-5)+", "+Nrt+")")):l.attr("transform","translate(-19, "+(i-h.height/2)+")")}))}),"drawBranches"),Jrt=o((function(t,e,r,n,i){return Crt.set(t,{pos:e,index:r}),e+=50+(i?40:0)+("TB"===Irt||"BT"===Irt?n.width/2:0)}),"setBranchPosition"),tnt=o((function(t,e,r,n){if(Rrt(),y.debug("in gitgraph renderer",t+"\n","id:",e,r),!Trt)throw new Error("GitGraph config not found");const i=Trt.rotateCommitLabel??!1,a=n.db;Art=a.getCommits();const s=a.getBranchesAsObjArray();Irt=a.getDirection();const o=Ga(`[id="${e}"]`);let l=0;s.forEach(((t,e)=>{const r=Mrt(t.name),n=o.append("g"),a=n.insert("g").attr("class","branchLabel"),s=a.insert("g").attr("class","label branch-label");s.node()?.appendChild(r);const c=r.getBBox();l=Jrt(t.name,l,e,c,i),s.remove(),a.remove(),n.remove()})),Hrt(o,Art,!1),Trt.showBranches&&Qrt(o,s),Zrt(o,Art),Hrt(o,Art,!0),Pk.insertTitle(o,"gitTitleText",Trt.titleTopMargin??0,a.getDiagramTitle()),rn(void 0,o,Trt.diagramPadding,Trt.useMaxWidth)}),"draw"),ent={draw:tnt},rnt=o((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"),nnt={parser:krt,db:grt,renderer:ent,styles:rnt},int=Object.freeze({__proto__:null,diagram:nnt}),ant=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_isoWeek=n()}(t,(function(){var t="day";return function(e,r,n){var i=o((function(e){return e.add(4-e.isoWeekday(),t)}),"a"),a=r.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 r,a,s,o=i(this),l=(r=this.isoWeekYear(),s=4-(a=(this.$u?n.utc:n)().year(r).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 s=a.startOf;a.startOf=function(t,e){var r=this.$utils(),n=!!r.u(e)||e;return"isoweek"===r.p(t)?n?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(t,e)}}}))}}),snt=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_customParseFormat=n()}(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,r=/\d/,n=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,s={},l=o((function(t){return(t=+t)+(t>68?1900:2e3)}),"a"),c=o((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),r=60*e[1]+(+e[2]||0);return 0===r?0:"+"===e[0]?-r:r}(t)}],u=o((function(t){var e=s[t];return e&&(e.indexOf?e:e.s.concat(e.f))}),"u"),d=o((function(t,e){var r,n=s.meridiem;if(n){for(var i=1;i<=24;i+=1)if(t.indexOf(n(i,0,e))>-1){r=i>12;break}}else r=t===(e?"pm":"PM");return r}),"d"),p={A:[a,function(t){this.afternoon=d(t,!1)}],a:[a,function(t){this.afternoon=d(t,!0)}],Q:[r,function(t){this.month=3*(t-1)+1}],S:[r,function(t){this.milliseconds=100*+t}],SS:[n,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:[n,c("day")],Do:[a,function(t){var e=s.ordinal,r=t.match(/\d+/);if(this.day=r[0],e)for(var n=1;n<=31;n+=1)e(n).replace(/\[|\]/g,"")===t&&(this.day=n)}],w:[i,c("week")],ww:[n,c("week")],M:[i,c("month")],MM:[n,c("month")],MMM:[a,function(t){var e=u("months"),r=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(r<1)throw new Error;this.month=r%12||r}],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:[n,function(t){this.year=l(t)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function g(r){var n,i;n=r,i=s&&s.formats;for(var a=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,r,n){var a=n&&n.toUpperCase();return r||i[n]||t[n]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,r){return e||r.slice(1)}))}))).match(e),o=a.length,l=0;l<o;l+=1){var c=a[l],h=p[c],u=h&&h[0],d=h&&h[1];a[l]=d?{regex:u,parser:d}:c.replace(/^\[|\]$/g,"")}return function(t){for(var e={},r=0,n=0;r<o;r+=1){var i=a[r];if("string"==typeof i)n+=i.length;else{var s=i.regex,l=i.parser,c=t.slice(n),h=s.exec(c)[0];l.call(e,h),t=t.replace(h,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var r=t.hours;e?r<12&&(t.hours+=12):12===r&&(t.hours=0),delete t.afternoon}}(e),e}}return o(g,"l"),function(t,e,r){r.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(l=t.parseTwoDigitYear);var n=e.prototype,i=n.parse;n.parse=function(t){var e=t.date,n=t.utc,a=t.args;this.$u=n;var o=a[1];if("string"==typeof o){var l=!0===a[2],c=!0===a[3],h=l||c,u=a[2];c&&(u=a[2]),s=this.$locale(),!l&&u&&(s=r.Ls[u]),this.$d=function(t,e,r,n){try{if(["x","X"].indexOf(e)>-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)):r?new Date(Date.UTC(y,v,m,b,w,k,T)):(x=new Date(y,v,m,b,w,k,T),p&&(x=n(x).week(p).toDate()),x)}catch(t){return new Date("")}}(e,o,n,r),this.init(),u&&!0!==u&&(this.$L=this.locale(u).$L),h&&e!=this.format(o)&&(this.$d=new Date("")),s={}}else if(o instanceof Array)for(var d=o.length,p=1;p<=d;p+=1){a[1]=o[p-1];var f=r.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)}}}))}}),ont=l({"../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js"(t,e){!function(r,n){"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_advancedFormat=n()}(t,(function(){return function(t,e){var r=e.prototype,n=r.format;r.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return n.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 r.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return r.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 n.bind(this)(a)}}}))}}),lnt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],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:o((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:o((function(t,e,r,n,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:n.setWeekday("monday");break;case 9:n.setWeekday("tuesday");break;case 10:n.setWeekday("wednesday");break;case 11:n.setWeekday("thursday");break;case 12:n.setWeekday("friday");break;case 13:n.setWeekday("saturday");break;case 14:n.setWeekday("sunday");break;case 15:n.setWeekend("friday");break;case 16:n.setWeekend("saturday");break;case 17:n.setDateFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 18:n.enableInclusiveEndDates(),this.$=a[o].substr(18);break;case 19:n.TopAxis(),this.$=a[o].substr(8);break;case 20:n.setAxisFormat(a[o].substr(11)),this.$=a[o].substr(11);break;case 21:n.setTickInterval(a[o].substr(13)),this.$=a[o].substr(13);break;case 22:n.setExcludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 23:n.setIncludes(a[o].substr(9)),this.$=a[o].substr(9);break;case 24:n.setTodayMarker(a[o].substr(12)),this.$=a[o].substr(12);break;case 27:n.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 28:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 29:case 30:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 31:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 33:n.addTask(a[o-1],a[o]),this.$="task";break;case 34:this.$=a[o-1],n.setClickEvent(a[o-1],a[o],null);break;case 35:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 36:this.$=a[o-2],n.setClickEvent(a[o-2],a[o-1],null),n.setLink(a[o-2],a[o]);break;case 37:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-2],a[o-1]),n.setLink(a[o-3],a[o]);break;case 38:this.$=a[o-2],n.setClickEvent(a[o-2],a[o],null),n.setLink(a[o-2],a[o-1]);break;case 39:this.$=a[o-3],n.setClickEvent(a[o-3],a[o-1],a[o]),n.setLink(a[o-3],a[o-2]);break;case 40:this.$=a[o-1],n.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:r,13:n,14:i,15:a,16:s,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:r,13:n,14:i,15:a,16:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},A=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,o(L,"Parser"),L.prototype=S,S.Parser=L,new L}();lnt.parser=lnt;var cnt=lnt,hnt=p(Wy(),1),unt=p(g(),1),dnt=p(ant(),1),pnt=p(snt(),1),gnt=p(ont(),1);unt.default.extend(dnt.default),unt.default.extend(pnt.default),unt.default.extend(gnt.default);var fnt,mnt,ynt={friday:5,saturday:6},vnt="",xnt="",bnt=void 0,wnt="",knt=[],Tnt=[],_nt=new Map,Ent=[],Cnt=[],Snt="",Ant="",Lnt=["active","done","crit","milestone"],Nnt=[],Int=!1,Rnt=!1,Mnt="sunday",Dnt="saturday",Ont=0,Pnt=o((function(){Ent=[],Cnt=[],Snt="",Nnt=[],git=0,fnt=void 0,mnt=void 0,vit=[],vnt="",xnt="",Ant="",bnt=void 0,wnt="",knt=[],Tnt=[],Int=!1,Rnt=!1,Ont=0,_nt=new Map,qr(),Mnt="sunday",Dnt="saturday"}),"clear"),Bnt=o((function(t){xnt=t}),"setAxisFormat"),$nt=o((function(){return xnt}),"getAxisFormat"),Fnt=o((function(t){bnt=t}),"setTickInterval"),znt=o((function(){return bnt}),"getTickInterval"),Unt=o((function(t){wnt=t}),"setTodayMarker"),Gnt=o((function(){return wnt}),"getTodayMarker"),qnt=o((function(t){vnt=t}),"setDateFormat"),jnt=o((function(){Int=!0}),"enableInclusiveEndDates"),Wnt=o((function(){return Int}),"endDatesAreInclusive"),Ynt=o((function(){Rnt=!0}),"enableTopAxis"),Hnt=o((function(){return Rnt}),"topAxisEnabled"),Vnt=o((function(t){Ant=t}),"setDisplayMode"),Xnt=o((function(){return Ant}),"getDisplayMode"),Knt=o((function(){return vnt}),"getDateFormat"),Znt=o((function(t){knt=t.toLowerCase().split(/[\s,]+/)}),"setIncludes"),Qnt=o((function(){return knt}),"getIncludes"),Jnt=o((function(t){Tnt=t.toLowerCase().split(/[\s,]+/)}),"setExcludes"),tit=o((function(){return Tnt}),"getExcludes"),eit=o((function(){return _nt}),"getLinks"),rit=o((function(t){Snt=t,Ent.push(t)}),"addSection"),nit=o((function(){return Ent}),"getSections"),iit=o((function(){let t=Tit();let e=0;for(;!t&&e<10;)t=Tit(),e++;return Cnt=vit}),"getTasks"),ait=o((function(t,e,r,n){return!n.includes(t.format(e.trim()))&&(!(!r.includes("weekends")||t.isoWeekday()!==ynt[Dnt]&&t.isoWeekday()!==ynt[Dnt]+1)||(!!r.includes(t.format("dddd").toLowerCase())||r.includes(t.format(e.trim()))))}),"isInvalidDate"),sit=o((function(t){Mnt=t}),"setWeekday"),oit=o((function(){return Mnt}),"getWeekday"),lit=o((function(t){Dnt=t}),"setWeekend"),cit=o((function(t,e,r,n){if(!r.length||t.manualEndTime)return;let i,a;i=t.startTime instanceof Date?(0,unt.default)(t.startTime):(0,unt.default)(t.startTime,e,!0),i=i.add(1,"d"),a=t.endTime instanceof Date?(0,unt.default)(t.endTime):(0,unt.default)(t.endTime,e,!0);const[s,o]=hit(i,a,e,r,n);t.endTime=s.toDate(),t.renderEndTime=o}),"checkTaskDates"),hit=o((function(t,e,r,n,i){let a=!1,s=null;for(;t<=e;)a||(s=e.toDate()),a=ait(t,r,n,i),a&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,s]}),"fixTaskDates"),uit=o((function(t,e,r){r=r.trim();const n=/^after\s+(?<ids>[\d\w- ]+)/.exec(r);if(null!==n){let t=null;for(const e of n.groups.ids.split(" ")){let r=wit(e);void 0!==r&&(!t||r.endTime>t.endTime)&&(t=r)}if(t)return t.endTime;const e=new Date;return e.setHours(0,0,0,0),e}let i=(0,unt.default)(r,e.trim(),!0);if(i.isValid())return i.toDate();{y.debug("Invalid date:"+r),y.debug("With date format:"+e.trim());const t=new Date(r);if(void 0===t||isNaN(t.getTime())||t.getFullYear()<-1e4||t.getFullYear()>1e4)throw new Error("Invalid date:"+r);return t}}),"getStartDate"),dit=o((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return null!==e?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]}),"parseDuration"),pit=o((function(t,e,r,n=!1){r=r.trim();const i=/^until\s+(?<ids>[\d\w- ]+)/.exec(r);if(null!==i){let t=null;for(const e of i.groups.ids.split(" ")){let r=wit(e);void 0!==r&&(!t||r.startTime<t.startTime)&&(t=r)}if(t)return t.startTime;const e=new Date;return e.setHours(0,0,0,0),e}let a=(0,unt.default)(r,e.trim(),!0);if(a.isValid())return n&&(a=a.add(1,"d")),a.toDate();let s=(0,unt.default)(t);const[o,l]=dit(r);if(!Number.isNaN(o)){const t=s.add(o,l);t.isValid()&&(s=t)}return s.toDate()}),"getEndDate"),git=0,fit=o((function(t){return void 0===t?"task"+(git+=1):t}),"parseId"),mit=o((function(t,e){let r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;const n=r.split(","),i={};Iit(n,i,Lnt);for(let t=0;t<n.length;t++)n[t]=n[t].trim();let a="";switch(n.length){case 1:i.id=fit(),i.startTime=t.endTime,a=n[0];break;case 2:i.id=fit(),i.startTime=uit(void 0,vnt,n[0]),a=n[1];break;case 3:i.id=fit(n[0]),i.startTime=uit(void 0,vnt,n[1]),a=n[2]}return a&&(i.endTime=pit(i.startTime,vnt,a,Int),i.manualEndTime=(0,unt.default)(a,"YYYY-MM-DD",!0).isValid(),cit(i,vnt,Tnt,knt)),i}),"compileData"),yit=o((function(t,e){let r;r=":"===e.substr(0,1)?e.substr(1,e.length):e;const n=r.split(","),i={};Iit(n,i,Lnt);for(let t=0;t<n.length;t++)n[t]=n[t].trim();switch(n.length){case 1:i.id=fit(),i.startTime={type:"prevTaskEnd",id:t},i.endTime={data:n[0]};break;case 2:i.id=fit(),i.startTime={type:"getStartDate",startData:n[0]},i.endTime={data:n[1]};break;case 3:i.id=fit(n[0]),i.startTime={type:"getStartDate",startData:n[1]},i.endTime={data:n[2]}}return i}),"parseData"),vit=[],xit={},bit=o((function(t,e){const r={section:Snt,type:Snt,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},n=yit(mnt,e);r.raw.startTime=n.startTime,r.raw.endTime=n.endTime,r.id=n.id,r.prevTaskId=mnt,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.order=Ont,Ont++;const i=vit.push(r);mnt=r.id,xit[r.id]=i-1}),"addTask"),wit=o((function(t){const e=xit[t];return vit[e]}),"findTaskById"),kit=o((function(t,e){const r={section:Snt,type:Snt,description:t,task:t,classes:[]},n=mit(fnt,e);r.startTime=n.startTime,r.endTime=n.endTime,r.id=n.id,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,fnt=r,Cnt.push(r)}),"addTaskOrg"),Tit=o((function(){const t=o((function(t){const e=vit[t];let r="";switch(vit[t].raw.startTime.type){case"prevTaskEnd":{const t=wit(e.prevTaskId);e.startTime=t.endTime;break}case"getStartDate":r=uit(void 0,vnt,vit[t].raw.startTime.startData),r&&(vit[t].startTime=r)}return vit[t].startTime&&(vit[t].endTime=pit(vit[t].startTime,vnt,vit[t].raw.endTime.data,Int),vit[t].endTime&&(vit[t].processed=!0,vit[t].manualEndTime=(0,unt.default)(vit[t].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),cit(vit[t],vnt,Tnt,knt))),vit[t].processed}),"compileTask");let e=!0;for(const[r,n]of vit.entries())t(r),e=e&&n.processed;return e}),"compileTasks"),_it=o((function(t,e){let r=e;"loose"!==Qr().securityLevel&&(r=(0,hnt.sanitizeUrl)(e)),t.split(",").forEach((function(t){void 0!==wit(t)&&(Sit(t,(()=>{window.open(r,"_self")})),_nt.set(t,r))})),Eit(t,"clickable")}),"setLink"),Eit=o((function(t,e){t.split(",").forEach((function(t){let r=wit(t);void 0!==r&&r.classes.push(e)}))}),"setClass"),Cit=o((function(t,e,r){if("loose"!==Qr().securityLevel)return;if(void 0===e)return;let n=[];if("string"==typeof r){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<n.length;t++){let e=n[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),n[t]=e}}0===n.length&&n.push(t),void 0!==wit(t)&&Sit(t,(()=>{Pk.runFunc(e,...n)}))}),"setClickFun"),Sit=o((function(t,e){Nnt.push((function(){const r=document.querySelector(`[id="${t}"]`);null!==r&&r.addEventListener("click",(function(){e()}))}),(function(){const r=document.querySelector(`[id="${t}-text"]`);null!==r&&r.addEventListener("click",(function(){e()}))}))}),"pushFun"),Ait=o((function(t,e,r){t.split(",").forEach((function(t){Cit(t,e,r)})),Eit(t,"clickable")}),"setClickEvent"),Lit=o((function(t){Nnt.forEach((function(e){e(t)}))}),"bindFunctions"),Nit={getConfig:o((()=>Qr().gantt),"getConfig"),clear:Pnt,setDateFormat:qnt,getDateFormat:Knt,enableInclusiveEndDates:jnt,endDatesAreInclusive:Wnt,enableTopAxis:Ynt,topAxisEnabled:Hnt,setAxisFormat:Bnt,getAxisFormat:$nt,setTickInterval:Fnt,getTickInterval:znt,setTodayMarker:Unt,getTodayMarker:Gnt,setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,setDisplayMode:Vnt,getDisplayMode:Xnt,setAccDescription:Yr,getAccDescription:Hr,addSection:rit,getSections:nit,getTasks:iit,addTask:bit,findTaskById:wit,addTaskOrg:kit,setIncludes:Znt,getIncludes:Qnt,setExcludes:Jnt,getExcludes:tit,setClickEvent:Ait,setLink:_it,getLinks:eit,bindFunctions:Lit,parseDuration:dit,isInvalidDate:ait,setWeekday:sit,getWeekday:oit,setWeekend:lit};function Iit(t,e,r){let n=!0;for(;n;)n=!1,r.forEach((function(r){const i=new RegExp("^\\s*"+r+"\\s*$");t[0].match(i)&&(e[r]=!0,t.shift(1),n=!0)}))}o(Iit,"getTaskTags");var Rit,Mit=p(g(),1),Dit=o((function(){y.debug("Something is calling, setConf, remove the call")}),"setConf"),Oit={monday:Ml,tuesday:Dl,wednesday:Ol,thursday:Pl,friday:Bl,saturday:$l,sunday:Rl},Pit=o(((t,e)=>{let r=[...t].map((()=>-1/0)),n=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order)),i=0;for(const t of n)for(let n=0;n<r.length;n++)if(t.startTime>=r[n]){r[n]=t.endTime,t.order=n+e,n>i&&(i=n);break}return i}),"getMaxIntersections"),Bit=o((function(t,e,r,n){const i=Qr().gantt,a=Qr().securityLevel;let s;"sandbox"===a&&(s=Ga("#i"+e));const l=Ga("sandbox"===a?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===a?s.nodes()[0].contentDocument:document,h=c.getElementById(e);void 0===(Rit=h.parentElement.offsetWidth)&&(Rit=1200),void 0!==i.useWidth&&(Rit=i.useWidth);const u=n.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"===n.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 r of Object.keys(t)){const n=Pit(t[r],e)+1;e+=n,g+=n*(i.barHeight+i.barGap),p[r]=n}}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 "+Rit+" "+g);const f=l.select(`[id="${e}"]`),m=Ah().domain([hn(u,(function(t){return t.startTime})),cn(u,(function(t){return t.endTime}))]).rangeRound([0,Rit-i.leftPadding-i.rightPadding]);function v(t,e){const r=t.startTime,n=e.startTime;let i=0;return r>n?i=1:r<n&&(i=-1),i}function x(t,e,r){const a=i.barHeight,s=a+i.barGap,o=i.topPadding,l=i.leftPadding,c=ul().domain([0,d.length]).range(["#00B9FA","#F95002"]).interpolate(Js);w(s,o,l,e,r,t,n.db.getExcludes(),n.db.getIncludes()),k(l,o,e,r),b(t,s,o,l,a,c,e),T(s,o),_(l,o,e,r)}function b(t,r,a,s,o,l,c){const h=[...new Set(t.map((t=>t.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*r+a-2})).attr("width",(function(){return c-i.rightPadding/2})).attr("height",r).attr("class",(function(t){for(const[e,r]of d.entries())if(t.type===r)return"section section"+e%i.numberSectionStyles;return"section section0"}));const u=f.append("g").selectAll("rect").data(t).enter(),p=n.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?m(t.startTime)+s+.5*(m(t.endTime)-m(t.startTime))-.5*o:m(t.startTime)+s})).attr("y",(function(t,e){return t.order*r+a})).attr("width",(function(t){return t.milestone?o:m(t.renderEndTime||t.endTime)-m(t.startTime)})).attr("height",o).attr("transform-origin",(function(t,e){return e=t.order,(m(t.startTime)+s+.5*(m(t.endTime)-m(t.startTime))).toString()+"px "+(e*r+a+.5*o).toString()+"px"})).attr("class",(function(t){let e="";t.classes.length>0&&(e=t.classes.join(" "));let r=0;for(const[e,n]of d.entries())t.type===n&&(r=e%i.numberSectionStyles);let n="";return t.active?t.crit?n+=" activeCrit":n=" active":t.done?n=t.crit?" doneCrit":" done":t.crit&&(n+=" crit"),0===n.length&&(n=" task"),t.milestone&&(n=" milestone "+n),n+=r,n+=" "+e,"task"+n})),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=m(t.startTime),r=m(t.renderEndTime||t.endTime);t.milestone&&(e+=.5*(m(t.endTime)-m(t.startTime))-.5*o),t.milestone&&(r=e+o);const n=this.getBBox().width;return n>r-e?r+n+1.5*i.leftPadding>c?e+s-5:r+s+5:(r-e)/2+e+s})).attr("y",(function(t,e){return t.order*r+i.barHeight/2+(i.fontSize/2-2)+a})).attr("text-height",o).attr("class",(function(t){const e=m(t.startTime);let r=m(t.endTime);t.milestone&&(r=e+o);const n=this.getBBox().width;let a="";t.classes.length>0&&(a=t.classes.join(" "));let s=0;for(const[e,r]of d.entries())t.type===r&&(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"),n>r-e?r+n+1.5*i.leftPadding>c?a+" taskTextOutsideLeft taskTextOutside"+s+" "+l:a+" taskTextOutsideRight taskTextOutside"+s+" "+l+" width-"+n:a+" taskText taskText"+s+" "+l+" width-"+n}));if("sandbox"===Qr().securityLevel){let t;t=Ga("#i"+e);const r=t.nodes()[0].contentDocument;u.filter((function(t){return p.has(t.id)})).each((function(t){var e=r.querySelector("#"+t.id),n=r.querySelector("#"+t.id+"-text");const i=e.parentNode;var a=r.createElement("a");a.setAttribute("xlink:href",p.get(t.id)),a.setAttribute("target","_top"),i.appendChild(a),a.appendChild(e),a.appendChild(n)}))}}function w(t,e,r,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||t<h)&&(h=t),(void 0===u||e>u)&&(u=e);if(!h||!u)return;if((0,Mit.default)(u).diff((0,Mit.default)(h),"year")>5)return void y.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=n.db.getDateFormat(),p=[];let g=null,v=(0,Mit.default)(h);for(;v.valueOf()<=u;)n.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 m(t.start)+r})).attr("y",i.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return m(e)-m(t.start)})).attr("height",s-e-i.gridLineStartPadding).attr("transform-origin",(function(e,n){return(m(e.start)+r+.5*(m(e.end)-m(e.start))).toString()+"px "+(n*t+.5*s).toString()+"px"})).attr("class","exclude-range")}function k(t,e,r,a){let s=Un(m).tickSize(-a+e+i.gridLineStartPadding).tickFormat(ac(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(null!==o){const t=o[1],e=o[2],r=n.db.getWeekday()||i.weekday;switch(e){case"millisecond":s.ticks(fl.every(t));break;case"second":s.ticks(Tl.every(t));break;case"minute":s.ticks(_l.every(t));break;case"hour":s.ticks(Cl.every(t));break;case"day":s.ticks(Al.every(t));break;case"week":s.ticks(Oit[r].every(t));break;case"month":s.ticks(Hl.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"),n.db.topAxisEnabled()||i.topAxis){let r=zn(m).tickSize(-a+e+i.gridLineStartPadding).tickFormat(ac(n.db.getAxisFormat()||i.axisFormat||"%Y-%m-%d"));if(null!==o){const t=o[1],e=o[2],a=n.db.getWeekday()||i.weekday;switch(e){case"millisecond":r.ticks(fl.every(t));break;case"second":r.ticks(Tl.every(t));break;case"minute":r.ticks(_l.every(t));break;case"hour":r.ticks(Cl.every(t));break;case"day":r.ticks(Al.every(t));break;case"week":r.ticks(Oit[a].every(t));break;case"month":r.ticks(Hl.every(t))}}f.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(r).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}function T(t,e){let r=0;const n=Object.keys(p).map((t=>[t,p[t]]));f.append("g").selectAll("text").data(n).enter().append((function(t){const e=t[0].split(Lr.lineBreakRegex),r=-(e.length-1)/2,n=c.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("dy",r+"em");for(const[t,r]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=r,n.appendChild(e)}return n})).attr("x",10).attr("y",(function(i,a){if(!(a>0))return i[1]*t/2+e;for(let s=0;s<a;s++)return r+=n[a-1][1],i[1]*t/2+r*t+e})).attr("font-size",i.sectionFontSize).attr("class",(function(t){for(const[e,r]of d.entries())if(t[0]===r)return"sectionTitle sectionTitle"+e%i.numberSectionStyles;return"sectionTitle"}))}function _(t,e,r,a){const s=n.db.getTodayMarker();if("off"===s)return;const o=f.append("g").attr("class","today"),l=new Date,c=o.append("line");c.attr("x1",m(l)+t).attr("x2",m(l)+t).attr("y1",i.titleTopMargin).attr("y2",a-i.titleTopMargin).attr("class","today"),""!==s&&c.attr("style",s.replace(/,/g,";"))}function E(t){const e={},r=[];for(let n=0,i=t.length;n<i;++n)Object.prototype.hasOwnProperty.call(e,t[n])||(e[t[n]]=!0,r.push(t[n]));return r}o(v,"taskCompare"),u.sort(v),x(u,Rit,g),Rr(f,g,Rit,i.useMaxWidth),f.append("text").text(n.db.getDiagramTitle()).attr("x",Rit/2).attr("y",i.titleTopMargin).attr("class","titleText"),o(x,"makeGantt"),o(b,"drawRects"),o(w,"drawExcludeDays"),o(k,"makeGrid"),o(T,"vertLabels"),o(_,"drawToday"),o(E,"checkUnique")}),"draw"),$it={parser:cnt,db:Nit,renderer:{setConf:Dit,draw:Bit},styles:o((t=>`\n .mermaid-main-font {\n font-family: ${t.fontFamily};\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: ${t.fontFamily};\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: ${t.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: ${t.fontFamily};\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: ${t.fontFamily};\n }\n`),"getStyles")},Fit=Object.freeze({__proto__:null,diagram:$it}),zit={parse:o((async t=>{const e=await Tet("info",t);y.debug(e)}),"parse")},Uit={version:t},Git={getVersion:o((()=>Uit.version),"getVersion")},qit=o(((t,e,r)=>{y.debug("rendering info diagram\n"+t);const n=ag(e);Rr(n,100,400,!0);n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)}),"draw"),jit={parser:zit,db:Git,renderer:{draw:qit}},Wit=Object.freeze({__proto__:null,diagram:jit}),Yit=Lt.pie,Hit={sections:new Map,showData:!1,config:Yit},Vit=Hit.sections,Xit=Hit.showData,Kit=structuredClone(Yit),Zit=o((()=>structuredClone(Kit)),"getConfig"),Qit=o((()=>{Vit=new Map,Xit=Hit.showData,qr()}),"clear"),Jit=o((({label:t,value:e})=>{Vit.has(t)||(Vit.set(t,e),y.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),tat={getConfig:Zit,clear:Qit,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addSection:Jit,getSections:o((()=>Vit),"getSections"),setShowData:o((t=>{Xit=t}),"setShowData"),getShowData:o((()=>Xit),"getShowData")},eat=o(((t,e)=>{IX(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)}),"populateDb"),rat={parse:o((async t=>{const e=await Tet("pie",t);y.debug(e),eat(e,tat)}),"parse")},nat=o((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"),iat=o((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return yu().value((t=>t.value))(e)}),"createPieArcs"),aat=o(((t,e,r,n)=>{y.debug("rendering pie chart\n"+t);const i=n.db,a=Qr(),s=Ok(i.getConfig(),a.pie),o=18,l=450,c=ag(e),h=c.append("g");h.attr("transform","translate(225,225)");const{themeVariables:u}=a;let[d]=Dk(u.pieOuterStrokeWidth);d??=2;const p=s.textPosition,g=Math.min(450,l)/2-40,f=lu().innerRadius(0).outerRadius(g),m=lu().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=iat(v),b=So([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("+m.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:r}=t.data;return i.getShowData()?`${e} [${r}]`:e}));const T=Math.max(...k.selectAll("text").nodes().map((t=>t?.getBoundingClientRect().width??0))),_=512+T;c.attr("viewBox",`0 0 ${_} 450`),Rr(c,l,_,s.useMaxWidth)}),"draw"),sat={parser:rat,db:tat,renderer:{draw:aat},styles:nat},oat=Object.freeze({__proto__:null,diagram:sat}),lat=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[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],R=[1,34],M=[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],W=[1,70],Y=[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],rt=[1,99],nt=[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:o((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:o((function(t,e,r,n,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],n.addClass(a[o-2],a[o]);break;case 37:this.$=[];break;case 42:this.$=a[o].trim(),n.setDiagramTitle(this.$);break;case 43:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 44:case 45:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 46:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 47:n.addPoint(a[o-3],"",a[o-1],a[o],[]);break;case 48:n.addPoint(a[o-4],a[o-3],a[o-1],a[o],[]);break;case 49:n.addPoint(a[o-4],"",a[o-2],a[o-1],a[o]);break;case 50:n.addPoint(a[o-5],a[o-4],a[o-2],a[o-1],a[o]);break;case 51:n.setXAxisLeftText(a[o-2]),n.setXAxisRightText(a[o]);break;case 52:a[o-1].text+=" ⟶ ",n.setXAxisLeftText(a[o-1]);break;case 53:n.setXAxisLeftText(a[o]);break;case 54:n.setYAxisBottomText(a[o-2]),n.setYAxisTopText(a[o]);break;case 55:a[o-1].text+=" ⟶ ",n.setYAxisBottomText(a[o-1]);break;case 56:n.setYAxisBottomText(a[o]);break;case 57:n.setQuadrant1Text(a[o]);break;case 58:n.setQuadrant2Text(a[o]);break;case 59:n.setQuadrant3Text(a[o]);break;case 60:n.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:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(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:R,64:M,65:D,66:O,67:P}),t(s,[2,34]),{27:45,55:n,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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(s,[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:W,10:Y,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:R,64:M,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:W,10:Y,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:R,64:M,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:R,64:M,65:D,66:O,67:P}),{46:[1,85]},{45:[1,86]},{4:J,5:tt,6:et,8:rt,11:nt,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:R,64:M,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:R,64:M,65:D,66:O,67:P}),t(c,[2,47],{22:88,16:89,23:100,4:J,5:tt,6:et,8:rt,11:nt,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:rt,11:nt,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:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt}),{4:J,5:tt,6:et,8:rt,11:nt,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:rt,11:nt,13:it,17:at,18:st,19:ot,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},pt=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,o(gt,"Parser"),gt.prototype=dt,dt.Parser=gt,new gt}();lat.parser=lat;var cat=lat,hat=bt(),uat=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{o(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:Lt.quadrantChart?.chartWidth||500,chartWidth:Lt.quadrantChart?.chartHeight||500,titlePadding:Lt.quadrantChart?.titlePadding||10,titleFontSize:Lt.quadrantChart?.titleFontSize||20,quadrantPadding:Lt.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:Lt.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:Lt.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:Lt.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:Lt.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:Lt.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:Lt.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:Lt.quadrantChart?.pointTextPadding||5,pointLabelFontSize:Lt.quadrantChart?.pointLabelFontSize||12,pointRadius:Lt.quadrantChart?.pointRadius||5,xAxisPosition:Lt.quadrantChart?.xAxisPosition||"top",yAxisPosition:Lt.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:Lt.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:Lt.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:hat.quadrant1Fill,quadrant2Fill:hat.quadrant2Fill,quadrant3Fill:hat.quadrant3Fill,quadrant4Fill:hat.quadrant4Fill,quadrant1TextFill:hat.quadrant1TextFill,quadrant2TextFill:hat.quadrant2TextFill,quadrant3TextFill:hat.quadrant3TextFill,quadrant4TextFill:hat.quadrant4TextFill,quadrantPointFill:hat.quadrantPointFill,quadrantPointTextFill:hat.quadrantPointTextFill,quadrantXAxisTextFill:hat.quadrantXAxisTextFill,quadrantYAxisTextFill:hat.quadrantYAxisTextFill,quadrantTitleFill:hat.quadrantTitleFill,quadrantInternalBorderStrokeFill:hat.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hat.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,y.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){y.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){y.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,e,r,n){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&&r?s:0,right:"right"===this.config.yAxisPosition&&r?s:0},l=this.config.titleFontSize+2*this.config.titlePadding,c={top:n?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,r,n){const{quadrantSpace:i,titleSpace:a}=n,{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&&r&&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&&r&&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:r,quadrantLeft:n,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:n+i,y:a,width:i,height:r,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:n,y:a,width:i,height:r,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:n,y:a+r,width:i,height:r,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:n+i,y:a+r,width:i,height:r,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:r,quadrantLeft:n,quadrantTop:i,quadrantWidth:a}=e,s=ul().domain([0,1]).range([n,a+n]),o=ul().domain([0,1]).range([r+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:r}=t,{quadrantHalfHeight:n,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:s,quadrantTop:o,quadrantWidth:l}=r;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+n,x2:a+l-e,y2:o+n}]}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),r=this.config.showTitle&&!!this.data.titleText,n=this.data.points.length>0?"bottom":this.config.xAxisPosition,i=this.calculateSpace(n,t,e,r);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(n,t,e,i),borderLines:this.getBorders(i),title:this.getTitle(r)}}},dat=class extends Error{static{o(this,"InvalidStyleError")}constructor(t,e,r){super(`value for ${t} ${e} is invalid, please use a valid ${r}`),this.name="InvalidStyleError"}};function pat(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function gat(t){return!/^\d+$/.test(t)}function fat(t){return!/^\d+px$/.test(t)}o(pat,"validateHexCode"),o(gat,"validateNumber"),o(fat,"validateSizeInPixels");var mat=Qr();function yat(t){return hr(t.trim(),mat)}o(yat,"textSanitizer");var vat=new uat;function xat(t){vat.setData({quadrant1Text:yat(t.text)})}function bat(t){vat.setData({quadrant2Text:yat(t.text)})}function wat(t){vat.setData({quadrant3Text:yat(t.text)})}function kat(t){vat.setData({quadrant4Text:yat(t.text)})}function Tat(t){vat.setData({xAxisLeftText:yat(t.text)})}function _at(t){vat.setData({xAxisRightText:yat(t.text)})}function Eat(t){vat.setData({yAxisTopText:yat(t.text)})}function Cat(t){vat.setData({yAxisBottomText:yat(t.text)})}function Sat(t){const e={};for(const r of t){const[t,n]=r.trim().split(/\s*:\s*/);if("radius"===t){if(gat(n))throw new dat(t,n,"number");e.radius=parseInt(n)}else if("color"===t){if(pat(n))throw new dat(t,n,"hex code");e.color=n}else if("stroke-color"===t){if(pat(n))throw new dat(t,n,"hex code");e.strokeColor=n}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(fat(n))throw new dat(t,n,"number of pixels (eg. 10px)");e.strokeWidth=n}}return e}function Aat(t,e,r,n,i){const a=Sat(i);vat.addPoints([{x:r,y:n,text:yat(t.text),className:e,...a}])}function Lat(t,e){vat.addClass(t,Sat(e))}function Nat(t){vat.setConfig({chartWidth:t})}function Iat(t){vat.setConfig({chartHeight:t})}function Rat(){const t=Qr(),{themeVariables:e,quadrantChart:r}=t;return r&&vat.setConfig(r),vat.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}),vat.setData({titleText:Xr()}),vat.build()}o(xat,"setQuadrant1Text"),o(bat,"setQuadrant2Text"),o(wat,"setQuadrant3Text"),o(kat,"setQuadrant4Text"),o(Tat,"setXAxisLeftText"),o(_at,"setXAxisRightText"),o(Eat,"setYAxisTopText"),o(Cat,"setYAxisBottomText"),o(Sat,"parseStyles"),o(Aat,"addPoint"),o(Lat,"addClass"),o(Nat,"setWidth"),o(Iat,"setHeight"),o(Rat,"getQuadrantData");var Mat={setWidth:Nat,setHeight:Iat,setQuadrant1Text:xat,setQuadrant2Text:bat,setQuadrant3Text:wat,setQuadrant4Text:kat,setXAxisLeftText:Tat,setXAxisRightText:_at,setYAxisTopText:Eat,setYAxisBottomText:Cat,parseStyles:Sat,addPoint:Aat,addClass:Lat,getQuadrantData:Rat,clear:o((function(){vat.clear(),qr()}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},Dat=o(((t,e,r,n)=>{function i(t){return"top"===t?"hanging":"middle"}function a(t){return"left"===t?"start":"middle"}function s(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(i,"getDominantBaseLine"),o(a,"getTextAnchor"),o(s,"getTransformation");const l=Qr();y.debug("Rendering quadrant chart\n"+t);const c=l.securityLevel;let h;"sandbox"===c&&(h=Ga("#i"+e));const u=Ga("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;Rr(u,g,p,l.quadrantChart?.useMaxWidth??!0),u.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const f=n.db.getQuadrantData(),m=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",s(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=m.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=>s(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=>s(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=>s(t.text)))}),"draw"),Oat={parser:cat,db:Mat,renderer:{draw:Dat},styles:o((()=>""),"styles")},Pat=Object.freeze({__proto__:null,diagram:Oat}),Bat=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 5:n.setOrientation(a[o]);break;case 9:n.setDiagramTitle(a[o].text.trim());break;case 12:n.setLineData({text:"",type:"text"},a[o]);break;case 13:n.setLineData(a[o-1],a[o]);break;case 14:n.setBarData({text:"",type:"text"},a[o]);break;case 15:n.setBarData(a[o-1],a[o]);break;case 16:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 17:case 18:this.$=a[o].trim(),n.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:n.setXAxisTitle(a[o]);break;case 23:n.setXAxisTitle(a[o-1]);break;case 24:n.setXAxisTitle({type:"text",text:""});break;case 25:n.setXAxisBand(a[o]);break;case 26:n.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:n.setYAxisTitle(a[o]);break;case 31:n.setYAxisTitle(a[o-1]);break;case 32:n.setYAxisTitle({type:"text",text:""});break;case 33:n.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,r,{3:1,4:2,7:4,5:n,34:i,35:a,36:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,34:i,35:a,36:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],34:i,35:a,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(l,[2,34]),t(l,[2,35]),t(l,[2,36]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,34:i,35:a,36:s}),{1:[2,3]},t(l,[2,5]),t(e,[2,7],{4:22,34:i,35:a,36:s}),{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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},N=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/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,o(I,"Parser"),I.prototype=L,L.Parser=I,new I}();Bat.parser=Bat;var $at=Bat;function Fat(t){return"bar"===t.type}function zat(t){return"band"===t.type}function Uat(t){return"linear"===t.type}o(Fat,"isBarPlot"),o(zat,"isBandAxisData"),o(Uat,"isLinearAxisData");var Gat=class{constructor(t){this.parentGroup=t}static{o(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce(((t,e)=>Math.max(e.length,t)),0)*e,height:e};const r={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const i of t){const t=g_(n,1,i),a=t?t.width:i.length*e,s=t?t.height:e;r.width=Math.max(r.width,a),r.height=Math.max(r.height,s)}return n.remove(),r}},qat=class{constructor(t,e,r,n){this.axisConfig=t,this.title=e,this.textDimensionCalculator=r,this.axisThemeConfig=n,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{o(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 r=this.getLabelDimension(),n=.2*t.width;this.outerPadding=Math.min(r.width/2,n);const i=r.height+2*this.axisConfig.labelPadding;this.labelTextHeight=r.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),r=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,r<=e&&(e-=r,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 r=this.getLabelDimension(),n=.2*t.height;this.outerPadding=Math.min(r.height/2,n);const i=r.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),r=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,r<=e&&(e-=r,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():[]}},jat=class extends qat{static{o(this,"BandAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.categories=r,this.scale=Lh().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Lh().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),y.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Wat=class extends qat{static{o(this,"LinearAxis")}constructor(t,e,r,n,i){super(t,n,i,e),this.domain=r,this.scale=ul().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=ul().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function Yat(t,e,r,n){const i=new Gat(n);return zat(t)?new jat(e,r,t.categories,t.title,i):new Wat(e,r,[t.min,t.max],t.title,i)}o(Yat,"getAxis");var Hat=class{constructor(t,e,r,n){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{o(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),r=Math.max(e.width,t.width),n=e.height+2*this.chartConfig.titlePadding;return e.width<=r&&e.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=r,this.boundingRect.height=n,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 Vat(t,e,r,n){const i=new Gat(n);return new Hat(i,t,e,r)}o(Vat,"getChartTitleComponent");var Xat=class{constructor(t,e,r,n,i){this.plotData=t,this.xAxis=e,this.yAxis=r,this.orientation=n,this.plotIndex=i}static{o(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?gu().y((t=>t[0])).x((t=>t[1]))(t):gu().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}]}]:[]}},Kat=class{constructor(t,e,r,n,i,a){this.barData=t,this.boundingRect=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}static{o(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()),r=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]-r,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]-r,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}},Zat=class{constructor(t,e,r){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0}}static{o(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,r]of this.chartData.plots.entries())switch(r.type){case"line":{const n=new Xat(r,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}break;case"bar":{const n=new Kat(r,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...n.getDrawableElement())}}return t}};function Qat(t,e,r){return new Zat(t,e,r)}o(Qat,"getPlotComponent");var Jat,tst=class{constructor(t,e,r,n){this.chartConfig=t,this.chartData=e,this.componentStore={title:Vat(t,e,r,n),plot:Qat(t,e,r),xAxis:Yat(e.xAxis,t.xAxis,{titleColor:r.xAxisTitleColor,labelColor:r.xAxisLabelColor,tickColor:r.xAxisTickColor,axisLineColor:r.xAxisLineColor},n),yAxis:Yat(e.yAxis,t.yAxis,{titleColor:r.yAxisTitleColor,labelColor:r.yAxisLabelColor,tickColor:r.yAxisTickColor,axisLineColor:r.yAxisLineColor},n)}}static{o(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=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}),n=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}),r=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:r,y:n}),this.componentStore.xAxis.setRange([r,r+i]),this.componentStore.xAxis.setBoundingBoxXY({x:r,y:n+a}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((t=>Fat(t)))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,r=0,n=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}),r=o.height,e-=o.height,this.componentStore.xAxis.setAxisPosition("left"),o=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=o.width,n=o.width,this.componentStore.yAxis.setAxisPosition("top"),o=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=o.height,i=r+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:n,y:i}),this.componentStore.yAxis.setRange([n,n+a]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some((t=>Fat(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}},est=class{static{o(this,"XYChartBuilder")}static build(t,e,r,n){return new tst(t,e,r,n).getDrawableElement()}},rst=0,nst=hst(),ist=cst(),ast=ust(),sst=ist.plotColorPalette.split(",").map((t=>t.trim())),ost=!1,lst=!1;function cst(){const t=bt(),e=Gt();return Ok(t.xyChart,e.themeVariables.xyChart)}function hst(){const t=Gt();return Ok(Lt.xyChart,t.xyChart)}function ust(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function dst(t){const e=Gt();return hr(t.trim(),e)}function pst(t){Jat=t}function gst(t){nst.chartOrientation="horizontal"===t?"horizontal":"vertical"}function fst(t){ast.xAxis.title=dst(t.text)}function mst(t,e){ast.xAxis={type:"linear",title:ast.xAxis.title,min:t,max:e},ost=!0}function yst(t){ast.xAxis={type:"band",title:ast.xAxis.title,categories:t.map((t=>dst(t.text)))},ost=!0}function vst(t){ast.yAxis.title=dst(t.text)}function xst(t,e){ast.yAxis={type:"linear",title:ast.yAxis.title,min:t,max:e},lst=!0}function bst(t){const e=Math.min(...t),r=Math.max(...t),n=Uat(ast.yAxis)?ast.yAxis.min:1/0,i=Uat(ast.yAxis)?ast.yAxis.max:-1/0;ast.yAxis={type:"linear",title:ast.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}function wst(t){let e=[];if(0===t.length)return e;if(!ost){const e=Uat(ast.xAxis)?ast.xAxis.min:1/0,r=Uat(ast.xAxis)?ast.xAxis.max:-1/0;mst(Math.min(e,1),Math.max(r,t.length))}if(lst||bst(t),zat(ast.xAxis)&&(e=ast.xAxis.categories.map(((e,r)=>[e,t[r]]))),Uat(ast.xAxis)){const r=ast.xAxis.min,n=ast.xAxis.max,i=(n-r)/(t.length-1),a=[];for(let t=r;t<=n;t+=i)a.push(`${t}`);e=a.map(((e,r)=>[e,t[r]]))}return e}function kst(t){return sst[0===t?0:t%sst.length]}function Tst(t,e){const r=wst(e);ast.plots.push({type:"line",strokeFill:kst(rst),strokeWidth:2,data:r}),rst++}function _st(t,e){const r=wst(e);ast.plots.push({type:"bar",fill:kst(rst),data:r}),rst++}function Est(){if(0===ast.plots.length)throw Error("No Plot to render, please provide a plot with some data");return ast.title=Xr(),est.build(nst,ast,ist,Jat)}function Cst(){return ist}function Sst(){return nst}o(cst,"getChartDefaultThemeConfig"),o(hst,"getChartDefaultConfig"),o(ust,"getChartDefaultData"),o(dst,"textSanitizer"),o(pst,"setTmpSVGG"),o(gst,"setOrientation"),o(fst,"setXAxisTitle"),o(mst,"setXAxisRangeData"),o(yst,"setXAxisBand"),o(vst,"setYAxisTitle"),o(xst,"setYAxisRangeData"),o(bst,"setYAxisRangeFromPlotData"),o(wst,"transformDataWithoutCategory"),o(kst,"getPlotColorFromPalette"),o(Tst,"setLineData"),o(_st,"setBarData"),o(Est,"getDrawableElem"),o(Cst,"getChartThemeConfig"),o(Sst,"getChartConfig");var Ast=o((function(){qr(),rst=0,nst=hst(),ast={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},ist=cst(),sst=ist.plotColorPalette.split(",").map((t=>t.trim())),ost=!1,lst=!1}),"clear"),Lst={getDrawableElem:Est,clear:Ast,setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr,setOrientation:gst,setXAxisTitle:fst,setXAxisRangeData:mst,setXAxisBand:yst,setYAxisTitle:vst,setYAxisRangeData:xst,setLineData:Tst,setBarData:_st,setTmpSVGG:pst,getChartThemeConfig:Cst,getChartConfig:Sst},Nst=o(((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=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})`}o(l,"getDominantBaseLine"),o(c,"getTextAnchor"),o(h,"getTextTransformation"),y.debug("Rendering xychart chart\n"+t);const u=ag(e),d=u.append("g").attr("class","main"),p=d.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Rr(u,s.height,s.width,!0),u.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),f={};function m(t){let e=d,r="";for(const[n]of t.entries()){let i=d;n>0&&f[r]&&(i=f[r]),r+=t[n],e=f[r],e||(e=f[r]=i.append("g").attr("class",t[n]))}return e}o(m,"getGroup");for(const t of g){if(0===t.data.length)continue;const e=m(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"),Ist={parser:$at,db:Lst,renderer:{draw:Nst}},Rst=Object.freeze({__proto__:null,diagram:Ist}),Mst=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],l=[2,7],c=[1,26],h=[1,27],u=[1,28],d=[1,29],p=[1,33],g=[1,34],f=[1,35],m=[1,36],y=[1,37],v=[1,38],x=[1,24],b=[1,31],w=[1,32],k=[1,30],T=[1,39],_=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],C=[1,61],S=[89,90],A=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],L=[27,29],N=[1,70],I=[1,71],R=[1,72],M=[1,73],D=[1,74],O=[1,75],P=[1,76],B=[1,83],$=[1,80],F=[1,84],z=[1,85],U=[1,86],G=[1,87],q=[1,88],j=[1,89],W=[1,90],Y=[1,91],H=[1,92],V=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],X=[63,64],K=[1,101],Z=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Q=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],J=[1,110],tt=[1,106],et=[1,107],rt=[1,108],nt=[1,109],it=[1,111],at=[1,116],st=[1,117],ot=[1,114],lt=[1,115],ct={trace:o((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 4:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:n.setDirection("TB");break;case 18:n.setDirection("BT");break;case 19:n.setDirection("RL");break;case 20:n.setDirection("LR");break;case 21:n.addRequirement(a[o-3],a[o-4]);break;case 22:n.addRequirement(a[o-5],a[o-6]),n.setClass([a[o-5]],a[o-3]);break;case 23:n.setNewReqId(a[o-2]);break;case 24:n.setNewReqText(a[o-2]);break;case 25:n.setNewReqRisk(a[o-2]);break;case 26:n.setNewReqVerifyMethod(a[o-2]);break;case 29:this.$=n.RequirementType.REQUIREMENT;break;case 30:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=n.RiskLevel.LOW_RISK;break;case 36:this.$=n.RiskLevel.MED_RISK;break;case 37:this.$=n.RiskLevel.HIGH_RISK;break;case 38:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=n.VerifyType.VERIFY_TEST;break;case 42:n.addElement(a[o-3]);break;case 43:n.addElement(a[o-5]),n.setClass([a[o-5]],a[o-3]);break;case 44:n.setNewElementType(a[o-2]);break;case 45:n.setNewElementDocRef(a[o-2]);break;case 48:n.addRelationship(a[o-2],a[o],a[o-4]);break;case 49:n.addRelationship(a[o-2],a[o-4],a[o]);break;case 50:this.$=n.Relationships.CONTAINS;break;case 51:this.$=n.Relationships.COPIES;break;case 52:this.$=n.Relationships.DERIVES;break;case 53:this.$=n.Relationships.SATISFIES;break;case 54:this.$=n.Relationships.VERIFIES;break;case 55:this.$=n.Relationships.REFINES;break;case 56:this.$=n.Relationships.TRACES;break;case 57:this.$=a[o-2],n.defineClass(a[o-1],a[o]);break;case 58:n.setClass(a[o-1],a[o]);break;case 59:n.setClass([a[o-2]],a[o]);break;case 60:case 62:case 65:this.$=[a[o]];break;case 61:case 63:this.$=a[o-2].concat([a[o]]);break;case 64:this.$=a[o-2],n.setCssStyle(a[o-1],a[o]);break;case 66:a[o-2].push(a[o]),this.$=a[o-2];break;case 68:this.$=a[o-1]+a[o]}}),"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:43,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:44,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:45,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:46,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:47,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:48,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:49,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{4:17,5:s,7:50,8:l,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:c,22:h,23:u,24:d,25:23,33:25,41:p,42:g,43:f,44:m,45:y,46:v,54:x,72:b,74:w,77:k,89:T,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:C,89:T,90:_},{30:63,33:62,75:C,89:T,90:_},{30:64,33:62,75:C,89:T,90:_},t(S,[2,29]),t(S,[2,30]),t(S,[2,31]),t(S,[2,32]),t(S,[2,33]),t(S,[2,34]),t(A,[2,81]),t(A,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(L,[2,79]),t(L,[2,80]),{27:[1,67],29:[1,68]},t(L,[2,85]),t(L,[2,86]),{62:69,65:N,66:I,67:R,68:M,69:D,70:O,71:P},{62:77,65:N,66:I,67:R,68:M,69:D,70:O,71:P},{30:78,33:62,75:C,89:T,90:_},{73:79,75:B,76:$,78:81,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},t(V,[2,60]),t(V,[2,62]),{73:93,75:B,76:$,78:81,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},{30:94,33:62,75:C,76:$,89:T,90:_},{5:[1,95]},{30:96,33:62,75:C,89:T,90:_},{5:[1,97]},{30:98,33:62,75:C,89:T,90:_},{63:[1,99]},t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),{64:[1,100]},t(E,[2,59],{76:$}),t(E,[2,64],{76:K}),{33:103,75:[1,102],89:T,90:_},t(Z,[2,65],{79:104,75:B,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H}),t(Q,[2,67]),t(Q,[2,69]),t(Q,[2,70]),t(Q,[2,71]),t(Q,[2,72]),t(Q,[2,73]),t(Q,[2,74]),t(Q,[2,75]),t(Q,[2,76]),t(Q,[2,77]),t(Q,[2,78]),t(E,[2,57],{76:K}),t(E,[2,58],{76:$}),{5:J,28:105,31:tt,34:et,36:rt,38:nt,40:it},{27:[1,112],76:$},{5:at,40:st,56:113,57:ot,59:lt},{27:[1,118],76:$},{33:119,89:T,90:_},{33:120,89:T,90:_},{75:B,78:121,79:82,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H},t(V,[2,61]),t(V,[2,63]),t(Q,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:J,28:126,31:tt,34:et,36:rt,38:nt,40:it},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:at,40:st,56:130,57:ot,59:lt},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(Z,[2,66],{79:104,75:B,80:F,81:z,82:U,83:G,84:q,85:j,86:W,87:Y,88:H}),{33:132,89:T,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:J,28:145,31:tt,34:et,36:rt,38:nt,40:it},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:at,40:st,56:152,57:ot,59:lt},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:J,28:159,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:160,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:161,31:tt,34:et,36:rt,38:nt,40:it},{5:J,28:162,31:tt,34:et,36:rt,38:nt,40:it},{5:at,40:st,56:163,57:ot,59:lt},{5:at,40:st,56:164,57:ot,59:lt},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},ht=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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 58:case 65:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:case 14:case 15:case 56:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 66:return"qString";case 67:return e.yytext=e.yytext.trim(),89;case 69:return 80;case 70:return 76}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return t}();function ut(){this.yy={}}return ct.lexer=ht,o(ut,"Parser"),ut.prototype=ct,ct.Parser=ut,new ut}();Mst.parser=Mst;var Dst=Mst,Ost=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().requirement),"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{o(this,"RequirementDB")}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=t)}setNewReqText(t){void 0!==this.latestRequirement&&(this.latestRequirement.text=t)}setNewReqRisk(t){void 0!==this.latestRequirement&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),y.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){void 0!==this.latestElement&&(this.latestElement.type=t)}setNewElementDocRef(t){void 0!==this.latestElement&&(this.latestElement.docRef=t)}addRelationship(t,e,r){this.relations.push({type:t,src:e,dst:r})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,qr()}setCssStyle(t,e){for(const r of t){const t=this.requirements.get(r)??this.elements.get(r);if(!e||!t)return;for(const r of e)r.includes(",")?t.cssStyles.push(...r.split(",")):t.cssStyles.push(r)}}setClass(t,e){for(const r of t){const t=this.requirements.get(r)??this.elements.get(r);if(t)for(const r of e){t.classes.push(r);const e=this.classes.get(r)?.styles;e&&t.cssStyles.push(...e)}}}defineClass(t,e){for(const r of t){let t=this.classes.get(r);void 0===t&&(t={id:r,styles:[],textStyles:[]},this.classes.set(r,t)),e&&e.forEach((function(e){if(/color/.exec(e)){const r=e.replace("fill","bgFill");t.textStyles.push(r)}t.styles.push(e)})),this.requirements.forEach((t=>{t.classes.includes(r)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))})),this.elements.forEach((t=>{t.classes.includes(r)&&t.cssStyles.push(...e.flatMap((t=>t.split(","))))}))}}getClasses(){return this.classes}getData(){const t=Qr(),e=[],r=[];for(const r of this.requirements.values()){const n=r;n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),n.shape="requirementBox",n.look=t.look,e.push(n)}for(const r of this.elements.values()){const n=r;n.shape="requirementBox",n.look=t.look,n.id=r.name,n.cssStyles=r.cssStyles,n.cssClasses=r.classes.join(" "),e.push(n)}for(const e of this.relations){let n=0;const i=e.type===this.Relationships.CONTAINS,a={id:`${e.src}-${e.dst}-${n}`,start:this.requirements.get(e.src)?.name??this.elements.get(e.src)?.name,end:this.requirements.get(e.dst)?.name??this.elements.get(e.dst)?.name,label:`&lt;&lt;${e.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",i?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:i?"normal":"dashed",arrowTypeStart:i?"requirement_contains":"",arrowTypeEnd:i?"":"requirement_arrow",look:t.look};r.push(a),n++}return{nodes:e,edges:r,other:{},config:t,direction:this.getDirection()}}},Pst=o((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 .divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n`),"getStyles"),Bst={};h(Bst,{draw:()=>$st});var $st=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.nodeSpacing=a?.nodeSpacing??50,o.rankSpacing=a?.rankSpacing??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"requirementDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"requirementDiagram",a?.useMaxWidth??!0)}),"draw"),Fst={parser:Dst,get db(){return new Ost},renderer:Bst,styles:Pst},zst=Object.freeze({__proto__:null,diagram:Fst}),Ust=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[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],R=[1,44],M=[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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:return n.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:n.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:n.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(a[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:n.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:n.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:n.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:n.LINETYPE.ACTIVE_START,actor:a[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:n.LINETYPE.ACTIVE_END,actor:a[o-1].actor};break;case 29:n.setDiagramTitle(a[o].substring(6)),this.$=a[o].substring(6);break;case 30:n.setDiagramTitle(a[o].substring(7)),this.$=a[o].substring(7);break;case 31:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 32:case 33:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 34:a[o-1].unshift({type:"loopStart",loopText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:n.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 35:a[o-1].unshift({type:"rectStart",color:n.parseMessage(a[o-2]),signalType:n.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:n.parseMessage(a[o-2]),signalType:n.LINETYPE.RECT_END}),this.$=a[o-1];break;case 36:a[o-1].unshift({type:"optStart",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.OPT_END}),this.$=a[o-1];break;case 37:a[o-1].unshift({type:"altStart",altText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:n.LINETYPE.ALT_END}),this.$=a[o-1];break;case 38:a[o-1].unshift({type:"parStart",parText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:n.LINETYPE.PAR_END}),this.$=a[o-1];break;case 39:a[o-1].unshift({type:"parStart",parText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.PAR_OVER_START}),a[o-1].push({type:"parEnd",signalType:n.LINETYPE.PAR_END}),this.$=a[o-1];break;case 40:a[o-1].unshift({type:"criticalStart",criticalText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.CRITICAL_START}),a[o-1].push({type:"criticalEnd",signalType:n.LINETYPE.CRITICAL_END}),this.$=a[o-1];break;case 41:a[o-1].unshift({type:"breakStart",breakText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.BREAK_START}),a[o-1].push({type:"breakEnd",optText:n.parseMessage(a[o-2]),signalType:n.LINETYPE.BREAK_END}),this.$=a[o-1];break;case 43:this.$=a[o-3].concat([{type:"option",optionText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.CRITICAL_OPTION},a[o]]);break;case 45:this.$=a[o-3].concat([{type:"and",parText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.PAR_AND},a[o]]);break;case 47:this.$=a[o-3].concat([{type:"else",altText:n.parseMessage(a[o-1]),signalType:n.LINETYPE.ALT_ELSE},a[o]]);break;case 48:a[o-3].draw="participant",a[o-3].type="addParticipant",a[o-3].description=n.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=n.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:n.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.$=n.PLACEMENT.LEFTOF;break;case 64:this.$=n.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:n.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:n.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.$=n.LINETYPE.SOLID_OPEN;break;case 70:this.$=n.LINETYPE.DOTTED_OPEN;break;case 71:this.$=n.LINETYPE.SOLID;break;case 72:this.$=n.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=n.LINETYPE.DOTTED;break;case 74:this.$=n.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=n.LINETYPE.SOLID_CROSS;break;case 76:this.$=n.LINETYPE.DOTTED_CROSS;break;case 77:this.$=n.LINETYPE.SOLID_POINT;break;case 78:this.$=n.LINETYPE.DOTTED_POINT;break;case 79:this.$=n.parseMessage(a[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,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:s,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:R,62:M,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:R,62:M,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:s,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:R,62:M,70:D},{4:a,5:s,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:R,62:M,70:D},{4:a,5:s,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:R,62:M,70:D},{16:[1,135]},{4:a,5:s,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:R,62:M,70:D},{16:[1,137]},{4:a,5:s,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:R,62:M,70:D},{16:[1,139]},{16:[1,140]},{4:a,5:s,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:R,62:M,70:D},{4:a,5:s,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:R,62:M,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},j=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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 W(){this.yy={}}return q.lexer=j,o(W,"Parser"),W.prototype=q,q.Parser=W,new W}();Ust.parser=Ust;var Gst=Ust,qst={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},jst={FILLED:0,OPEN:1},Wst={LEFTOF:0,RIGHTOF:1,OVER:2},Yst=class{constructor(){this.state=new NX((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}))),this.setAccTitle=jr,this.setAccDescription=Yr,this.setDiagramTitle=Vr,this.getAccTitle=Wr,this.getAccDescription=Hr,this.getDiagramTitle=Xr,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Qr().wrap),this.LINETYPE=qst,this.ARROWTYPE=jst,this.PLACEMENT=Wst}static{o(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,r,n){let i=this.state.records.currentBox;const a=this.state.records.actors.get(t);if(a){if(this.state.records.currentBox&&a.box&&this.state.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 '${this.state.records.currentBox.name}' at the same time.`);if(i=a.box?a.box:this.state.records.currentBox,a.box=i,a&&e===a.name&&null==r)return}if(null==r?.text&&(r={text:e,type:n}),null!=n&&null!=r.text||(r={text:e,type:n}),this.state.records.actors.set(t,{box:i,name:e,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,r=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&r++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&r--;return r}addMessage(t,e,r,n){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:r.text,wrap:r.wrap??this.autoWrap(),answer:n})}addSignal(t,e,r,n,i=!1){if(n===this.LINETYPE.ACTIVE_END){if(this.activationCount(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(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}}autoWrap(){return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:Qr().sequence?.wrap??!1}clear(){this.state.reset(),qr()}parseMessage(t){const e=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(e),i={text:n,wrap:r};return y.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=e?.[1]?e[1].trim():"transparent",n=e?.[2]?e[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{const e=(new Option).style;e.color=r,e.color!==r&&(r="transparent",n=t.trim())}const{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?hr(a,Qr()):void 0,color:r,wrap:i}}addNote(t,e,r){const n={actor:t,placement:e,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const r=this.getActor(t);try{let t=hr(e.text,Qr());t=t.replace(/&equals;/g,"="),t=t.replace(/&amp;/g,"&");const n=JSON.parse(t);this.insertLinks(r,n)}catch(t){y.error("error while parsing actor link text",t)}}addALink(t,e){const r=this.getActor(t);try{const t={};let n=hr(e.text,Qr());const i=n.indexOf("@");n=n.replace(/&equals;/g,"="),n=n.replace(/&amp;/g,"&");const a=n.slice(0,i-1).trim(),s=n.slice(i+1).trim();t[a]=s,this.insertLinks(r,t)}catch(t){y.error("error while parsing actor link text",t)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const r in e)t.links[r]=e[r]}addProperties(t,e){const r=this.getActor(t);try{const t=hr(e.text,Qr()),n=JSON.parse(t);this.insertProperties(r,n)}catch(t){y.error("error while parsing actor properties text",t)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const r in e)t.properties[r]=e[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const r=this.getActor(t),n=document.getElementById(e.text);try{const t=n.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(r,e.properties),e.links&&this.insertLinks(r,e.links)}catch(t){y.error("error while parsing actor details text",t)}}getActorProperty(t,e){if(void 0!==t?.properties)return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach((t=>{this.apply(t)}));else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(this.state.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");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":jr(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return Qr().sequence}},Hst=o((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"),Vst=p(Wy(),1),Xst="actor-man",Kst=o((function(t,e){return SH(t,e)}),"drawRect"),Zst=o((function(t,e,r,n,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>r?o.width:r;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,Vst.sanitizeUrl)(a[t]);g.attr("xlink:href",f),g.attr("target","_blank"),kot(n)(t,g,o.x+10,o.height+p,u,20,{class:"actor"},n),p+=30}}return d.attr("height",p),{height:o.height+p,width:u}}),"drawPopup"),Qst=o((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),Jst=o((async function(t,e,r=null){let n=t.append("foreignObject");const i=await Ar(e.text,Gt()),a=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),"noteText"===e.class){const r=t.node().firstChild;r.setAttribute("height",a.height+2*e.textMargin);const i=r.getBBox();n.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(r){let{startx:t,stopx:i,starty:s}=r;if(t>i){const e=t;t=i,i=e}n.attr("x",Math.round(t+Math.abs(t-i)/2-a.width/2)),"loopText"===e.class?n.attr("y",Math.round(s)):n.attr("y",Math.round(s-a.height))}return[n]}),"drawKatex"),tot=o((function(t,e){let r=0,n=0;const i=e.text.split(Lr.lineBreakRegex),[a,s]=Dk(e.fontSize);let l=[],c=0,h=o((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":h=o((()=>Math.round(e.y+(r+n+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":h=o((()=>Math.round(e.y+(r+n+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[o,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(c=o*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!==s&&i.style("font-size",s),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&&(n+=(i._groups||i)[0][0].getBBox().height,r=n),l.push(i)}return l}),"drawText"),eot=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,tot(t,e),n}),"drawLabel"),rot=-1,not=o(((t,e,r,n)=>{t.select&&r.forEach((r=>{const i=e.get(r),a=t.select("#actor"+i.actorCnt);!n.mirrorActors&&i.stopy?a.attr("y2",i.stopy+i.height/2):n.mirrorActors&&a.attr("y2",i.stopy)}))}),"fixLifeLineHeights"),iot=o((function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+e.height,o=t.append("g").lower();var l=o;n||(rot++,Object.keys(e.links||{}).length&&!r.forceMenus&&l.attr("onclick",Qst(`actor${rot}_popup`)).attr("cursor","pointer"),l.append("line").attr("id","actor"+rot).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=rot,null!=e.links&&l.attr("id","root-"+rot));const c=RH();var h="actor";e.properties?.class?h=e.properties.class:c.fill="#eaeaea",h+=n?" 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=Kst(l,c);if(e.rectData=c,e.properties?.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?IH(l,c.x+c.width-20,c.y+10,t.substr(1)):NH(l,c.x+c.width-20,c.y+10,t)}wot(r,Cr(e.description))(e.description,l,c.x,c.y,c.width,c.height,{class:"actor actor-box"},r);let d=e.height;if(u.node){const t=u.node().getBBox();e.height=t.height,d=t.height}return d}),"drawActorTypeParticipant"),aot=o((function(t,e,r,n){const i=n?e.stopy:e.starty,a=e.x+e.width/2,s=i+80,o=t.append("g").lower();n||(rot++,o.append("line").attr("id","actor"+rot).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=rot);const l=t.append("g");let c=Xst;c+=n?" actor-bottom":" actor-top",l.attr("class",c),l.attr("name",e.name);const h=RH();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"+rot).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+rot).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,wot(r,Cr(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:"actor actor-man"},r),e.height}),"drawActorTypeActor"),sot=o((async function(t,e,r,n){switch(e.type){case"actor":return await aot(t,e,r,n);case"participant":return await iot(t,e,r,n)}}),"drawActor"),oot=o((function(t,e,r){const n=t.append("g");uot(n,e),e.name&&wot(r)(e.name,n,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),n.lower()}),"drawBox"),lot=o((function(t){return t.append("g")}),"anchorElement"),cot=o((function(t,e,r,n,i){const a=RH(),s=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,Kst(s,a)}),"drawActivation"),hot=o((async function(t,e,r,n){const{boxMargin:i,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:c,messageFontSize:h,messageFontWeight:u}=n,d=t.append("g"),p=o((function(t,e,r,n){return d.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).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=MH();g.text=r,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=s||20,g.textMargin=a,g.class="labelText",eot(d,g),g=xot(),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=Cr(g.text)?await Jst(d,g,e):tot(d,g);if(void 0!==e.sectionTitles)for(const[t,r]of Object.entries(e.sectionTitles))if(r.message){g.text=r.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,Cr(g.text)?(e.starty=e.sections[t].y,await Jst(d,g,e)):tot(d,g);let n=Math.round(f.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=n-(i+a)}return e.height=Math.round(e.stopy-e.starty),d}),"drawLoop"),uot=o((function(t,e){AH(t,e)}),"drawBackgroundRect"),dot=o((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"),pot=o((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"),got=o((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"),fot=o((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"),mot=o((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"),yot=o((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"),vot=o((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"),xot=o((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"),bot=o((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),wot=function(){function t(t,e,r,n,a,s,o){i(e.append("text").attr("x",r+a/2).attr("y",n+s/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,r,n,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,[d,p]=Dk(c),g=t.split(Lr.lineBreakRegex);for(let t=0;t<g.length;t++){const l=t*d-d*(g.length-1)/2,c=e.append("text").attr("x",r+a/2).attr("y",n).style("text-anchor","middle").style("font-size",p).style("font-weight",u).style("font-family",h);c.append("tspan").attr("x",r+a/2).attr("dy",l).text(g[t]),c.attr("y",n+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function r(t,r,n,a,s,o,l,c){const h=r.append("switch"),u=h.append("foreignObject").attr("x",n).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,n,a,s,o,l,c),i(u,l)}async function n(t,r,n,a,s,o,l,c){const h=await Sr(t,Gt()),u=r.append("switch"),d=u.append("foreignObject").attr("x",n+s/2-h.width/2).attr("y",a+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");d.append("div").style("text-align","center").style("vertical-align","middle").html(await Ar(t,Gt())),e(t,u,n,a,s,o,l,c),i(d,l)}function i(t,e){for(const r in e)e.hasOwnProperty(r)&&t.attr(r,e[r])}return o(t,"byText"),o(e,"byTspan"),o(r,"byFo"),o(n,"byKatex"),o(i,"_setTextAttrs"),function(i,a=!1){return a?n:"fo"===i.textPlacement?r:"old"===i.textPlacement?t:e}}(),kot=function(){function t(t,e,r,i,a,s,o){n(e.append("text").attr("x",r).attr("y",i).style("text-anchor","start").text(t),o)}function e(t,e,r,i,a,s,o,l){const{actorFontSize:c,actorFontFamily:h,actorFontWeight:u}=l,d=t.split(Lr.lineBreakRegex);for(let t=0;t<d.length;t++){const a=t*c-c*(d.length-1)/2,l=e.append("text").attr("x",r).attr("y",i).style("text-anchor","start").style("font-size",c).style("font-weight",u).style("font-family",h);l.append("tspan").attr("x",r).attr("dy",a).text(d[t]),l.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(l,o)}}function r(t,r,i,a,s,o,l,c){const h=r.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,0,o,l,c),n(u,l)}function n(t,e){for(const r in e)e.hasOwnProperty(r)&&t.attr(r,e[r])}return o(t,"byText"),o(e,"byTspan"),o(r,"byFo"),o(n,"_setTextAttrs"),function(n){return"fo"===n.textPlacement?r:"old"===n.textPlacement?t:e}}(),Tot={drawRect:Kst,drawText:tot,drawLabel:eot,drawActor:sot,drawBox:oot,drawPopup:Zst,anchorElement:lot,drawActivation:cot,drawLoop:hot,drawBackgroundRect:uot,insertArrowHead:fot,insertArrowFilledHead:mot,insertSequenceNumber:yot,insertArrowCrossHead:vot,insertDatabaseIcon:dot,insertComputerIcon:pot,insertClockIcon:got,getTextObj:xot,getNoteRect:bot,fixLifeLineHeights:not,sanitizeUrl:Vst.sanitizeUrl},_ot={},Eot={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o((function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.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:o((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:o((function(t){this.boxes.push(t)}),"addBox"),addActor:o((function(t){this.actors.push(t)}),"addActor"),addLoop:o((function(t){this.loops.push(t)}),"addLoop"),addMessage:o((function(t){this.messages.push(t)}),"addMessage"),addNote:o((function(t){this.notes.push(t)}),"addNote"),lastActor:o((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:o((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:o((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:o((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o((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,Oot(Qr())}),"init"),updateVal:o((function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])}),"updateVal"),updateBounds:o((function(t,e,r,n){const i=this;let a=0;function s(s){return o((function(o){a++;const l=i.sequenceItems.length-a+1;i.updateVal(o,"starty",e-l*_ot.boxMargin,Math.min),i.updateVal(o,"stopy",n+l*_ot.boxMargin,Math.max),i.updateVal(Eot.data,"startx",t-l*_ot.boxMargin,Math.min),i.updateVal(Eot.data,"stopx",r+l*_ot.boxMargin,Math.max),"activation"!==s&&(i.updateVal(o,"startx",t-l*_ot.boxMargin,Math.min),i.updateVal(o,"stopx",r+l*_ot.boxMargin,Math.max),i.updateVal(Eot.data,"starty",e-l*_ot.boxMargin,Math.min),i.updateVal(Eot.data,"stopy",n+l*_ot.boxMargin,Math.max))}),"updateItemBounds")}o(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))}),"updateBounds"),insert:o((function(t,e,r,n){const i=Lr.getMin(t,r),a=Lr.getMax(t,r),s=Lr.getMin(e,n),o=Lr.getMax(e,n);this.updateVal(Eot.data,"startx",i,Math.min),this.updateVal(Eot.data,"starty",s,Math.min),this.updateVal(Eot.data,"stopx",a,Math.max),this.updateVal(Eot.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),newActivation:o((function(t,e,r){const n=r.get(t.from),i=Pot(t.from).length||0,a=n.x+n.width/2+(i-1)*_ot.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+_ot.activationWidth,stopy:void 0,actor:t.from,anchored:Tot.anchorElement(e)})}),"newActivation"),endActivation:o((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:o((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:o((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:o((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:o((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:o((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Eot.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:o((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:o((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:o((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Lr.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:o((function(){return this.verticalPos}),"getVerticalPos"),getBounds:o((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Cot=o((async function(t,e){Eot.bumpVerticalPos(_ot.boxMargin),e.height=_ot.boxMargin,e.starty=Eot.getVerticalPos();const r=RH();r.x=e.startx,r.y=e.starty,r.width=e.width||_ot.width,r.class="note";const n=t.append("g"),i=Tot.drawRect(n,r),a=MH();a.x=e.startx,a.y=e.starty,a.width=r.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=_ot.noteFontFamily,a.fontSize=_ot.noteFontSize,a.fontWeight=_ot.noteFontWeight,a.anchor=_ot.noteAlign,a.textMargin=_ot.noteMargin,a.valign="center";const s=Cr(a.text)?await Jst(n,a):tot(n,a),o=Math.round(s.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",o+2*_ot.noteMargin),e.height+=o+2*_ot.noteMargin,Eot.bumpVerticalPos(o+2*_ot.noteMargin),e.stopy=e.starty+o+2*_ot.noteMargin,e.stopx=e.startx+r.width,Eot.insert(e.startx,e.starty,e.stopx,e.stopy),Eot.models.addNote(e)}),"drawNote"),Sot=o((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),Aot=o((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),Lot=o((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Not(t,e){Eot.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Lr.splitBreaks(i).length,s=Cr(i),o=s?await Sr(i,Qr()):Pk.calculateTextDimensions(i,Sot(_ot));if(!s){const t=o.height/a;e.height+=t,Eot.bumpVerticalPos(t)}let l,c=o.height-10;const h=o.width;if(r===n){l=Eot.getVerticalPos()+c,_ot.rightAngles||(c+=_ot.boxMargin,l=Eot.getVerticalPos()+c),c+=30;const t=Lr.getMax(h/2,_ot.width/2);Eot.insert(r-t,Eot.getVerticalPos()-10+c,n+t,Eot.getVerticalPos()+30+c)}else c+=_ot.boxMargin,l=Eot.getVerticalPos()+c,Eot.insert(r,l-10,n,l);return Eot.bumpVerticalPos(c),e.height+=c,e.stopy=e.starty+e.height,Eot.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}o(Not,"boundMessage");var Iot=o((async function(t,e,r,n){const{startx:i,stopx:a,starty:s,message:o,type:l,sequenceIndex:c,sequenceVisible:h}=e,u=Pk.calculateTextDimensions(o,Sot(_ot)),d=MH();d.x=i,d.y=s+10,d.width=a-i,d.class="messageText",d.dy="1em",d.text=o,d.fontFamily=_ot.messageFontFamily,d.fontSize=_ot.messageFontSize,d.fontWeight=_ot.messageFontWeight,d.anchor=_ot.messageAlign,d.valign="center",d.textMargin=_ot.wrapPadding,d.tspan=!1,Cr(d.text)?await Jst(t,d,{startx:i,stopx:a,starty:r}):tot(t,d);const p=u.width;let g;i===a?g=_ot.rightAngles?t.append("path").attr("d",`M ${i},${r} H ${i+Lr.getMax(_ot.width/2,p/2)} V ${r+25} H ${i}`):t.append("path").attr("d","M "+i+","+r+" C "+(i+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)):(g=t.append("line"),g.attr("x1",i),g.attr("y1",r),g.attr("x2",a),g.attr("y2",r)),l===n.db.LINETYPE.DOTTED||l===n.db.LINETYPE.DOTTED_CROSS||l===n.db.LINETYPE.DOTTED_POINT||l===n.db.LINETYPE.DOTTED_OPEN||l===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(g.style("stroke-dasharray","3, 3"),g.attr("class","messageLine1")):g.attr("class","messageLine0");let f="";_ot.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!==n.db.LINETYPE.SOLID&&l!==n.db.LINETYPE.DOTTED||g.attr("marker-end","url("+f+"#arrowhead)"),l!==n.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==n.db.LINETYPE.BIDIRECTIONAL_DOTTED||(g.attr("marker-start","url("+f+"#arrowhead)"),g.attr("marker-end","url("+f+"#arrowhead)")),l!==n.db.LINETYPE.SOLID_POINT&&l!==n.db.LINETYPE.DOTTED_POINT||g.attr("marker-end","url("+f+"#filled-head)"),l!==n.db.LINETYPE.SOLID_CROSS&&l!==n.db.LINETYPE.DOTTED_CROSS||g.attr("marker-end","url("+f+"#crosshead)"),(h||_ot.showSequenceNumbers)&&(g.attr("marker-start","url("+f+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(c))}),"drawMessage"),Rot=o((function(t,e,r,n,i,a,s){let o,l=0,c=0,h=0;for(const t of n){const n=e.get(t),a=n.box;o&&o!=a&&(s||Eot.models.addBox(o),c+=_ot.boxMargin+o.margin),a&&a!=o&&(s||(a.x=l+c,a.y=i),c+=a.margin),n.width=n.width||_ot.width,n.height=Lr.getMax(n.height||_ot.height,_ot.height),n.margin=n.margin||_ot.actorMargin,h=Lr.getMax(h,n.height),r.get(n.name)&&(c+=n.width/2),n.x=l+c,n.starty=Eot.getVerticalPos(),Eot.insert(n.x,i,n.x+n.width,n.height),l+=n.width+c,n.box&&(n.box.width=l+a.margin-n.box.x),c=n.margin,o=n.box,Eot.models.addActor(n)}o&&!s&&Eot.models.addBox(o),Eot.bumpVerticalPos(h)}),"addActorRenderingData"),Mot=o((async function(t,e,r,n){if(n){let n=0;Eot.bumpVerticalPos(2*_ot.boxMargin);for(const i of r){const r=e.get(i);r.stopy||(r.stopy=Eot.getVerticalPos());const a=await Tot.drawActor(t,r,_ot,!0);n=Lr.getMax(n,a)}Eot.bumpVerticalPos(n+_ot.boxMargin)}else for(const n of r){const r=e.get(n);await Tot.drawActor(t,r,_ot,!1)}}),"drawActors"),Dot=o((function(t,e,r,n){let i=0,a=0;for(const s of r){const r=e.get(s),o=Got(r),l=Tot.drawPopup(t,r,o,_ot,_ot.forceMenus,n);l.height>i&&(i=l.height),l.width+r.x>a&&(a=l.width+r.x)}return{maxHeight:i,maxWidth:a}}),"drawActorsPopup"),Oot=o((function(t){N(_ot,t),t.fontFamily&&(_ot.actorFontFamily=_ot.noteFontFamily=_ot.messageFontFamily=t.fontFamily),t.fontSize&&(_ot.actorFontSize=_ot.noteFontSize=_ot.messageFontSize=t.fontSize),t.fontWeight&&(_ot.actorFontWeight=_ot.noteFontWeight=_ot.messageFontWeight=t.fontWeight)}),"setConf"),Pot=o((function(t){return Eot.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),Bot=o((function(t,e){const r=e.get(t),n=Pot(t);return[n.reduce((function(t,e){return Lr.getMin(t,e.startx)}),r.x+r.width/2-1),n.reduce((function(t,e){return Lr.getMax(t,e.stopx)}),r.x+r.width/2+1)]}),"activationBounds");function $ot(t,e,r,n,i){Eot.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const r=t[e.id].width,i=Sot(_ot);e.message=Pk.wrapLabel(`[${e.message}]`,r-2*_ot.wrapPadding,i),e.width=r,e.wrap=!0;const s=Pk.calculateTextDimensions(e.message,i),o=Lr.getMax(s.height,_ot.labelBoxHeight);a=n+o,y.debug(`${o} - ${e.message}`)}i(e),Eot.bumpVerticalPos(a)}function Fot(t,e,r,n,i,a,s){function l(r,n){r.x<i.get(t.from).x?(Eot.insert(e.stopx-n,e.starty,e.startx,e.stopy+r.height/2+_ot.noteMargin),e.stopx=e.stopx+n):(Eot.insert(e.startx,e.starty,e.stopx+n,e.stopy+r.height/2+_ot.noteMargin),e.stopx=e.stopx-n)}function c(r,n){r.x<i.get(t.to).x?(Eot.insert(e.startx-n,e.starty,e.stopx,e.stopy+r.height/2+_ot.noteMargin),e.startx=e.startx+n):(Eot.insert(e.stopx,e.starty,e.startx+n,e.stopy+r.height/2+_ot.noteMargin),e.startx=e.startx-n)}if(o(l,"receiverAdjustment"),o(c,"senderAdjustment"),a.get(t.to)==n){const e=i.get(t.to);l(e,"actor"==e.type?21:e.width/2+3),e.starty=r-e.height/2,Eot.bumpVerticalPos(e.height/2)}else if(s.get(t.from)==n){const e=i.get(t.from);if(_ot.mirrorActors){c(e,"actor"==e.type?18:e.width/2)}e.stopy=r-e.height/2,Eot.bumpVerticalPos(e.height/2)}else if(s.get(t.to)==n){const e=i.get(t.to);if(_ot.mirrorActors){l(e,"actor"==e.type?21:e.width/2+3)}e.stopy=r-e.height/2,Eot.bumpVerticalPos(e.height/2)}}o($ot,"adjustLoopHeightForWrap"),o(Fot,"adjustCreatedDestroyedData");var zot=o((async function(t,e,r,n){const{securityLevel:i,sequence:a}=Qr();let s;_ot=a,"sandbox"===i&&(s=Ga("#i"+e));const l=Ga("sandbox"===i?s.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?s.nodes()[0].contentDocument:document;Eot.init(),y.debug(n.db);const h="sandbox"===i?l.select(`[id="${e}"]`):Ga(`[id="${e}"]`),u=n.db.getActors(),d=n.db.getCreatedActors(),p=n.db.getDestroyedActors(),g=n.db.getBoxes();let f=n.db.getActorKeys();const m=n.db.getMessages(),v=n.db.getDiagramTitle(),x=n.db.hasAtLeastOneBox(),b=n.db.hasAtLeastOneBoxWithTitle(),w=await Uot(u,m,n);if(_ot.height=await qot(u,w,g),Tot.insertComputerIcon(h),Tot.insertDatabaseIcon(h),Tot.insertClockIcon(h),x&&(Eot.bumpVerticalPos(_ot.boxMargin),b&&Eot.bumpVerticalPos(g[0].textMaxHeight)),!0===_ot.hideUnusedParticipants){const t=new Set;m.forEach((e=>{t.add(e.from),t.add(e.to)})),f=f.filter((e=>t.has(e)))}Rot(h,u,d,f,0,m,!1);const k=await Yot(m,u,w,n);function T(t,e){const r=Eot.endActivation(t);r.starty+18>e&&(r.starty=e-6,e+=12),Tot.drawActivation(h,r,e,_ot,Pot(t.from).length),Eot.insert(r.startx,e-10,r.stopx,e)}Tot.insertArrowHead(h),Tot.insertArrowCrossHead(h),Tot.insertArrowFilledHead(h),Tot.insertSequenceNumber(h),o(T,"activeEnd");let _=1,E=1;const C=[],S=[];let A=0;for(const t of m){let e,r,i;switch(t.type){case n.db.LINETYPE.NOTE:Eot.resetVerticalPos(),r=t.noteModel,await Cot(h,r);break;case n.db.LINETYPE.ACTIVE_START:Eot.newActivation(t,h,u);break;case n.db.LINETYPE.ACTIVE_END:T(t,Eot.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.LOOP_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"loop",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.RECT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin,(t=>Eot.newLoop(void 0,t.message)));break;case n.db.LINETYPE.RECT_END:e=Eot.endLoop(),S.push(e),Eot.models.addLoop(e),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos());break;case n.db.LINETYPE.OPT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.OPT_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"opt",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.ALT_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.ALT_ELSE:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.ALT_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"alt",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t))),Eot.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.PAR_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"par",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.AUTONUMBER:_=t.message.start||_,E=t.message.step||E,t.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.CRITICAL_OPTION:$ot(k,t,_ot.boxMargin+_ot.boxTextMargin,_ot.boxMargin,(t=>Eot.addSectionToLoop(t)));break;case n.db.LINETYPE.CRITICAL_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"critical",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;case n.db.LINETYPE.BREAK_START:$ot(k,t,_ot.boxMargin,_ot.boxMargin+_ot.boxTextMargin,(t=>Eot.newLoop(t)));break;case n.db.LINETYPE.BREAK_END:e=Eot.endLoop(),await Tot.drawLoop(h,e,"break",_ot),Eot.bumpVerticalPos(e.stopy-Eot.getVerticalPos()),Eot.models.addLoop(e);break;default:try{i=t.msgModel,i.starty=Eot.getVerticalPos(),i.sequenceIndex=_,i.sequenceVisible=n.db.showSequenceNumbers();const e=await Not(0,i);Fot(t,i,e,A,u,d,p),C.push({messageModel:i,lineStartY:e}),Eot.models.addMessage(i)}catch(t){y.error("error while drawing message",t)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(_+=E),A++}y.debug("createdActors",d),y.debug("destroyedActors",p),await Mot(h,u,f,!1);for(const t of C)await Iot(h,t.messageModel,t.lineStartY,n);_ot.mirrorActors&&await Mot(h,u,f,!0),S.forEach((t=>Tot.drawBackgroundRect(h,t))),not(h,u,f,_ot);for(const t of Eot.models.boxes)t.height=Eot.getVerticalPos()-t.y,Eot.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)",Tot.drawBox(h,t,_ot);x&&Eot.bumpVerticalPos(_ot.boxMargin);const L=Dot(h,u,f,c),{bounds:N}=Eot.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<L.maxHeight&&(I=L.maxHeight);let R=I+2*_ot.diagramMarginY;_ot.mirrorActors&&(R=R-_ot.boxMargin+_ot.bottomMarginAdj);let M=N.stopx-N.startx;M<L.maxWidth&&(M=L.maxWidth);const D=M+2*_ot.diagramMarginX;v&&h.append("text").text(v).attr("x",(N.stopx-N.startx)/2-2*_ot.diagramMarginX).attr("y",-25),Rr(h,R,D,_ot.useMaxWidth);const O=v?40:0;h.attr("viewBox",N.startx-_ot.diagramMarginX+" -"+(_ot.diagramMarginY+O)+" "+D+" "+(R+O)),y.debug("models:",Eot.models)}),"draw");async function Uot(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const e=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(i.placement===r.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const a=void 0!==i.placement,s=!a,o=a?Aot(_ot):Sot(_ot),l=i.wrap?Pk.wrapLabel(i.message,_ot.width-2*_ot.wrapPadding,o):i.message,c=(Cr(l)?await Sr(i.message,Qr()):Pk.calculateTextDimensions(l,o)).width+2*_ot.wrapPadding;s&&i.from===e.nextActor?n[i.to]=Lr.getMax(n[i.to]||0,c):s&&i.from===e.prevActor?n[i.from]=Lr.getMax(n[i.from]||0,c):s&&i.from===i.to?(n[i.from]=Lr.getMax(n[i.from]||0,c/2),n[i.to]=Lr.getMax(n[i.to]||0,c/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=Lr.getMax(n[i.from]||0,c):i.placement===r.db.PLACEMENT.LEFTOF?n[e.prevActor]=Lr.getMax(n[e.prevActor]||0,c):i.placement===r.db.PLACEMENT.OVER&&(e.prevActor&&(n[e.prevActor]=Lr.getMax(n[e.prevActor]||0,c/2)),e.nextActor&&(n[i.from]=Lr.getMax(n[i.from]||0,c/2)))}return y.debug("maxMessageWidthPerActor:",n),n}o(Uot,"getMaxMessageWidthPerActor");var Got=o((function(t){let e=0;const r=Lot(_ot);for(const n in t.links){const t=Pk.calculateTextDimensions(n,r).width+2*_ot.wrapPadding+2*_ot.boxMargin;e<t&&(e=t)}return e}),"getRequiredPopupWidth");async function qot(t,e,r){let n=0;for(const e of t.keys()){const r=t.get(e);r.wrap&&(r.description=Pk.wrapLabel(r.description,_ot.width-2*_ot.wrapPadding,Lot(_ot)));const i=Cr(r.description)?await Sr(r.description,Qr()):Pk.calculateTextDimensions(r.description,Lot(_ot));r.width=r.wrap?_ot.width:Lr.getMax(_ot.width,i.width+2*_ot.wrapPadding),r.height=r.wrap?Lr.getMax(i.height,_ot.height):_ot.height,n=Lr.getMax(n,r.height)}for(const r in e){const n=t.get(r);if(!n)continue;const i=t.get(n.nextActor);if(!i){const t=e[r]+_ot.actorMargin-n.width/2;n.margin=Lr.getMax(t,_ot.actorMargin);continue}const a=e[r]+_ot.actorMargin-n.width/2-i.width/2;n.margin=Lr.getMax(a,_ot.actorMargin)}let i=0;return r.forEach((e=>{const r=Sot(_ot);let n=e.actorKeys.reduce(((e,r)=>e+(t.get(r).width+(t.get(r).margin||0))),0);n-=2*_ot.boxTextMargin,e.wrap&&(e.name=Pk.wrapLabel(e.name,n-2*_ot.wrapPadding,r));const a=Pk.calculateTextDimensions(e.name,r);i=Lr.getMax(a.height,i);const s=Lr.getMax(n,a.width+2*_ot.wrapPadding);if(e.margin=_ot.boxTextMargin,n<s){const t=(s-n)/2;e.margin+=t}})),r.forEach((t=>t.textMaxHeight=i)),Lr.getMax(n,_ot.height)}o(qot,"calculateActorMargins");var jot=o((async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=Cr(t.message)?await Sr(t.message,Qr()):Pk.calculateTextDimensions(o?Pk.wrapLabel(t.message,_ot.width,Aot(_ot)):t.message,Aot(_ot));const c={width:o?_ot.width:Lr.getMax(_ot.width,l.width+2*_ot.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(c.width=o?Lr.getMax(_ot.width,l.width):Lr.getMax(n.width/2+i.width/2,l.width+2*_ot.noteMargin),c.startx=a+(n.width+_ot.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(c.width=o?Lr.getMax(_ot.width,l.width+2*_ot.noteMargin):Lr.getMax(n.width/2+i.width/2,l.width+2*_ot.noteMargin),c.startx=a-c.width+(n.width-_ot.actorMargin)/2):t.to===t.from?(l=Pk.calculateTextDimensions(o?Pk.wrapLabel(t.message,Lr.getMax(_ot.width,n.width),Aot(_ot)):t.message,Aot(_ot)),c.width=o?Lr.getMax(_ot.width,n.width):Lr.getMax(n.width,_ot.width,l.width+2*_ot.noteMargin),c.startx=a+(n.width-c.width)/2):(c.width=Math.abs(a+n.width/2-(s+i.width/2))+_ot.actorMargin,c.startx=a<s?a+n.width/2-_ot.actorMargin/2:s+i.width/2-_ot.actorMargin/2),o&&(c.message=Pk.wrapLabel(t.message,c.width-2*_ot.wrapPadding,Aot(_ot))),y.debug(`NM:[${c.startx},${c.stopx},${c.starty},${c.stopy}:${c.width},${c.height}=${t.message}]`),c}),"buildNoteModel"),Wot=o((function(t,e,r){if(![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))return{};const[n,i]=Bot(t.from,e),[a,s]=Bot(t.to,e),l=n<=a;let c=l?i:n,h=l?a:s;const u=Math.abs(a-s)>2,d=o((t=>l?-t:t),"adjustValue");t.from===t.to?h=c:(t.activate&&!u&&(h+=d(_ot.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=d(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(c-=d(3)));const p=[n,i,a,s],g=Math.abs(c-h);t.wrap&&t.message&&(t.message=Pk.wrapLabel(t.message,Lr.getMax(g+2*_ot.wrapPadding,_ot.width),Sot(_ot)));const f=Pk.calculateTextDimensions(t.message,Sot(_ot));return{width:Lr.getMax(t.wrap?0:f.width+2*_ot.wrapPadding,g+2*_ot.wrapPadding,_ot.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"),Yot=o((async function(t,e,r,n){const i={},a=[];let s,o,l;for(const r of t){switch(r.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:r.message&&(s=a.pop(),i[s.id]=s,i[r.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const t=e.get(r.from?r.from:r.to.actor),n=Pot(r.from?r.from:r.to.actor).length,i=t.x+t.width/2+(n-1)*_ot.activationWidth/2,a={startx:i,stopx:i+_ot.activationWidth,actor:r.from,enabled:!0};Eot.activations.push(a)}break;case n.db.LINETYPE.ACTIVE_END:{const t=Eot.activations.map((t=>t.actor)).lastIndexOf(r.from);Eot.activations.splice(t,1).splice(0,1)}}void 0!==r.placement?(o=await jot(r,e,n),r.noteModel=o,a.forEach((t=>{s=t,s.from=Lr.getMin(s.from,o.startx),s.to=Lr.getMax(s.to,o.startx+o.width),s.width=Lr.getMax(s.width,Math.abs(s.from-s.to))-_ot.labelBoxWidth}))):(l=Wot(r,e,n),r.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach((t=>{if(s=t,l.startx===l.stopx){const t=e.get(r.from),n=e.get(r.to);s.from=Lr.getMin(t.x-l.width/2,t.x-t.width/2,s.from),s.to=Lr.getMax(n.x+l.width/2,n.x+t.width/2,s.to),s.width=Lr.getMax(s.width,Math.abs(s.to-s.from))-_ot.labelBoxWidth}else s.from=Lr.getMin(l.startx,s.from),s.to=Lr.getMax(l.stopx,s.to),s.width=Lr.getMax(s.width,l.width)-_ot.labelBoxWidth})))}return Eot.activations=[],y.debug("Loop type widths:",i),i}),"calculateLoopBounds"),Hot={parser:Gst,get db(){return new Yst},renderer:{bounds:Eot,drawActors:Mot,drawActorsPopup:Dot,setConf:Oot,draw:zot},styles:Hst,init:o((t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,Jr({sequence:{wrap:t.wrap}}))}),"init")},Vot=Object.freeze({__proto__:null,diagram:Hot}),Xot=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,42],s=[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],R=[1,61],M=[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],W=[1,107],Y=[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],rt=[1,143],nt=[1,8,9,59],it=[1,8,9,22,58,59,80,84,85,86,87,88,89],at={trace:o((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:o((function(t,e,r,n,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:n.addRelation(a[o]);break;case 19:a[o-1].title=n.cleanupLabel(a[o]),n.addRelation(a[o-1]);break;case 30:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 31:case 32:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 33:n.addClassesToNamespace(a[o-3],a[o-1]);break;case 34:n.addClassesToNamespace(a[o-4],a[o-1]);break;case 35:this.$=a[o],n.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:n.setCssClass(a[o-2],a[o]);break;case 41:n.addMembers(a[o-3],a[o-1]);break;case 42:n.setCssClass(a[o-5],a[o-3]),n.addMembers(a[o-5],a[o-1]);break;case 43:this.$=a[o],n.addClass(a[o]);break;case 44:this.$=a[o-1],n.addClass(a[o-1]),n.setClassLabel(a[o-1],a[o]);break;case 45:n.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:n.addMember(a[o-1],n.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:n.addNote(a[o],a[o-1]);break;case 57:n.addNote(a[o]);break;case 58:this.$=a[o-2],n.defineClass(a[o-1],a[o]);break;case 60:this.$=a[o-2].concat([a[o]]);break;case 61:n.setDirection("TB");break;case 62:n.setDirection("BT");break;case 63:n.setDirection("RL");break;case 64:n.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.$=n.relationType.AGGREGATION;break;case 70:this.$=n.relationType.EXTENSION;break;case 71:this.$=n.relationType.COMPOSITION;break;case 72:this.$=n.relationType.DEPENDENCY;break;case 73:this.$=n.relationType.LOLLIPOP;break;case 74:this.$=n.lineType.LINE;break;case 75:this.$=n.lineType.DOTTED_LINE;break;case 76:case 82:this.$=a[o-2],n.setClickEvent(a[o-1],a[o]);break;case 77:case 83:this.$=a[o-3],n.setClickEvent(a[o-2],a[o-1]),n.setTooltip(a[o-2],a[o]);break;case 78:this.$=a[o-2],n.setLink(a[o-1],a[o]);break;case 79:this.$=a[o-3],n.setLink(a[o-2],a[o-1],a[o]);break;case 80:this.$=a[o-3],n.setLink(a[o-2],a[o-1]),n.setTooltip(a[o-2],a[o]);break;case 81:this.$=a[o-4],n.setLink(a[o-3],a[o-2],a[o]),n.setTooltip(a[o-3],a[o-1]);break;case 84:this.$=a[o-3],n.setClickEvent(a[o-2],a[o-1],a[o]);break;case 85:this.$=a[o-4],n.setClickEvent(a[o-3],a[o-2],a[o-1]),n.setTooltip(a[o-3],a[o]);break;case 86:this.$=a[o-3],n.setLink(a[o-2],a[o]);break;case 87:this.$=a[o-4],n.setLink(a[o-3],a[o-1],a[o]);break;case 88:this.$=a[o-4],n.setLink(a[o-3],a[o-1]),n.setTooltip(a[o-3],a[o]);break;case 89:this.$=a[o-5],n.setLink(a[o-4],a[o-2],a[o]),n.setTooltip(a[o-4],a[o-1]);break;case 90:this.$=a[o-2],n.setCssStyle(a[o-1],a[o]);break;case 91:n.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:r,37:n,38:22,42:i,43:23,46:a,47:s,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:R,70:M,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:r,37:n,42:i,46:a,47:s,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:r,37:n,38:22,42:i,43:23,46:a,47:s,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:R,70:M,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:R,70:M}),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:W,80:Y,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:W,59:[1,119],80:Y,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:R,70:M}),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:rt}),t(nt,[2,92],{83:144,22:j,58:W,80:Y,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:rt}),{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:W,80:Y,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(nt,[2,93],{83:144,22:j,58:W,80:Y,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},st=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){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,o(ot,"Parser"),ot.prototype=at,at.Parser=ot,new ot}();Xot.parser=Xot;var Kot=Xot,Zot=["#","+","~","-",""],Qot=class{static{o(this,"ClassMember")}constructor(t,e){this.memberType=e,this.visibility="",this.classifier="",this.text="";const r=hr(t,Qr());this.parseMember(r)}getDisplayDetails(){let t=this.visibility+br(this.id);"method"===this.memberType&&(t+=`(${br(this.parameters.trim())})`,this.returnType&&(t+=" : "+br(this.returnType))),t=t.trim();return{displayText:t,cssStyle:this.parseClassifier()}}parseMember(t){let e="";if("method"===this.memberType){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(r){const t=r[1]?r[1].trim():"";if(Zot.includes(t)&&(this.visibility=t),this.id=r[2],this.parameters=r[3]?r[3].trim():"",e=r[4]?r[4].trim():"",this.returnType=r[5]?r[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 r=t.length,n=t.substring(0,1),i=t.substring(r-1);Zot.includes(n)&&(this.visibility=n),/[$*]/.exec(i)&&(e=i),this.id=t.substring(""===this.visibility?0:1,""===e?r:r-1)}this.classifier=e,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const r=`${this.visibility?"\\"+this.visibility:""}${br(this.id)}${"method"===this.memberType?`(${br(this.parameters)})${this.returnType?" : "+br(this.returnType):""}`:""}`;this.text=r.replaceAll("<","&lt;").replaceAll(">","&gt;"),this.text.startsWith("\\&lt;")&&(this.text=this.text.replace("\\&lt;","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},Jot="classId-",tlt=0,elt=o((t=>Lr.sanitizeText(t,Qr())),"sanitizeText"),rlt=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=[],this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=o((t=>{let e=Ga(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Ga("body").append("div").attr("class","mermaidTooltip").style("opacity",0));Ga(t).select("svg").selectAll("g.node").on("mouseover",(t=>{const r=Ga(t.currentTarget);if(null===r.attr("title"))return;const n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(r.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),e.html(e.html().replace(/&lt;br\/&gt;/g,"<br/>")),r.classed("hover",!0)})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0);Ga(t.currentTarget).classed("hover",!1)}))}),"setupToolTips"),this.direction="TB",this.setAccTitle=jr,this.getAccTitle=Wr,this.setAccDescription=Yr,this.getAccDescription=Hr,this.setDiagramTitle=Vr,this.getDiagramTitle=Xr,this.getConfig=o((()=>Qr().class),"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{o(this,"ClassDB")}splitClassNameAndType(t){const e=Lr.sanitizeText(t,Qr());let r="",n=e;if(e.indexOf("~")>0){const t=e.split("~");n=elt(t[0]),r=elt(t[1])}return{className:n,type:r}}setClassLabel(t,e){const r=Lr.sanitizeText(t,Qr());e&&(e=elt(e));const{className:n}=this.splitClassNameAndType(r);this.classes.get(n).label=e,this.classes.get(n).text=`${e}${this.classes.get(n).type?`<${this.classes.get(n).type}>`:""}`}addClass(t){const e=Lr.sanitizeText(t,Qr()),{className:r,type:n}=this.splitClassNameAndType(e);if(this.classes.has(r))return;const i=Lr.sanitizeText(r,Qr());this.classes.set(i,{id:i,type:n,label:i,text:`${i}${n?`&lt;${n}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:Jot+i+"-"+tlt}),tlt++}addInterface(t,e){const r={id:`interface${this.interfaces.length}`,label:t,classId:e};this.interfaces.push(r)}lookUpDomId(t){const e=Lr.sanitizeText(t,Qr());if(this.classes.has(e))return this.classes.get(e).domId;throw new Error("Class not found: "+e)}clear(){this.relations=[],this.classes=new Map,this.notes=[],this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.direction="TB",qr()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNotes(){return this.notes}addRelation(t){y.debug("Adding relation: "+JSON.stringify(t));const e=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];t.relation.type1!==this.relationType.LOLLIPOP||e.includes(t.relation.type2)?t.relation.type2!==this.relationType.LOLLIPOP||e.includes(t.relation.type1)?(this.addClass(t.id1),this.addClass(t.id2)):(this.addClass(t.id1),this.addInterface(t.id2,t.id1),t.id2="interface"+(this.interfaces.length-1)):(this.addClass(t.id2),this.addInterface(t.id1,t.id2),t.id1="interface"+(this.interfaces.length-1)),t.id1=this.splitClassNameAndType(t.id1).className,t.id2=this.splitClassNameAndType(t.id2).className,t.relationTitle1=Lr.sanitizeText(t.relationTitle1.trim(),Qr()),t.relationTitle2=Lr.sanitizeText(t.relationTitle2.trim(),Qr()),this.relations.push(t)}addAnnotation(t,e){const r=this.splitClassNameAndType(t).className;this.classes.get(r).annotations.push(e)}addMember(t,e){this.addClass(t);const r=this.splitClassNameAndType(t).className,n=this.classes.get(r);if("string"==typeof e){const t=e.trim();t.startsWith("<<")&&t.endsWith(">>")?n.annotations.push(elt(t.substring(2,t.length-2))):t.indexOf(")")>0?n.methods.push(new Qot(t,"method")):t&&n.members.push(new Qot(t,"attribute"))}}addMembers(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((e=>this.addMember(t,e))))}addNote(t,e){const r={id:`note${this.notes.length}`,class:e,text:t};this.notes.push(r)}cleanupLabel(t){return t.startsWith(":")&&(t=t.substring(1)),elt(t.trim())}setCssClass(t,e){t.split(",").forEach((t=>{let r=t;/\d/.exec(t[0])&&(r=Jot+r);const n=this.classes.get(r);n&&(n.cssClasses+=" "+e)}))}defineClass(t,e){for(const r of t){let t=this.styleClasses.get(r);void 0===t&&(t={id:r,styles:[],textStyles:[]},this.styleClasses.set(r,t)),e&&e.forEach((e=>{if(/color/.exec(e)){const r=e.replace("fill","bgFill");t.textStyles.push(r)}t.styles.push(e)})),this.classes.forEach((t=>{t.cssClasses.includes(r)&&t.styles.push(...e.flatMap((t=>t.split(","))))}))}}setTooltip(t,e){t.split(",").forEach((t=>{void 0!==e&&(this.classes.get(t).tooltip=elt(e))}))}getTooltip(t,e){return e&&this.namespaces.has(e)?this.namespaces.get(e).classes.get(t).tooltip:this.classes.get(t).tooltip}setLink(t,e,r){const n=Qr();t.split(",").forEach((t=>{let i=t;/\d/.exec(t[0])&&(i=Jot+i);const a=this.classes.get(i);a&&(a.link=Pk.formatUrl(e,n),"sandbox"===n.securityLevel?a.linkTarget="_top":a.linkTarget="string"==typeof r?elt(r):"_blank")})),this.setCssClass(t,"clickable")}setClickEvent(t,e,r){t.split(",").forEach((t=>{this.setClickFunc(t,e,r),this.classes.get(t).haveCallback=!0})),this.setCssClass(t,"clickable")}setClickFunc(t,e,r){const n=Lr.sanitizeText(t,Qr());if("loose"!==Qr().securityLevel)return;if(void 0===e)return;const i=n;if(this.classes.has(i)){const t=this.lookUpDomId(i);let n=[];if("string"==typeof r){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<n.length;t++){let e=n[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),n[t]=e}}0===n.length&&n.push(t),this.functions.push((()=>{const r=document.querySelector(`[id="${t}"]`);null!==r&&r.addEventListener("click",(()=>{Pk.runFunc(e,...n)}),!1)}))}}bindFunctions(t){this.functions.forEach((e=>{e(t)}))}getDirection(){return this.direction}setDirection(t){this.direction=t}addNamespace(t){this.namespaces.has(t)||(this.namespaces.set(t,{id:t,classes:new Map,children:{},domId:Jot+t+"-"+this.namespaceCounter}),this.namespaceCounter++)}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,e){if(this.namespaces.has(t))for(const r of e){const{className:e}=this.splitClassNameAndType(r);this.classes.get(e).parent=t,this.namespaces.get(t).classes.set(e,this.classes.get(e))}}setCssStyle(t,e){const r=this.classes.get(t);if(e&&r)for(const t of e)t.includes(",")?r.styles.push(...t.split(",")):r.styles.push(t)}getArrowMarker(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}getData(){const t=[],e=[],r=Qr();for(const e of this.namespaces.keys()){const n=this.namespaces.get(e);if(n){const e={id:n.id,label:n.id,isGroup:!0,padding:r.class.padding??16,shape:"rect",cssStyles:["fill: none","stroke: black"],look:r.look};t.push(e)}}for(const e of this.classes.keys()){const n=this.classes.get(e);if(n){const e=n;e.parentId=n.parent,e.look=r.look,t.push(e)}}let n=0;for(const i of this.notes){n++;const a={id:i.id,label:i.text,isGroup:!1,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look};t.push(a);const s=this.classes.get(i.class)?.id??"";if(s){const t={id:`edgeNote${n}`,start:i.id,end:s,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};e.push(t)}}for(const e of this.interfaces){const n={id:e.id,label:e.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};t.push(n)}n=0;for(const t of this.relations){n++;const i={id:Fk(t.id1,t.id2,{prefix:"id",counter:n}),start:t.id1,end:t.id2,type:"normal",label:t.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(t.relation.type1),arrowTypeEnd:this.getArrowMarker(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:r.look};e.push(i)}return{nodes:t,edges:e,other:{},config:r,direction:this.getDirection()}}},nlt=o((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"),ilt=o(((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir"),alt=o((function(t,e){return e.db.getClasses()}),"getClasses"),slt=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Qr(),o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=OA(s),o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"classDiagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,"classDiagram",a?.useMaxWidth??!0)}),"draw"),olt={getClasses:alt,draw:slt,getDir:ilt},llt={parser:Kot,get db(){return new rlt},renderer:olt,styles:nlt,init:o((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},clt=Object.freeze({__proto__:null,diagram:llt}),hlt={parser:Kot,get db(){return new rlt},renderer:olt,styles:nlt,init:o((t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},ult=Object.freeze({__proto__:null,diagram:hlt}),dlt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[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],R={trace:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 3:return n.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=n.trimColon(a[o]),this.$=t;break;case 14:this.$={stmt:"relation",state1:a[o-2],state2:a[o]};break;case 15:const e=n.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:n.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(),n.setAccTitle(this.$);break;case 30:case 31:this.$=a[o].trim(),n.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:n.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 37:n.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 38:n.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 39:n.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:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16: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:s,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:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},M=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/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 R.lexer=M,o(D,"Parser"),D.prototype=R,R.Parser=D,new D}();dlt.parser=dlt;var plt=dlt,glt="state",flt="relation",mlt="default",ylt="divider",vlt="fill:none",xlt="fill: #333",blt="text",wlt="normal",klt="rect",Tlt="rectWithTitle",_lt="divider",Elt="roundedWithTitle",Clt="statediagram",Slt="transition",Alt="parent",Llt="note",Nlt="----parent",Ilt=o(((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir"),Rlt=o((function(t,e){return e.db.getClasses()}),"getClasses"),Mlt=o((async function(t,e,r,n){y.info("REF0:"),y.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Qr();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=oX(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=a?.nodeSpacing||50,o.rankSpacing=a?.rankSpacing||50,o.markers=["barb"],o.diagramId=e,await DA(o,l);Pk.insertTitle(l,"statediagramTitleText",a?.titleTopMargin??25,n.db.getDiagramTitle()),lX(l,8,Clt,a?.useMaxWidth??!0)}),"draw"),Dlt={getClasses:Rlt,draw:Mlt,getDir:Ilt},Olt=new Map,Plt=0;function Blt(t="",e=0,r="",n="----"){return`state-${t}${null!==r&&r.length>0?`${n}${r}`:""}-${e}`}o(Blt,"stateDomId");var $lt=o(((t,e,r,n,i,a,s,o)=>{y.trace("items",e),e.forEach((e=>{switch(e.stmt){case glt:case mlt:qlt(t,e,r,n,i,a,s,o);break;case flt:{qlt(t,e.state1,r,n,i,a,s,o),qlt(t,e.state2,r,n,i,a,s,o);const l={id:"edge"+Plt,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:vlt,labelStyle:"",label:Lr.sanitizeText(e.description,Qr()),arrowheadStyle:xlt,labelpos:"c",labelType:blt,thickness:wlt,classes:Slt,look:s};i.push(l),Plt++}}}))}),"setupDoc"),Flt=o(((t,e="TB")=>{let r=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(r=e.value);return r}),"getDir");function zlt(t,e,r){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{if(r.get(t)){const n=r.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...n.styles]}})));const n=t.find((t=>t.id===e.id));n?Object.assign(n,e):t.push(e)}function Ult(t){return t?.classes?.join(" ")??""}function Glt(t){return t?.styles??[]}o(zlt,"insertOrUpdateNode"),o(Ult,"getClassesFromDbInfo"),o(Glt,"getStylesFromDbInfo");var qlt=o(((t,e,r,n,i,a,s,o)=>{const l=e.id,c=r.get(l),h=Ult(c),u=Glt(c);if(y.info("dataFetcher parsedItem",e,c,u),"root"!==l){let r=klt;!0===e.start?r="stateStart":!1===e.start&&(r="stateEnd"),e.type!==mlt&&(r=e.type),Olt.get(l)||Olt.set(l,{id:l,shape:r,description:Lr.sanitizeText(l,Qr()),cssClasses:`${h} statediagram-state`,cssStyles:u});const c=Olt.get(l);e.description&&(Array.isArray(c.description)?(c.shape=Tlt,c.description.push(e.description)):c.description?.length>0?(c.shape=Tlt,c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape=klt,c.description=e.description),c.description=Lr.sanitizeTextOrArray(c.description,Qr())),1===c.description?.length&&c.shape===Tlt&&("group"===c.type?c.shape=Elt:c.shape=klt),!c.type&&e.doc&&(y.info("Setting cluster for XCX",l,Flt(e)),c.type="group",c.isGroup=!0,c.dir=Flt(e),c.shape=e.type===ylt?_lt:Elt,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:Blt(l,Plt),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:s};if(d.shape===_lt&&(d.label=""),t&&"root"!==t.id&&(y.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-"+Plt,domId:Blt(l,Plt,Llt),type:c.type,isGroup:"group"===c.type,padding:Qr().flowchart.padding,look:s,position:e.note.position},r=l+Nlt,a={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+Nlt,domId:Blt(l,Plt,Alt),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Plt++,a.id=r,t.parentId=r,zlt(n,a,o),zlt(n,t,o),zlt(n,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:vlt,labelStyle:"",classes:"transition note-edge",arrowheadStyle:xlt,labelpos:"c",labelType:blt,thickness:wlt,look:s})}else zlt(n,d,o)}e.doc&&(y.trace("Adding nodes children "),$lt(e,e.doc,r,n,i,!a,s,o))}),"dataFetcher"),jlt=o((()=>{Olt.clear(),Plt=0}),"reset"),Wlt="[*]",Ylt="start",Hlt="color",Vlt="fill";function Xlt(){return new Map}o(Xlt,"newClassesList");var Klt,Zlt=o((()=>({relations:[],states:new Map,documents:{}})),"newDoc"),Qlt=o((t=>JSON.parse(JSON.stringify(t))),"clone"),Jlt=class{static{o(this,"StateDB")}constructor(t){this.clear(),this.version=t,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=Xlt();documents={root:Zlt()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(t){y.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(t,e,r){if(e.stmt===flt)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===glt&&("[*]"===e.id?(e.id=r?t.id+"_start":t.id+"_end",e.start=r):e.id=e.id.trim()),e.doc){const t=[];let r,n=[];for(r=0;r<e.doc.length;r++)if(e.doc[r].type===ylt){const i=Qlt(e.doc[r]);i.doc=Qlt(n),t.push(i),n=[]}else n.push(e.doc[r]);if(t.length>0&&n.length>0){const r={stmt:glt,id:xk(),type:"divider",doc:Qlt(n)};t.push(Qlt(r)),e.doc=t}e.doc.forEach((t=>this.docTranslator(e,t,!0)))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(t){let e;e=t.doc?t.doc:t,y.info(e),this.clear(!0),y.info("Extract initial document:",e),e.forEach((t=>{switch(y.warn("Statement",t.stmt),t.stmt){case glt:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case flt:this.addRelation(t.state1,t.state2,t.description);break;case"classDef":this.addStyleClass(t.id.trim(),t.classes);break;case"style":{const e=t.id.trim().split(","),r=t.styleClass.split(",");e.forEach((t=>{let e=this.getState(t);if(void 0===e){const r=t.trim();this.addState(r),e=this.getState(r)}e.styles=r.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case"applyClass":this.setCssClass(t.id.trim(),t.styleClass)}}));const r=this.getStates(),n=Qr().look;jlt(),qlt(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n,this.classes),this.nodes.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]}}))}addState(t,e="default",r=null,n=null,i=null,a=null,s=null,o=null){const l=t?.trim();if(this.currentDocument.states.has(l)?(this.currentDocument.states.get(l).doc||(this.currentDocument.states.get(l).doc=r),this.currentDocument.states.get(l).type||(this.currentDocument.states.get(l).type=e)):(y.info("Adding state ",l,n),this.currentDocument.states.set(l,{id:l,descriptions:[],type:e,doc:r,note:i,classes:[],styles:[],textStyles:[]})),n&&(y.info("Setting state description",l,n),"string"==typeof n&&this.addDescription(l,n.trim()),"object"==typeof n&&n.forEach((t=>this.addDescription(l,t.trim())))),i){const t=this.currentDocument.states.get(l);t.note=i,t.note.text=Lr.sanitizeText(t.note.text,Qr())}if(a){y.info("Setting state classes",l,a);("string"==typeof a?[a]:a).forEach((t=>this.setCssClass(l,t.trim())))}if(s){y.info("Setting state styles",l,s);("string"==typeof s?[s]:s).forEach((t=>this.setStyle(l,t.trim())))}if(o){y.info("Setting state styles",l,s);("string"==typeof o?[o]:o).forEach((t=>this.setTextStyle(l,t.trim())))}}clear(t){this.nodes=[],this.edges=[],this.documents={root:Zlt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Xlt(),t||qr()}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){y.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(t=""){let e=t;return t===Wlt&&(this.startEndCount++,e=`start${this.startEndCount}`),e}startTypeIfNeeded(t="",e="default"){return t===Wlt?Ylt:e}endIdIfNeeded(t=""){let e=t;return"[*]"===t&&(this.startEndCount++,e=`end${this.startEndCount}`),e}endTypeIfNeeded(t="",e="default"){return"[*]"===t?"end":e}addRelationObjs(t,e,r){let n=this.startIdIfNeeded(t.id.trim()),i=this.startTypeIfNeeded(t.id.trim(),t.type),a=this.startIdIfNeeded(e.id.trim()),s=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(n,i,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(a,s,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:n,id2:a,relationTitle:Lr.sanitizeText(r,Qr())})}addRelation(t,e,r){if("object"==typeof t)this.addRelationObjs(t,e,r);else{const n=this.startIdIfNeeded(t.trim()),i=this.startTypeIfNeeded(t),a=this.endIdIfNeeded(e.trim()),s=this.endTypeIfNeeded(e);this.addState(n,i),this.addState(a,s),this.currentDocument.relations.push({id1:n,id2:a,title:Lr.sanitizeText(r,Qr())})}}addDescription(t,e){const r=this.currentDocument.states.get(t),n=e.startsWith(":")?e.replace(":","").trim():e;r.descriptions.push(Lr.sanitizeText(n,Qr()))}cleanupLabel(t){return":"===t.substring(0,1)?t.substr(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const r=this.classes.get(t);null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(Hlt).exec(t)){const t=e.replace(Vlt,"bgFill").replace(Hlt,Vlt);r.textStyles.push(t)}r.styles.push(e)}))}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach((t=>{let r=this.getState(t);if(void 0===r){const e=t.trim();this.addState(e),r=this.getState(e)}r.classes.push(e)}))}setStyle(t,e){const r=this.getState(t);void 0!==r&&r.styles.push(e)}setTextStyle(t,e){const r=this.getState(t);void 0!==r&&r.textStyles.push(e)}getDirectionStatement(){return this.rootDoc.find((t=>"dir"===t.stmt))}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t&&":"===t[0]?t.substr(1).trim():t.trim()}getData(){const t=Qr();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Ilt(this.getRootDocV2())}}getConfig(){return Qr().state}getAccTitle=Wr;setAccTitle=jr;getAccDescription=Hr;setAccDescription=Yr;setDiagramTitle=Vr;getDiagramTitle=Xr},tct=o((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"),ect={},rct=o(((t,e)=>{ect[t]=e}),"set"),nct=o((t=>ect[t]),"get"),ict=o((()=>Object.keys(ect)),"keys"),act=o((()=>ict().length),"size"),sct={get:nct,set:rct,keys:ict,size:act},oct=o((t=>t.append("circle").attr("class","start-state").attr("r",Qr().state.sizeUnit).attr("cx",Qr().state.padding+Qr().state.sizeUnit).attr("cy",Qr().state.padding+Qr().state.sizeUnit)),"drawStartState"),lct=o((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Qr().state.textHeight).attr("class","divider").attr("x2",2*Qr().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),cct=o(((t,e)=>{const r=t.append("text").attr("x",2*Qr().state.padding).attr("y",Qr().state.textHeight+2*Qr().state.padding).attr("font-size",Qr().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Qr().state.padding).attr("y",Qr().state.padding).attr("width",n.width+2*Qr().state.padding).attr("height",n.height+2*Qr().state.padding).attr("rx",Qr().state.radius),r}),"drawSimpleState"),hct=o(((t,e)=>{const r=o((function(t,e,r){const n=t.append("tspan").attr("x",2*Qr().state.padding).text(e);r||n.attr("dy",Qr().state.textHeight)}),"addTspan"),n=t.append("text").attr("x",2*Qr().state.padding).attr("y",Qr().state.textHeight+1.3*Qr().state.padding).attr("font-size",Qr().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),i=n.height,a=t.append("text").attr("x",Qr().state.padding).attr("y",i+.4*Qr().state.padding+Qr().state.dividerMargin+Qr().state.textHeight).attr("class","state-description");let s=!0,l=!0;e.descriptions.forEach((function(t){s||(r(a,t,l),l=!1),s=!1}));const c=t.append("line").attr("x1",Qr().state.padding).attr("y1",Qr().state.padding+i+Qr().state.dividerMargin/2).attr("y2",Qr().state.padding+i+Qr().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),u=Math.max(h.width,n.width);return c.attr("x2",u+3*Qr().state.padding),t.insert("rect",":first-child").attr("x",Qr().state.padding).attr("y",Qr().state.padding).attr("width",u+2*Qr().state.padding).attr("height",h.height+i+2*Qr().state.padding).attr("rx",Qr().state.radius),t}),"drawDescrState"),uct=o(((t,e,r)=>{const n=Qr().state.padding,i=2*Qr().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Qr().state.titleShift).attr("font-size",Qr().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-n,c>s&&(h=(s-u)/2+n),Math.abs(o-d.x)<n&&c>s&&(h=o-(c-s)/2);const p=1-Qr().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",p).attr("class",r?"alt-composit":"composit").attr("width",u).attr("height",d.height+Qr().state.textHeight+Qr().state.titleShift+1).attr("rx","0"),l.attr("x",h+n),c<=s&&l.attr("x",o+(u-i)/2-c/2+n),t.insert("rect",":first-child").attr("x",h).attr("y",Qr().state.titleShift-Qr().state.textHeight-Qr().state.padding).attr("width",u).attr("height",3*Qr().state.textHeight).attr("rx",Qr().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",Qr().state.titleShift-Qr().state.textHeight-Qr().state.padding).attr("width",u).attr("height",d.height+3+2*Qr().state.textHeight).attr("rx",Qr().state.radius),t}),"addTitleAndBox"),dct=o((t=>(t.append("circle").attr("class","end-state-outer").attr("r",Qr().state.sizeUnit+Qr().state.miniPadding).attr("cx",Qr().state.padding+Qr().state.sizeUnit+Qr().state.miniPadding).attr("cy",Qr().state.padding+Qr().state.sizeUnit+Qr().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Qr().state.sizeUnit).attr("cx",Qr().state.padding+Qr().state.sizeUnit+2).attr("cy",Qr().state.padding+Qr().state.sizeUnit+2))),"drawEndState"),pct=o(((t,e)=>{let r=Qr().state.forkWidth,n=Qr().state.forkHeight;if(e.parentId){let t=r;r=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Qr().state.padding).attr("y",Qr().state.padding)}),"drawForkJoinState"),gct=o(((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>");s=s.replace(/\n/g,"<br/>");const o=s.split(Lr.lineBreakRegex);let l=1.25*Qr().state.noteMargin;for(const t of o){const n=t.trim();if(n.length>0){const t=a.append("tspan");if(t.text(n),0===l){l+=t.node().getBBox().height}i+=l,t.attr("x",e+Qr().state.noteMargin),t.attr("y",r+i+1.25*Qr().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}}),"_drawLongText"),fct=o(((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Qr().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=gct(t,0,0,n);return r.attr("height",a+2*Qr().state.noteMargin),r.attr("width",i+2*Qr().state.noteMargin),r}),"drawNote"),mct=o((function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");"start"===e.type&&oct(i),"end"===e.type&&dct(i),"fork"!==e.type&&"join"!==e.type||pct(i,e),"note"===e.type&&fct(e.note.text,i),"divider"===e.type&&lct(i),"default"===e.type&&0===e.descriptions.length&&cct(i,e),"default"===e.type&&e.descriptions.length>0&&hct(i,e);const a=i.node().getBBox();return n.width=a.width+2*Qr().state.padding,n.height=a.height+2*Qr().state.padding,sct.set(r,n),n}),"drawState"),yct=0,vct=o((function(t,e,r){const n=o((function(t){switch(t){case Jlt.relationType.AGGREGATION:return"aggregation";case Jlt.relationType.EXTENSION:return"extension";case Jlt.relationType.COMPOSITION:return"composition";case Jlt.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const i=e.points,a=gu().x((function(t){return t.x})).y((function(t){return t.y})).curve(Tu),s=t.append("path").attr("d",a(i)).attr("id","edge"+yct).attr("class","transition");let l="";if(Qr().state.arrowMarkerAbsolute&&(l=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,l=l.replace(/\(/g,"\\("),l=l.replace(/\)/g,"\\)")),s.attr("marker-end","url("+l+"#"+n(Jlt.relationType.DEPENDENCY)+"End)"),void 0!==r.title){const n=t.append("g").attr("class","stateLabel"),{x:i,y:a}=Pk.calcLabelPosition(e.points),s=Lr.getRows(r.title);let o=0;const l=[];let c=0,h=0;for(let t=0;t<=s.length;t++){const e=n.append("text").attr("text-anchor","middle").text(s[t]).attr("x",i).attr("y",a+o),r=e.node().getBBox();if(c=Math.max(c,r.width),h=Math.min(h,r.x),y.info(r.x,i,a+o),0===o){const t=e.node().getBBox();o=t.height,y.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,r)=>e.attr("y",a+r*o-t))),u=o*s.length}const d=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",i-c/2-Qr().state.padding/2).attr("y",a-u/2-Qr().state.padding/2-3.5).attr("width",c+Qr().state.padding).attr("height",u+Qr().state.padding),y.info(d)}yct++}),"drawEdge"),xct={},bct=o((function(){}),"setConf"),wct=o((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"),kct=o((function(t,e,r,n){Klt=Qr().state;const i=Qr().securityLevel;let a;"sandbox"===i&&(a=Ga("#i"+e));const s=Ga("sandbox"===i?a.nodes()[0].contentDocument.body:"body"),o="sandbox"===i?a.nodes()[0].contentDocument:document;y.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);wct(l);const c=n.db.getRootDoc();_ct(c,l,void 0,!1,s,o,n);const h=Klt.padding,u=l.node().getBBox(),d=u.width+2*h,p=u.height+2*h;Rr(l,p,1.75*d,Klt.useMaxWidth),l.attr("viewBox",`${u.x-Klt.padding} ${u.y-Klt.padding} `+d+" "+p)}),"draw"),Tct=o((t=>t?t.length*Klt.fontSizeFactor:1),"getLabelWidth"),_ct=o(((t,e,r,n,i,a,s)=>{const o=new Cj({compound:!0,multigraph:!0});let l,c=!0;for(l=0;l<t.length;l++)if("relation"===t[l].stmt){c=!1;break}r?o.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:c?1:Klt.edgeLengthFactor,nodeSep:c?1:50,isMultiGraph:!0}):o.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:c?1:Klt.edgeLengthFactor,nodeSep:c?1:50,ranker:"tight-tree",isMultiGraph:!0}),o.setDefaultEdgeLabel((function(){return{}}));const h=s.db.getStates(),u=s.db.getRelations(),d=Object.keys(h);for(const t of d){const l=h[t];let c;if(r&&(l.parentId=r),l.doc){let t=e.append("g").attr("id",l.id).attr("class","stateGroup");c=_ct(l.doc,t,l.id,!n,i,a,s);{t=uct(t,l,n);let e=t.node().getBBox();c.width=e.width,c.height=e.height+Klt.padding/2,xct[l.id]={y:Klt.compositTitleSize}}}else c=mct(e,l,o);if(l.note){const t={descriptions:[],id:l.id+"-note",note:l.note,type:"note"},r=mct(e,t,o);"left of"===l.note.position?(o.setNode(c.id+"-note",r),o.setNode(c.id,c)):(o.setNode(c.id,c),o.setNode(c.id+"-note",r)),o.setParent(c.id,c.id+"-group"),o.setParent(c.id+"-note",c.id+"-group")}else o.setNode(c.id,c)}y.debug("Count=",o.nodeCount(),o);let p=0;u.forEach((function(t){p++,y.debug("Setting edge",t),o.setEdge(t.id1,t.id2,{relation:t,width:Tct(t.title),height:Klt.labelHeight*Lr.getRows(t.title).length,labelpos:"c"},"id"+p)})),MY(o),y.debug("Graph after layout",o.nodes());const g=e.node();o.nodes().forEach((function(t){if(void 0!==t&&void 0!==o.node(t)){y.warn("Node "+t+": "+JSON.stringify(o.node(t))),i.select("#"+g.id+" #"+t).attr("transform","translate("+(o.node(t).x-o.node(t).width/2)+","+(o.node(t).y+(xct[t]?xct[t].y:0)-o.node(t).height/2)+" )"),i.select("#"+g.id+" #"+t).attr("data-x-shift",o.node(t).x-o.node(t).width/2);a.querySelectorAll("#"+g.id+" #"+t+" .divider").forEach((t=>{const e=t.parentElement;let r=0,n=0;e&&(e.parentElement&&(r=e.parentElement.getBBox().width),n=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(n)&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",r-n-8)}))}else y.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)&&(y.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(o.edge(t))),vct(e,o.edge(t),o.edge(t).relation))})),f=g.getBBox();const m={id:r||"root",label:r||"root",width:0,height:0};return m.width=f.width+2*Klt.padding,m.height=f.height+2*Klt.padding,y.debug("Doc rendered",m,o),m}),"renderDoc"),Ect={parser:plt,get db(){return new Jlt(1)},renderer:{setConf:bct,draw:kct},styles:tct,init:o((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},Cct=Object.freeze({__proto__:null,diagram:Ect}),Sct={parser:plt,get db(){return new Jlt(2)},renderer:Dlt,styles:tct,init:o((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")},Act=Object.freeze({__proto__:null,diagram:Sct}),Lct=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,14],c={trace:o((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:o((function(t,e,r,n,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:n.setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),n.setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),n.setAccDescription(this.$);break;case 12:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 13:n.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:r,12:n,14:i,16:a,17:s,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},h=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,o(u,"Parser"),u.prototype=c,c.Parser=u,new u}();Lct.parser=Lct;var Nct=Lct,Ict="",Rct=[],Mct=[],Dct=[],Oct=o((function(){Rct.length=0,Mct.length=0,Ict="",Dct.length=0,qr()}),"clear"),Pct=o((function(t){Ict=t,Rct.push(t)}),"addSection"),Bct=o((function(){return Rct}),"getSections"),$ct=o((function(){let t=Gct();let e=0;for(;!t&&e<100;)t=Gct(),e++;return Mct.push(...Dct),Mct}),"getTasks"),Fct=o((function(){const t=[];Mct.forEach((e=>{e.people&&t.push(...e.people)}));return[...new Set(t)].sort()}),"updateActors"),zct=o((function(t,e){const r=e.substr(1).split(":");let n=0,i=[];1===r.length?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map((t=>t.trim())),s={section:Ict,type:Ict,people:a,task:t,score:n};Dct.push(s)}),"addTask"),Uct=o((function(t){const e={section:Ict,type:Ict,description:t,task:t,classes:[]};Mct.push(e)}),"addTaskOrg"),Gct=o((function(){const t=o((function(t){return Dct[t].processed}),"compileTask");let e=!0;for(const[r,n]of Dct.entries())t(r),e=e&&n.processed;return e}),"compileTasks"),qct=o((function(){return Fct()}),"getActors"),jct={getConfig:o((()=>Qr().journey),"getConfig"),clear:Oct,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addSection:Pct,getSections:Bct,getTasks:$ct,addTask:zct,addTaskOrg:Uct,getActors:qct},Wct=o((t=>`.label {\n font-family: ${t.fontFamily};\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 font-family: ${t.fontFamily};\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: ${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 .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"),Yct=o((function(t,e){return SH(t,e)}),"drawRect"),Hct=o((function(t,e){const r=15,n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",r).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const n=lu().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function s(t){const n=lu().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).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"),o(a,"smile"),o(s,"sad"),o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n}),"drawFace"),Vct=o((function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),void 0!==r.class&&r.attr("class",r.class),void 0!==e.title&&r.append("title").text(e.title),r}),"drawCircle"),Xct=o((function(t,e){return LH(t,e)}),"drawText"),Kct=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Xct(t,e)}),"drawLabel"),Zct=o((function(t,e,r){const n=t.append("g"),i=RH();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Yct(n,i),eht(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)}),"drawSection"),Qct=-1,Jct=o((function(t,e,r){const n=e.x+r.width/2,i=t.append("g");Qct++;i.append("line").attr("id","task"+Qct).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Hct(i,{cx:n,cy:300+30*(5-e.score),score:e.score});const a=RH();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=r.width,a.height=r.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Yct(i,a);let s=e.x+14;e.people.forEach((t=>{const r=e.actors[t].color,n={cx:s,cy:e.y,r:7,fill:r,stroke:"#000",title:t,pos:e.actors[t].position};Vct(i,n),s+=10})),eht(r)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},r,e.colour)}),"drawTask"),tht=o((function(t,e){AH(t,e)}),"drawBackgroundRect"),eht=function(){function t(t,e,r,i,a,s,o,l){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(/<br\s*\/?>/gi);for(let t=0;t<d.length;t++){const l=t*h-h*(d.length-1)/2,p=e.append("text").attr("x",r+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",r+a/2).attr("dy",l).text(d[t]),p.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(p,o)}}function r(t,r,i,a,s,o,l,c){const h=r.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,o,l,c),n(u,l)}function n(t,e){for(const r in e)r in e&&t.attr(r,e[r])}return o(t,"byText"),o(e,"byTspan"),o(r,"byFo"),o(n,"_setTextAttrs"),function(n){return"fo"===n.textPlacement?r:"old"===n.textPlacement?t:e}}(),rht={drawRect:Yct,drawCircle:Vct,drawSection:Zct,drawText:Xct,drawLabel:Kct,drawTask:Jct,drawBackgroundRect:tht,initGraphics:o((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")}),"initGraphics")},nht=o((function(t){Object.keys(t).forEach((function(e){sht[e]=t[e]}))}),"setConf"),iht={};function aht(t){const e=Qr().journey;let r=60;Object.keys(iht).forEach((n=>{const i=iht[n].color,a={cx:20,cy:r,r:7,fill:i,stroke:"#000",pos:iht[n].position};rht.drawCircle(t,a);const s={x:40,y:r+7,fill:"#666",text:n,textMargin:5|e.boxTextMargin};rht.drawText(t,s),r+=20}))}o(aht,"drawActorLegend");var sht=Qr().journey,oht=sht.leftMargin,lht=o((function(t,e,r,n){const i=Qr().journey,a=Qr().securityLevel;let s;"sandbox"===a&&(s=Ga("#i"+e));const o=Ga("sandbox"===a?s.nodes()[0].contentDocument.body:"body");cht.init();const l=o.select("#"+e);rht.initGraphics(l);const c=n.db.getTasks(),h=n.db.getDiagramTitle(),u=n.db.getActors();for(const t in iht)delete iht[t];let d=0;u.forEach((t=>{iht[t]={color:i.actorColours[d%i.actorColours.length],position:d},d++})),aht(l),cht.insert(0,0,oht,50*Object.keys(iht).length),dht(l,c,0);const p=cht.getBounds();h&&l.append("text").text(h).attr("x",oht).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=p.stopy-p.starty+2*i.diagramMarginY,f=oht+p.stopx+2*i.diagramMarginX;Rr(l,g,f,i.useMaxWidth),l.append("line").attr("x1",oht).attr("y1",4*i.height).attr("x2",f-oht-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"),cht={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:o((function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0}),"init"),updateVal:o((function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])}),"updateVal"),updateBounds:o((function(t,e,r,n){const i=Qr().journey,a=this;let s=0;function l(l){return o((function(o){s++;const c=a.sequenceItems.length-s+1;a.updateVal(o,"starty",e-c*i.boxMargin,Math.min),a.updateVal(o,"stopy",n+c*i.boxMargin,Math.max),a.updateVal(cht.data,"startx",t-c*i.boxMargin,Math.min),a.updateVal(cht.data,"stopx",r+c*i.boxMargin,Math.max),"activation"!==l&&(a.updateVal(o,"startx",t-c*i.boxMargin,Math.min),a.updateVal(o,"stopx",r+c*i.boxMargin,Math.max),a.updateVal(cht.data,"starty",e-c*i.boxMargin,Math.min),a.updateVal(cht.data,"stopy",n+c*i.boxMargin,Math.max))}),"updateItemBounds")}o(l,"updateFn"),this.sequenceItems.forEach(l())}),"updateBounds"),insert:o((function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(cht.data,"startx",i,Math.min),this.updateVal(cht.data,"starty",s,Math.min),this.updateVal(cht.data,"stopx",a,Math.max),this.updateVal(cht.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)}),"insert"),bumpVerticalPos:o((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos}),"bumpVerticalPos"),getVerticalPos:o((function(){return this.verticalPos}),"getVerticalPos"),getBounds:o((function(){return this.data}),"getBounds")},hht=sht.sectionFills,uht=sht.sectionColours,dht=o((function(t,e,r){const n=Qr().journey;let i="";const a=r+(2*n.height+n.diagramMarginY);let s=0,o="#CCC",l="black",c=0;for(const[r,h]of e.entries()){if(i!==h.section){o=hht[s%hht.length],c=s%hht.length,l=uht[s%uht.length];let a=0;const u=h.section;for(let t=r;t<e.length&&e[t].section==u;t++)a+=1;const d={x:r*n.taskMargin+r*n.width+oht,y:50,text:h.section,fill:o,num:c,colour:l,taskCount:a};rht.drawSection(t,d,n),i=h.section,s++}const u=h.people.reduce(((t,e)=>(iht[e]&&(t[e]=iht[e]),t)),{});h.x=r*n.taskMargin+r*n.width+oht,h.y=a,h.width=n.diagramMarginX,h.height=n.diagramMarginY,h.colour=l,h.fill=o,h.num=c,h.actors=u,rht.drawTask(t,h,n),cht.insert(h.x,h.y,h.x+h.width+n.taskMargin,450)}}),"drawTasks"),pht={setConf:nht,draw:lht},ght={parser:Nct,db:jct,renderer:pht,styles:Wct,init:o((t=>{pht.setConf(t.journey),jct.clear()}),"init")},fht=Object.freeze({__proto__:null,diagram:ght}),mht=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[6,8,10,11,12,14,16,17,20,21],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],l=[1,16],c=[1,17],h={trace:o((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:o((function(t,e,r,n,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:n.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 9:this.$=a[o].trim(),n.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=a[o].trim(),n.getCommonDb().setAccDescription(this.$);break;case 12:n.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 15:n.addTask(a[o],0,""),this.$=a[o];break;case 16:n.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:r,12:n,14:i,16:a,17:s,18:14,19:15,20:l,21:c},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:18,11:r,12:n,14:i,16:a,17:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},u=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,o(d,"Parser"),d.prototype=h,h.Parser=d,new d}();mht.parser=mht;var yht=mht,vht={};h(vht,{addEvent:()=>Nht,addSection:()=>Cht,addTask:()=>Lht,addTaskOrg:()=>Iht,clear:()=>Eht,default:()=>Mht,getCommonDb:()=>_ht,getSections:()=>Sht,getTasks:()=>Aht});var xht="",bht=0,wht=[],kht=[],Tht=[],_ht=o((()=>$r),"getCommonDb"),Eht=o((function(){wht.length=0,kht.length=0,xht="",Tht.length=0,qr()}),"clear"),Cht=o((function(t){xht=t,wht.push(t)}),"addSection"),Sht=o((function(){return wht}),"getSections"),Aht=o((function(){let t=Rht();let e=0;for(;!t&&e<100;)t=Rht(),e++;return kht.push(...Tht),kht}),"getTasks"),Lht=o((function(t,e,r){const n={id:bht++,section:xht,type:xht,task:t,score:e||0,events:r?[r]:[]};Tht.push(n)}),"addTask"),Nht=o((function(t){Tht.find((t=>t.id===bht-1)).events.push(t)}),"addEvent"),Iht=o((function(t){const e={section:xht,type:xht,description:t,task:t,classes:[]};kht.push(e)}),"addTaskOrg"),Rht=o((function(){const t=o((function(t){return Tht[t].processed}),"compileTask");let e=!0;for(const[r,n]of Tht.entries())t(r),e=e&&n.processed;return e}),"compileTasks"),Mht={clear:Eht,getCommonDb:_ht,addSection:Cht,getSections:Sht,getTasks:Aht,addTask:Lht,addTaskOrg:Iht,addEvent:Nht},Dht=o((function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),void 0!==e.class&&r.attr("class",e.class),r}),"drawRect"),Oht=o((function(t,e){const r=15,n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",r).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const n=lu().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function s(t){const n=lu().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(r/2.2);t.append("path").attr("class","mouth").attr("d",n).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"),o(a,"smile"),o(s,"sad"),o(l,"ambivalent"),e.score>3?a(i):e.score<3?s(i):l(i),n}),"drawFace"),Pht=o((function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),void 0!==r.class&&r.attr("class",r.class),void 0!==e.title&&r.append("title").text(e.title),r}),"drawCircle"),Bht=o((function(t,e){const r=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),void 0!==e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(r),n}),"drawText"),$ht=o((function(t,e){function r(t,e,r,n,i){return t+","+e+" "+(t+r)+","+e+" "+(t+r)+","+(e+n-i)+" "+(t+r-1.2*i)+","+(e+n)+" "+t+","+(e+n)}o(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,Bht(t,e)}),"drawLabel"),Fht=o((function(t,e,r){const n=t.append("g"),i=jht();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,Dht(n,i),Wht(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)}),"drawSection"),zht=-1,Uht=o((function(t,e,r){const n=e.x+r.width/2,i=t.append("g");zht++;i.append("line").attr("id","task"+zht).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Oht(i,{cx:n,cy:300+30*(5-e.score),score:e.score});const a=jht();a.x=e.x,a.y=e.y,a.fill=e.fill,a.width=r.width,a.height=r.height,a.class="task task-type-"+e.num,a.rx=3,a.ry=3,Dht(i,a),Wht(r)(e.task,i,a.x,a.y,a.width,a.height,{class:"task"},r,e.colour)}),"drawTask"),Ght=o((function(t,e){Dht(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()}),"drawBackgroundRect"),qht=o((function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}}),"getTextObj"),jht=o((function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),Wht=function(){function t(t,e,r,i,a,s,o,l){n(e.append("text").attr("x",r+a/2).attr("y",i+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,r,i,a,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,d=t.split(/<br\s*\/?>/gi);for(let t=0;t<d.length;t++){const l=t*h-h*(d.length-1)/2,p=e.append("text").attr("x",r+a/2).attr("y",i).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",r+a/2).attr("dy",l).text(d[t]),p.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(p,o)}}function r(t,r,i,a,s,o,l,c){const h=r.append("switch"),u=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,a,s,o,l,c),n(u,l)}function n(t,e){for(const r in e)r in e&&t.attr(r,e[r])}return o(t,"byText"),o(e,"byTspan"),o(r,"byFo"),o(n,"_setTextAttrs"),function(n){return"fo"===n.textPlacement?r:"old"===n.textPlacement?t:e}}(),Yht=o((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")}),"initGraphics");function Hht(t,e){t.each((function(){var t,r=Ga(this),n=r.text().split(/(\s+|<br>)/).reverse(),i=[],a=r.attr("y"),s=parseFloat(r.attr("dy")),o=r.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let s=0;s<n.length;s++)t=n[n.length-1-s],i.push(t),o.text(i.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(i.pop(),o.text(i.join(" ").trim()),i="<br>"===t?[""]:[t],o=r.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))}))}o(Hht,"wrap");var Vht=o((function(t,e,r,n){const i=r%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(Hht,e.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.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+")"),Kht(s,e,i,n),e}),"drawNode"),Xht=o((function(t,e,r){const n=t.append("g"),i=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(Hht,e.width).node().getBBox(),a=r.fontSize?.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),i.height+1.1*a*.5+e.padding}),"getVirtualNodeHeight"),Kht=o((function(t,e,r){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-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)}),"defaultBkg"),Zht={drawRect:Dht,drawCircle:Pht,drawSection:Fht,drawText:Bht,drawLabel:$ht,drawTask:Uht,drawBackgroundRect:Ght,getTextObj:qht,getNoteRect:jht,initGraphics:Yht,drawNode:Vht,getVirtualNodeHeight:Xht},Qht=o((function(t,e,r,n){const i=Qr(),a=i.leftMargin??50;y.debug("timeline",n.db);const s=i.securityLevel;let o;"sandbox"===s&&(o=Ga("#i"+e));const l=Ga("sandbox"===s?o.nodes()[0].contentDocument.body:"body").select("#"+e);l.append("g");const c=n.db.getTasks(),h=n.db.getCommonDb().getDiagramTitle();y.debug("task",c),Zht.initGraphics(l);const u=n.db.getSections();y.debug("sections",u);let d=0,p=0,g=0,f=0,m=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},r=Zht.getVirtualNodeHeight(l,e,i);y.debug("sectionHeight before draw",r),d=Math.max(d,r+20)}));let w=0,k=0;y.debug("tasks.length",c.length);for(const[t,e]of c.entries()){const r={number:t,descr:e,section:e.section,width:150,padding:20,maxHeight:p},n=Zht.getVirtualNodeHeight(l,r,i);y.debug("taskHeight before draw",n),p=Math.max(p,n+20),w=Math.max(w,e.events.length);let a=0;for(const t of e.events){const r={descr:t,section:e.section,number:e.section,width:150,padding:20,maxHeight:50};a+=Zht.getVirtualNodeHeight(l,r,i)}k=Math.max(k,a)}y.debug("maxSectionHeight before draw",d),y.debug("maxTaskHeight before draw",p),u&&u.length>0?u.forEach((t=>{const e=c.filter((e=>e.section===t)),r={number:x,descr:t,section:x,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:d};y.debug("sectionNode",r);const n=l.append("g"),a=Zht.drawNode(n,r,x,i);y.debug("sectionNode output",a),n.attr("transform",`translate(${m}, 50)`),v+=d+50,e.length>0&&Jht(l,e,x,m,v,p,i,w,k,d,!1),m+=200*Math.max(e.length,1),v=50,x++})):(b=!1,Jht(l,c,x,m,v,p,i,w,k,d,!0));const T=l.node().getBBox();y.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)"),Mr(void 0,l,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)}),"draw"),Jht=o((function(t,e,r,n,i,a,s,o,l,c,h){for(const o of e){const e={descr:o.task,section:r,number:r,width:150,padding:20,maxHeight:a};y.debug("taskNode",e);const u=t.append("g").attr("class","taskWrapper"),d=Zht.drawNode(u,e,r,s).height;if(y.debug("taskHeight after draw",d),u.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,d),o.events){const e=t.append("g").attr("class","lineWrapper");let u=a;i+=100,u+=tut(t,o.events,r,n,i,s),i-=100,e.append("line").attr("x1",n+95).attr("y1",i+a).attr("x2",n+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")}n+=200,h&&!s.timeline?.disableMulticolor&&r++}i-=10}),"drawTasks"),tut=o((function(t,e,r,n,i,a){let s=0;const o=i;i+=100;for(const o of e){const e={descr:o,section:r,number:r,width:150,padding:20,maxHeight:50};y.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),c=Zht.drawNode(l,e,r,a).height;s+=c,l.attr("transform",`translate(${n}, ${i})`),i=i+10+c}return i=o,s}),"drawEvents"),eut={setConf:o((()=>{}),"setConf"),draw:Qht},rut=o((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],it(t["lineColor"+e])?t["lineColor"+e]=st(t["lineColor"+e],20):t["lineColor"+e]=ot(t["lineColor"+e],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=""+(17-3*r);e+=`\n .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} path {\n fill: ${t["cScale"+r]};\n }\n .section-${r-1} text {\n fill: ${t["cScaleLabel"+r]};\n }\n .node-icon-${r-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+r]};\n }\n .section-edge-${r-1}{\n stroke: ${t["cScale"+r]};\n }\n .edge-depth-${r-1}{\n stroke-width: ${n};\n }\n .section-${r-1} line {\n stroke: ${t["cScaleInv"+r]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+r]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e}),"genSections"),nut={db:vht,renderer:eut,parser:yht,styles:o((t=>`\n .edge {\n stroke-width: 3;\n }\n ${rut(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")},iut=Object.freeze({__proto__:null,diagram:nut});function aut(t){return(aut="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 sut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function out(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lut(t,e,r){return e&&out(t.prototype,e),r&&out(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cut(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hut(t,e){return put(t)||fut(t,e)||mut(t,e)||xut()}function uut(t){return dut(t)||gut(t)||mut(t)||vut()}function dut(t){if(Array.isArray(t))return yut(t)}function put(t){if(Array.isArray(t))return t}function gut(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function fut(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a=[],s=!0,o=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);s=!0);}catch(t){o=!0,i=t}finally{try{s||null==r.return||r.return()}finally{if(o)throw i}}return a}}function mut(t,e){if(t){if("string"==typeof t)return yut(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yut(t,e):void 0}}function yut(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vut(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function xut(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function but(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=mut(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=o((function(){}),"F");return{s:i,n:o((function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}),"n"),e:o((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,s=!0,l=!1;return{s:o((function(){r=r.call(t)}),"s"),n:o((function(){var t=r.next();return s=t.done,t}),"n"),e:o((function(t){l=!0,a=t}),"e"),f:o((function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}),"f")}}o(aut,"_typeof"),o(sut,"_classCallCheck"),o(out,"_defineProperties"),o(lut,"_createClass"),o(cut,"_defineProperty$1"),o(hut,"_slicedToArray"),o(uut,"_toConsumableArray"),o(dut,"_arrayWithoutHoles"),o(put,"_arrayWithHoles"),o(gut,"_iterableToArray"),o(fut,"_iterableToArrayLimit"),o(mut,"_unsupportedIterableToArray"),o(yut,"_arrayLikeToArray"),o(vut,"_nonIterableSpread"),o(xut,"_nonIterableRest"),o(but,"_createForOfIteratorHelper");var wut="undefined"==typeof window?null:window,kut=wut?wut.navigator:null;wut&&wut.document;var Tut=aut(""),_ut=aut({}),Eut=aut((function(){})),Cut="undefined"==typeof HTMLElement?"undefined":aut(HTMLElement),Sut=o((function(t){return t&&t.instanceString&&Lut(t.instanceString)?t.instanceString():null}),"instanceStr"),Aut=o((function(t){return null!=t&&aut(t)==Tut}),"string"),Lut=o((function(t){return null!=t&&aut(t)===Eut}),"fn"),Nut=o((function(t){return!Put(t)&&(Array.isArray?Array.isArray(t):null!=t&&t instanceof Array)}),"array"),Iut=o((function(t){return null!=t&&aut(t)===_ut&&!Nut(t)&&t.constructor===Object}),"plainObject"),Rut=o((function(t){return null!=t&&aut(t)===_ut}),"object"),Mut=o((function(t){return null!=t&&aut(t)===aut(1)&&!isNaN(t)}),"number"),Dut=o((function(t){return Mut(t)&&Math.floor(t)===t}),"integer"),Out=o((function(t){return"undefined"===Cut?void 0:null!=t&&t instanceof HTMLElement}),"htmlElement"),Put=o((function(t){return But(t)||$ut(t)}),"elementOrCollection"),But=o((function(t){return"collection"===Sut(t)&&t._private.single}),"element"),$ut=o((function(t){return"collection"===Sut(t)&&!t._private.single}),"collection"),Fut=o((function(t){return"core"===Sut(t)}),"core"),zut=o((function(t){return"stylesheet"===Sut(t)}),"stylesheet"),Uut=o((function(t){return"event"===Sut(t)}),"event"),Gut=o((function(t){return null==t||!(""!==t&&!t.match(/^\s+$/))}),"emptyString"),qut=o((function(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement}),"domElement"),jut=o((function(t){return Iut(t)&&Mut(t.x1)&&Mut(t.x2)&&Mut(t.y1)&&Mut(t.y2)}),"boundingBox"),Wut=o((function(t){return Rut(t)&&Lut(t.then)}),"promise"),Yut=o((function(){return kut&&kut.userAgent.match(/msie|trident|edge/i)}),"ms"),Hut=o((function(t,e){e||(e=o((function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);return t.join("$")}),"keyFn"));var r=o((function r(){var n,i=this,a=arguments,s=e.apply(i,a),o=r.cache;return(n=o[s])||(n=o[s]=t.apply(i,a)),n}),"memoizedFn");return r.cache={},r}),"memoize"),Vut=Hut((function(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))})),Xut=Hut((function(t){return t.replace(/(-\w)/g,(function(t){return t[1].toUpperCase()}))})),Kut=Hut((function(t,e){return t+e[0].toUpperCase()+e.substring(1)}),(function(t,e){return t+"$"+e})),Zut=o((function(t){return Gut(t)?t:t.charAt(0).toUpperCase()+t.substring(1)}),"capitalize"),Qut="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Jut=o((function(t,e){return t<e?-1:t>e?1:0}),"ascending"),tdt=o((function(t,e){return-1*Jut(t,e)}),"descending"),edt=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(null!=n)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a];t[s]=n[s]}}return t},rdt=o((function(t){if((4===t.length||7===t.length)&&"#"===t[0]){var e,r,n,i=16;return 4===t.length?(e=parseInt(t[1]+t[1],i),r=parseInt(t[2]+t[2],i),n=parseInt(t[3]+t[3],i)):(e=parseInt(t[1]+t[2],i),r=parseInt(t[3]+t[4],i),n=parseInt(t[5]+t[6],i)),[e,r,n]}}),"hex2tuple"),ndt=o((function(t){var e,r,n,i,a,s,l,c;function h(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}o(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((r=parseInt(u[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(n=parseFloat(u[2]))<0||n>100)return;if(n/=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===n)s=l=c=Math.round(255*i);else{var d=i<.5?i*(1+n):i+n-i*n,p=2*i-d;s=Math.round(255*h(p,d,r+1/3)),l=Math.round(255*h(p,d,r)),c=Math.round(255*h(p,d,r-1/3))}e=[s,l,c,a]}return e}),"hsl2tuple"),idt=o((function(t){var e,r=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(r){e=[];for(var n=[],i=1;i<=3;i++){var a=r[i];if("%"===a[a.length-1]&&(n[i]=!0),a=parseFloat(a),n[i]&&(a=a/100*255),a<0||a>255)return;e.push(Math.floor(a))}var s=n[1]||n[2]||n[3],o=n[1]&&n[2]&&n[3];if(s&&!o)return;var l=r[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;e.push(l)}}return e}),"rgb2tuple"),adt=o((function(t){return odt[t.toLowerCase()]}),"colorname2tuple"),sdt=o((function(t){return(Nut(t)?t:null)||adt(t)||rdt(t)||idt(t)||ndt(t)}),"color2tuple"),odt={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]},ldt=o((function(t){for(var e=t.map,r=t.keys,n=r.length,i=0;i<n;i++){var a=r[i];if(Iut(a))throw Error("Tried to set map with object key");i<r.length-1?(null==e[a]&&(e[a]={}),e=e[a]):e[a]=t.value}}),"setMap"),cdt=o((function(t){for(var e=t.map,r=t.keys,n=r.length,i=0;i<n;i++){var a=r[i];if(Iut(a))throw Error("Tried to get map with object key");if(null==(e=e[a]))return e}return e}),"getMap");function hdt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}o(hdt,"isObject");var udt=hdt,ddt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function pdt(t,e){return t(e={exports:{}},e.exports),e.exports}o(pdt,"createCommonjsModule");var gdt="object"==typeof ddt&&ddt&&ddt.Object===Object&&ddt,fdt="object"==typeof self&&self&&self.Object===Object&&self,mdt=gdt||fdt||Function("return this")(),ydt=o((function(){return mdt.Date.now()}),"now"),vdt=/\s/;function xdt(t){for(var e=t.length;e--&&vdt.test(t.charAt(e)););return e}o(xdt,"trimmedEndIndex");var bdt=xdt,wdt=/^\s+/;function kdt(t){return t?t.slice(0,bdt(t)+1).replace(wdt,""):t}o(kdt,"baseTrim");var Tdt=kdt,_dt=mdt.Symbol,Edt=Object.prototype,Cdt=Edt.hasOwnProperty,Sdt=Edt.toString,Adt=_dt?_dt.toStringTag:void 0;function Ldt(t){var e=Cdt.call(t,Adt),r=t[Adt];try{t[Adt]=void 0;var n=!0}catch(t){}var i=Sdt.call(t);return n&&(e?t[Adt]=r:delete t[Adt]),i}o(Ldt,"getRawTag");var Ndt=Ldt,Idt=Object.prototype.toString;function Rdt(t){return Idt.call(t)}o(Rdt,"objectToString");var Mdt=Rdt,Ddt=_dt?_dt.toStringTag:void 0;function Odt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ddt&&Ddt in Object(t)?Ndt(t):Mdt(t)}o(Odt,"baseGetTag");var Pdt=Odt;function Bdt(t){return null!=t&&"object"==typeof t}o(Bdt,"isObjectLike");var $dt=Bdt;function Fdt(t){return"symbol"==typeof t||$dt(t)&&"[object Symbol]"==Pdt(t)}o(Fdt,"isSymbol");var zdt=Fdt,Udt=/^[-+]0x[0-9a-f]+$/i,Gdt=/^0b[01]+$/i,qdt=/^0o[0-7]+$/i,jdt=parseInt;function Wdt(t){if("number"==typeof t)return t;if(zdt(t))return NaN;if(udt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=udt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Tdt(t);var r=Gdt.test(t);return r||qdt.test(t)?jdt(t.slice(2),r?2:8):Udt.test(t)?NaN:+t}o(Wdt,"toNumber");var Ydt=Wdt,Hdt=Math.max,Vdt=Math.min;function Xdt(t,e,r){var n,i,a,s,l,c,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=n,a=i;return n=i=void 0,h=e,s=t.apply(a,r)}function f(t){return h=t,l=setTimeout(v,e),u?g(t):s}function m(t){var r=e-(t-c);return d?Vdt(r,a-(t-h)):r}function y(t){var r=t-c;return void 0===c||r>=e||r<0||d&&t-h>=a}function v(){var t=ydt();if(y(t))return x(t);l=setTimeout(v,m(t))}function x(t){return l=void 0,p&&n?g(t):(n=i=void 0,s)}function b(){void 0!==l&&clearTimeout(l),h=0,n=c=i=l=void 0}function w(){return void 0===l?s:x(ydt())}function k(){var t=ydt(),r=y(t);if(n=arguments,i=this,c=t,r){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)),s}return e=Ydt(e)||0,udt(r)&&(u=!!r.leading,a=(d="maxWait"in r)?Hdt(Ydt(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),o(g,"invokeFunc"),o(f,"leadingEdge"),o(m,"remainingWait"),o(y,"shouldInvoke"),o(v,"timerExpired"),o(x,"trailingEdge"),o(b,"cancel"),o(w,"flush"),o(k,"debounced"),k.cancel=b,k.flush=w,k}o(Xdt,"debounce");var Kdt=Xdt,Zdt=wut?wut.performance:null,Qdt=Zdt&&Zdt.now?function(){return Zdt.now()}:function(){return Date.now()},Jdt=function(){if(wut){if(wut.requestAnimationFrame)return function(t){wut.requestAnimationFrame(t)};if(wut.mozRequestAnimationFrame)return function(t){wut.mozRequestAnimationFrame(t)};if(wut.webkitRequestAnimationFrame)return function(t){wut.webkitRequestAnimationFrame(t)};if(wut.msRequestAnimationFrame)return function(t){wut.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout((function(){t(Qdt())}),1e3/60)}}(),tpt=o((function(t){return Jdt(t)}),"requestAnimationFrame"),ept=Qdt,rpt=9261,npt=65599,ipt=5381,apt=o((function(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rpt,n=r;!(e=t.next()).done;)n=n*npt+e.value|0;return n}),"hashIterableInts"),spt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rpt;return e*npt+t|0}),"hashInt"),opt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ipt;return(e<<5)+e+t|0}),"hashIntAlt"),lpt=o((function(t,e){return 2097152*t+e}),"combineHashes"),cpt=o((function(t){return 2097152*t[0]+t[1]}),"combineHashesArray"),hpt=o((function(t,e){return[spt(t[0],e[0]),opt(t[1],e[1])]}),"hashArrays"),upt=o((function(t,e){var r={value:0,done:!1},n=0,i=t.length;return apt({next:o((function(){return n<i?r.value=t[n++]:r.done=!0,r}),"next")},e)}),"hashIntsArray"),dpt=o((function(t,e){var r={value:0,done:!1},n=0,i=t.length;return apt({next:o((function(){return n<i?r.value=t.charCodeAt(n++):r.done=!0,r}),"next")},e)}),"hashString"),ppt=o((function(){return gpt(arguments)}),"hashStrings"),gpt=o((function(t){for(var e,r=0;r<t.length;r++){var n=t[r];e=0===r?dpt(n):dpt(n,e)}return e}),"hashStringsArray"),fpt=!0,mpt=null!=console.warn,ypt=null!=console.trace,vpt=Number.MAX_SAFE_INTEGER||9007199254740991,xpt=o((function(){return!0}),"trueify"),bpt=o((function(){return!1}),"falsify"),wpt=o((function(){return 0}),"zeroify"),kpt=o((function(){}),"noop"),Tpt=o((function(t){throw new Error(t)}),"error"),_pt=o((function(t){if(void 0===t)return fpt;fpt=!!t}),"warnings"),Ept=o((function(t){_pt()&&(mpt?console.warn(t):(console.log(t),ypt&&console.trace()))}),"warn"),Cpt=o((function(t){return edt({},t)}),"clone"),Spt=o((function(t){return null==t?t:Nut(t)?t.slice():Iut(t)?Cpt(t):t}),"copy"),Apt=o((function(t){return t.slice()}),"copyArray"),Lpt=o((function(t,e){for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e}),"uuid"),Npt={},Ipt=o((function(){return Npt}),"staticEmptyObject"),Rpt=o((function(t){var e=Object.keys(t);return function(r){for(var n={},i=0;i<e.length;i++){var a=e[i],s=null==r?void 0:r[a];n[a]=void 0===s?t[a]:s}return n}}),"defaults"),Mpt=o((function(t,e,r){for(var n=t.length-1;n>=0&&(t[n]!==e||(t.splice(n,1),!r));n--);}),"removeFromArray"),Dpt=o((function(t){t.splice(0,t.length)}),"clearArray"),Opt=o((function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.push(n)}}),"push"),Ppt=o((function(t,e,r){return r&&(e=Kut(r,e)),t[e]}),"getPrefixedProperty"),Bpt=o((function(t,e,r,n){r&&(e=Kut(r,e)),t[e]=n}),"setPrefixedProperty"),$pt="undefined"!=typeof Map?Map:function(){function t(){sut(this,t),this._obj={}}return o(t,"ObjectMap"),lut(t,[{key:"set",value:o((function(t,e){return this._obj[t]=e,this}),"set")},{key:"delete",value:o((function(t){return this._obj[t]=void 0,this}),"_delete")},{key:"clear",value:o((function(){this._obj={}}),"clear")},{key:"has",value:o((function(t){return void 0!==this._obj[t]}),"has")},{key:"get",value:o((function(t){return this._obj[t]}),"get")}]),t}(),Fpt=function(){function t(e){if(sut(this,t),this._obj=Object.create(null),this.size=0,null!=e){var r;r=null!=e.instanceString&&e.instanceString()===this.instanceString()?e.toArray():e;for(var n=0;n<r.length;n++)this.add(r[n])}}return o(t,"ObjectSet"),lut(t,[{key:"instanceString",value:o((function(){return"set"}),"instanceString")},{key:"add",value:o((function(t){var e=this._obj;1!==e[t]&&(e[t]=1,this.size++)}),"add")},{key:"delete",value:o((function(t){var e=this._obj;1===e[t]&&(e[t]=0,this.size--)}),"_delete")},{key:"clear",value:o((function(){this._obj=Object.create(null)}),"clear")},{key:"has",value:o((function(t){return 1===this._obj[t]}),"has")},{key:"toArray",value:o((function(){var t=this;return Object.keys(this._obj).filter((function(e){return t.has(e)}))}),"toArray")},{key:"forEach",value:o((function(t,e){return this.toArray().forEach(t,e)}),"forEach")}]),t}(),zpt="undefined"!==("undefined"==typeof Set?"undefined":aut(Set))?Set:Fpt,Upt=o((function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==t&&void 0!==e&&Fut(t)){var n=e.group;if(null==n&&(n=e.data&&null!=e.data.source&&null!=e.data.target?"edges":"nodes"),"nodes"===n||"edges"===n){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:n,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"===n:!!e.pannable,active:!1,classes:new zpt,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=[];Nut(e.classes)?l=e.classes:Aut(e.classes)&&(l=e.classes.split(/\s+/));for(var c=0,h=l.length;c<h;c++){var u=l[c];u&&""!==u&&i.classes.add(u)}this.createEmitter();var d=e.style||e.css;d&&(Ept("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(void 0===r||r)&&this.restore()}else Tpt("An element must be of type `nodes` or `edges`; you specified `"+n+"`")}else Tpt("An element must have a core reference and parameters set")}),"Element"),Gpt=o((function(t){return t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs},o((function(e,r,n){var i;Iut(e)&&!Put(e)&&(e=(i=e).roots||i.root,r=i.visit,n=i.directed),n=2!==arguments.length||Lut(r)?n:r,r=Lut(r)?r:function(){};for(var a,s=this._private.cy,l=e=Aut(e)?this.filter(e):e,c=[],h=[],u={},d={},p={},g=0,f=this.byGroup(),m=f.nodes,y=f.edges,v=0;v<l.length;v++){var x=l[v],b=x.id();x.isNode()&&(c.unshift(x),t.bfs&&(p[b]=!0,h.push(x)),d[b]=0)}for(var w=o((function(){var e=t.bfs?c.shift():c.pop(),i=e.id();if(t.dfs){if(p[i])return"continue";p[i]=!0,h.push(e)}var s,o=d[i],l=u[i],f=null!=l?l.source():null,v=null!=l?l.target():null,x=null==l?void 0:e.same(f)?v[0]:f[0];if(!0===(s=r(e,l,x,g++,o)))return a=e,"break";if(!1===s)return"break";for(var b=e.connectedEdges().filter((function(t){return(!n||t.source().same(e))&&y.has(t)})),w=0;w<b.length;w++){var k=b[w],T=k.connectedNodes().filter((function(t){return!t.same(e)&&m.has(t)})),_=T.id();0===T.length||p[_]||(T=T[0],c.push(T),t.bfs&&(p[_]=!0,h.push(T)),u[_]=k,d[_]=d[i]+1)}}),"_loop");0!==c.length;){var k=w();if("continue"!==k&&"break"===k)break}for(var T=s.collection(),_=0;_<h.length;_++){var E=h[_],C=u[E.id()];null!=C&&T.push(C),T.push(E)}return{path:s.collection(T),found:s.collection(a)}}),"searchFn")}),"defineSearch"),qpt={breadthFirstSearch:Gpt({bfs:!0}),depthFirstSearch:Gpt({dfs:!0})};qpt.bfs=qpt.breadthFirstSearch,qpt.dfs=qpt.depthFirstSearch;var jpt=pdt((function(t,e){(function(){var e,r,n,i,a,s,l,c,h,u,d,p,g,f,m;n=Math.floor,u=Math.min,r=o((function(t,e){return t<e?-1:t>e?1:0}),"defaultCmp"),h=o((function(t,e,i,a,s){var o;if(null==i&&(i=0),null==s&&(s=r),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=t.length);i<a;)s(e,t[o=n((i+a)/2)])<0?a=o:i=o+1;return[].splice.apply(t,[i,i-i].concat(e)),e}),"insort"),s=o((function(t,e,n){return null==n&&(n=r),t.push(e),f(t,0,t.length-1,n)}),"heappush"),a=o((function(t,e){var n,i;return null==e&&(e=r),n=t.pop(),t.length?(i=t[0],t[0]=n,m(t,0,e)):i=n,i}),"heappop"),c=o((function(t,e,n){var i;return null==n&&(n=r),i=t[0],t[0]=e,m(t,0,n),i}),"heapreplace"),l=o((function(t,e,n){var i;return null==n&&(n=r),t.length&&n(t[0],e)<0&&(e=(i=[t[0],e])[0],t[0]=i[1],m(t,0,n)),e}),"heappushpop"),i=o((function(t,e){var i,a,s,o,l,c;for(null==e&&(e=r),l=[],a=0,s=(o=function(){c=[];for(var e=0,r=n(t.length/2);0<=r?e<r:e>r;0<=r?e++:e--)c.push(e);return c}.apply(this).reverse()).length;a<s;a++)i=o[a],l.push(m(t,i,e));return l}),"heapify"),g=o((function(t,e,n){var i;if(null==n&&(n=r),-1!==(i=t.indexOf(e)))return f(t,0,i,n),m(t,i,n)}),"updateItem"),d=o((function(t,e,n){var a,s,o,c,h;if(null==n&&(n=r),!(s=t.slice(0,e)).length)return s;for(i(s,n),o=0,c=(h=t.slice(e)).length;o<c;o++)a=h[o],l(s,a,n);return s.sort(n).reverse()}),"nlargest"),p=o((function(t,e,n){var s,o,l,c,d,p,g,f,m;if(null==n&&(n=r),10*e<=t.length){if(!(l=t.slice(0,e).sort(n)).length)return l;for(o=l[l.length-1],c=0,p=(g=t.slice(e)).length;c<p;c++)n(s=g[c],o)<0&&(h(l,s,0,null,n),l.pop(),o=l[l.length-1]);return l}for(i(t,n),m=[],d=0,f=u(e,t.length);0<=f?d<f:d>f;0<=f?++d:--d)m.push(a(t,n));return m}),"nsmallest"),f=o((function(t,e,n,i){var a,s,o;for(null==i&&(i=r),a=t[n];n>e&&i(a,s=t[o=n-1>>1])<0;)t[n]=s,n=o;return t[n]=a}),"_siftdown"),m=o((function(t,e,n){var i,a,s,o,l;for(null==n&&(n=r),a=t.length,l=e,s=t[e],i=2*e+1;i<a;)(o=i+1)<a&&!(n(t[i],t[o])<0)&&(i=o),t[e]=t[i],i=2*(e=i)+1;return t[e]=s,f(t,l,e,n)}),"_siftup"),e=function(){function t(t){this.cmp=null!=t?t:r,this.nodes=[]}return t.push=s,t.pop=a,t.replace=c,t.pushpop=l,t.heapify=i,t.updateItem=g,t.nlargest=d,t.nsmallest=p,o(t,"Heap"),t.prototype.push=function(t){return s(this.nodes,t,this.cmp)},t.prototype.pop=function(){return a(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(t){return-1!==this.nodes.indexOf(t)},t.prototype.replace=function(t){return c(this.nodes,t,this.cmp)},t.prototype.pushpop=function(t){return l(this.nodes,t,this.cmp)},t.prototype.heapify=function(){return i(this.nodes,this.cmp)},t.prototype.updateItem=function(t){return g(this.nodes,t,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return(e=new t).nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}(),t.exports=e}).call(ddt)})),Wpt=jpt,Ypt=Rpt({root:null,weight:o((function(t){return 1}),"weight"),directed:!1}),Hpt={dijkstra:o((function(t){if(!Iut(t)){var e=arguments;t={root:e[0],weight:e[1],directed:e[2]}}var r=Ypt(t),n=r.root,i=r.weight,a=r.directed,s=this,l=i,c=Aut(n)?this.filter(n)[0]:n[0],h={},u={},d={},p=this.byGroup(),g=p.nodes,f=p.edges;f.unmergeBy((function(t){return t.isLoop()}));for(var m=o((function(t){return h[t.id()]}),"getDist"),y=o((function(t,e){h[t.id()]=e,v.updateItem(t)}),"setDist"),v=new Wpt((function(t,e){return m(t)-m(e)})),x=0;x<g.length;x++){var b=g[x];h[b.id()]=b.same(c)?0:1/0,v.push(b)}for(var w=o((function(t,e){for(var r,n=(a?t.edgesTo(e):t.edgesWith(e)).intersect(f),i=1/0,s=0;s<n.length;s++){var o=n[s],c=l(o);(c<i||!r)&&(i=c,r=o)}return{edge:r,dist:i}}),"distBetween");v.size()>0;){var k=v.pop(),T=m(k),_=k.id();if(d[_]=T,T!==1/0)for(var E=k.neighborhood().intersect(g),C=0;C<E.length;C++){var S=E[C],A=S.id(),L=w(k,S),N=T+L.dist;N<m(S)&&(y(S,N),u[A]={node:k,edge:L.edge})}}return{distanceTo:o((function(t){var e=Aut(t)?g.filter(t)[0]:t[0];return d[e.id()]}),"distanceTo"),pathTo:o((function(t){var e=Aut(t)?g.filter(t)[0]:t[0],r=[],n=e,i=n.id();if(e.length>0)for(r.unshift(e);u[i];){var a=u[i];r.unshift(a.edge),r.unshift(a.node),i=(n=a.node).id()}return s.spawn(r)}),"pathTo")}}),"dijkstra")},Vpt={kruskal:o((function(t){t=t||function(t){return 1};for(var e=this.byGroup(),r=e.nodes,n=e.edges,i=r.length,a=new Array(i),s=r,l=o((function(t){for(var e=0;e<a.length;e++){if(a[e].has(t))return e}}),"findSetIndex"),c=0;c<i;c++)a[c]=this.spawn(r[c]);for(var h=n.sort((function(e,r){return t(e)-t(r)})),u=0;u<h.length;u++){var d=h[u],p=d.source()[0],g=d.target()[0],f=l(p),m=l(g),y=a[f],v=a[m];f!==m&&(s.merge(d),y.merge(v),a.splice(m,1))}return s}),"kruskal")},Xpt=Rpt({root:null,goal:null,weight:o((function(t){return 1}),"weight"),heuristic:o((function(t){return 0}),"heuristic"),directed:!1}),Kpt={aStar:o((function(t){var e=this.cy(),r=Xpt(t),n=r.root,i=r.goal,a=r.heuristic,s=r.directed,l=r.weight;n=e.collection(n)[0],i=e.collection(i)[0];var c,h,u=n.id(),d=i.id(),p={},g={},f={},m=new Wpt((function(t,e){return g[t.id()]-g[e.id()]})),y=new zpt,v={},x={},b=o((function(t,e){m.push(t),y.add(e)}),"addToOpenSet"),w=o((function(){c=m.pop(),h=c.id(),y.delete(h)}),"popFromOpenSet"),k=o((function(t){return y.has(t)}),"isInOpenSet");b(n,u),p[u]=0,g[u]=a(n);for(var T=0;m.size()>0;){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;L<A.length;L++){var N=A[L];if(this.hasElementWithId(N.id())&&(!s||N.data("source")===h)){var I=N.source(),R=N.target(),M=I.id()!==h?I:R,D=M.id();if(this.hasElementWithId(D)&&!f[D]){var O=p[h]+l(N);k(D)?O<p[D]&&(p[D]=O,g[D]=O+a(M),v[D]=c,x[D]=N):(p[D]=O,g[D]=O+a(M),b(M,D),v[D]=c,x[D]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:T}}),"aStar")},Zpt=Rpt({weight:o((function(t){return 1}),"weight"),directed:!1}),Qpt={floydWarshall:o((function(t){for(var e=this.cy(),r=Zpt(t),n=r.weight,i=r.directed,a=n,s=this.byGroup(),l=s.nodes,c=s.edges,h=l.length,u=h*h,d=o((function(t){return l.indexOf(t)}),"indexOf"),p=o((function(t){return l[t]}),"atIndex"),g=new Array(u),f=0;f<u;f++){var m=f%h,y=(f-m)/h;g[f]=y===m?0:1/0}for(var v=new Array(u),x=new Array(u),b=0;b<c.length;b++){var w=c[b],k=w.source()[0],T=w.target()[0];if(k!==T){var _=d(k),E=d(T),C=_*h+E,S=a(w);if(g[C]>S&&(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;L<h;L++)for(var N=0;N<h;N++)for(var I=N*h+L,R=0;R<h;R++){var M=N*h+R,D=L*h+R;g[I]+g[D]<g[M]&&(g[M]=g[I]+g[D],v[M]=v[I])}var O=o((function(t){return(Aut(t)?e.filter(t):t)[0]}),"getArgEle"),P=o((function(t){return d(O(t))}),"indexOfArgEle"),B={distance:o((function(t,e){var r=P(t),n=P(e);return g[r*h+n]}),"distance"),path:o((function(t,r){var n=P(t),i=P(r),a=p(n);if(n===i)return a.collection();if(null==v[n*h+i])return e.collection();var s,o=e.collection(),l=n;for(o.merge(a);n!==i;)l=n,n=v[n*h+i],s=x[l*h+n],o.merge(s),o.merge(p(n));return o}),"path")};return B}),"floydWarshall")},Jpt=Rpt({weight:o((function(t){return 1}),"weight"),directed:!1,root:null}),tgt={bellmanFord:o((function(t){var e=this,r=Jpt(t),n=r.weight,i=r.directed,a=r.root,s=n,l=this,c=this.cy(),h=this.byGroup(),u=h.edges,d=h.nodes,p=d.length,g=new $pt,f=!1,m=[];a=c.collection(a)[0],u.unmergeBy((function(t){return t.isLoop()}));for(var y=u.length,v=o((function(t){var e=g.get(t.id());return e||(e={},g.set(t.id(),e)),e}),"getInfo"),x=o((function(t){return(Aut(t)?c.$(t):t)[0]}),"getNodeFromTo"),b=o((function(t){return v(x(t)).dist}),"distanceTo"),w=o((function(t){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,n=x(t),i=[],s=n;;){if(null==s)return e.spawn();var o=v(s),c=o.edge,h=o.pred;if(i.unshift(s[0]),s.same(r)&&i.length>0)break;null!=c&&i.unshift(c),s=h}return l.spawn(i)}),"pathTo"),k=0;k<p;k++){var T=d[k],_=v(T);T.same(a)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var E=!1,C=o((function(t,e,r,n,i,a){var s=n.dist+a;s<i.dist&&!r.same(n.edge)&&(i.dist=s,i.pred=t,i.edge=r,E=!0)}),"checkForEdgeReplacement"),S=1;S<p;S++){E=!1;for(var A=0;A<y;A++){var L=u[A],N=L.source(),I=L.target(),R=s(L),M=v(N),D=v(I);C(N,I,L,M,D,R),i||C(I,N,L,D,M,R)}if(!E)break}if(E)for(var O=[],P=0;P<y;P++){var B=u[P],$=B.source(),F=B.target(),z=s(B),U=v($).dist,G=v(F).dist;if(U+z<G||!i&&G+z<U){if(f||(Ept("Graph contains a negative weight cycle for Bellman-Ford"),f=!0),!1===t.findNegativeWeightCycles)break;var q=[];U+z<G&&q.push($),!i&&G+z<U&&q.push(F);for(var j=q.length,W=0;W<j;W++){var Y=q[W],H=[Y];H.push(v(Y).edge);for(var V=v(Y).pred;-1===H.indexOf(V);)H.push(V),H.push(v(V).edge),V=v(V).pred;for(var X=(H=H.slice(H.indexOf(V)))[0].id(),K=0,Z=2;Z<H.length;Z+=2)H[Z].id()<X&&(X=H[Z].id(),K=Z);(H=H.slice(K).concat(H.slice(0,K))).push(H[0]);var Q=H.map((function(t){return t.id()})).join(",");-1===O.indexOf(Q)&&(m.push(l.spawn(H)),O.push(Q))}}}return{distanceTo:b,pathTo:w,hasNegativeWeightCycle:f,negativeWeightCycles:m}}),"bellmanFord")},egt=Math.sqrt(2),rgt=o((function(t,e,r){0===r.length&&Tpt("Karger-Stein must be run on a connected (sub)graph");for(var n=r[t],i=n[1],a=n[2],s=e[i],o=e[a],l=r,c=l.length-1;c>=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;p<l.length;p++){var g=l[p];g[1]===o?(l[p]=g.slice(),l[p][1]=s):g[2]===o&&(l[p]=g.slice(),l[p][2]=s)}for(var f=0;f<e.length;f++)e[f]===o&&(e[f]=s);return l}),"collapse"),ngt=o((function(t,e,r,n){for(;r>n;){var i=Math.floor(Math.random()*e.length);e=rgt(i,t,e),r--}return e}),"contractUntil"),igt={kargerStein:o((function(){var t=this,e=this.byGroup(),r=e.nodes,n=e.edges;n.unmergeBy((function(t){return t.isLoop()}));var i=r.length,a=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/egt);if(!(i<2)){for(var c=[],h=0;h<a;h++){var u=n[h];c.push([h,r.indexOf(u.source()),r.indexOf(u.target())])}for(var d=1/0,p=[],g=new Array(i),f=new Array(i),m=new Array(i),y=o((function(t,e){for(var r=0;r<i;r++)e[r]=t[r]}),"copyNodesMap"),v=0;v<=s;v++){for(var x=0;x<i;x++)f[x]=x;var b=ngt(f,c.slice(),i,l),w=b.slice();y(f,m);var k=ngt(f,b,l,2),T=ngt(m,w,l,2);k.length<=T.length&&k.length<d?(d=k.length,p=k,y(f,g)):T.length<=k.length&&T.length<d&&(d=T.length,p=T,y(m,g))}for(var _=this.spawn(p.map((function(t){return n[t[0]]}))),E=this.spawn(),C=this.spawn(),S=g[0],A=0;A<g.length;A++){var L=g[A],N=r[A];L===S?E.merge(N):C.merge(N)}var I=o((function(e){var r=t.spawn();return e.forEach((function(e){r.merge(e),e.connectedEdges().forEach((function(e){t.contains(e)&&!_.contains(e)&&r.merge(e)}))})),r}),"constructComponent"),R=[I(E),I(C)];return{cut:_,components:R,partition1:E,partition2:C}}Tpt("At least 2 nodes are required for Karger-Stein algorithm")}),"kargerStein")},agt=o((function(t){return{x:t.x,y:t.y}}),"copyPosition"),sgt=o((function(t,e,r){return{x:t.x*e+r.x,y:t.y*e+r.y}}),"modelToRenderedPosition"),ogt=o((function(t,e,r){return{x:(t.x-r.x)/e,y:(t.y-r.y)/e}}),"renderedToModelPosition"),lgt=o((function(t){return{x:t[0],y:t[1]}}),"array2point"),cgt=o((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=1/0,i=e;i<r;i++){var a=t[i];isFinite(a)&&(n=Math.min(a,n))}return n}),"min"),hgt=o((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=-1/0,i=e;i<r;i++){var a=t[i];isFinite(a)&&(n=Math.max(a,n))}return n}),"max"),ugt=o((function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=0,i=0,a=e;a<r;a++){var s=t[a];isFinite(s)&&(n+=s,i++)}return n/i}),"mean"),dgt=o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,n=!(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];n?t=t.slice(e,r):(r<t.length&&t.splice(r,t.length-r),e>0&&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"),pgt=o((function(t){return Math.PI*t/180}),"deg2rad"),ggt=o((function(t,e){return Math.atan2(e,t)-Math.PI/2}),"getAngleFromDisp"),fgt=Math.log2||function(t){return Math.log(t)/Math.log(2)},mgt=o((function(t){return t>0?1:t<0?-1:0}),"signum"),ygt=o((function(t,e){return Math.sqrt(vgt(t,e))}),"dist"),vgt=o((function(t,e){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n}),"sqdist"),xgt=o((function(t){for(var e=t.length,r=0,n=0;n<e;n++)r+=t[n];for(var i=0;i<e;i++)t[i]=t[i]/r;return t}),"inPlaceSumNormalize"),bgt=o((function(t,e,r,n){return(1-n)*(1-n)*t+2*(1-n)*n*e+n*n*r}),"qbezierAt"),wgt=o((function(t,e,r,n){return{x:bgt(t.x,e.x,r.x,n),y:bgt(t.y,e.y,r.y,n)}}),"qbezierPtAt"),kgt=o((function(t,e,r,n){var i=e.x-t.x,a=e.y-t.y,s=ygt(t,e),o=i/s,l=a/s;return r=null==r?0:r,n=null!=n?n:r*s,{x:t.x+o*n,y:t.y+l*n}}),"lineAt"),Tgt=o((function(t,e,r){return Math.max(t,Math.min(r,e))}),"bound"),_gt=o((function(t){if(null==t)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=t.x1&&null!=t.y1){if(null!=t.x2&&null!=t.y2&&t.x2>=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"),Egt=o((function(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}}),"copyBoundingBox"),Cgt=o((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"),Sgt=o((function(t,e,r){return{x1:t.x1+e,x2:t.x2+e,y1:t.y1+r,y2:t.y2+r,w:t.w,h:t.h}}),"shiftBoundingBox"),Agt=o((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"),Lgt=o((function(t,e,r){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,r),t.y2=Math.max(t.y2,r),t.h=t.y2-t.y1}),"expandBoundingBoxByPoint"),Ngt=o((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"),Igt=o((function(t){var e,r,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)e=r=n=i=a[0];else if(2===a.length)e=n=a[0],i=r=a[1];else if(4===a.length){var s=hut(a,4);e=s[0],r=s[1],n=s[2],i=s[3]}return t.x1-=i,t.x2+=r,t.y1-=e,t.y2+=n,t.w=t.x2-t.x1,t.h=t.y2-t.y1,t}),"expandBoundingBoxSides"),Rgt=o((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"),Mgt=o((function(t,e){return!(t.x1>e.x2)&&(!(e.x1>t.x2)&&(!(t.x2<e.x1)&&(!(e.x2<t.x1)&&(!(t.y2<e.y1)&&(!(e.y2<t.y1)&&(!(t.y1>e.y2)&&!(e.y1>t.y2)))))))}),"boundingBoxesIntersect"),Dgt=o((function(t,e,r){return t.x1<=e&&e<=t.x2&&t.y1<=r&&r<=t.y2}),"inBoundingBox"),Ogt=o((function(t,e){return Dgt(t,e.x,e.y)}),"pointInBoundingBox"),Pgt=o((function(t,e){return Dgt(t,e.x1,e.y1)&&Dgt(t,e.x2,e.y2)}),"boundingBoxInBoundingBox"),Bgt=o((function(t,e,r,n,i,a,s){var o,l,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",h="auto"===c?sft(i,a):c,u=i/2,d=a/2,p=(h=Math.min(h,u,d))!==u,g=h!==d;if(p){var f=r-u+h-s,m=n-d-s,y=r+u-h+s,v=m;if((o=Jgt(t,e,r,n,f,m,y,v,!1)).length>0)return o}if(g){var x=r+u+s,b=n-d+h-s,w=x,k=n+d-h+s;if((o=Jgt(t,e,r,n,x,b,w,k,!1)).length>0)return o}if(p){var T=r-u+h-s,_=n+d+s,E=r+u-h+s,C=_;if((o=Jgt(t,e,r,n,T,_,E,C,!1)).length>0)return o}if(g){var S=r-u-s,A=n-d+h-s,L=S,N=n+d-h+s;if((o=Jgt(t,e,r,n,S,A,L,N,!1)).length>0)return o}var I=r-u+h,R=n-d+h;if((l=Zgt(t,e,r,n,I,R,h+s)).length>0&&l[0]<=I&&l[1]<=R)return[l[0],l[1]];var M=r+u-h,D=n-d+h;if((l=Zgt(t,e,r,n,M,D,h+s)).length>0&&l[0]>=M&&l[1]<=D)return[l[0],l[1]];var O=r+u-h,P=n+d-h;if((l=Zgt(t,e,r,n,O,P,h+s)).length>0&&l[0]>=O&&l[1]>=P)return[l[0],l[1]];var B=r-u+h,$=n+d-h;return(l=Zgt(t,e,r,n,B,$,h+s)).length>0&&l[0]<=B&&l[1]>=$?[l[0],l[1]]:[]}),"roundRectangleIntersectLine"),$gt=o((function(t,e,r,n,i,a,s){var o=s,l=Math.min(r,i),c=Math.max(r,i),h=Math.min(n,a),u=Math.max(n,a);return l-o<=t&&t<=c+o&&h-o<=e&&e<=u+o}),"inLineVicinity"),Fgt=o((function(t,e,r,n,i,a,s,o,l){var c=Math.min(r,s,i)-l,h=Math.max(r,s,i)+l,u=Math.min(n,o,a)-l,d=Math.max(n,o,a)+l;return!(t<c||t>h||e<u||e>d)}),"inBezierVicinity"),zgt=o((function(t,e,r,n){var i=e*e-4*t*(r-=n);if(i<0)return[];var a=Math.sqrt(i),s=2*t;return[(-e+a)/s,(-e-a)/s]}),"solveQuadratic"),Ugt=o((function(t,e,r,n,i){var a,s,o,l,c,h,u,d;return 0===t&&(t=1e-5),o=-27*(n/=t)+(e/=t)*(9*(r/=t)-e*e*2),a=(s=(3*r-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"),Ggt=o((function(t,e,r,n,i,a,s,o){var l=[];Ugt(1*r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s+n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o,9*r*i-3*r*r-3*r*s-6*i*i+3*i*s+9*n*a-3*n*n-3*n*o-6*a*a+3*a*o,3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t+3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e,1*r*i-r*r+r*t-i*t+n*a-n*n+n*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<c.length;f++)u=Math.pow(1-c[f],2)*r+2*(1-c[f])*c[f]*i+c[f]*c[f]*s,d=Math.pow(1-c[f],2)*n+2*(1-c[f])*c[f]*a+c[f]*c[f]*o,p=Math.pow(u-t,2)+Math.pow(d-e,2),g>=0?p<g&&(g=p):g=p;return g}),"sqdistToQuadraticBezier"),qgt=o((function(t,e,r,n,i,a){var s=[t-r,e-n],o=[i-r,a-n],l=o[0]*o[0]+o[1]*o[1],c=s[0]*s[0]+s[1]*s[1],h=s[0]*o[0]+s[1]*o[1],u=h*h/l;return h<0?c:u>l?(t-i)*(t-i)+(e-a)*(e-a):c-u}),"sqdistToFiniteLine"),jgt=o((function(t,e,r){for(var n,i,a,s,o=0,l=0;l<r.length/2;l++)if(n=r[2*l],i=r[2*l+1],l+1<r.length/2?(a=r[2*(l+1)],s=r[2*(l+1)+1]):(a=r[2*(l+1-r.length/2)],s=r[2*(l+1-r.length/2)+1]),n==t&&a==t);else{if(!(n>=t&&t>=a||n<=t&&t<=a))continue;(t-n)/(a-n)*(s-i)+i>e&&o++}return o%2!=0}),"pointInsidePolygonPoints"),Wgt=o((function(t,e,r,n,i,a,s,o,l){var c,h=new Array(r.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;g<h.length/2;g++)h[2*g]=a/2*(r[2*g]*d-r[2*g+1]*p),h[2*g+1]=s/2*(r[2*g+1]*d+r[2*g]*p),h[2*g]+=n,h[2*g+1]+=i;if(l>0){var f=Vgt(h,-l);u=Hgt(f)}else u=h;return jgt(t,e,u)}),"pointInsidePolygon"),Ygt=o((function(t,e,r,n,i,a,s,o){for(var l=new Array(2*r.length),c=0;c<o.length;c++){var h=o[c];if(l[4*c+0]=h.startX,l[4*c+1]=h.startY,l[4*c+2]=h.stopX,l[4*c+3]=h.stopY,Math.pow(h.cx-t,2)+Math.pow(h.cy-e,2)<=Math.pow(h.radius,2))return!0}return jgt(t,e,l)}),"pointInsideRoundPolygon"),Hgt=o((function(t){for(var e,r,n,i,a,s,o,l,c=new Array(t.length/2),h=0;h<t.length/4;h++){e=t[4*h],r=t[4*h+1],n=t[4*h+2],i=t[4*h+3],h<t.length/4-1?(a=t[4*(h+1)],s=t[4*(h+1)+1],o=t[4*(h+1)+2],l=t[4*(h+1)+3]):(a=t[0],s=t[1],o=t[2],l=t[3]);var u=Jgt(e,r,n,i,a,s,o,l,!0);c[2*h]=u[0],c[2*h+1]=u[1]}return c}),"joinLines"),Vgt=o((function(t,e){for(var r,n,i,a,s=new Array(2*t.length),o=0;o<t.length/2;o++){r=t[2*o],n=t[2*o+1],o<t.length/2-1?(i=t[2*(o+1)],a=t[2*(o+1)+1]):(i=t[0],a=t[1]);var l=a-n,c=-(i-r),h=Math.sqrt(l*l+c*c),u=l/h,d=c/h;s[4*o]=r+u*e,s[4*o+1]=n+d*e,s[4*o+2]=i+u*e,s[4*o+3]=a+d*e}return s}),"expandPolygon"),Xgt=o((function(t,e,r,n,i,a){var s=r-t,o=n-e;s/=i,o/=a;var l=Math.sqrt(s*s+o*o),c=l-1;if(c<0)return[];var h=c/l;return[(r-t)*h+t,(n-e)*h+e]}),"intersectLineEllipse"),Kgt=o((function(t,e,r,n,i,a,s){return t-=i,e-=a,(t/=r/2+s)*t+(e/=n/2+s)*e<=1}),"checkInEllipse"),Zgt=o((function(t,e,r,n,i,a,s){var o=[r-t,n-e],l=[t-i,e-a],c=o[0]*o[0]+o[1]*o[1],h=2*(l[0]*o[0]+l[1]*o[1]),u=h*h-4*c*(l[0]*l[0]+l[1]*l[1]-s*s);if(u<0)return[];var d=(-h+Math.sqrt(u))/(2*c),p=(-h-Math.sqrt(u))/(2*c),g=Math.min(d,p),f=Math.max(d,p),m=[];if(g>=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"),Qgt=o((function(t,e,r){return e<=t&&t<=r||r<=t&&t<=e?t:t<=e&&e<=r||r<=e&&e<=t?e:r}),"midOfThree"),Jgt=o((function(t,e,r,n,i,a,s,o,l){var c=t-i,h=r-t,u=s-i,d=e-a,p=n-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?Qgt(t,r,s)===s?[s,o]:Qgt(t,r,i)===i?[i,a]:Qgt(i,s,r)===r?[r,n]:[]:[]}),"finiteLinesIntersect"),tft=o((function(t,e,r,n,i,a,s,o){var l,c,h,u,d,p,g=[],f=new Array(r.length),m=!0;if(null==a&&(m=!1),m){for(var y=0;y<f.length/2;y++)f[2*y]=r[2*y]*a+n,f[2*y+1]=r[2*y+1]*s+i;if(o>0){var v=Vgt(f,-o);c=Hgt(v)}else c=f}else c=r;for(var x=0;x<c.length/2;x++)h=c[2*x],u=c[2*x+1],x<c.length/2-1?(d=c[2*(x+1)],p=c[2*(x+1)+1]):(d=c[0],p=c[1]),0!==(l=Jgt(t,e,n,i,h,u,d,p)).length&&g.push(l[0],l[1]);return g}),"polygonIntersectLine"),eft=o((function(t,e,r,n,i,a,s,o,l){var c,h=[],u=new Array(2*r.length);l.forEach((function(r,a){0===a?(u[u.length-2]=r.startX,u[u.length-1]=r.startY):(u[4*a-2]=r.startX,u[4*a-1]=r.startY),u[4*a]=r.stopX,u[4*a+1]=r.stopY,0!==(c=Zgt(t,e,n,i,r.cx,r.cy,r.radius)).length&&h.push(c[0],c[1])}));for(var d=0;d<u.length/4;d++)0!==(c=Jgt(t,e,n,i,u[4*d],u[4*d+1],u[4*d+2],u[4*d+3],!1)).length&&h.push(c[0],c[1]);if(h.length>2){for(var p=[h[0],h[1]],g=Math.pow(p[0]-t,2)+Math.pow(p[1]-e,2),f=1;f<h.length/2;f++){var m=Math.pow(h[2*f]-t,2)+Math.pow(h[2*f+1]-e,2);m<=g&&(p[0]=h[2*f],p[1]=h[2*f+1],g=m)}return p}return h}),"roundPolygonIntersectLine"),rft=o((function(t,e,r){var n=[t[0]-e[0],t[1]-e[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),a=(i-r)/i;return a<0&&(a=1e-5),[e[0]+a*n[0],e[1]+a*n[1]]}),"shortenIntersection"),nft=o((function(t,e){var r=aft(t,e);return r=ift(r)}),"generateUnitNgonPointsFitToSquare"),ift=o((function(t){for(var e,r,n=t.length/2,i=1/0,a=1/0,s=-1/0,o=-1/0,l=0;l<n;l++)e=t[2*l],r=t[2*l+1],i=Math.min(i,e),s=Math.max(s,e),a=Math.min(a,r),o=Math.max(o,r);for(var c=2/(s-i),h=2/(o-a),u=0;u<n;u++)e=t[2*u]=t[2*u]*c,r=t[2*u+1]=t[2*u+1]*h,i=Math.min(i,e),s=Math.max(s,e),a=Math.min(a,r),o=Math.max(o,r);if(a<-1)for(var d=0;d<n;d++)r=t[2*d+1]=t[2*d+1]+(-1-a);return t}),"fitPolygonToSquare"),aft=o((function(t,e){var r=1/t*2*Math.PI,n=t%2==0?Math.PI/2+r/2:Math.PI/2;n+=e;for(var i,a=new Array(2*t),s=0;s<t;s++)i=s*r+n,a[2*s]=Math.cos(i),a[2*s+1]=Math.sin(-i);return a}),"generateUnitNgonPoints"),sft=o((function(t,e){return Math.min(t/4,e/4,8)}),"getRoundRectangleRadius"),oft=o((function(t,e){return Math.min(t/10,e/10,8)}),"getRoundPolygonRadius"),lft=o((function(){return 8}),"getCutRectangleCornerLength"),cft=o((function(t,e,r){return[t-2*e+r,2*(e-t),t]}),"bezierPtsToQuadCoeff"),hft=o((function(t,e){return{heightOffset:Math.min(15,.05*e),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}}),"getBarrelCurveConstants"),uft=Rpt({dampingFactor:.8,precision:1e-6,iterations:200,weight:o((function(t){return 1}),"weight")}),dft={pageRank:o((function(t){for(var e=uft(t),r=e.dampingFactor,n=e.precision,i=e.iterations,a=e.weight,s=this._private.cy,l=this.byGroup(),c=l.nodes,h=l.edges,u=c.length,d=u*u,p=h.length,g=new Array(d),f=new Array(u),m=(1-r)/u,y=0;y<u;y++){for(var v=0;v<u;v++){g[y*u+v]=0}f[y]=0}for(var x=0;x<p;x++){var b=h[x],w=b.data("source"),k=b.data("target");if(w!==k){var T=c.indexOfId(w),_=c.indexOfId(k),E=a(b);g[_*u+T]+=E,f[T]+=E}}for(var C=1/u+m,S=0;S<u;S++)if(0===f[S])for(var A=0;A<u;A++){g[A*u+S]=C}else for(var L=0;L<u;L++){var N=L*u+S;g[N]=g[N]/f[S]+m}for(var I,R=new Array(u),M=new Array(u),D=0;D<u;D++)R[D]=1;for(var O=0;O<i;O++){for(var P=0;P<u;P++)M[P]=0;for(var B=0;B<u;B++)for(var $=0;$<u;$++){var F=B*u+$;M[B]+=g[F]*R[$]}xgt(M),I=R,R=M,M=I;for(var z=0,U=0;U<u;U++){var G=I[U]-R[U];z+=G*G}if(z<n)break}var q={rank:o((function(t){return t=s.collection(t)[0],R[c.indexOf(t)]}),"rank")};return q}),"pageRank")},pft=Rpt({root:null,weight:o((function(t){return 1}),"weight"),directed:!1,alpha:0}),gft={degreeCentralityNormalized:o((function(t){t=pft(t);var e=this.cy(),r=this.nodes(),n=r.length;if(t.directed){for(var i={},a={},s=0,l=0,c=0;c<n;c++){var h=r[c],u=h.id();t.root=h;var d=this.degreeCentrality(t);s<d.indegree&&(s=d.indegree),l<d.outdegree&&(l=d.outdegree),i[u]=d.indegree,a[u]=d.outdegree}return{indegree:o((function(t){return 0==s?0:(Aut(t)&&(t=e.filter(t)),i[t.id()]/s)}),"indegree"),outdegree:o((function(t){return 0===l?0:(Aut(t)&&(t=e.filter(t)),a[t.id()]/l)}),"outdegree")}}for(var p={},g=0,f=0;f<n;f++){var m=r[f];t.root=m;var y=this.degreeCentrality(t);g<y.degree&&(g=y.degree),p[m.id()]=y.degree}return{degree:o((function(t){return 0===g?0:(Aut(t)&&(t=e.filter(t)),p[t.id()]/g)}),"degree")}}),"degreeCentralityNormalized"),degreeCentrality:o((function(t){t=pft(t);var e=this.cy(),r=this,n=t,i=n.root,a=n.weight,s=n.directed,o=n.alpha;if(i=e.collection(i)[0],s){for(var l=i.connectedEdges(),c=l.filter((function(t){return t.target().same(i)&&r.has(t)})),h=l.filter((function(t){return t.source().same(i)&&r.has(t)})),u=c.length,d=h.length,p=0,g=0,f=0;f<c.length;f++)p+=a(c[f]);for(var m=0;m<h.length;m++)g+=a(h[m]);return{indegree:Math.pow(u,1-o)*Math.pow(p,o),outdegree:Math.pow(d,1-o)*Math.pow(g,o)}}for(var y=i.connectedEdges().intersection(r),v=y.length,x=0,b=0;b<y.length;b++)x+=a(y[b]);return{degree:Math.pow(v,1-o)*Math.pow(x,o)}}),"degreeCentrality")};gft.dc=gft.degreeCentrality,gft.dcn=gft.degreeCentralityNormalised=gft.degreeCentralityNormalized;var fft=Rpt({harmonic:!0,weight:o((function(){return 1}),"weight"),directed:!1,root:null}),mft={closenessCentralityNormalized:o((function(t){for(var e=fft(t),r=e.harmonic,n=e.weight,i=e.directed,a=this.cy(),s={},l=0,c=this.nodes(),h=this.floydWarshall({weight:n,directed:i}),u=0;u<c.length;u++){for(var d=0,p=c[u],g=0;g<c.length;g++)if(u!==g){var f=h.distance(p,c[g]);d+=r?1/f:f}r||(d=1/d),l<d&&(l=d),s[p.id()]=d}return{closeness:o((function(t){return 0==l?0:(t=Aut(t)?a.filter(t)[0].id():t.id(),s[t]/l)}),"closeness")}}),"closenessCentralityNormalized"),closenessCentrality:o((function(t){var e=fft(t),r=e.root,n=e.weight,i=e.directed,a=e.harmonic;r=this.filter(r)[0];for(var s=this.dijkstra({root:r,weight:n,directed:i}),o=0,l=this.nodes(),c=0;c<l.length;c++){var h=l[c];if(!h.same(r)){var u=s.distanceTo(h);o+=a?1/u:u}}return a?o:1/o}),"closenessCentrality")};mft.cc=mft.closenessCentrality,mft.ccn=mft.closenessCentralityNormalised=mft.closenessCentralityNormalized;var yft=Rpt({weight:null,directed:!1}),vft={betweennessCentrality:o((function(t){for(var e=yft(t),r=e.directed,n=e.weight,i=null!=n,a=this.cy(),s=this.nodes(),l={},c={},h=0,u={set:o((function(t,e){c[t]=e,e>h&&(h=e)}),"set"),get:o((function(t){return c[t]}),"get")},d=0;d<s.length;d++){var p=s[d],g=p.id();l[g]=r?p.outgoers().nodes():p.openNeighborhood().nodes(),u.set(g,0)}for(var f=o((function(t){for(var e=s[t].id(),r=[],o={},c={},h={},d=new Wpt((function(t,e){return h[t]-h[e]})),p=0;p<s.length;p++){var g=s[p].id();o[g]=[],c[g]=0,h[g]=1/0}for(c[e]=1,h[e]=0,d.push(e);!d.empty();){var f=d.pop();if(r.push(f),i)for(var m=0;m<l[f].length;m++){var y=l[f][m],v=a.getElementById(f),x=void 0;x=v.edgesTo(y).length>0?v.edgesTo(y)[0]:y.edgesTo(v)[0];var b=n(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,o[y]=[]),h[y]==h[f]+b&&(c[y]=c[y]+c[f],o[y].push(f))}else for(var w=0;w<l[f].length;w++){var k=l[f][w].id();h[k]==1/0&&(d.push(k),h[k]=h[f]+1),h[k]==h[f]+1&&(c[k]=c[k]+c[f],o[k].push(f))}}for(var T={},_=0;_<s.length;_++)T[s[_].id()]=0;for(;r.length>0;){for(var E=r.pop(),C=0;C<o[E].length;C++){var S=o[E][C];T[S]=T[S]+c[S]/c[E]*(1+T[E])}E!=s[t].id()&&u.set(E,u.get(E)+T[E])}}),"_loop"),m=0;m<s.length;m++)f(m);var y={betweenness:o((function(t){var e=a.collection(t).id();return u.get(e)}),"betweenness"),betweennessNormalized:o((function(t){if(0==h)return 0;var e=a.collection(t).id();return u.get(e)/h}),"betweennessNormalized")};return y.betweennessNormalised=y.betweennessNormalized,y}),"betweennessCentrality")};vft.bc=vft.betweennessCentrality;var xft=Rpt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),bft=o((function(t){return xft(t)}),"setOptions"),wft=o((function(t,e){for(var r=0,n=0;n<e.length;n++)r+=e[n](t);return r}),"getSimilarity"),kft=o((function(t,e,r){for(var n=0;n<e;n++)t[n*e+n]=r}),"addLoops"),Tft=o((function(t,e){for(var r,n=0;n<e;n++){r=0;for(var i=0;i<e;i++)r+=t[i*e+n];for(var a=0;a<e;a++)t[a*e+n]=t[a*e+n]/r}}),"normalize"),_ft=o((function(t,e,r){for(var n=new Array(r*r),i=0;i<r;i++){for(var a=0;a<r;a++)n[i*r+a]=0;for(var s=0;s<r;s++)for(var o=0;o<r;o++)n[i*r+o]+=t[i*r+s]*e[s*r+o]}return n}),"mmult"),Eft=o((function(t,e,r){for(var n=t.slice(0),i=1;i<r;i++)t=_ft(t,n,e);return t}),"expand"),Cft=o((function(t,e,r){for(var n=new Array(e*e),i=0;i<e*e;i++)n[i]=Math.pow(t[i],r);return Tft(n,e),n}),"inflate"),Sft=o((function(t,e,r,n){for(var i=0;i<r;i++){if(Math.round(t[i]*Math.pow(10,n))/Math.pow(10,n)!==Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n))return!1}return!0}),"hasConverged"),Aft=o((function(t,e,r,n){for(var i=[],a=0;a<e;a++){for(var s=[],o=0;o<e;o++)Math.round(1e3*t[a*e+o])/1e3>0&&s.push(r[o]);0!==s.length&&i.push(n.collection(s))}return i}),"assign"),Lft=o((function(t,e){for(var r=0;r<t.length;r++)if(!e[r]||t[r].id()!==e[r].id())return!1;return!0}),"isDuplicate"),Nft=o((function(t){for(var e=0;e<t.length;e++)for(var r=0;r<t.length;r++)e!=r&&Lft(t[e],t[r])&&t.splice(r,1);return t}),"removeDuplicates"),Ift=o((function(t){for(var e=this.nodes(),r=this.edges(),n=this.cy(),i=bft(t),a={},s=0;s<e.length;s++)a[e[s].id()]=s;for(var o,l=e.length,c=l*l,h=new Array(c),u=0;u<c;u++)h[u]=0;for(var d=0;d<r.length;d++){var p=r[d],g=a[p.source().id()],f=a[p.target().id()],m=wft(p,i.attributes);h[g*l+f]+=m,h[f*l+g]+=m}kft(h,l,i.multFactor),Tft(h,l);for(var y=!0,v=0;y&&v<i.maxIterations;)y=!1,o=Eft(h,l,i.expandFactor),h=Cft(o,l,i.inflateFactor),Sft(h,o,c,4)||(y=!0),v++;var x=Aft(h,l,e,n);return x=Nft(x)}),"markovClustering"),Rft={markovClustering:Ift,mcl:Ift},Mft=o((function(t){return t}),"identity"),Dft=o((function(t,e){return Math.abs(e-t)}),"absDiff"),Oft=o((function(t,e,r){return t+Dft(e,r)}),"addAbsDiff"),Pft=o((function(t,e,r){return t+Math.pow(r-e,2)}),"addSquaredDiff"),Bft=o((function(t){return Math.sqrt(t)}),"sqrt"),$ft=o((function(t,e,r){return Math.max(t,Dft(e,r))}),"maxAbsDiff"),Fft=o((function(t,e,r,n,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Mft,s=n,o=0;o<t;o++)s=i(s,e(o),r(o));return a(s)}),"getDistance"),zft={euclidean:o((function(t,e,r){return t>=2?Fft(t,e,r,0,Pft,Bft):Fft(t,e,r,0,Oft)}),"euclidean"),squaredEuclidean:o((function(t,e,r){return Fft(t,e,r,0,Pft)}),"squaredEuclidean"),manhattan:o((function(t,e,r){return Fft(t,e,r,0,Oft)}),"manhattan"),max:o((function(t,e,r){return Fft(t,e,r,-1/0,$ft)}),"max")};function Uft(t,e,r,n,i,a){var s;return s=Lut(t)?t:zft[t]||zft.euclidean,0===e&&Lut(t)?s(i,a):s(e,r,n,i,a)}zft["squared-euclidean"]=zft.squaredEuclidean,zft.squaredeuclidean=zft.squaredEuclidean,o(Uft,"clusteringDistance");var Gft=Rpt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),qft=o((function(t){return Gft(t)}),"setOptions"),jft=o((function(t,e,r,n,i){var a="kMedoids"!==i?function(t){return r[t]}:function(t){return n[t](r)},s=o((function(t){return n[t](e)}),"getQ"),l=r,c=e;return Uft(t,n.length,a,s,l,c)}),"getDist"),Wft=o((function(t,e,r){for(var n=r.length,i=new Array(n),a=new Array(n),s=new Array(e),o=null,l=0;l<n;l++)i[l]=t.min(r[l]).value,a[l]=t.max(r[l]).value;for(var c=0;c<e;c++){o=[];for(var h=0;h<n;h++)o[h]=Math.random()*(a[h]-i[h])+i[h];s[c]=o}return s}),"randomCentroids"),Yft=o((function(t,e,r,n,i){for(var a=1/0,s=0,o=0;o<e.length;o++){var l=jft(r,t,e[o],n,i);l<a&&(a=l,s=o)}return s}),"classify"),Hft=o((function(t,e,r){for(var n=[],i=null,a=0;a<e.length;a++)r[(i=e[a]).id()]===t&&n.push(i);return n}),"buildCluster"),Vft=o((function(t,e,r){return Math.abs(e-t)<=r}),"haveValuesConverged"),Xft=o((function(t,e,r){for(var n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++){if(Math.abs(t[n][i]-e[n][i])>r)return!1}return!0}),"haveMatricesConverged"),Kft=o((function(t,e,r){for(var n=0;n<r;n++)if(t===e[n])return!0;return!1}),"seenBefore"),Zft=o((function(t,e){var r=new Array(e);if(t.length<50)for(var n=0;n<e;n++){for(var i=t[Math.floor(Math.random()*t.length)];Kft(i,r,n);)i=t[Math.floor(Math.random()*t.length)];r[n]=i}else for(var a=0;a<e;a++)r[a]=t[Math.floor(Math.random()*t.length)];return r}),"randomMedoids"),Qft=o((function(t,e,r){for(var n=0,i=0;i<e.length;i++)n+=jft("manhattan",e[i],t,r,"kMedoids");return n}),"findCost"),Jft=o((function(t){var e,r=this.cy(),n=this.nodes(),i=null,a=qft(t),s=new Array(a.k),o={};a.testMode?"number"==typeof a.testCentroids?(a.testCentroids,e=Wft(n,a.k,a.attributes)):e="object"===aut(a.testCentroids)?a.testCentroids:Wft(n,a.k,a.attributes):e=Wft(n,a.k,a.attributes);for(var l=!0,c=0;l&&c<a.maxIterations;){for(var h=0;h<n.length;h++)o[(i=n[h]).id()]=Yft(i,e,a.distance,a.attributes,"kMeans");l=!1;for(var u=0;u<a.k;u++){var d=Hft(u,n,o);if(0!==d.length){for(var p=a.attributes.length,g=e[u],f=new Array(p),m=new Array(p),y=0;y<p;y++){m[y]=0;for(var v=0;v<d.length;v++)i=d[v],m[y]+=a.attributes[y](i);f[y]=m[y]/d.length,Vft(f[y],g[y],a.sensitivityThreshold)||(l=!0)}e[u]=f,s[u]=r.collection(d)}}c++}return s}),"kMeans"),tmt=o((function(t){var e,r,n=this.cy(),i=this.nodes(),a=null,s=qft(t),o=new Array(s.k),l={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(e="object"===aut(s.testCentroids)?s.testCentroids:Zft(i,s.k)):e=Zft(i,s.k);for(var h=!0,u=0;h&&u<s.maxIterations;){for(var d=0;d<i.length;d++)l[(a=i[d]).id()]=Yft(a,e,s.distance,s.attributes,"kMedoids");h=!1;for(var p=0;p<e.length;p++){var g=Hft(p,i,l);if(0!==g.length){c[p]=Qft(e[p],g,s.attributes);for(var f=0;f<g.length;f++)(r=Qft(g[f],g,s.attributes))<c[p]&&(c[p]=r,e[p]=g[f],h=!0);o[p]=n.collection(g)}}u++}return o}),"kMedoids"),emt=o((function(t,e,r,n,i){for(var a,s,o=0;o<e.length;o++)for(var l=0;l<t.length;l++)n[o][l]=Math.pow(r[o][l],i.m);for(var c=0;c<t.length;c++)for(var h=0;h<i.attributes.length;h++){a=0,s=0;for(var u=0;u<e.length;u++)a+=n[u][c]*i.attributes[h](e[u]),s+=n[u][c];t[c][h]=a/s}}),"updateCentroids"),rmt=o((function(t,e,r,n,i){for(var a=0;a<t.length;a++)e[a]=t[a].slice();for(var s,o,l,c=2/(i.m-1),h=0;h<r.length;h++)for(var u=0;u<n.length;u++){s=0;for(var d=0;d<r.length;d++)o=jft(i.distance,n[u],r[h],i.attributes,"cmeans"),l=jft(i.distance,n[u],r[d],i.attributes,"cmeans"),s+=Math.pow(o/l,c);t[u][h]=1/s}}),"updateMembership"),nmt=o((function(t,e,r,n){for(var i,a,s=new Array(r.k),o=0;o<s.length;o++)s[o]=[];for(var l=0;l<e.length;l++){i=-1/0,a=-1;for(var c=0;c<e[0].length;c++)e[l][c]>i&&(i=e[l][c],a=c);s[a].push(t[l])}for(var h=0;h<s.length;h++)s[h]=n.collection(s[h]);return s}),"assign"),imt=o((function(t){var e,r,n,i,a=this.cy(),s=this.nodes(),o=qft(t);n=new Array(s.length);for(var l=0;l<s.length;l++)n[l]=new Array(o.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(o.k);for(var h=0;h<s.length;h++){for(var u=0,d=0;d<o.k;d++)r[h][d]=Math.random(),u+=r[h][d];for(var p=0;p<o.k;p++)r[h][p]=r[h][p]/u}e=new Array(o.k);for(var g=0;g<o.k;g++)e[g]=new Array(o.attributes.length);i=new Array(s.length);for(var f=0;f<s.length;f++)i[f]=new Array(o.k);for(var m=!0,y=0;m&&y<o.maxIterations;)m=!1,emt(e,s,r,i,o),rmt(r,n,e,s,o),Xft(r,n,o.sensitivityThreshold)||(m=!0),y++;return{clusters:nmt(s,r,o,a),degreeOfMembership:r}}),"fuzzyCMeans"),amt={kMeans:Jft,kMedoids:tmt,fuzzyCMeans:imt,fcm:imt},smt=Rpt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),omt={single:"min",complete:"max"},lmt=o((function(t){var e=smt(t),r=omt[e.linkage];return null!=r&&(e.linkage=r),e}),"setOptions"),cmt=o((function(t,e,r,n,i){for(var a,s=0,l=1/0,c=i.attributes,h=o((function(t,e){return Uft(i.distance,c.length,(function(e){return c[e](t)}),(function(t){return c[t](e)}),t,e)}),"getDist"),u=0;u<t.length;u++){var d=t[u].key,p=r[d][n[d]];p<l&&(s=d,l=p)}if("threshold"===i.mode&&l>=i.threshold||"dendrogram"===i.mode&&1===t.length)return!1;var g,f=e[s],m=e[n[s]];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;y<t.length;y++){var v=t[y];f.key===v.key?a=1/0:"min"===i.linkage?(a=r[f.key][v.key],r[f.key][v.key]>r[m.key][v.key]&&(a=r[m.key][v.key])):"max"===i.linkage?(a=r[f.key][v.key],r[f.key][v.key]<r[m.key][v.key]&&(a=r[m.key][v.key])):a="mean"===i.linkage?(r[f.key][v.key]*f.size+r[m.key][v.key]*m.size)/(f.size+m.size):"dendrogram"===i.mode?h(v.value,f.value):h(v.value[0],f.value[0]),r[f.key][v.key]=r[v.key][f.key]=a}for(var x=0;x<t.length;x++){var b=t[x].key;if(n[b]===f.key||n[b]===m.key){for(var w=b,k=0;k<t.length;k++){var T=t[k].key;r[b][T]<r[b][w]&&(w=T)}n[b]=w}t[x].index=x}return f.key=m.key=f.index=m.index=null,!0}),"mergeClosest"),hmt=o((function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))}),"getAllChildren"),umt=o((function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),i=t(e.right,r),a=r.add({group:"nodes",data:{id:n+","+i}});return r.add({group:"edges",data:{source:n,target:a.id()}}),r.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}return e.value?e.value.id():void 0}),"buildDendrogram"),dmt=o((function t(e,r,n){if(!e)return[];var i=[],a=[],s=[];return 0===r?(e.left&&hmt(e.left,i),e.right&&hmt(e.right,a),s=i.concat(a),[n.collection(s)]):1===r?e.value?[n.collection(e.value)]:(e.left&&hmt(e.left,i),e.right&&hmt(e.right,a),[n.collection(i),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(i=t(e.left,r-1,n)),e.right&&(a=t(e.right,r-1,n)),i.concat(a))}),"buildClustersFromTree"),pmt=o((function(t){for(var e=this.cy(),r=this.nodes(),n=lmt(t),i=n.attributes,a=o((function(t,e){return Uft(n.distance,i.length,(function(e){return i[e](t)}),(function(t){return i[t](e)}),t,e)}),"getDist"),s=[],l=[],c=[],h=[],u=0;u<r.length;u++){var d={value:"dendrogram"===n.mode?r[u]:[r[u]],key:u,index:u};s[u]=d,h[u]=d,l[u]=[],c[u]=0}for(var p=0;p<s.length;p++)for(var g=0;g<=p;g++){var f=void 0;f="dendrogram"===n.mode?p===g?1/0:a(s[p].value,s[g].value):p===g?1/0:a(s[p].value[0],s[g].value[0]),l[p][g]=f,l[g][p]=f,f<l[p][c[p]]&&(c[p]=g)}for(var m,y=cmt(s,h,l,c,n);y;)y=cmt(s,h,l,c,n);return"dendrogram"===n.mode?(m=dmt(s[0],n.dendrogramDepth,e),n.addDendrogram&&umt(s[0],e)):(m=new Array(s.length),s.forEach((function(t,r){t.key=t.index=null,m[r]=e.collection(t.value)}))),m}),"hierarchicalClustering"),gmt={hierarchicalClustering:pmt,hca:pmt},fmt=Rpt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),mmt=o((function(t){var e=t.damping,r=t.preference;.5<=e&&e<1||Tpt("Damping must range on [0.5, 1). Got: ".concat(e));var n=["median","mean","min","max"];return n.some((function(t){return t===r}))||Mut(r)||Tpt("Preference must be one of [".concat(n.map((function(t){return"'".concat(t,"'")})).join(", "),"] or a number. Got: ").concat(r)),fmt(t)}),"setOptions"),ymt=o((function(t,e,r,n){var i=o((function(t,e){return n[e](t)}),"attr");return-Uft(t,n.length,(function(t){return i(e,t)}),(function(t){return i(r,t)}),e,r)}),"getSimilarity"),vmt=o((function(t,e){return"median"===e?dgt(t):"mean"===e?ugt(t):"min"===e?cgt(t):"max"===e?hgt(t):e}),"getPreference"),xmt=o((function(t,e,r){for(var n=[],i=0;i<t;i++)e[i*t+i]+r[i*t+i]>0&&n.push(i);return n}),"findExemplars"),bmt=o((function(t,e,r){for(var n=[],i=0;i<t;i++){for(var a=-1,s=-1/0,o=0;o<r.length;o++){var l=r[o];e[i*t+l]>s&&(a=l,s=e[i*t+l])}a>0&&n.push(a)}for(var c=0;c<r.length;c++)n[r[c]]=r[c];return n}),"assignClusters"),wmt=o((function(t,e,r){for(var n=bmt(t,e,r),i=0;i<r.length;i++){for(var a=[],s=0;s<n.length;s++)n[s]===r[i]&&a.push(s);for(var o=-1,l=-1/0,c=0;c<a.length;c++){for(var h=0,u=0;u<a.length;u++)h+=e[a[u]*t+a[c]];h>l&&(o=c,l=h)}r[i]=a[o]}return n=bmt(t,e,r)}),"assign"),kmt=o((function(t){for(var e,r,n,i,a,s,o=this.cy(),l=this.nodes(),c=mmt(t),h={},u=0;u<l.length;u++)h[l[u].id()]=u;r=(e=l.length)*e,n=new Array(r);for(var d=0;d<r;d++)n[d]=-1/0;for(var p=0;p<e;p++)for(var g=0;g<e;g++)p!==g&&(n[p*e+g]=ymt(c.distance,l[p],l[g],c.attributes));i=vmt(n,c.preference);for(var f=0;f<e;f++)n[f*e+f]=i;a=new Array(r);for(var m=0;m<r;m++)a[m]=0;s=new Array(r);for(var y=0;y<r;y++)s[y]=0;for(var v=new Array(e),x=new Array(e),b=new Array(e),w=0;w<e;w++)v[w]=0,x[w]=0,b[w]=0;for(var k,T=new Array(e*c.minIterations),_=0;_<T.length;_++)T[_]=0;for(k=0;k<c.maxIterations;k++){for(var E=0;E<e;E++){for(var C=-1/0,S=-1/0,A=-1,L=0,N=0;N<e;N++)v[N]=a[E*e+N],(L=s[E*e+N]+n[E*e+N])>=C?(S=C,C=L,A=N):L>S&&(S=L);for(var I=0;I<e;I++)a[E*e+I]=(1-c.damping)*(n[E*e+I]-C)+c.damping*v[I];a[E*e+A]=(1-c.damping)*(n[E*e+A]-S)+c.damping*v[A]}for(var R=0;R<e;R++){for(var M=0,D=0;D<e;D++)v[D]=s[D*e+R],x[D]=Math.max(0,a[D*e+R]),M+=x[D];M-=x[R],x[R]=a[R*e+R],M+=x[R];for(var O=0;O<e;O++)s[O*e+R]=(1-c.damping)*Math.min(0,M-x[O])+c.damping*v[O];s[R*e+R]=(1-c.damping)*(M-x[R])+c.damping*v[R]}for(var P=0,B=0;B<e;B++){var $=s[B*e+B]+a[B*e+B]>0?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;z<e;z++){b[z]=0;for(var U=0;U<c.minIterations;U++)b[z]+=T[U*e+z];0!==b[z]&&b[z]!==c.minIterations||F++}if(F===e)break}}for(var G=xmt(e,a,s),q=wmt(e,n,G),j={},W=0;W<G.length;W++)j[G[W]]=[];for(var Y=0;Y<l.length;Y++){var H=q[h[l[Y].id()]];null!=H&&j[H].push(l[Y])}for(var V=new Array(G.length),X=0;X<G.length;X++)V[X]=o.collection(j[G[X]]);return V}),"affinityPropagation"),Tmt={affinityPropagation:kmt,ap:kmt},_mt=Rpt({root:void 0,directed:!1}),Emt={hierholzer:o((function(t){if(!Iut(t)){var e=arguments;t={root:e[0],directed:e[1]}}var r,n,i,a=_mt(t),s=a.root,l=a.directed,c=this,h=!1;s&&(i=Aut(s)?this.filter(s)[0].id():s[0].id());var u={},d={};l?c.forEach((function(t){var e=t.id();if(t.isNode()){var i=t.indegree(!0),a=t.outdegree(!0),s=i-a,o=a-i;1==s?r?h=!0:r=e:1==o?n?h=!0:n=e:(o>1||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&&(r?n?h=!0:n=e:r=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(n&&r)if(l){if(i&&n!=i)return p;i=n}else{if(i&&n!=i&&r!=i)return p;i||(i=n)}else i||(i=c[0].id());var g=o((function(t){for(var e,r,n,i=t,a=[t];u[i].length;)e=u[i].shift(),r=d[e][0],i!=(n=d[e][1])?(u[n]=u[n].filter((function(t){return t!=e})),i=n):l||i==r||(u[r]=u[r].filter((function(t){return t!=e})),i=r),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")},Cmt=o((function(){var t=this,e={},r=0,n=0,i=[],a=[],s={},l=o((function(r,n){for(var s=a.length-1,o=[],l=t.spawn();a[s].x!=r||a[s].y!=n;)o.push(a.pop().edge),s--;o.push(a.pop().edge),o.forEach((function(r){var n=r.connectedNodes().intersection(t);l.merge(r),n.forEach((function(r){var n=r.id(),i=r.connectedEdges().intersection(t);l.merge(r),e[n].cutVertex?l.merge(i.filter((function(t){return t.isLoop()}))):l.merge(i)}))})),i.push(l)}),"buildComponent"),c=o((function o(c,h,u){c===u&&(n+=1),e[h]={id:r,low:r++,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(),s[f]||(s[f]=!0,a.push({x:h,y:g,edge:t})),g in e?e[h].low=Math.min(e[h].low,e[g].id):(o(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 r=t.id();r in e||(n=0,c(r,r),e[r].cutVertex=n>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"),Smt={hopcroftTarjanBiconnected:Cmt,htbc:Cmt,htb:Cmt,hopcroftTarjanBiconnectedComponents:Cmt},Amt=o((function(){var t=this,e={},r=0,n=[],i=[],a=t.spawn(t),s=o((function s(o){if(i.push(o),e[o]={index:r,low:r++,explored:!1},t.getElementById(o).connectedEdges().intersection(t).forEach((function(t){var r=t.target().id();r!==o&&(r in e||s(r),e[r].explored||(e[o].low=Math.min(e[o].low,e[r].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);n.push(u),a=a.difference(u)}}),"stronglyConnectedSearch");return t.forEach((function(t){if(t.isNode()){var r=t.id();r in e||s(r)}})),{cut:a,components:n}}),"tarjanStronglyConnected"),Lmt={};[qpt,Hpt,Vpt,Kpt,Qpt,tgt,igt,dft,gft,mft,vft,Rft,amt,gmt,Tmt,Emt,Smt,{tarjanStronglyConnected:Amt,tsc:Amt,tscc:Amt,tarjanStronglyConnectedComponents:Amt}].forEach((function(t){edt(Lmt,t)}));var Nmt=o((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");Nmt.prototype={fulfill:o((function(t){return Imt(this,1,"fulfillValue",t)}),"fulfill"),reject:o((function(t){return Imt(this,2,"rejectReason",t)}),"reject"),then:o((function(t,e){var r=this,n=new Nmt;return r.onFulfilled.push(Dmt(t,n,"fulfill")),r.onRejected.push(Dmt(e,n,"reject")),Rmt(r),n.proxy}),"then")};var Imt=o((function(t,e,r,n){return 0===t.state&&(t.state=e,t[r]=n,Rmt(t)),t}),"deliver"),Rmt=o((function(t){1===t.state?Mmt(t,"onFulfilled",t.fulfillValue):2===t.state&&Mmt(t,"onRejected",t.rejectReason)}),"execute"),Mmt=o((function(t,e,r){if(0!==t[e].length){var n=t[e];t[e]=[];var i=o((function(){for(var t=0;t<n.length;t++)n[t](r)}),"func");"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}}),"execute_handlers"),Dmt=o((function(t,e,r){return function(n){if("function"!=typeof t)e[r].call(e,n);else{var i;try{i=t(n)}catch(t){return void e.reject(t)}Omt(e,i)}}}),"resolver"),Omt=o((function t(e,r){if(e!==r&&e.proxy!==r){var n;if("object"===aut(r)&&null!==r||"function"==typeof r)try{n=r.then}catch(t){return void e.reject(t)}if("function"!=typeof n)e.fulfill(r);else{var i=!1;try{n.call(r,(function(n){i||(i=!0,n===r?e.reject(new TypeError("circular thenable chain")):t(e,n))}),(function(t){i||(i=!0,e.reject(t))}))}catch(t){i||e.reject(t)}}}else e.reject(new TypeError("cannot resolve promise with itself"))}),"resolve");Nmt.all=function(t){return new Nmt((function(e,r){for(var n=new Array(t.length),i=0,a=o((function(r,a){n[r]=a,++i===t.length&&e(n)}),"fulfill"),s=0;s<t.length;s++)!function(e){var n=t[e];null!=n&&null!=n.then?n.then((function(t){a(e,t)}),(function(t){r(t)})):a(e,n)}(s)}))},Nmt.resolve=function(t){return new Nmt((function(e,r){e(t)}))},Nmt.reject=function(t){return new Nmt((function(e,r){r(t)}))};var Pmt="undefined"!=typeof Promise?Promise:Nmt,Bmt=o((function(t,e,r){var n=Fut(t),i=!n,a=this._private=edt({duration:1e3},e,r);if(a.target=t,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&Lut(a.complete)&&a.completes.push(a.complete),i){var s=t.position();a.startPosition=a.startPosition||{x:s.x,y:s.y},a.startStyle=a.startStyle||t.cy().style().getAnimationStartStyle(t,a.style)}if(n){var o=t.pan();a.startPan={x:o.x,y:o.y},a.startZoom=t.zoom()}this.length=1,this[0]=this}),"Animation"),$mt=Bmt.prototype;edt($mt,{instanceString:o((function(){return"animation"}),"instanceString"),hook:o((function(){var t=this._private;if(!t.hooked){var e=t.target._private.animation;(t.queue?e.queue:e.current).push(this),Put(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this}),"hook"),play:o((function(){var t=this._private;return 1===t.progress&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this}),"play"),playing:o((function(){return this._private.playing}),"playing"),apply:o((function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this}),"apply"),applying:o((function(){return this._private.applying}),"applying"),pause:o((function(){var t=this._private;return t.playing=!1,t.started=!1,this}),"pause"),stop:o((function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this}),"stop"),rewind:o((function(){return this.progress(0)}),"rewind"),fastforward:o((function(){return this.progress(1)}),"fastforward"),time:o((function(t){var e=this._private;return void 0===t?e.progress*e.duration:this.progress(t/e.duration)}),"time"),progress:o((function(t){var e=this._private,r=e.playing;return void 0===t?e.progress:(r&&this.pause(),e.progress=t,e.started=!1,r&&this.play(),this)}),"progress"),completed:o((function(){return 1===this._private.progress}),"completed"),reverse:o((function(){var t=this._private,e=t.playing;e&&this.pause(),t.progress=1-t.progress,t.started=!1;var r=o((function(e,r){var n=t[e];null!=n&&(t[e]=t[r],t[r]=n)}),"swap");if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),t.style)for(var n=0;n<t.style.length;n++){var i=t.style[n],a=i.name,s=t.startStyle[a];t.startStyle[a]=i,t.style[n]=s}return e&&this.play(),this}),"reverse"),promise:o((function(t){var e,r=this._private;if("frame"===t)e=r.frames;else e=r.completes;return new Pmt((function(t,r){e.push((function(){t()}))}))}),"promise")}),$mt.complete=$mt.completed,$mt.run=$mt.play,$mt.running=$mt.playing;var Fmt={animated:o((function(){return o((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return!1;var r=e[0];return r?r._private.animation.current.length>0:void 0}),"animatedImpl")}),"animated"),clearQueue:o((function(){return o((function(){var t=this,e=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var r=0;r<e.length;r++){e[r]._private.animation.queue=[]}return this}),"clearQueueImpl")}),"clearQueue"),delay:o((function(){return o((function(t,e){return(this._private.cy||this).styleEnabled()?this.animate({delay:t,duration:t,complete:e}):this}),"delayImpl")}),"delay"),delayAnimation:o((function(){return o((function(t,e){return(this._private.cy||this).styleEnabled()?this.animation({delay:t,duration:t,complete:e}):this}),"delayAnimationImpl")}),"delayAnimation"),animation:o((function(){return o((function(t,e){var r=this,n=void 0!==r.length,i=n?r:[r],a=this._private.cy||this,s=!n,o=!s;if(!a.styleEnabled())return this;var l=a.style();if(t=edt({},t,e),0===Object.keys(t).length)return new Bmt(i[0],t);switch(void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}if(o&&(t.style=l.getPropsList(t.style||t.css),t.css=void 0),o&&null!=t.renderedPosition){var c=t.renderedPosition,h=a.pan(),u=a.zoom();t.position=ogt(c,u,h)}if(s&&null!=t.panBy){var d=t.panBy,p=a.pan();t.pan={x:p.x+d.x,y:p.y+d.y}}var g=t.center||t.centre;if(s&&null!=g){var f=a.getCenterPan(g.eles,t.zoom);null!=f&&(t.pan=f)}if(s&&null!=t.fit){var m=t.fit,y=a.getFitViewport(m.eles||m.boundingBox,m.padding);null!=y&&(t.pan=y.pan,t.zoom=y.zoom)}if(s&&Iut(t.zoom)){var v=a.getZoomedViewport(t.zoom);null!=v?(v.zoomed&&(t.zoom=v.zoom),v.panned&&(t.pan=v.pan)):t.zoom=null}return new Bmt(i[0],t)}),"animationImpl")}),"animation"),animate:o((function(){return o((function(t,e){var r=this,n=void 0!==r.length?r:[r];if(!(this._private.cy||this).styleEnabled())return this;e&&(t=edt({},t,e));for(var i=0;i<n.length;i++){var a=n[i],s=a.animated()&&(void 0===t.queue||t.queue);a.animation(t,s?{queue:!0}:void 0).play()}return this}),"animateImpl")}),"animate"),stop:o((function(){return o((function(t,e){var r=this,n=void 0!==r.length?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<n.length;a++){for(var s=n[a]._private,o=s.animation.current,l=0;l<o.length;l++){var c=o[l]._private;e&&(c.duration=0)}t&&(s.animation.queue=[]),e||(s.animation.current=[])}return i.notify("draw"),this}),"stopImpl")}),"stop")},zmt=Array.isArray,Umt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gmt=/^\w*$/;function qmt(t,e){if(zmt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!zdt(t))||(Gmt.test(t)||!Umt.test(t)||null!=e&&t in Object(e))}o(qmt,"isKey");var jmt=qmt;function Wmt(t){if(!udt(t))return!1;var e=Pdt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}o(Wmt,"isFunction");var Ymt=Wmt,Hmt=mdt["__core-js_shared__"],Vmt=function(){var t=/[^.]+$/.exec(Hmt&&Hmt.keys&&Hmt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Xmt(t){return!!Vmt&&Vmt in t}o(Xmt,"isMasked");var Kmt=Xmt,Zmt=Function.prototype.toString;function Qmt(t){if(null!=t){try{return Zmt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}o(Qmt,"toSource");var Jmt=Qmt,tyt=/^\[object .+?Constructor\]$/,eyt=Function.prototype,ryt=Object.prototype,nyt=eyt.toString,iyt=ryt.hasOwnProperty,ayt=RegExp("^"+nyt.call(iyt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function syt(t){return!(!udt(t)||Kmt(t))&&(Ymt(t)?ayt:tyt).test(Jmt(t))}o(syt,"baseIsNative");var oyt=syt;function lyt(t,e){return null==t?void 0:t[e]}o(lyt,"getValue$1");var cyt=lyt;function hyt(t,e){var r=cyt(t,e);return oyt(r)?r:void 0}o(hyt,"getNative");var uyt=hyt,dyt=uyt(Object,"create");function pyt(){this.__data__=dyt?dyt(null):{},this.size=0}o(pyt,"hashClear");var gyt=pyt;function fyt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}o(fyt,"hashDelete");var myt=fyt,yyt=Object.prototype.hasOwnProperty;function vyt(t){var e=this.__data__;if(dyt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return yyt.call(e,t)?e[t]:void 0}o(vyt,"hashGet");var xyt=vyt,byt=Object.prototype.hasOwnProperty;function wyt(t){var e=this.__data__;return dyt?void 0!==e[t]:byt.call(e,t)}o(wyt,"hashHas");var kyt=wyt;function Tyt(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dyt&&void 0===e?"__lodash_hash_undefined__":e,this}o(Tyt,"hashSet");var _yt=Tyt;function Eyt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Eyt,"Hash"),Eyt.prototype.clear=gyt,Eyt.prototype.delete=myt,Eyt.prototype.get=xyt,Eyt.prototype.has=kyt,Eyt.prototype.set=_yt;var Cyt=Eyt;function Syt(){this.__data__=[],this.size=0}o(Syt,"listCacheClear");var Ayt=Syt;function Lyt(t,e){return t===e||t!=t&&e!=e}o(Lyt,"eq");var Nyt=Lyt;function Iyt(t,e){for(var r=t.length;r--;)if(Nyt(t[r][0],e))return r;return-1}o(Iyt,"assocIndexOf");var Ryt=Iyt,Myt=Array.prototype.splice;function Dyt(t){var e=this.__data__,r=Ryt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Myt.call(e,r,1),--this.size,!0)}o(Dyt,"listCacheDelete");var Oyt=Dyt;function Pyt(t){var e=this.__data__,r=Ryt(e,t);return r<0?void 0:e[r][1]}o(Pyt,"listCacheGet");var Byt=Pyt;function $yt(t){return Ryt(this.__data__,t)>-1}o($yt,"listCacheHas");var Fyt=$yt;function zyt(t,e){var r=this.__data__,n=Ryt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}o(zyt,"listCacheSet");var Uyt=zyt;function Gyt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(Gyt,"ListCache"),Gyt.prototype.clear=Ayt,Gyt.prototype.delete=Oyt,Gyt.prototype.get=Byt,Gyt.prototype.has=Fyt,Gyt.prototype.set=Uyt;var qyt=Gyt,jyt=uyt(mdt,"Map");function Wyt(){this.size=0,this.__data__={hash:new Cyt,map:new(jyt||qyt),string:new Cyt}}o(Wyt,"mapCacheClear");var Yyt=Wyt;function Hyt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}o(Hyt,"isKeyable");var Vyt=Hyt;function Xyt(t,e){var r=t.__data__;return Vyt(e)?r["string"==typeof e?"string":"hash"]:r.map}o(Xyt,"getMapData");var Kyt=Xyt;function Zyt(t){var e=Kyt(this,t).delete(t);return this.size-=e?1:0,e}o(Zyt,"mapCacheDelete");var Qyt=Zyt;function Jyt(t){return Kyt(this,t).get(t)}o(Jyt,"mapCacheGet");var tvt=Jyt;function evt(t){return Kyt(this,t).has(t)}o(evt,"mapCacheHas");var rvt=evt;function nvt(t,e){var r=Kyt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}o(nvt,"mapCacheSet");var ivt=nvt;function avt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}o(avt,"MapCache"),avt.prototype.clear=Yyt,avt.prototype.delete=Qyt,avt.prototype.get=tvt,avt.prototype.has=rvt,avt.prototype.set=ivt;var svt=avt;function ovt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=o((function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s}),"memoized");return r.cache=new(ovt.Cache||svt),r}o(ovt,"memoize"),ovt.Cache=svt;var lvt=ovt;function cvt(t){var e=lvt(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}o(cvt,"memoizeCapped");var hvt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uvt=/\\(\\)?/g,dvt=cvt((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(hvt,(function(t,r,n,i){e.push(n?i.replace(uvt,"$1"):r||t)})),e})),pvt=dvt;function gvt(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}o(gvt,"arrayMap");var fvt=gvt,mvt=_dt?_dt.prototype:void 0,yvt=mvt?mvt.toString:void 0;function vvt(t){if("string"==typeof t)return t;if(zmt(t))return fvt(t,vvt)+"";if(zdt(t))return yvt?yvt.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}o(vvt,"baseToString");var xvt=vvt;function bvt(t){return null==t?"":xvt(t)}o(bvt,"toString$1");var wvt=bvt;function kvt(t,e){return zmt(t)?t:jmt(t,e)?[t]:pvt(wvt(t))}o(kvt,"castPath");var Tvt=kvt;function _vt(t){if("string"==typeof t||zdt(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}o(_vt,"toKey");var Evt=_vt;function Cvt(t,e){for(var r=0,n=(e=Tvt(e,t)).length;null!=t&&r<n;)t=t[Evt(e[r++])];return r&&r==n?t:void 0}o(Cvt,"baseGet");var Svt=Cvt;function Avt(t,e,r){var n=null==t?void 0:Svt(t,e);return void 0===n?r:n}o(Avt,"get");var Lvt=Avt,Nvt=function(){try{var t=uyt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Ivt(t,e,r){"__proto__"==e&&Nvt?Nvt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}o(Ivt,"baseAssignValue");var Rvt=Ivt,Mvt=Object.prototype.hasOwnProperty;function Dvt(t,e,r){var n=t[e];Mvt.call(t,e)&&Nyt(n,r)&&(void 0!==r||e in t)||Rvt(t,e,r)}o(Dvt,"assignValue");var Ovt=Dvt,Pvt=/^(?:0|[1-9]\d*)$/;function Bvt(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Pvt.test(t))&&t>-1&&t%1==0&&t<e}o(Bvt,"isIndex");var $vt=Bvt;function Fvt(t,e,r,n){if(!udt(t))return t;for(var i=-1,a=(e=Tvt(e,t)).length,s=a-1,o=t;null!=o&&++i<a;){var l=Evt(e[i]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var h=o[l];void 0===(c=n?n(h,l,o):void 0)&&(c=udt(h)?h:$vt(e[i+1])?[]:{})}Ovt(o,l,c),o=o[l]}return t}o(Fvt,"baseSet");var zvt=Fvt;function Uvt(t,e,r){return null==t?t:zvt(t,e,r)}o(Uvt,"set");var Gvt=Uvt;function qvt(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}o(qvt,"copyArray");var jvt=qvt;function Wvt(t){return zmt(t)?fvt(t,Evt):zdt(t)?[t]:jvt(pvt(wvt(t)))}o(Wvt,"toPath");var Yvt=Wvt,Hvt={data:o((function(t){return t=edt({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:o((function(t){}),"beforeGet"),beforeSet:o((function(t,e){}),"beforeSet"),onSet:o((function(t){}),"onSet"),canSet:o((function(t){return!0}),"canSet")},t),o((function(e,r){var n=t,i=this,a=void 0!==i.length,s=a?i:[i],o=a?i[0]:i;if(Aut(e)){var l,c=-1!==e.indexOf(".")&&Yvt(e);if(n.allowGetting&&void 0===r)return o&&(n.beforeGet(o),l=c&&void 0===o._private[n.field][e]?Lvt(o._private[n.field],c):o._private[n.field][e]),l;if(n.allowSetting&&void 0!==r&&!n.immutableKeys[e]){var h=cut({},e,r);n.beforeSet(i,h);for(var u=0,d=s.length;u<d;u++){var p=s[u];n.canSet(p)&&(c&&void 0===o._private[n.field][e]?Gvt(p._private[n.field],c,r):p._private[n.field][e]=r)}n.updateStyle&&i.updateStyle(),n.onSet(i),n.settingTriggersEvent&&i[n.triggerFnName](n.settingEvent)}}else if(n.allowSetting&&Iut(e)){var g,f,m=e,y=Object.keys(m);n.beforeSet(i,m);for(var v=0;v<y.length;v++){if(f=m[g=y[v]],!n.immutableKeys[g])for(var x=0;x<s.length;x++){var b=s[x];n.canSet(b)&&(b._private[n.field][g]=f)}}n.updateStyle&&i.updateStyle(),n.onSet(i),n.settingTriggersEvent&&i[n.triggerFnName](n.settingEvent)}else if(n.allowBinding&&Lut(e)){var w=e;i.on(n.bindingEvent,w)}else if(n.allowGetting&&void 0===e){var k;return o&&(n.beforeGet(o),k=o._private[n.field]),k}return i}),"dataImpl")}),"data"),removeData:o((function(t){return t=edt({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},t),o((function(e){var r=t,n=this,i=void 0!==n.length?n:[n];if(Aut(e)){for(var a=e.split(/\s+/),s=a.length,o=0;o<s;o++){var l=a[o];if(!Gut(l))if(!r.immutableKeys[l])for(var c=0,h=i.length;c<h;c++)i[c]._private[r.field][l]=void 0}r.triggerEvent&&n[r.triggerFnName](r.event)}else if(void 0===e){for(var u=0,d=i.length;u<d;u++)for(var p=i[u]._private[r.field],g=Object.keys(p),f=0;f<g.length;f++){var m=g[f];!r.immutableKeys[m]&&(p[m]=void 0)}r.triggerEvent&&n[r.triggerFnName](r.event)}return n}),"removeDataImpl")}),"removeData")},Vvt={eventAliasesOn:o((function(t){var e=t;e.addListener=e.listen=e.bind=e.on,e.unlisten=e.unbind=e.off=e.removeListener,e.trigger=e.emit,e.pon=e.promiseOn=function(t,e){var r=this,n=Array.prototype.slice.call(arguments,0);return new Pmt((function(t,e){var i=o((function(e){r.off.apply(r,s),t(e)}),"callback"),a=n.concat([i]),s=a.concat([]);r.on.apply(r,a)}))}}),"eventAliasesOn")},Xvt={};[Fmt,Hvt,Vvt].forEach((function(t){edt(Xvt,t)}));var Kvt={animate:Xvt.animate(),animation:Xvt.animation(),animated:Xvt.animated(),clearQueue:Xvt.clearQueue(),delay:Xvt.delay(),delayAnimation:Xvt.delayAnimation(),stop:Xvt.stop()},Zvt={classes:o((function(t){var e=this;if(void 0===t){var r=[];return e[0]._private.classes.forEach((function(t){return r.push(t)})),r}Nut(t)||(t=(t||"").match(/\S+/g)||[]);for(var n=[],i=new zpt(t),a=0;a<e.length;a++){for(var s=e[a],o=s._private,l=o.classes,c=!1,h=0;h<t.length;h++){var u=t[h];if(!l.has(u)){c=!0;break}}c||(c=l.size!==t.length),c&&(o.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),e}),"classes"),addClass:o((function(t){return this.toggleClass(t,!0)}),"addClass"),hasClass:o((function(t){var e=this[0];return null!=e&&e._private.classes.has(t)}),"hasClass"),toggleClass:o((function(t,e){Nut(t)||(t=t.match(/\S+/g)||[]);for(var r=this,n=void 0===e,i=[],a=0,s=r.length;a<s;a++)for(var o=r[a],l=o._private.classes,c=!1,h=0;h<t.length;h++){var u=t[h],d=l.has(u),p=!1;e||n&&!d?(l.add(u),p=!0):(!e||n&&d)&&(l.delete(u),p=!0),!c&&p&&(i.push(o),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r}),"toggleClass"),removeClass:o((function(t){return this.toggleClass(t,!1)}),"removeClass"),flashClass:o((function(t,e){var r=this;if(null==e)e=250;else if(0===e)return r;return r.addClass(t),setTimeout((function(){r.removeClass(t)}),e),r}),"flashClass")};Zvt.className=Zvt.classNames=Zvt.classes;var Qvt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Qut,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Qvt.variable="(?:[\\w-.]|(?:\\\\"+Qvt.metaChar+"))+",Qvt.className="(?:[\\w-]|(?:\\\\"+Qvt.metaChar+"))+",Qvt.value=Qvt.string+"|"+Qvt.number,Qvt.id=Qvt.variable,function(){var t,e,r;for(t=Qvt.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Qvt.comparatorOp+="|@"+e;for(t=Qvt.comparatorOp.split("|"),r=0;r<t.length;r++)(e=t[r]).indexOf("!")>=0||"="!==e&&(Qvt.comparatorOp+="|\\!"+e)}();var Jvt=o((function(){return{checks:[]}}),"newQuery"),txt=0,ext=1,rxt=2,nxt=3,ixt=4,axt=5,sxt=6,oxt=7,lxt=8,cxt=9,hxt=10,uxt=11,dxt=12,pxt=13,gxt=14,fxt=15,mxt=16,yxt=17,vxt=18,xxt=19,bxt=20,wxt=[{selector:":selected",matches:o((function(t){return t.selected()}),"matches")},{selector:":unselected",matches:o((function(t){return!t.selected()}),"matches")},{selector:":selectable",matches:o((function(t){return t.selectable()}),"matches")},{selector:":unselectable",matches:o((function(t){return!t.selectable()}),"matches")},{selector:":locked",matches:o((function(t){return t.locked()}),"matches")},{selector:":unlocked",matches:o((function(t){return!t.locked()}),"matches")},{selector:":visible",matches:o((function(t){return t.visible()}),"matches")},{selector:":hidden",matches:o((function(t){return!t.visible()}),"matches")},{selector:":transparent",matches:o((function(t){return t.transparent()}),"matches")},{selector:":grabbed",matches:o((function(t){return t.grabbed()}),"matches")},{selector:":free",matches:o((function(t){return!t.grabbed()}),"matches")},{selector:":removed",matches:o((function(t){return t.removed()}),"matches")},{selector:":inside",matches:o((function(t){return!t.removed()}),"matches")},{selector:":grabbable",matches:o((function(t){return t.grabbable()}),"matches")},{selector:":ungrabbable",matches:o((function(t){return!t.grabbable()}),"matches")},{selector:":animated",matches:o((function(t){return t.animated()}),"matches")},{selector:":unanimated",matches:o((function(t){return!t.animated()}),"matches")},{selector:":parent",matches:o((function(t){return t.isParent()}),"matches")},{selector:":childless",matches:o((function(t){return t.isChildless()}),"matches")},{selector:":child",matches:o((function(t){return t.isChild()}),"matches")},{selector:":orphan",matches:o((function(t){return t.isOrphan()}),"matches")},{selector:":nonorphan",matches:o((function(t){return t.isChild()}),"matches")},{selector:":compound",matches:o((function(t){return t.isNode()?t.isParent():t.source().isParent()||t.target().isParent()}),"matches")},{selector:":loop",matches:o((function(t){return t.isLoop()}),"matches")},{selector:":simple",matches:o((function(t){return t.isSimple()}),"matches")},{selector:":active",matches:o((function(t){return t.active()}),"matches")},{selector:":inactive",matches:o((function(t){return!t.active()}),"matches")},{selector:":backgrounding",matches:o((function(t){return t.backgrounding()}),"matches")},{selector:":nonbackgrounding",matches:o((function(t){return!t.backgrounding()}),"matches")}].sort((function(t,e){return tdt(t.selector,e.selector)})),kxt=function(){for(var t,e={},r=0;r<wxt.length;r++)e[(t=wxt[r]).selector]=t.matches;return e}(),Txt=o((function(t,e){return kxt[t](e)}),"stateSelectorMatches"),_xt="("+wxt.map((function(t){return t.selector})).join("|")+")",Ext=o((function(t){return t.replace(new RegExp("\\\\("+Qvt.metaChar+")","g"),(function(t,e){return e}))}),"cleanMetaChars"),Cxt=o((function(t,e,r){t[t.length-1]=r}),"replaceLastQuery"),Sxt=[{name:"group",query:!0,regex:"("+Qvt.group+")",populate:o((function(t,e,r){var n=hut(r,1)[0];e.checks.push({type:txt,value:"*"===n?n:n+"s"})}),"populate")},{name:"state",query:!0,regex:_xt,populate:o((function(t,e,r){var n=hut(r,1)[0];e.checks.push({type:oxt,value:n})}),"populate")},{name:"id",query:!0,regex:"\\#("+Qvt.id+")",populate:o((function(t,e,r){var n=hut(r,1)[0];e.checks.push({type:lxt,value:Ext(n)})}),"populate")},{name:"className",query:!0,regex:"\\.("+Qvt.className+")",populate:o((function(t,e,r){var n=hut(r,1)[0];e.checks.push({type:cxt,value:Ext(n)})}),"populate")},{name:"dataExists",query:!0,regex:"\\[\\s*("+Qvt.variable+")\\s*\\]",populate:o((function(t,e,r){var n=hut(r,1)[0];e.checks.push({type:ixt,field:Ext(n)})}),"populate")},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Qvt.variable+")\\s*("+Qvt.comparatorOp+")\\s*("+Qvt.value+")\\s*\\]",populate:o((function(t,e,r){var n=hut(r,3),i=n[0],a=n[1],s=n[2];s=null!=new RegExp("^"+Qvt.string+"$").exec(s)?s.substring(1,s.length-1):parseFloat(s),e.checks.push({type:nxt,field:Ext(i),operator:a,value:s})}),"populate")},{name:"dataBool",query:!0,regex:"\\[\\s*("+Qvt.boolOp+")\\s*("+Qvt.variable+")\\s*\\]",populate:o((function(t,e,r){var n=hut(r,2),i=n[0],a=n[1];e.checks.push({type:axt,field:Ext(a),operator:i})}),"populate")},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Qvt.meta+")\\s*("+Qvt.comparatorOp+")\\s*("+Qvt.number+")\\s*\\]\\]",populate:o((function(t,e,r){var n=hut(r,3),i=n[0],a=n[1],s=n[2];e.checks.push({type:sxt,field:Ext(i),operator:a,value:parseFloat(s)})}),"populate")},{name:"nextQuery",separator:!0,regex:Qvt.separator,populate:o((function(t,e){var r=t.currentSubject,n=t.edgeCount,i=t.compoundCount,a=t[t.length-1];return null!=r&&(a.subject=r,t.currentSubject=null),a.edgeCount=n,a.compoundCount=i,t.edgeCount=0,t.compoundCount=0,t[t.length++]=Jvt()}),"populate")},{name:"directedEdge",separator:!0,regex:Qvt.directedEdge,populate:o((function(t,e){if(null==t.currentSubject){var r=Jvt(),n=e,i=Jvt();return r.checks.push({type:uxt,source:n,target:i}),Cxt(t,e,r),t.edgeCount++,i}var a=Jvt(),s=e,o=Jvt();return a.checks.push({type:dxt,source:s,target:o}),Cxt(t,e,a),t.edgeCount++,o}),"populate")},{name:"undirectedEdge",separator:!0,regex:Qvt.undirectedEdge,populate:o((function(t,e){if(null==t.currentSubject){var r=Jvt(),n=e,i=Jvt();return r.checks.push({type:hxt,nodes:[n,i]}),Cxt(t,e,r),t.edgeCount++,i}var a=Jvt(),s=e,o=Jvt();return a.checks.push({type:gxt,node:s,neighbor:o}),Cxt(t,e,a),o}),"populate")},{name:"child",separator:!0,regex:Qvt.child,populate:o((function(t,e){if(null==t.currentSubject){var r=Jvt(),n=Jvt(),i=t[t.length-1];return r.checks.push({type:fxt,parent:i,child:n}),Cxt(t,e,r),t.compoundCount++,n}if(t.currentSubject===e){var a=Jvt(),s=t[t.length-1],o=Jvt(),l=Jvt(),c=Jvt(),h=Jvt();return a.checks.push({type:xxt,left:s,right:o,subject:l}),l.checks=e.checks,e.checks=[{type:bxt}],h.checks.push({type:bxt}),o.checks.push({type:yxt,parent:h,child:c}),Cxt(t,s,a),t.currentSubject=l,t.compoundCount++,c}var u=Jvt(),d=Jvt(),p=[{type:yxt,parent:u,child:d}];return u.checks=e.checks,e.checks=p,t.compoundCount++,d}),"populate")},{name:"descendant",separator:!0,regex:Qvt.descendant,populate:o((function(t,e){if(null==t.currentSubject){var r=Jvt(),n=Jvt(),i=t[t.length-1];return r.checks.push({type:mxt,ancestor:i,descendant:n}),Cxt(t,e,r),t.compoundCount++,n}if(t.currentSubject===e){var a=Jvt(),s=t[t.length-1],o=Jvt(),l=Jvt(),c=Jvt(),h=Jvt();return a.checks.push({type:xxt,left:s,right:o,subject:l}),l.checks=e.checks,e.checks=[{type:bxt}],h.checks.push({type:bxt}),o.checks.push({type:vxt,ancestor:h,descendant:c}),Cxt(t,s,a),t.currentSubject=l,t.compoundCount++,c}var u=Jvt(),d=Jvt(),p=[{type:vxt,ancestor:u,descendant:d}];return u.checks=e.checks,e.checks=p,t.compoundCount++,d}),"populate")},{name:"subject",modifier:!0,regex:Qvt.subject,populate:o((function(t,e){if(null!=t.currentSubject&&t.currentSubject!==e)return Ept("Redefinition of subject in selector `"+t.toString()+"`"),!1;t.currentSubject=e;var r=t[t.length-1].checks[0],n=null==r?null:r.type;n===uxt?r.type=pxt:n===hxt&&(r.type=gxt,r.node=r.nodes[1],r.neighbor=r.nodes[0],r.nodes=null)}),"populate")}];Sxt.forEach((function(t){return t.regexObj=new RegExp("^"+t.regex)}));var Axt=o((function(t){for(var e,r,n,i=0;i<Sxt.length;i++){var a=Sxt[i],s=a.name,o=t.match(a.regexObj);if(null!=o){r=o,e=a,n=s;var l=o[0];t=t.substring(l.length);break}}return{expr:e,match:r,name:n,remaining:t}}),"consumeExpr"),Lxt=o((function(t){var e=t.match(/^\s+/);if(e){var r=e[0];t=t.substring(r.length)}return t}),"consumeWhitespace"),Nxt=o((function(t){var e=this,r=e.inputText=t,n=e[0]=Jvt();for(e.length=1,r=Lxt(r);;){var i=Axt(r);if(null==i.expr)return Ept("The selector `"+t+"`is invalid"),!1;var a=i.match.slice(1),s=i.expr.populate(e,n,a);if(!1===s)return!1;if(null!=s&&(n=s),(r=i.remaining).match(/^\s*$/))break}var o=e[e.length-1];null!=e.currentSubject&&(o.subject=e.currentSubject),o.edgeCount=e.edgeCount,o.compoundCount=e.compoundCount;for(var l=0;l<e.length;l++){var c=e[l];if(c.compoundCount>0&&c.edgeCount>0)return Ept("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Ept("The selector `"+t+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Ept("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"),Ixt=o((function(){if(null!=this.toStringCache)return this.toStringCache;for(var t=o((function(t){return null==t?"":t}),"clean"),e=o((function(e){return Aut(e)?'"'+e+'"':t(e)}),"cleanVal"),r=o((function(t){return" "+t+" "}),"space"),n=o((function(n,a){var s=n.type,o=n.value;switch(s){case txt:var l=t(o);return l.substring(0,l.length-1);case nxt:var c=n.field,h=n.operator;return"["+c+r(t(h))+e(o)+"]";case axt:var u=n.operator,d=n.field;return"["+t(u)+d+"]";case ixt:return"["+n.field+"]";case sxt:var p=n.operator;return"[["+n.field+r(t(p))+e(o)+"]]";case oxt:return o;case lxt:return"#"+o;case cxt:return"."+o;case yxt:case fxt:return i(n.parent,a)+r(">")+i(n.child,a);case vxt:case mxt:return i(n.ancestor,a)+" "+i(n.descendant,a);case xxt:var g=i(n.left,a),f=i(n.subject,a),m=i(n.right,a);return g+(g.length>0?" ":"")+f+m;case bxt:return""}}),"checkToString"),i=o((function(t,e){return t.checks.reduce((function(r,i,a){return r+(e===t&&0===a?"$":"")+n(i,e)}),"")}),"queryToString"),a="",s=0;s<this.length;s++){var l=this[s];a+=i(l,l.subject),this.length>1&&s<this.length-1&&(a+=", ")}return this.toStringCache=a,a}),"toString"),Rxt={parse:Nxt,toString:Ixt},Mxt=o((function(t,e,r){var n,i,a,s=Aut(t),o=Mut(t),l=Aut(r),c=!1,h=!1,u=!1;switch(e.indexOf("!")>=0&&(e=e.replace("!",""),h=!0),e.indexOf("@")>=0&&(e=e.replace("@",""),c=!0),(s||l||c)&&(i=s||o?""+t:"",a=""+r),c&&(t=i=i.toLowerCase(),r=a=a.toLowerCase()),e){case"*=":n=i.indexOf(a)>=0;break;case"$=":n=i.indexOf(a,i.length-a.length)>=0;break;case"^=":n=0===i.indexOf(a);break;case"=":n=t===r;break;case">":u=!0,n=t>r;break;case">=":u=!0,n=t>=r;break;case"<":u=!0,n=t<r;break;case"<=":u=!0,n=t<=r;break;default:n=!1}return!h||null==t&&u||(n=!n),n}),"valCmp"),Dxt=o((function(t,e){switch(e){case"?":return!!t;case"!":return!t;case"^":return void 0===t}}),"boolCmp"),Oxt=o((function(t){return void 0!==t}),"existCmp"),Pxt=o((function(t,e){return t.data(e)}),"data"),Bxt=o((function(t,e){return t[e]()}),"meta"),$xt=[],Fxt=o((function(t,e){return t.checks.every((function(t){return $xt[t.type](t,e)}))}),"matches");$xt[txt]=function(t,e){var r=t.value;return"*"===r||r===e.group()},$xt[oxt]=function(t,e){var r=t.value;return Txt(r,e)},$xt[lxt]=function(t,e){var r=t.value;return e.id()===r},$xt[cxt]=function(t,e){var r=t.value;return e.hasClass(r)},$xt[sxt]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Mxt(Bxt(e,r),n,i)},$xt[nxt]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Mxt(Pxt(e,r),n,i)},$xt[axt]=function(t,e){var r=t.field,n=t.operator;return Dxt(Pxt(e,r),n)},$xt[ixt]=function(t,e){var r=t.field;return t.operator,Oxt(Pxt(e,r))},$xt[hxt]=function(t,e){var r=t.nodes[0],n=t.nodes[1],i=e.source(),a=e.target();return Fxt(r,i)&&Fxt(n,a)||Fxt(n,i)&&Fxt(r,a)},$xt[gxt]=function(t,e){return Fxt(t.node,e)&&e.neighborhood().some((function(e){return e.isNode()&&Fxt(t.neighbor,e)}))},$xt[uxt]=function(t,e){return Fxt(t.source,e.source())&&Fxt(t.target,e.target())},$xt[dxt]=function(t,e){return Fxt(t.source,e)&&e.outgoers().some((function(e){return e.isNode()&&Fxt(t.target,e)}))},$xt[pxt]=function(t,e){return Fxt(t.target,e)&&e.incomers().some((function(e){return e.isNode()&&Fxt(t.source,e)}))},$xt[fxt]=function(t,e){return Fxt(t.child,e)&&Fxt(t.parent,e.parent())},$xt[yxt]=function(t,e){return Fxt(t.parent,e)&&e.children().some((function(e){return Fxt(t.child,e)}))},$xt[mxt]=function(t,e){return Fxt(t.descendant,e)&&e.ancestors().some((function(e){return Fxt(t.ancestor,e)}))},$xt[vxt]=function(t,e){return Fxt(t.ancestor,e)&&e.descendants().some((function(e){return Fxt(t.descendant,e)}))},$xt[xxt]=function(t,e){return Fxt(t.subject,e)&&Fxt(t.left,e)&&Fxt(t.right,e)},$xt[bxt]=function(){return!0},$xt[ext]=function(t,e){return t.value.has(e)},$xt[rxt]=function(t,e){return(0,t.value)(e)};var zxt=o((function(t){var e=this;if(1===e.length&&1===e[0].checks.length&&e[0].checks[0].type===lxt)return t.getElementById(e[0].checks[0].value).collection();var r=o((function(t){for(var r=0;r<e.length;r++){var n=e[r];if(Fxt(n,t))return!0}return!1}),"selectorFunction");return null==e.text()&&(r=o((function(){return!0}),"selectorFunction")),t.filter(r)}),"filter"),Uxt=o((function(t){for(var e=0;e<this.length;e++){var r=this[e];if(Fxt(r,t))return!0}return!1}),"matches"),Gxt={matches:Uxt,filter:zxt},qxt=o((function(t){this.inputText=t,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==t||Aut(t)&&t.match(/^\s*$/)||(Put(t)?this.addQuery({checks:[{type:ext,value:t.collection()}]}):Lut(t)?this.addQuery({checks:[{type:rxt,value:t}]}):Aut(t)?this.parse(t)||(this.invalid=!0):Tpt("A selector must be created from a string; found "))}),"Selector"),jxt=qxt.prototype;[Rxt,Gxt].forEach((function(t){return edt(jxt,t)})),jxt.text=function(){return this.inputText},jxt.size=function(){return this.length},jxt.eq=function(t){return this[t]},jxt.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},jxt.addQuery=function(t){this[this.length++]=t},jxt.selector=jxt.toString;var Wxt={allAre:o((function(t){var e=new qxt(t);return this.every((function(t){return e.matches(t)}))}),"allAre"),is:o((function(t){var e=new qxt(t);return this.some((function(t){return e.matches(t)}))}),"is"),some:o((function(t,e){for(var r=0;r<this.length;r++){if(e?t.apply(e,[this[r],r,this]):t(this[r],r,this))return!0}return!1}),"some"),every:o((function(t,e){for(var r=0;r<this.length;r++){if(!(e?t.apply(e,[this[r],r,this]):t(this[r],r,this)))return!1}return!0}),"every"),same:o((function(t){if(this===t)return!0;t=this.cy().collection(t);var e=this.length;return e===t.length&&(1===e?this[0]===t[0]:this.every((function(e){return t.hasElementWithId(e.id())})))}),"same"),anySame:o((function(t){return t=this.cy().collection(t),this.some((function(e){return t.hasElementWithId(e.id())}))}),"anySame"),allAreNeighbors:o((function(t){t=this.cy().collection(t);var e=this.neighborhood();return t.every((function(t){return e.hasElementWithId(t.id())}))}),"allAreNeighbors"),contains:o((function(t){t=this.cy().collection(t);var e=this;return t.every((function(t){return e.hasElementWithId(t.id())}))}),"contains")};Wxt.allAreNeighbours=Wxt.allAreNeighbors,Wxt.has=Wxt.contains,Wxt.equal=Wxt.equals=Wxt.same;var Yxt,Hxt,Vxt=o((function(t,e){return o((function(r,n,i,a){var s,o=r,l=this;if(null==o?s="":Put(o)&&1===o.length&&(s=o.id()),1===l.length&&s){var c=l[0]._private,h=c.traversalCache=c.traversalCache||{},u=h[e]=h[e]||[],d=dpt(s),p=u[d];return p||(u[d]=t.call(l,r,n,i,a))}return t.call(l,r,n,i,a)}),"traversalCache")}),"cache"),Xxt={parent:o((function(t){var e=[];if(1===this.length){var r=this[0]._private.parent;if(r)return r}for(var n=0;n<this.length;n++){var i=this[n]._private.parent;i&&e.push(i)}return this.spawn(e,!0).filter(t)}),"parent"),parents:o((function(t){for(var e=[],r=this.parent();r.nonempty();){for(var n=0;n<r.length;n++){var i=r[n];e.push(i)}r=r.parent()}return this.spawn(e,!0).filter(t)}),"parents"),commonAncestors:o((function(t){for(var e,r=0;r<this.length;r++){var n=this[r].parents();e=(e=e||n).intersect(n)}return e.filter(t)}),"commonAncestors"),orphans:o((function(t){return this.stdFilter((function(t){return t.isOrphan()})).filter(t)}),"orphans"),nonorphans:o((function(t){return this.stdFilter((function(t){return t.isChild()})).filter(t)}),"nonorphans"),children:Vxt((function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r]._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(t)}),"children"),siblings:o((function(t){return this.parent().children().not(this).filter(t)}),"siblings"),isParent:o((function(){var t=this[0];if(t)return t.isNode()&&0!==t._private.children.length}),"isParent"),isChildless:o((function(){var t=this[0];if(t)return t.isNode()&&0===t._private.children.length}),"isChildless"),isChild:o((function(){var t=this[0];if(t)return t.isNode()&&null!=t._private.parent}),"isChild"),isOrphan:o((function(){var t=this[0];if(t)return t.isNode()&&null==t._private.parent}),"isOrphan"),descendants:o((function(t){var e=[];function r(t){for(var n=0;n<t.length;n++){var i=t[n];e.push(i),i.children().nonempty()&&r(i.children())}}return o(r,"add"),r(this.children()),this.spawn(e,!0).filter(t)}),"descendants")};function Kxt(t,e,r,n){for(var i=[],a=new zpt,s=t.cy().hasCompoundNodes(),o=0;o<t.length;o++){var l=t[o];r?i.push(l):s&&n(i,a,l)}for(;i.length>0;){var c=i.shift();e(c),a.add(c.id()),s&&n(i,a,c)}return t}function Zxt(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i<n.length;i++){var a=n[i];e.has(a.id())||t.push(a)}}function Qxt(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}function Jxt(t,e,r){Qxt(t,e,r),Zxt(t,e,r)}o(Kxt,"forEachCompound"),o(Zxt,"addChildren"),Xxt.forEachDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Zxt)},o(Qxt,"addParent"),Xxt.forEachUp=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Qxt)},o(Jxt,"addParentAndChildren"),Xxt.forEachUpAndDown=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Kxt(this,t,e,Jxt)},Xxt.ancestors=Xxt.parents,(Yxt=Hxt={data:Xvt.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:Xvt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Xvt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xvt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Xvt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Xvt.removeData({field:"rscratch",triggerEvent:!1}),id:o((function(){var t=this[0];if(t)return t._private.data.id}),"id")}).attr=Yxt.data,Yxt.removeAttr=Yxt.removeData;var tbt,ebt,rbt=Hxt,nbt={};function ibt(t){return function(e){var r=this;if(void 0===e&&(e=!0),0!==r.length&&r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;s<a.length;s++){var o=a[s];!e&&o.isLoop()||(n+=t(i,o))}return n}}}function abt(t,e){return function(r){for(var n,i=this.nodes(),a=0;a<i.length;a++){var s=i[a][t](r);void 0===s||void 0!==n&&!e(s,n)||(n=s)}return n}}o(ibt,"defineDegreeFunction"),edt(nbt,{degree:ibt((function(t,e){return e.source().same(e.target())?2:1})),indegree:ibt((function(t,e){return e.target().same(t)?1:0})),outdegree:ibt((function(t,e){return e.source().same(t)?1:0}))}),o(abt,"defineDegreeBoundsFunction"),edt(nbt,{minDegree:abt("degree",(function(t,e){return t<e})),maxDegree:abt("degree",(function(t,e){return t>e})),minIndegree:abt("indegree",(function(t,e){return t<e})),maxIndegree:abt("indegree",(function(t,e){return t>e})),minOutdegree:abt("outdegree",(function(t,e){return t<e})),maxOutdegree:abt("outdegree",(function(t,e){return t>e}))}),edt(nbt,{totalDegree:o((function(t){for(var e=0,r=this.nodes(),n=0;n<r.length;n++)e+=r[n].degree(t);return e}),"totalDegree")});var sbt=o((function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if(!i.locked()){var a=i._private.position,s={x:null!=e.x?e.x-a.x:0,y:null!=e.y?e.y-a.y:0};!i.isParent()||0===s.x&&0===s.y||i.children().shift(s,r),i.dirtyBoundingBoxCache()}}}),"beforePositionSet"),obt={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:o((function(t){t.updateCompoundBounds()}),"beforeGet"),beforeSet:o((function(t,e){sbt(t,e,!1)}),"beforeSet"),onSet:o((function(t){t.dirtyCompoundBoundsCache()}),"onSet"),canSet:o((function(t){return!t.locked()}),"canSet")};tbt=ebt={position:Xvt.data(obt),silentPosition:Xvt.data(edt({},obt,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:o((function(t,e){sbt(t,e,!0)}),"beforeSet"),onSet:o((function(t){t.dirtyCompoundBoundsCache()}),"onSet")})),positions:o((function(t,e){if(Iut(t))e?this.silentPosition(t):this.position(t);else if(Lut(t)){var r=t,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var a,s=this[i];(a=r(s,i))&&(e?s.silentPosition(a):s.position(a))}n.endBatch()}return this}),"positions"),silentPositions:o((function(t){return this.positions(t,!0)}),"silentPositions"),shift:o((function(t,e,r){var n;if(Iut(t)?(n={x:Mut(t.x)?t.x:0,y:Mut(t.y)?t.y:0},r=e):Aut(t)&&Mut(e)&&((n={x:0,y:0})[t]=e),null!=n){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var o=s.position(),l={x:o.x+n.x,y:o.y+n.y};r?s.silentPosition(l):s.position(l)}}i.endBatch()}return this}),"shift"),silentShift:o((function(t,e){return Iut(t)?this.shift(t,!0):Aut(t)&&Mut(e)&&this.shift(t,e,!0),this}),"silentShift"),renderedPosition:o((function(t,e){var r=this[0],n=this.cy(),i=n.zoom(),a=n.pan(),s=Iut(t)?t:void 0,o=void 0!==s||void 0!==e&&Aut(t);if(r&&r.isNode()){if(!o){var l=r.position();return s=sgt(l,i,a),void 0===t?s:s[t]}for(var c=0;c<this.length;c++){var h=this[c];void 0!==e?h.position(t,(e-a[t])/i):void 0!==s&&h.position(ogt(s,i,a))}}else if(!o)return;return this}),"renderedPosition"),relativePosition:o((function(t,e){var r=this[0],n=this.cy(),i=Iut(t)?t:void 0,a=void 0!==i||void 0!==e&&Aut(t),s=n.hasCompoundNodes();if(r&&r.isNode()){if(!a){var o=r.position(),l=s?r.parent():null,c=l&&l.length>0,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;d<this.length;d++){var p=this[d],g=s?p.parent():null,f=g&&g.length>0,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")},tbt.modelPosition=tbt.point=tbt.position,tbt.modelPositions=tbt.points=tbt.positions,tbt.renderedPoint=tbt.renderedPosition,tbt.relativePoint=tbt.relativePosition;var lbt,cbt,hbt=ebt;lbt=cbt={},cbt.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}},cbt.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 r=e._private;r.compoundBoundsClean=!1,r.bbCache=null,t||e.emitAndNotify("bounds")}})),this):this},cbt.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 r(t){if(t.isParent()){var e=t._private,r=t.children(),n="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=r.boundingBox({includeLabels:n,includeOverlays:!1,useCache:!1}),s=e.position;0!==a.w&&0!==a.h||((a={w:t.pstyle("width").pfValue,h:t.pstyle("height").pfValue}).x1=s.x-a.w/2,a.x2=s.x+a.w/2,a.y1=s.y-a.h/2,a.y2=s.y+a.h/2),o(v,"computeBiasValues"),o(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),s.x=(-p+a.x1+a.x2+g)/2,e.autoHeight=Math.max(a.h,i.height.val),s.y=(-m+a.y1+a.y2+y)/2}function v(t,e,r){var n=0,i=0,a=e+r;return t>0&&a>0&&(n=e/a*t,i=r/a*t),{biasDiff:n,biasComplementDiff:i}}function x(t,e,r,n){if("%"!==r.units)return"px"===r.units?r.pfValue:0;switch(n){case"width":return t>0?r.pfValue*t:0;case"height":return e>0?r.pfValue*e:0;case"average":return t>0&&e>0?r.pfValue*(t+e)/2:0;case"min":return t>0&&e>0?t>e?r.pfValue*e:r.pfValue*t:0;case"max":return t>0&&e>0?t>e?r.pfValue*t:r.pfValue*e:0;default:return 0}}}o(r,"update");for(var n=0;n<this.length;n++){var i=this[n],a=i._private;a.compoundBoundsClean&&!t||(r(i),e.batching()||(a.compoundBoundsClean=!0))}return this};var ubt=o((function(t){return t===1/0||t===-1/0?0:t}),"noninf"),dbt=o((function(t,e,r,n,i){n-e!=0&&i-r!=0&&null!=e&&null!=r&&null!=n&&null!=i&&(t.x1=e<t.x1?e:t.x1,t.x2=n>t.x2?n:t.x2,t.y1=r<t.y1?r:t.y1,t.y2=i>t.y2?i:t.y2,t.w=t.x2-t.x1,t.h=t.y2-t.y1)}),"updateBounds"),pbt=o((function(t,e){return null==e?t:dbt(t,e.x1,e.y1,e.x2,e.y2)}),"updateBoundsFromBox"),gbt=o((function(t,e,r){return Ppt(t,e,r)}),"prefixedProperty"),fbt=o((function(t,e,r){if(!e.cy().headless()){var n,i,a=e._private,s=a.rstyle,o=s.arrowWidth/2;if("none"!==e.pstyle(r+"-arrow-shape").value){"source"===r?(n=s.srcX,i=s.srcY):"target"===r?(n=s.tgtX,i=s.tgtY):(n=s.midX,i=s.midY);var l=a.arrowBounds=a.arrowBounds||{},c=l[r]=l[r]||{};c.x1=n-o,c.y1=i-o,c.x2=n+o,c.y2=i+o,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Ngt(c,1),dbt(t,c.x1,c.y1,c.x2,c.y2)}}}),"updateBoundsFromArrow"),mbt=o((function(t,e,r){if(!e.cy().headless()){var n;n=r?r+"-":"";var i=e._private,a=i.rstyle;if(e.pstyle(n+"label").strValue){var s,l,c,h,u=e.pstyle("text-halign"),d=e.pstyle("text-valign"),p=gbt(a,"labelWidth",r),g=gbt(a,"labelHeight",r),f=gbt(a,"labelX",r),m=gbt(a,"labelY",r),y=e.pstyle(n+"text-margin-x").pfValue,v=e.pstyle(n+"text-margin-y").pfValue,x=e.isEdge(),b=e.pstyle(n+"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)s=f-C,l=f+C,c=m-S,h=m+S;else{switch(u.value){case"left":s=f-E,l=f;break;case"center":s=f-C,l=f+C;break;case"right":s=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+_}}var A=y-Math.max(w,k)-T-2,L=y+Math.max(w,k)+T+2,N=v-Math.max(w,k)-T-2,I=v+Math.max(w,k)+T+2;s+=A,l+=L,c+=N,h+=I;var R=r||"main",M=i.labelBounds,D=M[R]=M[R]||{};D.x1=s,D.y1=c,D.x2=l,D.y2=h,D.w=l-s,D.h=h-c,D.leftPad=A,D.rightPad=L,D.topPad=N,D.botPad=I;var O=x&&"autorotate"===b.strValue,P=null!=b.pfValue&&0!==b.pfValue;if(O||P){var B=O?gbt(i.rstyle,"labelAngle",r):b.pfValue,$=Math.cos(B),F=Math.sin(B),z=(s+l)/2,U=(c+h)/2;if(!x){switch(u.value){case"left":z=l;break;case"right":z=s}switch(d.value){case"top":U=h;break;case"bottom":U=c}}var G=o((function(t,e){return{x:(t-=z)*$-(e-=U)*F+z,y:t*F+e*$+U}}),"rotate"),q=G(s,c),j=G(s,h),W=G(l,c),Y=G(l,h);s=Math.min(q.x,j.x,W.x,Y.x),l=Math.max(q.x,j.x,W.x,Y.x),c=Math.min(q.y,j.y,W.y,Y.y),h=Math.max(q.y,j.y,W.y,Y.y)}var H=R+"Rot",V=M[H]=M[H]||{};V.x1=s,V.y1=c,V.x2=l,V.y2=h,V.w=l-s,V.h=h-c,dbt(t,s,c,l,h),dbt(i.labelBounds.all,s,c,l,h)}return t}}),"updateBoundsFromLabel"),ybt=o((function(t,e){if(!e.cy().headless()){var r=e.pstyle("outline-opacity").value,n=e.pstyle("outline-width").value;if(r>0&&n>0){var i=e.pstyle("outline-offset").value,a=e.pstyle("shape").value,s=n+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(Igt(t,[Math.ceil(h/2),Math.ceil(u/2)]),0!==c){var d=Sgt(t,0,c);Agt(t,d)}}}}),"updateBoundsFromOutline"),vbt=o((function(t,e){var r,n,i,a,s,l,c=t._private.cy,h=c.styleEnabled(),u=c.headless(),d=_gt(),p=t._private,g=t.isNode(),f=t.isEdge(),m=p.rstyle,y=g&&h?t.pstyle("bounds-expansion").pfValue:[0],v=o((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();s=_.x,l=_.y;var E=t.outerWidth()/2,C=t.outerHeight()/2;dbt(d,r=s-E,i=l-C,n=s+E,a=l+C),h&&e.includeOutlines&&ybt(d,t)}else if(f&&e.includeEdges)if(h&&!u){var S=t.pstyle("curve-style").strValue;if(r=Math.min(m.srcX,m.midX,m.tgtX),n=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),dbt(d,r-=T,i-=T,n+=T,a+=T),"haystack"===S){var A=m.haystackPts;if(A&&2===A.length){if(r=A[0].x,i=A[0].y,r>(n=A[1].x)){var L=r;r=n,n=L}if(i>(a=A[1].y)){var N=i;i=a,a=N}dbt(d,r-T,i-T,n+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 R=0;R<I.length;R++){var M=I[R];r=M.x-T,n=M.x+T,i=M.y-T,a=M.y+T,dbt(d,r,i,n,a)}}}else{var D=t.source().position(),O=t.target().position();if((r=D.x)>(n=O.x)){var P=r;r=n,n=P}if((i=D.y)>(a=O.y)){var B=i;i=a,a=B}dbt(d,r-=T,i-=T,n+=T,a+=T)}if(h&&e.includeEdges&&f&&(fbt(d,t,"mid-source"),fbt(d,t,"mid-target"),fbt(d,t,"source"),fbt(d,t,"target")),h)if("yes"===t.pstyle("ghost").value){var $=t.pstyle("ghost-offset-x").pfValue,F=t.pstyle("ghost-offset-y").pfValue;dbt(d,d.x1+$,d.y1+F,d.x2+$,d.y2+F)}var z=p.bodyBounds=p.bodyBounds||{};Rgt(z,d),Igt(z,y),Ngt(z,1),h&&(r=d.x1,n=d.x2,i=d.y1,a=d.y2,dbt(d,r-k,i-k,n+k,a+k));var U=p.overlayBounds=p.overlayBounds||{};Rgt(U,d),Igt(U,y),Ngt(U,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?Cgt(G.all):G.all=_gt(),h&&e.includeLabels&&(e.includeMainLabels&&mbt(d,t,null),f&&(e.includeSourceLabels&&mbt(d,t,"source"),e.includeTargetLabels&&mbt(d,t,"target")))}return d.x1=ubt(d.x1),d.y1=ubt(d.y1),d.x2=ubt(d.x2),d.y2=ubt(d.y2),d.w=ubt(d.x2-d.x1),d.h=ubt(d.y2-d.y1),d.w>0&&d.h>0&&x&&(Igt(d,y),Ngt(d,1)),d}),"boundingBoxImpl"),xbt=o((function(t){var e=0,r=o((function(t){return(t?1:0)<<e++}),"tf"),n=0;return n+=r(t.incudeNodes),n+=r(t.includeEdges),n+=r(t.includeLabels),n+=r(t.includeMainLabels),n+=r(t.includeSourceLabels),n+=r(t.includeTargetLabels),n+=r(t.includeOverlays),n+=r(t.includeOutlines)}),"getKey"),bbt=o((function(t){if(t.isEdge()){var e=t.source().position(),r=t.target().position(),n=o((function(t){return Math.round(t)}),"r");return upt([n(e.x),n(e.y),n(r.x),n(r.y)])}return 0}),"getBoundingBoxPosKey"),wbt=o((function(t,e){var r,n=t._private,i=t.isEdge(),a=(null==e?Tbt:xbt(e))===Tbt,s=bbt(t),l=n.bbCachePosKey===s,c=e.useCache&&l,h=o((function(t){return null==t._private.bbCache||t._private.styleDirty}),"isDirty");if(!c||h(t)||i&&(h(t.source())||h(t.target()))?(l||t.recalculateRenderedStyle(c),r=vbt(t,kbt),n.bbCache=r,n.bbCachePosKey=s):r=n.bbCache,!a){var u=t.isNode();r=_gt(),(e.includeNodes&&u||e.includeEdges&&!u)&&(e.includeOverlays?pbt(r,n.overlayBounds):pbt(r,n.bodyBounds)),e.includeLabels&&(e.includeMainLabels&&(!i||e.includeSourceLabels&&e.includeTargetLabels)?pbt(r,n.labelBounds.all):(e.includeMainLabels&&pbt(r,n.labelBounds.mainRot),e.includeSourceLabels&&pbt(r,n.labelBounds.sourceRot),e.includeTargetLabels&&pbt(r,n.labelBounds.targetRot))),r.w=r.x2-r.x1,r.h=r.y2-r.y1}return r}),"cachedBoundingBoxImpl"),kbt={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Tbt=xbt(kbt),_bt=Rpt(kbt);cbt.boundingBox=function(t){var e;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==t&&void 0!==t.useCache&&!0!==t.useCache){e=_gt();var r=_bt(t=t||kbt),n=this;if(n.cy().styleEnabled())for(var i=0;i<n.length;i++){var a=n[i],s=a._private,o=bbt(a),l=s.bbCachePosKey===o,c=r.useCache&&l&&!s.styleDirty;a.recalculateRenderedStyle(c)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var u=n[h];pbt(e,wbt(u,r))}}else t=void 0===t?kbt:_bt(t),e=wbt(this[0],t);return e.x1=ubt(e.x1),e.y1=ubt(e.y1),e.x2=ubt(e.x2),e.y2=ubt(e.y2),e.w=ubt(e.x2-e.x1),e.h=ubt(e.y2-e.y1),e},cbt.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},cbt.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),i=r.collection();if(n&&(i=e.filter((function(t){return t.isParent()})),e=e.not(i)),Iut(t)){var a=t;t=o((function(){return a}),"fn")}var s=o((function(e,r){return e._private.bbAtOldPos=t(e,r)}),"storeOldPos"),l=o((function(t){return t._private.bbAtOldPos}),"getOldPos");r.startBatch(),e.forEach(s).silentPositions(t),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var c=Egt(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),r.endBatch(),c},lbt.boundingbox=lbt.bb=lbt.boundingBox,lbt.renderedBoundingbox=lbt.renderedBoundingBox;var Ebt,Cbt,Sbt=cbt;Ebt=Cbt={};var Abt=o((function(t){t.uppercaseName=Zut(t.name),t.autoName="auto"+t.uppercaseName,t.labelName="label"+t.uppercaseName,t.outerName="outer"+t.uppercaseName,t.uppercaseOuterName=Zut(t.outerName),Ebt[t.name]=o((function(){var e=this[0],r=e._private,n=r.cy._private.styleEnabled;if(e){if(n){if(e.isParent())return e.updateCompoundBounds(),r[t.autoName]||0;var i=e.pstyle(t.name);return"label"===i.strValue?(e.recalculateRenderedStyle(),r.rstyle[t.labelName]||0):i.pfValue}return 1}}),"dimImpl"),Ebt["outer"+t.uppercaseName]=o((function(){var e=this[0],r=e._private.cy._private.styleEnabled;if(e)return r?e[t.name]()+e.pstyle("border-width").pfValue+2*e.padding():1}),"outerDimImpl"),Ebt["rendered"+t.uppercaseName]=o((function(){var e=this[0];if(e)return e[t.name]()*this.cy().zoom()}),"renderedDimImpl"),Ebt["rendered"+t.uppercaseOuterName]=o((function(){var e=this[0];if(e)return e[t.outerName]()*this.cy().zoom()}),"renderedOuterDimImpl")}),"defineDimFns");Abt({name:"width"}),Abt({name:"height"}),Cbt.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),void 0!==e.autoPadding?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Cbt.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Cbt.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Lbt=Cbt,Nbt=o((function(t,e){if(t.isEdge())return e(t)}),"ifEdge"),Ibt=o((function(t,e){if(t.isEdge()){var r=t.cy();return sgt(e(t),r.zoom(),r.pan())}}),"ifEdgeRenderedPosition"),Rbt=o((function(t,e){if(t.isEdge()){var r=t.cy(),n=r.pan(),i=r.zoom();return e(t).map((function(t){return sgt(t,i,n)}))}}),"ifEdgeRenderedPositions"),Mbt={controlPoints:{get:o((function(t){return t.renderer().getControlPoints(t)}),"controlPoints"),mult:!0},segmentPoints:{get:o((function(t){return t.renderer().getSegmentPoints(t)}),"segmentPoints"),mult:!0},sourceEndpoint:{get:o((function(t){return t.renderer().getSourceEndpoint(t)}),"sourceEndpoint")},targetEndpoint:{get:o((function(t){return t.renderer().getTargetEndpoint(t)}),"targetEndpoint")},midpoint:{get:o((function(t){return t.renderer().getEdgeMidpoint(t)}),"midpoint")}},Dbt=o((function(t){return"rendered"+t[0].toUpperCase()+t.substr(1)}),"renderedName"),Obt=Object.keys(Mbt).reduce((function(t,e){var r=Mbt[e],n=Dbt(e);return t[e]=function(){return Nbt(this,r.get)},r.mult?t[n]=function(){return Rbt(this,r.get)}:t[n]=function(){return Ibt(this,r.get)},t}),{}),Pbt=edt({},hbt,Sbt,Lbt,Obt),Bbt=o((function(t,e){this.recycle(t,e)}),"Event");function $bt(){return!1}function Fbt(){return!0}o($bt,"returnFalse"),o(Fbt,"returnTrue"),Bbt.prototype={instanceString:o((function(){return"event"}),"instanceString"),recycle:o((function(t,e){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=$bt,null!=t&&t.preventDefault?(this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?Fbt:$bt):null!=t&&t.type?e=t:this.type=t,null!=e&&(this.originalEvent=e.originalEvent,this.type=null!=e.type?e.type:this.type,this.cy=e.cy,this.target=e.target,this.position=e.position,this.renderedPosition=e.renderedPosition,this.namespace=e.namespace,this.layout=e.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var r=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*n+i.x,y:r.y*n+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()}),"recycle"),preventDefault:o((function(){this.isDefaultPrevented=Fbt;var t=this.originalEvent;t&&t.preventDefault&&t.preventDefault()}),"preventDefault"),stopPropagation:o((function(){this.isPropagationStopped=Fbt;var t=this.originalEvent;t&&t.stopPropagation&&t.stopPropagation()}),"stopPropagation"),stopImmediatePropagation:o((function(){this.isImmediatePropagationStopped=Fbt,this.stopPropagation()}),"stopImmediatePropagation"),isDefaultPrevented:$bt,isPropagationStopped:$bt,isImmediatePropagationStopped:$bt};var zbt=/^([^.]+)(\.(?:[^.]+))?$/,Ubt={qualifierCompare:o((function(t,e){return t===e}),"qualifierCompare"),eventMatches:o((function(){return!0}),"eventMatches"),addEventFields:o((function(){}),"addEventFields"),callbackContext:o((function(t){return t}),"callbackContext"),beforeEmit:o((function(){}),"beforeEmit"),afterEmit:o((function(){}),"afterEmit"),bubble:o((function(){return!1}),"bubble"),parent:o((function(){return null}),"parent"),context:null},Gbt=Object.keys(Ubt),qbt={};function jbt(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qbt,e=arguments.length>1?arguments[1]:void 0,r=0;r<Gbt.length;r++){var n=Gbt[r];this[n]=t[n]||Ubt[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}o(jbt,"Emitter");var Wbt=jbt.prototype,Ybt=o((function(t,e,r,n,i,a,s){Lut(n)&&(i=n,n=null),s&&(a=null==a?s:edt({},a,s));for(var o=Nut(r)?r:r.split(/\s+/),l=0;l<o.length;l++){var c=o[l];if(!Gut(c)){var h=c.match(zbt);if(h)if(!1===e(t,c,h[1],h[2]?h[2]:null,n,i,a))break}}}),"forEachEvent"),Hbt=o((function(t,e){return t.addEventFields(t.context,e),new Bbt(e.type,e)}),"makeEventObj"),Vbt=o((function(t,e,r){if(Uut(r))e(t,r);else if(Iut(r))e(t,Hbt(t,r));else for(var n=Nut(r)?r:r.split(/\s+/),i=0;i<n.length;i++){var a=n[i];if(!Gut(a)){var s=a.match(zbt);if(s){var o=s[1],l=s[2]?s[2]:null;e(t,Hbt(t,{type:o,namespace:l,target:t.context}))}}}}),"forEachEventObj");Wbt.on=Wbt.addListener=function(t,e,r,n,i){return Ybt(this,(function(t,e,r,n,i,a,s){Lut(a)&&t.listeners.push({event:e,callback:a,type:r,namespace:n,qualifier:i,conf:s})}),t,e,r,n,i),this},Wbt.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Wbt.removeListener=Wbt.off=function(t,e,r,n){var i=this;0!==this.emitting&&(this.listeners=Apt(this.listeners));for(var a=this.listeners,s=o((function(s){var o=a[s];Ybt(i,(function(e,r,n,i,l,c){if((o.type===n||"*"===t)&&(!i&&".*"!==o.namespace||o.namespace===i)&&(!l||e.qualifierCompare(o.qualifier,l))&&(!c||o.callback===c))return a.splice(s,1),!1}),t,e,r,n)}),"_loop"),l=a.length-1;l>=0;l--)s(l);return this},Wbt.removeAllListeners=function(){return this.removeListener("*")},Wbt.emit=Wbt.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Nut(e)||(e=[e]),Vbt(this,(function(t,a){null!=r&&(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:r}],i=n.length);for(var s=o((function(r){var i=n[r];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&t.eventMatches(t.context,i,a)){var s=[a];null!=e&&Opt(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;l<i;l++)s(l);t.bubble(t.context)&&!a.isPropagationStopped()&&t.parent(t.context).emit(a,e)}),t),this.emitting--,this};var Xbt={qualifierCompare:o((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:o((function(t,e,r){var n=e.qualifier;return null==n||t!==r.target&&But(r.target)&&n.matches(r.target)}),"eventMatches"),addEventFields:o((function(t,e){e.cy=t.cy(),e.target=t}),"addEventFields"),callbackContext:o((function(t,e,r){return null!=e.qualifier?r.target:t}),"callbackContext"),beforeEmit:o((function(t,e){e.conf&&e.conf.once&&e.conf.onceCollection.removeListener(e.event,e.qualifier,e.callback)}),"beforeEmit"),bubble:o((function(){return!0}),"bubble"),parent:o((function(t){return t.isChild()?t.parent():t.cy()}),"parent")},Kbt=o((function(t){return Aut(t)?new qxt(t):t}),"argSelector"),Zbt={createEmitter:o((function(){for(var t=0;t<this.length;t++){var e=this[t],r=e._private;r.emitter||(r.emitter=new jbt(Xbt,e))}return this}),"createEmitter"),emitter:o((function(){return this._private.emitter}),"emitter"),on:o((function(t,e,r){for(var n=Kbt(e),i=0;i<this.length;i++){this[i].emitter().on(t,n,r)}return this}),"on"),removeListener:o((function(t,e,r){for(var n=Kbt(e),i=0;i<this.length;i++){this[i].emitter().removeListener(t,n,r)}return this}),"removeListener"),removeAllListeners:o((function(){for(var t=0;t<this.length;t++){this[t].emitter().removeAllListeners()}return this}),"removeAllListeners"),one:o((function(t,e,r){for(var n=Kbt(e),i=0;i<this.length;i++){this[i].emitter().one(t,n,r)}return this}),"one"),once:o((function(t,e,r){for(var n=Kbt(e),i=0;i<this.length;i++){this[i].emitter().on(t,n,r,{once:!0,onceCollection:this})}}),"once"),emit:o((function(t,e){for(var r=0;r<this.length;r++){this[r].emitter().emit(t,e)}return this}),"emit"),emitAndNotify:o((function(t,e){if(0!==this.length)return this.cy().notify(t,this),this.emit(t,e),this}),"emitAndNotify")};Xvt.eventAliasesOn(Zbt);var Qbt={nodes:o((function(t){return this.filter((function(t){return t.isNode()})).filter(t)}),"nodes"),edges:o((function(t){return this.filter((function(t){return t.isEdge()})).filter(t)}),"edges"),byGroup:o((function(){for(var t=this.spawn(),e=this.spawn(),r=0;r<this.length;r++){var n=this[r];n.isNode()?t.push(n):e.push(n)}return{nodes:t,edges:e}}),"byGroup"),filter:o((function(t,e){if(void 0===t)return this;if(Aut(t)||Put(t))return new qxt(t).filter(this);if(Lut(t)){for(var r=this.spawn(),n=this,i=0;i<n.length;i++){var a=n[i];(e?t.apply(e,[a,i,n]):t(a,i,n))&&r.push(a)}return r}return this.spawn()}),"filter"),not:o((function(t){if(t){Aut(t)&&(t=this.filter(t));for(var e=this.spawn(),r=0;r<this.length;r++){var n=this[r];t.has(n)||e.push(n)}return e}return this}),"not"),absoluteComplement:o((function(){return this.cy().mutableElements().not(this)}),"absoluteComplement"),intersect:o((function(t){if(Aut(t)){var e=t;return this.filter(e)}for(var r=this.spawn(),n=t,i=this.length<t.length,a=i?this:n,s=i?n:this,o=0;o<a.length;o++){var l=a[o];s.has(l)&&r.push(l)}return r}),"intersect"),xor:o((function(t){var e=this._private.cy;Aut(t)&&(t=e.$(t));var r=this.spawn(),n=t,i=o((function(t,e){for(var n=0;n<t.length;n++){var i=t[n],a=i._private.data.id;e.hasElementWithId(a)||r.push(i)}}),"add");return i(this,n),i(n,this),r}),"xor"),diff:o((function(t){var e=this._private.cy;Aut(t)&&(t=e.$(t));var r=this.spawn(),n=this.spawn(),i=this.spawn(),a=t,s=o((function(t,e,r){for(var n=0;n<t.length;n++){var a=t[n],s=a._private.data.id;e.hasElementWithId(s)?i.merge(a):r.push(a)}}),"add");return s(this,a,r),s(a,this,n),{left:r,right:n,both:i}}),"diff"),add:o((function(t){var e=this._private.cy;if(!t)return this;if(Aut(t)){var r=t;t=e.mutableElements().filter(r)}for(var n=this.spawnSelf(),i=0;i<t.length;i++){var a=t[i];!this.has(a)&&n.push(a)}return n}),"add"),merge:o((function(t){var e=this._private,r=e.cy;if(!t)return this;if(t&&Aut(t)){var n=t;t=r.mutableElements().filter(n)}for(var i=e.map,a=0;a<t.length;a++){var s=t[a],o=s._private.data.id;if(!i.has(o)){var l=this.length++;this[l]=s,i.set(o,{ele:s,index:l})}}return this}),"merge"),unmergeAt:o((function(t){var e=this[t].id(),r=this._private.map;this[t]=void 0,r.delete(e);var n=t===this.length-1;if(this.length>1&&!n){var i=this.length-1,a=this[i],s=a._private.data.id;this[i]=void 0,this[t]=a,r.set(s,{ele:a,index:t})}return this.length--,this}),"unmergeAt"),unmergeOne:o((function(t){t=t[0];var e=this._private,r=t._private.data.id,n=e.map.get(r);if(!n)return this;var i=n.index;return this.unmergeAt(i),this}),"unmergeOne"),unmerge:o((function(t){var e=this._private.cy;if(!t)return this;if(t&&Aut(t)){var r=t;t=e.mutableElements().filter(r)}for(var n=0;n<t.length;n++)this.unmergeOne(t[n]);return this}),"unmerge"),unmergeBy:o((function(t){for(var e=this.length-1;e>=0;e--){t(this[e])&&this.unmergeAt(e)}return this}),"unmergeBy"),map:o((function(t,e){for(var r=[],n=this,i=0;i<n.length;i++){var a=n[i],s=e?t.apply(e,[a,i,n]):t(a,i,n);r.push(s)}return r}),"map"),reduce:o((function(t,e){for(var r=e,n=this,i=0;i<n.length;i++)r=t(r,n[i],i,n);return r}),"reduce"),max:o((function(t,e){for(var r,n=-1/0,i=this,a=0;a<i.length;a++){var s=i[a],o=e?t.apply(e,[s,a,i]):t(s,a,i);o>n&&(n=o,r=s)}return{value:n,ele:r}}),"max"),min:o((function(t,e){for(var r,n=1/0,i=this,a=0;a<i.length;a++){var s=i[a],o=e?t.apply(e,[s,a,i]):t(s,a,i);o<n&&(n=o,r=s)}return{value:n,ele:r}}),"min")},Jbt=Qbt;Jbt.u=Jbt["|"]=Jbt["+"]=Jbt.union=Jbt.or=Jbt.add,Jbt["\\"]=Jbt["!"]=Jbt["-"]=Jbt.difference=Jbt.relativeComplement=Jbt.subtract=Jbt.not,Jbt.n=Jbt["&"]=Jbt["."]=Jbt.and=Jbt.intersection=Jbt.intersect,Jbt["^"]=Jbt["(+)"]=Jbt["(-)"]=Jbt.symmetricDifference=Jbt.symdiff=Jbt.xor,Jbt.fnFilter=Jbt.filterFn=Jbt.stdFilter=Jbt.filter,Jbt.complement=Jbt.abscomp=Jbt.absoluteComplement;var twt={isNode:o((function(){return"nodes"===this.group()}),"isNode"),isEdge:o((function(){return"edges"===this.group()}),"isEdge"),isLoop:o((function(){return this.isEdge()&&this.source()[0]===this.target()[0]}),"isLoop"),isSimple:o((function(){return this.isEdge()&&this.source()[0]!==this.target()[0]}),"isSimple"),group:o((function(){var t=this[0];if(t)return t._private.group}),"group")},ewt=o((function(t,e){var r=t.cy().hasCompoundNodes();function n(t){var e=t.pstyle("z-compound-depth");return"auto"===e.value?r?t.zDepth():0:"bottom"===e.value?-1:"top"===e.value?vpt:0}o(n,"getDepth");var i=n(t)-n(e);if(0!==i)return i;function a(t){return"auto"===t.pstyle("z-index-compare").value&&t.isNode()?1:0}o(a,"getEleDepth");var s=a(t)-a(e);if(0!==s)return s;var l=t.pstyle("z-index").value-e.pstyle("z-index").value;return 0!==l?l:t.poolIndex()-e.poolIndex()}),"zIndexSort"),rwt={forEach:o((function(t,e){if(Lut(t))for(var r=this.length,n=0;n<r;n++){var i=this[n];if(!1===(e?t.apply(e,[i,n,this]):t(i,n,this)))break}return this}),"forEach"),toArray:o((function(){for(var t=[],e=0;e<this.length;e++)t.push(this[e]);return t}),"toArray"),slice:o((function(t,e){var r=[],n=this.length;null==e&&(e=n),null==t&&(t=0),t<0&&(t=n+t),e<0&&(e=n+e);for(var i=t;i>=0&&i<e&&i<n;i++)r.push(this[i]);return this.spawn(r)}),"slice"),size:o((function(){return this.length}),"size"),eq:o((function(t){return this[t]||this.spawn()}),"eq"),first:o((function(){return this[0]||this.spawn()}),"first"),last:o((function(){return this[this.length-1]||this.spawn()}),"last"),empty:o((function(){return 0===this.length}),"empty"),nonempty:o((function(){return!this.empty()}),"nonempty"),sort:o((function(t){if(!Lut(t))return this;var e=this.toArray().sort(t);return this.spawn(e)}),"sort"),sortByZIndex:o((function(){return this.sort(ewt)}),"sortByZIndex"),zDepth:o((function(){var t=this[0];if(t){var e=t._private;if("nodes"===e.group){var r=e.data.parent?t.parents().size():0;return t.isParent()?r:vpt-1}var n=e.source,i=e.target,a=n.zDepth(),s=i.zDepth();return Math.max(a,s,0)}}),"zDepth")};rwt.each=rwt.forEach;var nwt=o((function(){var t="undefined";("undefined"==typeof Symbol?"undefined":aut(Symbol))!=t&&aut(Symbol.iterator)!=t&&(rwt[Symbol.iterator]=function(){var t=this,e={value:void 0,done:!1},r=0,n=this.length;return cut({next:o((function(){return r<n?e.value=t[r++]:(e.value=void 0,e.done=!0),e}),"next")},Symbol.iterator,(function(){return this}))})}),"defineSymbolIterator");nwt();var iwt=Rpt({nodeDimensionsIncludeLabels:!1}),awt={layoutDimensions:o((function(t){var e;if(t=iwt(t),this.takesUpSpace())if(t.nodeDimensionsIncludeLabels){var r=this.boundingBox();e={w:r.w,h:r.h}}else e={w:this.outerWidth(),h:this.outerHeight()};else e={w:0,h:0};return 0!==e.w&&0!==e.h||(e.w=e.h=1),e}),"layoutDimensions"),layoutPositions:o((function(t,e,r){var n=this.nodes().filter((function(t){return!t.isParent()})),i=this.cy(),a=e.eles,s=o((function(t){return t.id()}),"getMemoizeKey"),l=Hut(r,s);t.emit({type:"layoutstart",layout:t}),t.animations=[];var c=o((function(t,e,r){var n=e.x1+e.w/2,i=e.y1+e.h/2;return{x:n+(r.x-n)*t,y:i+(r.y-i)*t}}),"calculateSpacing"),h=e.spacingFactor&&1!==e.spacingFactor,u=o((function(){if(!h)return null;for(var t=_gt(),e=0;e<n.length;e++){var r=n[e],i=l(r,e);Lgt(t,i.x,i.y)}return t}),"spacingBb")(),d=Hut((function(t,r){var n=l(t,r);if(h){var i=Math.abs(e.spacingFactor);n=c(i,u,n)}return null!=e.transform&&(n=e.transform(t,n)),n}),s);if(e.animate){for(var p=0;p<n.length;p++){var g=n[p],f=d(g,p);if(null==e.animateFilter||e.animateFilter(g,p)){var m=g.animation({position:f,duration:e.animationDuration,easing:e.animationEasing});t.animations.push(m)}else g.position(f)}if(e.fit){var y=i.animation({fit:{boundingBox:a.boundingBoxAt(d),padding:e.padding},duration:e.animationDuration,easing:e.animationEasing});t.animations.push(y)}else if(void 0!==e.zoom&&void 0!==e.pan){var v=i.animation({zoom:e.zoom,pan:e.pan,duration:e.animationDuration,easing:e.animationEasing});t.animations.push(v)}t.animations.forEach((function(t){return t.play()})),t.one("layoutready",e.ready),t.emit({type:"layoutready",layout:t}),Pmt.all(t.animations.map((function(t){return t.promise()}))).then((function(){t.one("layoutstop",e.stop),t.emit({type:"layoutstop",layout:t})}))}else n.positions(d),e.fit&&i.fit(e.eles,e.padding),null!=e.zoom&&i.zoom(e.zoom),e.pan&&i.pan(e.pan),t.one("layoutready",e.ready),t.emit({type:"layoutready",layout:t}),t.one("layoutstop",e.stop),t.emit({type:"layoutstop",layout:t});return this}),"layoutPositions"),layout:o((function(t){return this.cy().makeLayout(edt({},t,{eles:this}))}),"layout")};function swt(t,e,r){var n,i=r._private,a=i.styleCache=i.styleCache||[];return null!=(n=a[t])?n:n=a[t]=e(r)}function owt(t,e){return t=dpt(t),o((function(r){return swt(t,e,r)}),"cachedStyleFunction")}function lwt(t,e){t=dpt(t);var r=o((function(t){return e.call(t)}),"selfFn");return o((function(){var e=this[0];if(e)return swt(t,r,e)}),"cachedPrototypeStyleFunction")}awt.createLayout=awt.makeLayout=awt.layout,o(swt,"styleCache"),o(owt,"cacheStyleFunction"),o(lwt,"cachePrototypeStyleFunction");var cwt={recalculateRenderedStyle:o((function(t){var e=this.cy(),r=e.renderer(),n=e.styleEnabled();return r&&n&&r.recalculateRenderedStyle(this,t),this}),"recalculateRenderedStyle"),dirtyStyleCache:o((function(){var t,e=this.cy(),r=o((function(t){return t._private.styleCache=null}),"dirty");e.hasCompoundNodes()?((t=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(t.connectedEdges()),t.forEach(r)):this.forEach((function(t){r(t),t.connectedEdges().forEach(r)}));return this}),"dirtyStyleCache"),updateStyle:o((function(t){var e=this._private.cy;if(!e.styleEnabled())return this;if(e.batching())return e._private.batchStyleEles.merge(this),this;var r=this;t=!(!t&&void 0!==t),e.hasCompoundNodes()&&(r=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var n=r;return t?n.emitAndNotify("style"):n.emit("style"),r.forEach((function(t){return t._private.styleDirty=!0})),this}),"updateStyle"),cleanStyle:o((function(){var t=this.cy();if(t.styleEnabled())for(var e=0;e<this.length;e++){var r=this[e];r._private.styleDirty&&(r._private.styleDirty=!1,t.style().apply(r))}}),"cleanStyle"),parsedStyle:o((function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this[0],n=r.cy();if(n.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,n.style().apply(r));var i=r._private.style[t];return null!=i?i:e?n.style().getDefaultProperty(t):null}}),"parsedStyle"),numericStyle:o((function(t){var e=this[0];if(e.cy().styleEnabled()&&e){var r=e.pstyle(t);return void 0!==r.pfValue?r.pfValue:r.value}}),"numericStyle"),numericStyleUnits:o((function(t){var e=this[0];if(e.cy().styleEnabled())return e?e.pstyle(t).units:void 0}),"numericStyleUnits"),renderedStyle:o((function(t){var e=this.cy();if(!e.styleEnabled())return this;var r=this[0];return r?e.style().getRenderedStyle(r,t):void 0}),"renderedStyle"),style:o((function(t,e){var r=this.cy();if(!r.styleEnabled())return this;var n=r.style();if(Iut(t)){var i=t;n.applyBypass(this,i,false),this.emitAndNotify("style")}else if(Aut(t)){if(void 0===e){var a=this[0];return a?n.getStylePropertyValue(a,t):void 0}n.applyBypass(this,t,e,false),this.emitAndNotify("style")}else if(void 0===t){var s=this[0];return s?n.getRawStyle(s):void 0}return this}),"style"),removeStyle:o((function(t){var e=this.cy();if(!e.styleEnabled())return this;var r=e.style(),n=this;if(void 0===t)for(var i=0;i<n.length;i++){var a=n[i];r.removeAllBypasses(a,false)}else{t=t.split(/\s+/);for(var s=0;s<n.length;s++){var o=n[s];r.removeBypasses(o,t,false)}}return this.emitAndNotify("style"),this}),"removeStyle"),show:o((function(){return this.css("display","element"),this}),"show"),hide:o((function(){return this.css("display","none"),this}),"hide"),effectiveOpacity:o((function(){var t=this.cy();if(!t.styleEnabled())return 1;var e=t.hasCompoundNodes(),r=this[0];if(r){var n=r._private,i=r.pstyle("opacity").value;if(!e)return i;var a=n.data.parent?r.parents():null;if(a)for(var s=0;s<a.length;s++){i*=a[s].pstyle("opacity").value}return i}}),"effectiveOpacity"),transparent:o((function(){if(!this.cy().styleEnabled())return!1;var t=this[0],e=t.cy().hasCompoundNodes();return t?e?0===t.effectiveOpacity():0===t.pstyle("opacity").value:void 0}),"transparent"),backgrounding:o((function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}),"backgrounding")};function hwt(t,e){var r=t._private.data.parent?t.parents():null;if(r)for(var n=0;n<r.length;n++){if(!e(r[n]))return!1}return!0}function uwt(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var t=this.cy();if(!t.styleEnabled())return!0;var i=this[0],a=t.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!a||hwt(i,n);var o=s.source,l=s.target;return r(o)&&(!a||hwt(o,r))&&(o===l||r(l)&&(!a||hwt(l,r)))}}}o(hwt,"checkCompound"),o(uwt,"defineDerivedStateFunction");var dwt=owt("eleTakesUpSpace",(function(t){return"element"===t.pstyle("display").value&&0!==t.width()&&(!t.isNode()||0!==t.height())}));cwt.takesUpSpace=lwt("takesUpSpace",uwt({ok:dwt}));var pwt=owt("eleInteractive",(function(t){return"yes"===t.pstyle("events").value&&"visible"===t.pstyle("visibility").value&&dwt(t)})),gwt=owt("parentInteractive",(function(t){return"visible"===t.pstyle("visibility").value&&dwt(t)}));cwt.interactive=lwt("interactive",uwt({ok:pwt,parentOk:gwt,edgeOkViaNode:dwt})),cwt.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var fwt=owt("eleVisible",(function(t){return"visible"===t.pstyle("visibility").value&&0!==t.pstyle("opacity").pfValue&&dwt(t)})),mwt=dwt;cwt.visible=lwt("visible",uwt({ok:fwt,edgeOkViaNode:mwt})),cwt.hidden=function(){var t=this[0];if(t)return!t.visible()},cwt.isBundledBezier=lwt("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),cwt.bypass=cwt.css=cwt.style,cwt.renderedCss=cwt.renderedStyle,cwt.removeBypass=cwt.removeCss=cwt.removeStyle,cwt.pstyle=cwt.parsedStyle;var ywt={};function vwt(t){return function(){var e=arguments,r=[];if(2===e.length){var n=e[0],i=e[1];this.on(t.event,n,i)}else if(1===e.length&&Lut(e[0])){var a=e[0];this.on(t.event,a)}else if(0===e.length||1===e.length&&Nut(e[0])){for(var s=1===e.length?e[0]:null,o=0;o<this.length;o++){var l=this[o],c=!t.ableField||l._private[t.ableField],h=l._private[t.field]!=t.value;if(t.overrideAble){var u=t.overrideAble(l);if(void 0!==u&&(c=u,!u))return this}c&&(l._private[t.field]=t.value,h&&r.push(l))}var d=this.spawn(r);d.updateStyle(),d.emit(t.event),s&&d.emit(s)}return this}}function xwt(t){ywt[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(void 0!==r)return r}return e._private[t.field]}},ywt[t.on]=vwt({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),ywt[t.off]=vwt({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}o(vwt,"defineSwitchFunction"),o(xwt,"defineSwitchSet"),xwt({field:"locked",overrideField:o((function(t){return!!t.cy().autolock()||void 0}),"overrideField"),on:"lock",off:"unlock"}),xwt({field:"grabbable",overrideField:o((function(t){return!t.cy().autoungrabify()&&!t.pannable()&&void 0}),"overrideField"),on:"grabify",off:"ungrabify"}),xwt({field:"selected",ableField:"selectable",overrideAble:o((function(t){return!t.cy().autounselectify()&&void 0}),"overrideAble"),on:"select",off:"unselect"}),xwt({field:"selectable",overrideField:o((function(t){return!t.cy().autounselectify()&&void 0}),"overrideField"),on:"selectify",off:"unselectify"}),ywt.deselect=ywt.unselect,ywt.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},xwt({field:"active",on:"activate",off:"unactivate"}),xwt({field:"pannable",on:"panify",off:"unpanify"}),ywt.inactive=function(){var t=this[0];if(t)return!t._private.active};var bwt={},wwt=o((function(t){return o((function(e){for(var r=[],n=0;n<this.length;n++){var i=this[n];if(i.isNode()){for(var a=!1,s=i.connectedEdges(),o=0;o<s.length;o++){var l=s[o],c=l.source(),h=l.target();if(t.noIncomingEdges&&h===i&&c!==i||t.noOutgoingEdges&&c===i&&h!==i){a=!0;break}}a||r.push(i)}}return this.spawn(r,!0).filter(e)}),"dagExtremityImpl")}),"defineDagExtremity"),kwt=o((function(t){return function(e){for(var r=[],n=0;n<this.length;n++){var i=this[n];if(i.isNode())for(var a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),c=o.target();t.outgoing&&l===i?(r.push(o),r.push(c)):t.incoming&&c===i&&(r.push(o),r.push(l))}}return this.spawn(r,!0).filter(e)}}),"defineDagOneHop"),Twt=o((function(t){return function(e){for(var r=this,n=[],i={};;){var a=t.outgoing?r.outgoers():r.incomers();if(0===a.length)break;for(var s=!1,o=0;o<a.length;o++){var l=a[o],c=l.id();i[c]||(i[c]=!0,n.push(l),s=!0)}if(!s)break;r=a}return this.spawn(n,!0).filter(e)}}),"defineDagAllHops");function _wt(t){return o((function(e){for(var r=[],n=0;n<this.length;n++){var i=this[n]._private[t.attr];i&&r.push(i)}return this.spawn(r,!0).filter(e)}),"sourceImpl")}function Ewt(t){return o((function(e){var r=[],n=this._private.cy,i=t||{};Aut(e)&&(e=n.$(e));for(var a=0;a<e.length;a++)for(var s=e[a]._private.edges,o=0;o<s.length;o++){var l=s[o],c=l._private.data,h=this.hasElementWithId(c.source)&&e.hasElementWithId(c.target),u=e.hasElementWithId(c.source)&&this.hasElementWithId(c.target);if(h||u){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!h)continue;if(i.thisIsTgt&&!u)continue}r.push(l)}}return this.spawn(r,!0)}),"edgesWithImpl")}function Cwt(t){return t=edt({},{codirected:!1},t),o((function(e){for(var r=[],n=this.edges(),i=t,a=0;a<n.length;a++)for(var s=n[a]._private,o=s.source,l=o._private.data.id,c=s.data.target,h=o._private.edges,u=0;u<h.length;u++){var d=h[u],p=d._private.data,g=p.target,f=p.source,m=g===c&&f===l,y=l===g&&c===f;(i.codirected&&m||!i.codirected&&(m||y))&&r.push(d)}return this.spawn(r,!0).filter(e)}),"parallelEdgesImpl")}bwt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},edt(bwt,{roots:wwt({noIncomingEdges:!0}),leaves:wwt({noOutgoingEdges:!0}),outgoers:Vxt(kwt({outgoing:!0}),"outgoers"),successors:Twt({outgoing:!0}),incomers:Vxt(kwt({incoming:!0}),"incomers"),predecessors:Twt({incoming:!0})}),edt(bwt,{neighborhood:Vxt((function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var i=r[n],a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),c=o.target(),h=i===l?c:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)}),"neighborhood"),closedNeighborhood:o((function(t){return this.neighborhood().add(this).filter(t)}),"closedNeighborhood"),openNeighborhood:o((function(t){return this.neighborhood(t)}),"openNeighborhood")}),bwt.neighbourhood=bwt.neighborhood,bwt.closedNeighbourhood=bwt.closedNeighborhood,bwt.openNeighbourhood=bwt.openNeighborhood,edt(bwt,{source:Vxt(o((function(t){var e,r=this[0];return r&&(e=r._private.source||r.cy().collection()),e&&t?e.filter(t):e}),"sourceImpl"),"source"),target:Vxt(o((function(t){var e,r=this[0];return r&&(e=r._private.target||r.cy().collection()),e&&t?e.filter(t):e}),"targetImpl"),"target"),sources:_wt({attr:"source"}),targets:_wt({attr:"target"})}),o(_wt,"defineSourceFunction"),edt(bwt,{edgesWith:Vxt(Ewt(),"edgesWith"),edgesTo:Vxt(Ewt({thisIsSrc:!0}),"edgesTo")}),o(Ewt,"defineEdgesWithFunction"),edt(bwt,{connectedEdges:Vxt((function(t){for(var e=[],r=0;r<this.length;r++){var n=this[r];if(n.isNode())for(var i=n._private.edges,a=0;a<i.length;a++){var s=i[a];e.push(s)}}return this.spawn(e,!0).filter(t)}),"connectedEdges"),connectedNodes:Vxt((function(t){for(var e=[],r=0;r<this.length;r++){var n=this[r];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)}),"connectedNodes"),parallelEdges:Vxt(Cwt(),"parallelEdges"),codirectedEdges:Vxt(Cwt({codirected:!0}),"codirectedEdges")}),o(Cwt,"defineParallelEdgesFunction"),edt(bwt,{components:o((function(t){var e=this,r=e.cy(),n=r.collection(),i=null==t?e.nodes():t.nodes(),a=[];null!=t&&i.empty()&&(i=t.sources());var s=o((function(t,e){n.merge(t),i.unmerge(t),e.merge(t)}),"visitInComponent");if(i.empty())return e.spawn();var l=o((function(){var t=r.collection();a.push(t);var n=i[0];s(n,t),e.bfs({directed:!1,roots:n,visit:o((function(e){return s(e,t)}),"visit")}),t.forEach((function(r){r.connectedEdges().forEach((function(r){e.has(r)&&t.has(r.source())&&t.has(r.target())&&t.merge(r)}))}))}),"_loop");do{l()}while(i.length>0);return a}),"components"),component:o((function(){var t=this[0];return t.cy().mutableElements().components(t)[0]}),"component")}),bwt.componentsOf=bwt.components;var Swt=o((function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t){var i=new $pt,a=!1;if(e){if(e.length>0&&Iut(e[0])&&!But(e[0])){a=!0;for(var s=[],l=new zpt,c=0,h=e.length;c<h;c++){var u=e[c];null==u.data&&(u.data={});var d=u.data;if(null==d.id)d.id=Lpt();else if(t.hasElementWithId(d.id)||l.has(d.id))continue;var p=new Upt(t,u,!1);s.push(p),l.add(d.id)}e=s}}else e=[];this.length=0;for(var g=0,f=e.length;g<f;g++){var m=e[g][0];if(null!=m){var y=m._private.data.id;r&&i.has(y)||(r&&i.set(y,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:t,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(t){this.lazyMap=t},rebuildMap:o((function(){for(var t=this.lazyMap=new $pt,e=this.eles,r=0;r<e.length;r++){var n=e[r];t.set(n.id(),{index:r,ele:n})}}),"rebuildMap")},r&&(this._private.map=i),a&&!n&&this.restore()}else Tpt("A collection must have a reference to the core")}),"Collection"),Awt=Upt.prototype=Swt.prototype=Object.create(Array.prototype);Awt.instanceString=function(){return"collection"},Awt.spawn=function(t,e){return new Swt(this.cy(),t,e)},Awt.spawnSelf=function(){return this.spawn(this)},Awt.cy=function(){return this._private.cy},Awt.renderer=function(){return this._private.cy.renderer()},Awt.element=function(){return this[0]},Awt.collection=function(){return $ut(this)?this:new Swt(this._private.cy,[this])},Awt.unique=function(){return new Swt(this._private.cy,this,!0)},Awt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Awt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Swt(e)},Awt.$id=Awt.getElementById,Awt.poolIndex=function(){var t=this._private.cy._private.elements,e=this[0]._private.data.id;return t._private.map.get(e).index},Awt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Awt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Awt.json=function(t){var e=this.element(),r=this.cy();if(null==e&&t)return this;if(null!=e){var n=e._private;if(Iut(t)){if(r.startBatch(),t.data){e.data(t.data);var i=n.data;if(e.isEdge()){var a=!1,s={},l=t.data.source,c=t.data.target;null!=l&&l!=i.source&&(s.source=""+l,a=!0),null!=c&&c!=i.target&&(s.target=""+c,a=!0),a&&(e=e.move(s))}else{var h="parent"in t.data,u=t.data.parent;!h||null==u&&null==i.parent||u==i.parent||(void 0===u&&(u=null),null!=u&&(u=""+u),e=e.move({parent:u}))}}t.position&&e.position(t.position);var d=o((function(r,i,a){var s=t[r];null!=s&&s!==n[r]&&(s?e[i]():e[a]())}),"checkSwitch");return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=t.classes&&e.classes(t.classes),r.endBatch(),this}if(void 0===t){var p={data:Spt(n.data),position:Spt(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};p.classes="";var g=0;return n.classes.forEach((function(t){return p.classes+=0==g++?t:" "+t})),p}}},Awt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e].json();t.push(r)}return t},Awt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r].json(),i=new Upt(t,n,!1);e.push(i)}return new Swt(t,e)},Awt.copy=Awt.clone,Awt.restore=function(){for(var t,e,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),s=a._private,l=[],c=[],h=0,u=i.length;h<u;h++){var d=i[h];n&&!d.removed()||(d.isNode()?l.push(d):c.push(d))}t=l.concat(c);var p=o((function(){t.splice(e,1),e--}),"removeFromElements");for(e=0;e<t.length;e++){var g=t[e],f=g._private,m=f.data;if(g.clearTraversalCache(),n||f.removed)if(void 0===m.id)m.id=Lpt();else if(Mut(m.id))m.id=""+m.id;else{if(Gut(m.id)||!Aut(m.id)){Tpt("Can not create element with invalid string ID `"+m.id+"`"),p();continue}if(a.hasElementWithId(m.id)){Tpt("Can not create second element with ID `"+m.id+"`"),p();continue}}else;var y=m.id;if(g.isNode()){var v=f.position;null==v.x&&(v.x=0),null==v.y&&(v.y=0)}if(g.isEdge()){for(var x=g,b=["source","target"],w=b.length,k=!1,T=0;T<w;T++){var _=b[T],E=m[_];Mut(E)&&(E=m[_]=""+m[_]),null==E||""===E?(Tpt("Can not create edge `"+y+"` with unspecified "+_),k=!0):a.hasElementWithId(E)||(Tpt("Can not create edge `"+y+"` with nonexistant "+_+" `"+E+"`"),k=!0)}if(k){p();continue}var C=a.getElementById(m.source),S=a.getElementById(m.target);C.same(S)?C._private.edges.push(x):(C._private.edges.push(x),S._private.edges.push(x)),x._private.source=C,x._private.target=S}f.map=new $pt,f.map.set(y,{ele:g,index:0}),f.removed=!1,n&&a.addToPool(g)}for(var A=0;A<l.length;A++){var L=l[A],N=L._private.data;Mut(N.parent)&&(N.parent=""+N.parent);var I=N.parent,R=null!=I;if(R||L._private.parent){var M=L._private.parent?a.collection().merge(L._private.parent):a.getElementById(I);if(M.empty())N.parent=void 0;else if(M[0].removed())Ept("Node added with missing parent, reference to parent removed"),N.parent=void 0,L._private.parent=null;else{for(var D=!1,O=M;!O.empty();){if(L.same(O)){D=!0,N.parent=void 0;break}O=O.parent()}D||(M[0]._private.children.push(L),L._private.parent=M[0],s.hasCompoundNodes=!0)}}}if(t.length>0){for(var P=t.length===i.length?i:new Swt(a,t),B=0;B<P.length;B++){var $=P[B];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}(s.hasCompoundNodes?a.collection().merge(P).merge(P.connectedNodes()).merge(P.parent()):P).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?P.emitAndNotify("add"):n&&P.emit("add")}return i},Awt.removed=function(){var t=this[0];return t&&t._private.removed},Awt.inside=function(){var t=this[0];return t&&!t._private.removed},Awt.remove=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this,n=[],i={},a=r._private.cy;function s(t){for(var e=t._private.edges,r=0;r<e.length;r++)c(e[r])}function l(t){for(var e=t._private.children,r=0;r<e.length;r++)c(e[r])}function c(t){var r=i[t.id()];e&&t.removed()||r||(i[t.id()]=!0,t.isNode()?(n.push(t),s(t),l(t)):n.unshift(t))}o(s,"addConnectedEdges"),o(l,"addChildren"),o(c,"add");for(var h=0,u=r.length;h<u;h++){var d=r[h];c(d)}function p(t,e){var r=t._private.edges;Mpt(r,e),t.clearTraversalCache()}function g(t){t.clearTraversalCache()}o(p,"removeEdgeRef"),o(g,"removeParallelRef");var f=[];function m(t,e){e=e[0];var r=(t=t[0])._private.children,n=t.id();Mpt(r,e),e._private.parent=null,f.ids[n]||(f.ids[n]=!0,f.push(t))}f.ids={},o(m,"removeChildRef"),r.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var y=0;y<n.length;y++){var v=n[y];if(v.isEdge()){var x=v.source()[0],b=v.target()[0];p(x,v),p(b,v);for(var w=v.parallelEdges(),k=0;k<w.length;k++){var T=w[k];g(T),T.isBundledBezier()&&T.dirtyBoundingBoxCache()}}else{var _=v.parent();0!==_.length&&m(_,v)}e&&(v._private.removed=!0)}var E=a._private.elements;a._private.hasCompoundNodes=!1;for(var C=0;C<E.length;C++){var S=E[C];if(S.isParent()){a._private.hasCompoundNodes=!0;break}}var A=new Swt(this.cy(),n);A.size()>0&&(t?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var L=0;L<f.length;L++){var N=f[L];e&&N.removed()||N.updateStyle()}return A},Awt.move=function(t){var e=this._private.cy,r=this,n=!1,i=!1,a=o((function(t){return null==t?t:""+t}),"toString");if(void 0!==t.source||void 0!==t.target){var s=a(t.source),l=a(t.target),c=null!=s&&e.hasElementWithId(s),h=null!=l&&e.hasElementWithId(l);(c||h)&&(e.batch((function(){r.remove(n,i),r.emitAndNotify("moveout");for(var t=0;t<r.length;t++){var e=r[t],a=e._private.data;e.isEdge()&&(c&&(a.source=s),h&&(a.target=l))}r.restore(n,i)})),r.emitAndNotify("move"))}else if(void 0!==t.parent){var u=a(t.parent);if(null===u||e.hasElementWithId(u)){var d=null===u?void 0:u;e.batch((function(){var t=r.remove(n,i);t.emitAndNotify("moveout");for(var e=0;e<r.length;e++){var a=r[e],s=a._private.data;a.isNode()&&(s.parent=d)}t.restore(n,i)})),r.emitAndNotify("move")}}return this},[Lmt,Kvt,Zvt,Wxt,Xxt,rbt,nbt,Pbt,Zbt,Qbt,twt,rwt,awt,cwt,ywt,bwt].forEach((function(t){edt(Awt,t)}));var Lwt={add:o((function(t){var e,r=this;if(Put(t)){var n=t;if(n._private.cy===r)e=n.restore();else{for(var i=[],a=0;a<n.length;a++){var s=n[a];i.push(s.json())}e=new Swt(r,i)}}else if(Nut(t)){e=new Swt(r,t)}else if(Iut(t)&&(Nut(t.nodes)||Nut(t.edges))){for(var o=t,l=[],c=["nodes","edges"],h=0,u=c.length;h<u;h++){var d=c[h],p=o[d];if(Nut(p))for(var g=0,f=p.length;g<f;g++){var m=edt({group:d},p[g]);l.push(m)}}e=new Swt(r,l)}else{e=new Upt(r,t).collection()}return e}),"add"),remove:o((function(t){if(Put(t));else if(Aut(t)){var e=t;t=this.$(e)}return t.remove()}),"remove")};function Nwt(t,e,r,n){var i=4,a=.001,s=1e-7,l=10,c=11,h=1/(c-1),u="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var p=u?new Float32Array(c):new Array(c);function g(t,e){return 1-3*e+3*t}function f(t,e){return 3*e-6*t}function m(t){return 3*t}function y(t,e,r){return((g(e,r)*t+f(e,r))*t+m(e))*t}function v(t,e,r){return 3*g(e,r)*t*t+2*f(e,r)*t+m(e)}function x(e,n){for(var a=0;a<i;++a){var s=v(n,t,r);if(0===s)return n;n-=(y(n,t,r)-e)/s}return n}function b(){for(var e=0;e<c;++e)p[e]=y(e*h,t,r)}function w(e,n,i){var a,o,c=0;do{(a=y(o=n+(i-n)/2,t,r)-e)>0?i=o:n=o}while(Math.abs(a)>s&&++c<l);return o}function k(e){for(var n=0,i=1,s=c-1;i!==s&&p[i]<=e;++i)n+=h;--i;var o=n+(e-p[i])/(p[i+1]-p[i])*h,l=v(o,t,r);return l>=a?x(e,o):0===l?o:w(e,n,n+h)}o(g,"A"),o(f,"B"),o(m,"C"),o(y,"calcBezier"),o(v,"getSlope"),o(x,"newtonRaphsonIterate"),o(b,"calcSampleValues"),o(w,"binarySubdivide"),o(k,"getTForX");var T=!1;function _(){T=!0,t===e&&r===n||b()}o(_,"precompute");var E=o((function(i){return T||_(),t===e&&r===n?i:0===i?0:1===i?1:y(k(i),e,n)}),"f");E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var C="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return C},E}o(Nwt,"generateCubicBezier");var Iwt=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,r,n){var i={x:e.x+n.dx*r,v:e.v+n.dv*r,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function r(r,n){var i={dx:r.v,dv:t(r)},a=e(r,.5*n,i),s=e(r,.5*n,a),o=e(r,n,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 r.x=r.x+l*n,r.v=r.v+c*n,r}return o(t,"springAccelerationForState"),o(e,"springEvaluateStateWithDerivative"),o(r,"springIntegrateState"),o((function t(e,n,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,n=parseFloat(n)||20,i=i||null,l.tension=e,l.friction=n,s=(a=null!==i)?(h=t(e,n))/i*.016:.016;o=r(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")}(),Rwt=o((function(t,e,r,n){var i=Nwt(t,e,r,n);return function(t,e,r){return t+(e-t)*i(r)}}),"cubicBezier"),Mwt={linear:o((function(t,e,r){return t+(e-t)*r}),"linear"),ease:Rwt(.25,.1,.25,1),"ease-in":Rwt(.42,0,1,1),"ease-out":Rwt(0,0,.58,1),"ease-in-out":Rwt(.42,0,.58,1),"ease-in-sine":Rwt(.47,0,.745,.715),"ease-out-sine":Rwt(.39,.575,.565,1),"ease-in-out-sine":Rwt(.445,.05,.55,.95),"ease-in-quad":Rwt(.55,.085,.68,.53),"ease-out-quad":Rwt(.25,.46,.45,.94),"ease-in-out-quad":Rwt(.455,.03,.515,.955),"ease-in-cubic":Rwt(.55,.055,.675,.19),"ease-out-cubic":Rwt(.215,.61,.355,1),"ease-in-out-cubic":Rwt(.645,.045,.355,1),"ease-in-quart":Rwt(.895,.03,.685,.22),"ease-out-quart":Rwt(.165,.84,.44,1),"ease-in-out-quart":Rwt(.77,0,.175,1),"ease-in-quint":Rwt(.755,.05,.855,.06),"ease-out-quint":Rwt(.23,1,.32,1),"ease-in-out-quint":Rwt(.86,0,.07,1),"ease-in-expo":Rwt(.95,.05,.795,.035),"ease-out-expo":Rwt(.19,1,.22,1),"ease-in-out-expo":Rwt(1,0,0,1),"ease-in-circ":Rwt(.6,.04,.98,.335),"ease-out-circ":Rwt(.075,.82,.165,1),"ease-in-out-circ":Rwt(.785,.135,.15,.86),spring:o((function(t,e,r){if(0===r)return Mwt.linear;var n=Iwt(t,e,r);return function(t,e,r){return t+(e-t)*n(r)}}),"spring"),"cubic-bezier":Rwt};function Dwt(t,e,r,n,i){if(1===n)return r;if(e===r)return r;var a=i(e,r,n);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 Owt(t,e){return null!=t.pfValue||null!=t.value?null==t.pfValue||null!=e&&"%"===e.type.units?t.value:t.pfValue:t}function Pwt(t,e,r,n,i){var a=null!=i?i.type:null;r<0?r=0:r>1&&(r=1);var s=Owt(t,i),o=Owt(e,i);if(Mut(s)&&Mut(o))return Dwt(a,s,o,r,n);if(Nut(s)&&Nut(o)){for(var l=[],c=0;c<o.length;c++){var h=s[c],u=o[c];if(null!=h&&null!=u){var d=Dwt(a,h,u,r,n);l.push(d)}else l.push(u)}return l}}function Bwt(t,e,r,n){var i=!n,a=t._private,s=e._private,o=s.easing,l=s.startTime,c=(n?t:t.cy()).style();if(!s.easingImpl)if(null==o)s.easingImpl=Mwt.linear;else{var h,u,d;if(Aut(o))h=c.parse("transition-timing-function",o).value;else h=o;Aut(h)?(u=h,d=[]):(u=h[1],d=h.slice(2).map((function(t){return+t}))),d.length>0?("spring"===u&&d.push(s.duration),s.easingImpl=Mwt[u].apply(null,d)):s.easingImpl=Mwt[u]}var p,g=s.easingImpl;if(p=0===s.duration?1:(r-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={};$wt(f.x,m.x)&&(y.x=Pwt(f.x,m.x,p,g)),$wt(f.y,m.y)&&(y.y=Pwt(f.y,m.y,p,g)),t.position(y)}var v=s.startPan,x=s.pan,b=a.pan,w=null!=x&&n;w&&($wt(v.x,x.x)&&(b.x=Pwt(v.x,x.x,p,g)),$wt(v.y,x.y)&&(b.y=Pwt(v.y,x.y,p,g)),t.emit("pan"));var k=s.startZoom,T=s.zoom,_=null!=T&&n;_&&($wt(k,T)&&(a.zoom=Tgt(a.minZoom,Pwt(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<E.length;C++){var S=E[C],A=S.name,L=S,N=s.startStyle[A],I=Pwt(N,L,p,g,c.properties[N.name]);c.overrideBypass(t,A,I)}t.emit("style")}}return s.progress=p,p}function $wt(t,e){return null!=t&&null!=e&&(!(!Mut(t)||!Mut(e))||!(!t||!e))}function Fwt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function zwt(t,e){var r=e._private.aniEles,n=[];function i(e,r){var i=e._private,a=i.animation.current,s=i.animation.queue,l=!1;if(0===a.length){var c=s.shift();c&&a.push(c)}for(var h=o((function(t){for(var e=t.length-1;e>=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||Fwt(0,d,t),Bwt(e,d,t,r),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 r||0!==a.length||0!==s.length||n.push(e),l}o(i,"stepOne");for(var a=!1,s=0;s<r.length;s++){var l=i(r[s]);a=a||l}var c=i(e,!0);(a||c)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}o(Dwt,"getEasedValue"),o(Owt,"getValue"),o(Pwt,"ease"),o(Bwt,"step$1"),o($wt,"valid"),o(Fwt,"startAnimation"),o(zwt,"stepAll");var Uwt={animate:Xvt.animate(),animation:Xvt.animation(),animated:Xvt.animated(),clearQueue:Xvt.clearQueue(),delay:Xvt.delay(),delayAnimation:Xvt.delayAnimation(),stop:Xvt.stop(),addToAnimationPool:o((function(t){this.styleEnabled()&&this._private.aniEles.merge(t)}),"addToAnimationPool"),stopAnimationLoop:o((function(){this._private.animationsRunning=!1}),"stopAnimationLoop"),startAnimationLoop:o((function(){var t=this;if(t._private.animationsRunning=!0,t.styleEnabled()){o(r,"headlessStep");var e=t.renderer();e&&e.beforeRender?e.beforeRender(o((function(e,r){zwt(r,t)}),"rendererAnimationStep"),e.beforeRenderPriorities.animations):r()}function r(){t._private.animationsRunning&&tpt(o((function(e){zwt(e,t),r()}),"animationStep"))}}),"startAnimationLoop")},Gwt={qualifierCompare:o((function(t,e){return null==t||null==e?null==t&&null==e:t.sameText(e)}),"qualifierCompare"),eventMatches:o((function(t,e,r){var n=e.qualifier;return null==n||t!==r.target&&But(r.target)&&n.matches(r.target)}),"eventMatches"),addEventFields:o((function(t,e){e.cy=t,e.target=t}),"addEventFields"),callbackContext:o((function(t,e,r){return null!=e.qualifier?r.target:t}),"callbackContext")},qwt=o((function(t){return Aut(t)?new qxt(t):t}),"argSelector"),jwt={createEmitter:o((function(){var t=this._private;return t.emitter||(t.emitter=new jbt(Gwt,this)),this}),"createEmitter"),emitter:o((function(){return this._private.emitter}),"emitter"),on:o((function(t,e,r){return this.emitter().on(t,qwt(e),r),this}),"on"),removeListener:o((function(t,e,r){return this.emitter().removeListener(t,qwt(e),r),this}),"removeListener"),removeAllListeners:o((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),one:o((function(t,e,r){return this.emitter().one(t,qwt(e),r),this}),"one"),once:o((function(t,e,r){return this.emitter().one(t,qwt(e),r),this}),"once"),emit:o((function(t,e){return this.emitter().emit(t,e),this}),"emit"),emitAndNotify:o((function(t,e){return this.emit(t),this.notify(t,e),this}),"emitAndNotify")};Xvt.eventAliasesOn(jwt);var Wwt={png:o((function(t){return t=t||{},this._private.renderer.png(t)}),"png"),jpg:o((function(t){var e=this._private.renderer;return(t=t||{}).bg=t.bg||"#fff",e.jpg(t)}),"jpg")};Wwt.jpeg=Wwt.jpg;var Ywt={layout:o((function(t){var e=this;if(null!=t)if(null!=t.name){var r,n=t.name,i=e.extension("layout",n);if(null!=i)return r=Aut(t.eles)?e.$(t.eles):null!=t.eles?t.eles:e.$(),new i(edt({},t,{cy:e,eles:r}));Tpt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Tpt("A `name` must be specified to make a layout");else Tpt("Layout options must be specified to make a layout")}),"layout")};Ywt.createLayout=Ywt.makeLayout=Ywt.layout;var Hwt={notify:o((function(t,e){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var n=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();null!=e&&n.merge(e)}else if(r.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(t,e)}}),"notify"),notifications:o((function(t){var e=this._private;return void 0===t?e.notificationsEnabled:(e.notificationsEnabled=!!t,this)}),"notifications"),noNotifications:o((function(t){this.notifications(!1),t(),this.notifications(!0)}),"noNotifications"),batching:o((function(){return this._private.batchCount>0}),"batching"),startBatch:o((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:o((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(r){var n=t.batchNotifications[r];n.empty()?e.notify(r):e.notify(r,n)}))}return this}),"endBatch"),batch:o((function(t){return this.startBatch(),t(),this.endBatch(),this}),"batch"),batchData:o((function(t){var e=this;return this.batch((function(){for(var r=Object.keys(t),n=0;n<r.length;n++){var i=r[n],a=t[i];e.getElementById(i).data(a)}}))}),"batchData")},Vwt=Rpt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:12,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Xwt={renderTo:o((function(t,e,r,n){return this._private.renderer.renderTo(t,e,r,n),this}),"renderTo"),renderer:o((function(){return this._private.renderer}),"renderer"),forceRender:o((function(){return this.notify("draw"),this}),"forceRender"),resize:o((function(){return this.invalidateSize(),this.emitAndNotify("resize"),this}),"resize"),initRenderer:o((function(t){var e=this,r=e.extension("renderer",t.name);if(null!=r){void 0!==t.wheelSensitivity&&Ept("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Vwt(t);n.cy=e,e._private.renderer=new r(n),this.notify("init")}else Tpt("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))}),"initRenderer"),destroyRenderer:o((function(){var t=this;t.notify("destroy");var e=t.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)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:o((function(t){return this.on("render",t)}),"onRender"),offRender:o((function(t){return this.off("render",t)}),"offRender")};Xwt.invalidateDimensions=Xwt.resize;var Kwt={collection:o((function(t,e){return Aut(t)?this.$(t):Put(t)?t.collection():Nut(t)?(e||(e={}),new Swt(this,t,e.unique,e.removed)):new Swt(this)}),"collection"),nodes:o((function(t){var e=this.$((function(t){return t.isNode()}));return t?e.filter(t):e}),"nodes"),edges:o((function(t){var e=this.$((function(t){return t.isEdge()}));return t?e.filter(t):e}),"edges"),$:o((function(t){var e=this._private.elements;return t?e.filter(t):e.spawnSelf()}),"$"),mutableElements:o((function(){return this._private.elements}),"mutableElements")};Kwt.elements=Kwt.filter=Kwt.$;var Zwt={},Qwt="t";Zwt.apply=function(t){for(var e=this,r=e._private.cy.collection(),n=0;n<t.length;n++){var i=t[n],a=e.getContextMeta(i);if(!a.empty){var s=e.getContextStyle(a),o=e.applyContextStyle(a,s,i);i._private.appliedInitStyle?e.updateTransitions(i,o.diffProps):i._private.appliedInitStyle=!0,e.updateStyleHints(i)&&r.push(i)}}return r},Zwt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},i=t+"-"+e,a=n[i];if(a)return a;for(var s=[],o={},l=0;l<r.length;l++){var c=r[l],h=t[l]===Qwt,u=e[l]===Qwt,d=h!==u,p=c.mappedProperties.length>0;if(d||u&&p){var g=void 0;d&&p||d?g=c.properties:p&&(g=c.mappedProperties);for(var f=0;f<g.length;f++){for(var m=g[f],y=m.name,v=!1,x=l+1;x<r.length;x++){var b=r[x];if(e[x]===Qwt&&(v=null!=b.properties[m.name]))break}o[y]||v||(o[y]=!0,s.push(y))}}}return n[i]=s,s},Zwt.getContextMeta=function(t){for(var e,r=this,n="",i=t._private.styleCxtKey||"",a=0;a<r.length;a++){var s=r[a];n+=s.selector&&s.selector.matches(t)?Qwt:"f"}return e=r.getPropertiesDiff(i,n),t._private.styleCxtKey=n,{key:n,diffPropNames:e,empty:0===e.length}},Zwt.getContextStyle=function(t){var e=t.key,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var n={_private:{key:e}},i=0;i<this.length;i++){var a=this[i];if(e[i]===Qwt)for(var s=0;s<a.properties.length;s++){var o=a.properties[s];n[o.name]=o}}return r[e]=n,n},Zwt.applyContextStyle=function(t,e,r){for(var n=t.diffPropNames,i={},a=this.types,s=0;s<n.length;s++){var o=n[s],l=e[o],c=r.pstyle(o);if(!l){if(!c)continue;l=c.bypass?{name:o,deleteBypassed:!0}:{name:o,delete:!0}}if(c!==l){if(l.mapped===a.fn&&null!=c&&null!=c.mapping&&c.mapping.value===l.value){var h=c.mapping;if((h.fnValue=l.value(r))===h.prevFnValue)continue}var u=i[o]={prev:c};this.applyParsedProperty(r,l),u.next=r.pstyle(o),u.next&&u.next.bypass&&(u.next=u.next.bypassed)}}return{diffProps:i}},Zwt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,i=r.propertyGroupKeys,a=o((function(t,e,n){return r.getPropertiesHash(t,e,n)}),"propHash"),s=e.styleKey;if(t.removed())return!1;var l="nodes"===e.group,c=t._private.style;n=Object.keys(c);for(var h=0;h<i.length;h++){var u=i[h];e.styleKeys[u]=[rpt,ipt]}for(var d=o((function(t,r){return e.styleKeys[r][0]=spt(t,e.styleKeys[r][0])}),"updateGrKey1"),p=o((function(t,r){return e.styleKeys[r][1]=opt(t,e.styleKeys[r][1])}),"updateGrKey2"),g=o((function(t,e){d(t,e),p(t,e)}),"updateGrKey"),f=o((function(t,e){for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);d(n,e),p(n,e)}}),"updateGrKeyWStr"),m=o((function(t){return-128<t&&t<128&&Math.floor(t)!==t?2e9-(1024*t|0):t}),"cleanNum"),y=0;y<n.length;y++){var v=n[y],x=c[v];if(null!=x){var b=this.properties[v],w=b.type,k=b.groupKey,T=void 0;null!=b.hashOverride?T=b.hashOverride(t,x):null!=x.pfValue&&(T=x.pfValue);var _=null==b.enums?x.value:null,E=null!=T,C=E||null!=_,S=x.units;if(w.number&&C&&!w.multiple)g(m(E?T:_),k),E||null==S||f(S,k);else f(x.strValue,k)}}for(var A=[rpt,ipt],L=0;L<i.length;L++){var N=i[L],I=e.styleKeys[N];A[0]=spt(I[0],A[0]),A[1]=opt(I[1],A[1])}e.styleKey=lpt(A[0],A[1]);var R=e.styleKeys;e.labelDimsKey=cpt(R.labelDimensions);var M=a(t,["label"],R.labelDimensions);if(e.labelKey=cpt(M),e.labelStyleKey=cpt(hpt(R.commonLabel,M)),!l){var D=a(t,["source-label"],R.labelDimensions);e.sourceLabelKey=cpt(D),e.sourceLabelStyleKey=cpt(hpt(R.commonLabel,D));var O=a(t,["target-label"],R.labelDimensions);e.targetLabelKey=cpt(O),e.targetLabelStyleKey=cpt(hpt(R.commonLabel,O))}if(l){var P=e.styleKeys,B=P.nodeBody,$=P.nodeBorder,F=P.nodeOutline,z=P.backgroundImage,U=P.compound,G=P.pie,q=[B,$,F,z,U,G].filter((function(t){return null!=t})).reduce(hpt,[rpt,ipt]);e.nodeKey=cpt(q),e.hasPie=null!=G&&G[0]!==rpt&&G[1]!==ipt}return s!==e.styleKey},Zwt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Zwt.applyParsedProperty=function(t,e){var r,n=this,i=e,a=t._private.style,s=n.types,l=n.properties[i.name].type,c=i.bypass,h=a[i.name],u=h&&h.bypass,d=t._private,p="mapping",g=o((function(t){return null==t?null:null!=t.pfValue?t.pfValue:t.value}),"getVal"),f=o((function(){var e=g(h),r=g(i);n.checkTriggers(t,i.name,e,r)}),"checkTriggers");if("curve-style"===e.name&&t.isEdge()&&("bezier"!==e.value&&t.isLoop()||"haystack"===e.value&&(t.source().isParent()||t.target().isParent()))&&(i=e=this.parse(e.name,"bezier",c)),i.delete)return a[i.name]=void 0,f(),!0;if(i.deleteBypassed)return h?!!h.bypass&&(h.bypassed=void 0,f(),!0):(f(),!0);if(i.deleteBypass)return h?!!h.bypass&&(a[i.name]=h.bypassed,f(),!0):(f(),!0);var m=o((function(){Ept("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")}),"printMappingErr");switch(i.mapped){case s.mapData:for(var y,v=i.field.split("."),x=d.data,b=0;b<v.length&&x;b++){x=x[v[b]]}if(null==x)return m(),!1;if(!Mut(x))return Ept("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+x+"` for `"+t.id()+"` is non-numeric)"),!1;var w=i.fieldMax-i.fieldMin;if((y=0===w?0:(x-i.fieldMin)/w)<0?y=0:y>1&&(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)];r={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;r=this.parse(i.name,I,i.bypass,p)}if(!r)return m(),!1;r.mapping=i,i=r;break;case s.data:for(var R=i.field.split("."),M=d.data,D=0;D<R.length&&M;D++){M=M[R[D]]}if(null!=M&&(r=this.parse(i.name,M,i.bypass,p)),!r)return m(),!1;r.mapping=i,i=r;break;case s.fn:var O=i.value,P=null!=i.fnValue?i.fnValue:O(t);if(i.prevFnValue=P,null==P)return Ept("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+t.id()+"` is null)"),!1;if(!(r=this.parse(i.name,P,i.bypass,p)))return Ept("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+t.id()+"` is invalid)"),!1;r.mapping=Spt(i),i=r;break;case void 0:break;default:return!1}return c?(i.bypassed=u?h.bypassed:h,a[i.name]=i):u?h.bypassed=i:a[i.name]=i,f(),!0},Zwt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),e)for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];null!=l&&(l.bypass?l.bypassed=null:i[o]=null)}else n._private.style={}}},Zwt.update=function(){this._private.cy.mutableElements().updateStyle()},Zwt.updateTransitions=function(t,e){var r=this,n=t._private,i=t.pstyle("transition-property").value,a=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var o={},l=!1,c=0;c<i.length;c++){var h=i[c],u=t.pstyle(h),d=e[h];if(d){var p=d.prev,g=null!=d.next?d.next:u,f=!1,m=void 0,y=1e-6;p&&(Mut(p.pfValue)&&Mut(g.pfValue)?(f=g.pfValue-p.pfValue,m=p.pfValue+y*f):Mut(p.value)&&Mut(g.value)?(f=g.value-p.value,m=p.value+y*f):Nut(p.value)&&Nut(g.value)&&(f=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),f&&(o[h]=g.strValue,this.applyBypass(t,h,m),l=!0))}}if(!l)return;n.transitioning=!0,new Pmt((function(e){s>0?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(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1}))}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)},Zwt.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);null!=o&&o(r,n)&&a(s)},Zwt.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,(function(t){return t.triggersZOrder}),(function(){i._private.cy.notify("zorder",t)}))},Zwt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,(function(t){return t.triggersBounds}),(function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==e||"bezier"!==r&&"bezier"!==n||t.parallelEdges().forEach((function(t){t.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==e||"none"!==r&&"none"!==n||t.connectedEdges().forEach((function(t){t.dirtyBoundingBoxCache()}))}))},Zwt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var Jwt={applyBypass:function(t,e,r,n){var i=[];if("*"===e||"**"===e){if(void 0!==r)for(var a=0;a<this.properties.length;a++){var s=this.properties[a].name,o=this.parse(s,r,!0);o&&i.push(o)}}else if(Aut(e)){var l=this.parse(e,r,!0);l&&i.push(l)}else{if(!Iut(e))return!1;var c=e;n=r;for(var h=Object.keys(c),u=0;u<h.length;u++){var d=h[u],p=c[d];if(void 0===p&&(p=c[Xut(d)]),void 0!==p){var g=this.parse(d,p,!0);g&&i.push(g)}}}if(0===i.length)return!1;for(var f=!1,m=0;m<t.length;m++){for(var y=t[m],v={},x=void 0,b=0;b<i.length;b++){var w=i[b];if(n){var k=y.pstyle(w.name);x=v[w.name]={prev:k}}f=this.applyParsedProperty(y,Spt(w))||f,n&&(x.next=y.pstyle(w.name))}f&&this.updateStyleHints(y),n&&this.updateTransitions(y,v,true)}return f},overrideBypass:function(t,e,r){e=Vut(e);for(var n=0;n<t.length;n++){var i=t[n],a=i._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,c=a?null!=a.pfValue?a.pfValue:a.value:null;a&&a.bypass?(a.value=r,null!=a.pfValue&&(a.pfValue=r),a.strValue=o?"rgb("+r.join(",")+")":l?r.join(" "):""+r,this.updateStyleHints(i)):this.applyBypass(i,e,r),this.checkTriggers(i,e,c,r)}},removeAllBypasses:function(t,e){return this.removeBypasses(t,this.propertyNames,e)},removeBypasses:function(t,e,r){for(var n=0;n<t.length;n++){for(var i=t[n],a={},s=0;s<e.length;s++){var o=e[s],l=this.properties[o],c=i.pstyle(l.name);if(c&&c.bypass){var h=this.parse(o,"",!0),u=a[l.name]={prev:c};this.applyParsedProperty(i,h),u.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,a,true)}}},tkt={getEmSizeInPixels:function(){var t=this.containerCss("font-size");return null!=t?parseFloat(t):1},containerCss:function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)}},ekt={getRenderedStyle:function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},getRawStyle:function(t,e){var r=this;if(t=t[0]){for(var n={},i=0;i<r.properties.length;i++){var a=r.properties[i],s=r.getStylePropertyValue(t,a.name,e);null!=s&&(n[a.name]=s,n[Xut(a.name)]=s)}return n}},getIndexedStyle:function(t,e,r,n){var i=t.pstyle(e)[r][n];return null!=i?i:t.cy().style().getDefaultProperty(e)[r][0]},getStylePropertyValue:function(t,e,r){if(t=t[0]){var n=this.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,a=t.pstyle(n.name);if(a){var s=a.value,l=a.units,c=a.strValue;if(r&&i.number&&null!=s&&Mut(s)){var h=t.cy().zoom(),u=o((function(t){return t*h}),"getRenderedValue"),d=o((function(t,e){return u(t)+e}),"getValueStringWithUnits"),p=Nut(s),g=p?l.every((function(t){return null!=t})):null!=l;return g?p?s.map((function(t,e){return d(t,l[e])})).join(" "):d(s,l):p?s.map((function(t){return Aut(t)?t:""+u(t)})).join(" "):""+u(s)}if(null!=c)return c}return null}},getAnimationStartStyle:function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n].name,a=t.pstyle(i);void 0!==a&&(a=Iut(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(r[i]=a)}return r},getPropsList:function(t){var e=[],r=t,n=this.properties;if(r)for(var i=Object.keys(r),a=0;a<i.length;a++){var s=i[a],o=r[s],l=n[s]||n[Vut(s)],c=this.parse(l.name,o);c&&e.push(c)}return e},getNonDefaultPropertiesHash:function(t,e,r){var n,i,a,s,o,l,c=r.slice();for(o=0;o<e.length;o++)if(n=e[o],null!=(i=t.pstyle(n,!1)))if(null!=i.pfValue)c[0]=spt(s,c[0]),c[1]=opt(s,c[1]);else for(a=i.strValue,l=0;l<a.length;l++)s=a.charCodeAt(l),c[0]=spt(s,c[0]),c[1]=opt(s,c[1]);return c}};ekt.getPropertiesHash=ekt.getNonDefaultPropertiesHash;var rkt={appendFromJson:function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],i=n.selector,a=n.style||n.css,s=Object.keys(a);e.selector(i);for(var o=0;o<s.length;o++){var l=s[o],c=a[l];e.css(l,c)}}return e},fromJson:function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},json:function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,i=r.properties,a={},s=0;s<i.length;s++){var o=i[s];a[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:a})}return t}},nkt={appendFromString:function(t){var e,r,n,i=this,a=""+t;function s(){a=a.length>e.length?a.substr(e.length):""}function l(){r=r.length>n.length?r.substr(n.length):""}for(a=a.replace(/[/][*](\s|.)+?[*][/]/g,""),o(s,"removeSelAndBlockFromRemaining"),o(l,"removePropAndValFromRem");;){if(a.match(/^\s*$/))break;var c=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Ept("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 qxt(h).invalid){Ept("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),s();continue}var u=c[2],d=!1;r=u;for(var p=[];;){if(r.match(/^\s*$/))break;var g=r.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Ept("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),d=!0;break}n=g[0];var f=g[1],m=g[2];if(this.properties[f])i.parse(f,m)?(p.push({name:f,val:m}),l()):(Ept("Skipping property: Invalid property definition in: "+n),l());else Ept("Skipping property: Invalid property name in: "+n),l()}if(d){s();break}i.selector(h);for(var y=0;y<p.length;y++){var v=p[y];i.css(v.name,v.val)}s()}return i},fromString:function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e}},ikt={};!function(){var t=Qut,e=o((function(t){return"^"+t+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"}),"data"),r=o((function(e){var r=t+"|\\w+|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+)?))))?\\)|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+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+e+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+r+")\\s*\\,\\s*("+r+")\\)$"}),"mapData"),n=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];ikt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:e("data")},layoutData:{mapping:!0,regex:e("layoutData")},scratch:{mapping:!0,regex:e("scratch")},mapData:{mapping:!0,regex:r("mapData")},mapLayoutData:{mapping:!0,regex:r("mapLayoutData")},mapScratch:{mapping:!0,regex:r("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:n,singleRegexMatchValue:!0},urls:{regexes:n,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:o((function(t,e){switch(t.length){case 2:return"deg"!==e[0]&&"rad"!==e[0]&&"deg"!==e[1]&&"rad"!==e[1];case 1:return Aut(t[0])||"deg"===e[0]||"rad"===e[0];default:return!1}}),"validate")},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:o((function(t){var e=t.length;return 1===e||2===e||4===e}),"validate")}};var i={zeroNonZero:o((function(t,e){return(null==t||null==e)&&t!==e||(0==t&&0!=e||0!=t&&0==e)}),"zeroNonZero"),any:o((function(t,e){return t!=e}),"any"),emptyNonEmpty:o((function(t,e){var r=Gut(t),n=Gut(e);return r&&!n||!r&&n}),"emptyNonEmpty")},a=ikt.types,s=[{name:"label",type:a.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any}],l=[{name:"source-label",type:a.text,triggersBounds:i.any},{name:"source-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:a.size,triggersBounds:i.any}],c=[{name:"target-label",type:a.text,triggersBounds:i.any},{name:"target-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:a.size,triggersBounds:i.any}],h=[{name:"font-family",type:a.fontFamily,triggersBounds:i.any},{name:"font-style",type:a.fontStyle,triggersBounds:i.any},{name:"font-weight",type:a.fontWeight,triggersBounds:i.any},{name:"font-size",type:a.size,triggersBounds:i.any},{name:"text-transform",type:a.textTransform,triggersBounds:i.any},{name:"text-wrap",type:a.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:a.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:a.size,triggersBounds:i.any},{name:"text-outline-width",type:a.size,triggersBounds:i.any},{name:"line-height",type:a.positiveNumber,triggersBounds:i.any}],u=[{name:"text-valign",type:a.valign,triggersBounds:i.any},{name:"text-halign",type:a.halign,triggersBounds:i.any},{name:"color",type:a.color},{name:"text-outline-color",type:a.color},{name:"text-outline-opacity",type:a.zeroOneNumber},{name:"text-background-color",type:a.color},{name:"text-background-opacity",type:a.zeroOneNumber},{name:"text-background-padding",type:a.size,triggersBounds:i.any},{name:"text-border-opacity",type:a.zeroOneNumber},{name:"text-border-color",type:a.color},{name:"text-border-width",type:a.size,triggersBounds:i.any},{name:"text-border-style",type:a.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:a.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:a.justification}],d=[{name:"events",type:a.bool,triggersZOrder:i.any},{name:"text-events",type:a.bool,triggersZOrder:i.any}],p=[{name:"display",type:a.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:a.visibility,triggersZOrder:i.any},{name:"opacity",type:a.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:a.zeroOneNumber},{name:"min-zoomed-font-size",type:a.size},{name:"z-compound-depth",type:a.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:a.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:a.number,triggersZOrder:i.any}],g=[{name:"overlay-padding",type:a.size,triggersBounds:i.any},{name:"overlay-color",type:a.color},{name:"overlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:a.overlayShape,triggersBounds:i.any},{name:"overlay-corner-radius",type:a.cornerRadius}],f=[{name:"underlay-padding",type:a.size,triggersBounds:i.any},{name:"underlay-color",type:a.color},{name:"underlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:a.overlayShape,triggersBounds:i.any},{name:"underlay-corner-radius",type:a.cornerRadius}],m=[{name:"transition-property",type:a.propList},{name:"transition-duration",type:a.time},{name:"transition-delay",type:a.time},{name:"transition-timing-function",type:a.easing}],y=o((function(t,e){return"label"===e.value?-t.poolIndex():e.pfValue}),"nodeSizeHashOverride"),v=[{name:"height",type:a.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"width",type:a.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"shape",type:a.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:a.polygonPointList,triggersBounds:i.any},{name:"corner-radius",type:a.cornerRadius},{name:"background-color",type:a.color},{name:"background-fill",type:a.fill},{name:"background-opacity",type:a.zeroOneNumber},{name:"background-blacken",type:a.nOneOneNumber},{name:"background-gradient-stop-colors",type:a.colors},{name:"background-gradient-stop-positions",type:a.percentages},{name:"background-gradient-direction",type:a.gradientDirection},{name:"padding",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:a.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:a.boundsExpansion,triggersBounds:i.any}],x=[{name:"border-color",type:a.color},{name:"border-opacity",type:a.zeroOneNumber},{name:"border-width",type:a.size,triggersBounds:i.any},{name:"border-style",type:a.borderStyle},{name:"border-cap",type:a.lineCap},{name:"border-join",type:a.lineJoin},{name:"border-dash-pattern",type:a.numbers},{name:"border-dash-offset",type:a.number},{name:"border-position",type:a.linePosition}],b=[{name:"outline-color",type:a.color},{name:"outline-opacity",type:a.zeroOneNumber},{name:"outline-width",type:a.size,triggersBounds:i.any},{name:"outline-style",type:a.borderStyle},{name:"outline-offset",type:a.size,triggersBounds:i.any}],w=[{name:"background-image",type:a.urls},{name:"background-image-crossorigin",type:a.bgCrossOrigin},{name:"background-image-opacity",type:a.zeroOneNumbers},{name:"background-image-containment",type:a.bgContainment},{name:"background-image-smoothing",type:a.bools},{name:"background-position-x",type:a.bgPos},{name:"background-position-y",type:a.bgPos},{name:"background-width-relative-to",type:a.bgRelativeTo},{name:"background-height-relative-to",type:a.bgRelativeTo},{name:"background-repeat",type:a.bgRepeat},{name:"background-fit",type:a.bgFit},{name:"background-clip",type:a.bgClip},{name:"background-width",type:a.bgWH},{name:"background-height",type:a.bgWH},{name:"background-offset-x",type:a.bgPos},{name:"background-offset-y",type:a.bgPos}],k=[{name:"position",type:a.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:a.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:a.size,triggersBounds:i.any},{name:"min-width-bias-left",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:a.size,triggersBounds:i.any},{name:"min-height-bias-top",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:a.sizeMaybePercent,triggersBounds:i.any}],T=[{name:"line-style",type:a.lineStyle},{name:"line-color",type:a.color},{name:"line-fill",type:a.fill},{name:"line-cap",type:a.lineCap},{name:"line-opacity",type:a.zeroOneNumber},{name:"line-dash-pattern",type:a.numbers},{name:"line-dash-offset",type:a.number},{name:"line-outline-width",type:a.size},{name:"line-outline-color",type:a.color},{name:"line-gradient-stop-colors",type:a.colors},{name:"line-gradient-stop-positions",type:a.percentages},{name:"curve-style",type:a.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:a.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:a.size,triggersBounds:i.any},{name:"control-point-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:a.numbers,triggersBounds:i.any},{name:"segment-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:a.numbers,triggersBounds:i.any},{name:"segment-radii",type:a.numbers,triggersBounds:i.any},{name:"radius-type",type:a.radiusType,triggersBounds:i.any},{name:"taxi-turn",type:a.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:a.size,triggersBounds:i.any},{name:"taxi-direction",type:a.axisDirection,triggersBounds:i.any},{name:"taxi-radius",type:a.number,triggersBounds:i.any},{name:"edge-distances",type:a.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:a.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:a.angle,triggersBounds:i.any},{name:"loop-sweep",type:a.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:a.size,triggersBounds:i.any},{name:"target-distance-from-node",type:a.size,triggersBounds:i.any}],_=[{name:"ghost",type:a.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:a.zeroOneNumber}],E=[{name:"selection-box-color",type:a.color},{name:"selection-box-opacity",type:a.zeroOneNumber},{name:"selection-box-border-color",type:a.color},{name:"selection-box-border-width",type:a.size},{name:"active-bg-color",type:a.color},{name:"active-bg-opacity",type:a.zeroOneNumber},{name:"active-bg-size",type:a.size},{name:"outside-texture-bg-color",type:a.color},{name:"outside-texture-bg-opacity",type:a.zeroOneNumber}],C=[];ikt.pieBackgroundN=16,C.push({name:"pie-size",type:a.sizeMaybePercent});for(var S=1;S<=ikt.pieBackgroundN;S++)C.push({name:"pie-"+S+"-background-color",type:a.color}),C.push({name:"pie-"+S+"-background-size",type:a.percent}),C.push({name:"pie-"+S+"-background-opacity",type:a.zeroOneNumber});var A=[],L=ikt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:a.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:a.color},{name:"arrow-fill",type:a.arrowFill},{name:"arrow-width",type:a.arrowWidth}].forEach((function(t){L.forEach((function(e){var r=e+"-"+t.name,n=t.type,i=t.triggersBounds;A.push({name:r,type:n,triggersBounds:i})}))}),{});var N=ikt.properties=[].concat(d,m,p,g,f,_,u,h,s,l,c,v,x,b,w,C,k,T,A,E),I=ikt.propertyGroups={behavior:d,transition:m,visibility:p,overlay:g,underlay:f,ghost:_,commonLabel:u,labelDimensions:h,mainLabel:s,sourceLabel:l,targetLabel:c,nodeBody:v,nodeBorder:x,nodeOutline:b,backgroundImage:w,pie:C,compound:k,edgeLine:T,edgeArrow:A,core:E},R=ikt.propertyGroupNames={};(ikt.propertyGroupKeys=Object.keys(I)).forEach((function(t){R[t]=I[t].map((function(t){return t.name})),I[t].forEach((function(e){return e.groupKey=t}))}));var M=ikt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];ikt.propertyNames=N.map((function(t){return t.name}));for(var D=0;D<N.length;D++){var O=N[D];N[O.name]=O}for(var P=0;P<M.length;P++){var B=M[P],$=N[B.pointsTo],F={name:B.name,alias:!0,pointsTo:$};N.push(F),N[B.name]=F}}(),ikt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},ikt.getDefaultProperties=function(){var t=this._private;if(null!=t.defaultProperties)return t.defaultProperties;for(var e=edt({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(t,e){for(var r=1;r<=ikt.pieBackgroundN;r++){var n=e.name.replace("{{i}}",r),i=e.value;t[n]=i}return t}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce((function(t,e){return ikt.arrowPrefixes.forEach((function(r){var n=r+"-"+e.name,i=e.value;t[n]=i})),t}),{})),r={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var a=i.name,s=e[a],o=this.parse(a,s);r[a]=o}}return t.defaultProperties=r,t.defaultProperties},ikt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var akt={parse:function(t,e,r,n){var i=this;if(Lut(e))return i.parseImplWarn(t,e,r,n);var a,s=ppt(t,""+e,r?"t":"f","mapping"===n||!0===n||!1===n||null==n?"dontcare":n),o=i.propCache=i.propCache||[];return(a=o[s])||(a=o[s]=i.parseImplWarn(t,e,r,n)),(r||"mapping"===n)&&(a=Spt(a))&&(a.value=Spt(a.value)),a},parseImplWarn:function(t,e,r,n){var i=this.parseImpl(t,e,r,n);return i||null==e||Ept("The style property `".concat(t,": ").concat(e,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==e||Ept("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(t,e,r,n){var i=this;t=Vut(t);var a=i.properties[t],s=e,l=i.types;if(!a)return null;if(void 0===e)return null;a.alias&&(a=a.pointsTo,t=a.name);var c=Aut(e);c&&(e=e.trim());var h,u,d=a.type;if(!d)return null;if(r&&(""===e||null===e))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Lut(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:r};if(!c||n||e.length<7||"a"!==e[1]);else{if(e.length>=7&&"d"===e[0]&&(h=new RegExp(l.data.regex).exec(e))){if(r)return!1;var p=l.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:r}}if(e.length>=10&&"m"===e[0]&&(u=new RegExp(l.mapData.regex).exec(e))){if(r)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 Ept("`"+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:r}}}if(d.multiple&&"multiple"!==n){var x;if(x=c?e.split(/\s+/):Nut(e)?e:[e],d.evenMultiple&&x.length%2!=0)return null;for(var b=[],w=[],k=[],T="",_=!1,E=0;E<x.length;E++){var C=i.parse(t,x[E],r,"multiple");_=_||Aut(C.value),b.push(C.value),k.push(null!=C.pfValue?C.pfValue:C.value),w.push(C.units),T+=(E>0?" ":"")+C.strValue}return d.validate&&!d.validate(b,w)?null:d.singleEnum&&_?1===b.length&&Aut(b[0])?{name:t,value:b[0],strValue:b[0],bypass:r}:null:{name:t,value:b,pfValue:k,strValue:T,bypass:r,units:w}}var S=o((function(){for(var n=0;n<d.enums.length;n++){if(d.enums[n]===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null}),"checkEnums");if(d.number){var A,L="px";if(d.units&&(A=d.units),d.implicitUnits&&(L=d.implicitUnits),!d.unitless)if(c){var N="px|em"+(d.allowPercent?"|\\%":"");A&&(N=A);var I=e.match("^("+Qut+")("+N+")?$");I&&(e=I[1],A=I[2]||L)}else A&&!d.implicitUnits||(A=L);if(e=parseFloat(e),isNaN(e)&&void 0===d.enums)return null;if(isNaN(e)&&void 0!==d.enums)return e=s,S();if(d.integer&&!Dut(e))return null;if(void 0!==d.min&&(e<d.min||d.strictMin&&e===d.min)||void 0!==d.max&&(e>d.max||d.strictMax&&e===d.max))return null;var R={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:r};return d.unitless||"px"!==A&&"em"!==A?R.pfValue=e:R.pfValue="px"!==A&&A?this.getEmSizeInPixels()*e:e,"ms"!==A&&"s"!==A||(R.pfValue="ms"===A?e:1e3*e),"deg"!==A&&"rad"!==A||(R.pfValue="rad"===A?e:pgt(e)),"%"===A&&(R.pfValue=e/100),R}if(d.propList){var M=[],D=""+e;if("none"===D);else{for(var O=D.split(/\s*,\s*|\s+/),P=0;P<O.length;P++){var B=O[P].trim();i.properties[B]?M.push(B):Ept("`"+B+"` is not a valid property name")}if(0===M.length)return null}return{name:t,value:M,strValue:0===M.length?"none":M.join(" "),bypass:r}}if(d.color){var $=sdt(e);return $?{name:t,value:$,pfValue:$,strValue:"rgb("+$[0]+","+$[1]+","+$[2]+")",bypass:r}:null}if(d.regex||d.regexes){if(d.enums){var F=S();if(F)return F}for(var z=d.regexes?d.regexes:[d.regex],U=0;U<z.length;U++){var G=new RegExp(z[U]).exec(e);if(G)return{name:t,value:d.singleRegexMatchValue?G[1]:G,strValue:""+e,bypass:r}}return null}return d.string?{name:t,value:""+e,strValue:""+e,bypass:r}:d.enums?S():null}},skt=o((function t(e){if(!(this instanceof t))return new t(e);Fut(e)?(this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()):Tpt("A style must have a core reference")}),"Style"),okt=skt.prototype;okt.instanceString=function(){return"style"},okt.clear=function(){for(var t=this._private,e=t.cy.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(e,!0),e.forEach((function(t){var e=t[0]._private;e.styleDirty=!0,e.appliedInitStyle=!1})),this},okt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},okt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},okt.selector=function(t){var e="core"===t?null:new qxt(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},okt.css=function(){var t=this,e=arguments;if(1===e.length)for(var r=e[0],n=0;n<t.properties.length;n++){var i=t.properties[n],a=r[i.name];void 0===a&&(a=r[Xut(i.name)]),void 0!==a&&this.cssRule(i.name,a)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},okt.style=okt.css,okt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r),!this[n].selector&&(this._private.coreStyle[r.name]=r)}return this},okt.append=function(t){return zut(t)?t.appendToStyle(this):Nut(t)?this.appendFromJson(t):Aut(t)&&this.appendFromString(t),this},skt.fromJson=function(t,e){var r=new skt(t);return r.fromJson(e),r},skt.fromString=function(t,e){return new skt(t).fromString(e)},[Zwt,Jwt,tkt,ekt,rkt,nkt,ikt,akt].forEach((function(t){edt(okt,t)})),skt.types=okt.types,skt.properties=okt.properties,skt.propertyGroups=okt.propertyGroups,skt.propertyGroupNames=okt.propertyGroupNames,skt.propertyGroupKeys=okt.propertyGroupKeys;var lkt={style:o((function(t){t&&this.setStyle(t).update();return this._private.style}),"style"),setStyle:o((function(t){var e=this._private;return zut(t)?e.style=t.generateStyle(this):Nut(t)?e.style=skt.fromJson(this,t):Aut(t)?e.style=skt.fromString(this,t):e.style=skt(this),e.style}),"setStyle"),updateStyle:o((function(){this.mutableElements().updateStyle()}),"updateStyle")},ckt={autolock:o((function(t){return void 0===t?this._private.autolock:(this._private.autolock=!!t,this)}),"autolock"),autoungrabify:o((function(t){return void 0===t?this._private.autoungrabify:(this._private.autoungrabify=!!t,this)}),"autoungrabify"),autounselectify:o((function(t){return void 0===t?this._private.autounselectify:(this._private.autounselectify=!!t,this)}),"autounselectify"),selectionType:o((function(t){var e=this._private;return null==e.selectionType&&(e.selectionType="single"),void 0===t?e.selectionType:("additive"!==t&&"single"!==t||(e.selectionType=t),this)}),"selectionType"),panningEnabled:o((function(t){return void 0===t?this._private.panningEnabled:(this._private.panningEnabled=!!t,this)}),"panningEnabled"),userPanningEnabled:o((function(t){return void 0===t?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!t,this)}),"userPanningEnabled"),zoomingEnabled:o((function(t){return void 0===t?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!t,this)}),"zoomingEnabled"),userZoomingEnabled:o((function(t){return void 0===t?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!t,this)}),"userZoomingEnabled"),boxSelectionEnabled:o((function(t){return void 0===t?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!t,this)}),"boxSelectionEnabled"),pan:o((function(){var t,e,r,n,i,a=arguments,s=this._private.pan;switch(a.length){case 0:return s;case 1:if(Aut(a[0]))return s[t=a[0]];if(Iut(a[0])){if(!this._private.panningEnabled)return this;n=(r=a[0]).x,i=r.y,Mut(n)&&(s.x=n),Mut(i)&&(s.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=a[0],e=a[1],"x"!==t&&"y"!==t||!Mut(e)||(s[t]=e),this.emit("pan viewport")}return this.notify("viewport"),this}),"pan"),panBy:o((function(t,e){var r,n,i,a,s,o=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(o.length){case 1:Iut(t)&&(a=(i=o[0]).x,s=i.y,Mut(a)&&(l.x+=a),Mut(s)&&(l.y+=s),this.emit("pan viewport"));break;case 2:n=e,"x"!==(r=t)&&"y"!==r||!Mut(n)||(l[r]+=n),this.emit("pan viewport")}return this.notify("viewport"),this}),"panBy"),gc:o((function(){this.notify("gc")}),"gc"),fit:o((function(t,e){var r=this.getFitViewport(t,e);if(r){var n=this._private;n.zoom=r.zoom,n.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this}),"fit"),getFitViewport:o((function(t,e){if(Mut(t)&&void 0===e&&(e=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var r;if(Aut(t)){var n=t;t=this.$(n)}else if(jut(t)){var i=t;(r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2}).w=r.x2-r.x1,r.h=r.y2-r.y1}else Put(t)||(t=this.mutableElements());if(!Put(t)||!t.empty()){r=r||t.boundingBox();var a,s=this.width(),o=this.height();if(e=Mut(e)?e:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0)return{zoom:a=(a=(a=Math.min((s-2*e)/r.w,(o-2*e)/r.h))>this._private.maxZoom?this._private.maxZoom:a)<this._private.minZoom?this._private.minZoom:a,pan:{x:(s-a*(r.x1+r.x2))/2,y:(o-a*(r.y1+r.y2))/2}}}}}),"getFitViewport"),zoomRange:o((function(t,e){var r=this._private;if(null==e){var n=t;t=n.min,e=n.max}return Mut(t)&&Mut(e)&&t<=e?(r.minZoom=t,r.maxZoom=e):Mut(t)&&void 0===e&&t<=r.maxZoom?r.minZoom=t:Mut(e)&&void 0===t&&e>=r.minZoom&&(r.maxZoom=e),this}),"zoomRange"),minZoom:o((function(t){return void 0===t?this._private.minZoom:this.zoomRange({min:t})}),"minZoom"),maxZoom:o((function(t){return void 0===t?this._private.maxZoom:this.zoomRange({max:t})}),"maxZoom"),getZoomedViewport:o((function(t){var e,r,n=this._private,i=n.pan,a=n.zoom,s=!1;if(n.zoomingEnabled||(s=!0),Mut(t)?r=t:Iut(t)&&(r=t.level,null!=t.position?e=sgt(t.position,a,i):null!=t.renderedPosition&&(e=t.renderedPosition),null==e||n.panningEnabled||(s=!0)),r=(r=r>n.maxZoom?n.maxZoom:r)<n.minZoom?n.minZoom:r,s||!Mut(r)||r===a||null!=e&&(!Mut(e.x)||!Mut(e.y)))return null;if(null!=e){var o=i,l=a,c=r;return{zoomed:!0,panned:!0,zoom:c,pan:{x:-c/l*(e.x-o.x)+e.x,y:-c/l*(e.y-o.y)+e.y}}}return{zoomed:!0,panned:!1,zoom:r,pan:i}}),"getZoomedViewport"),zoom:o((function(t){if(void 0===t)return this._private.zoom;var e=this.getZoomedViewport(t),r=this._private;return null!=e&&e.zoomed?(r.zoom=e.zoom,e.panned&&(r.pan.x=e.pan.x,r.pan.y=e.pan.y),this.emit("zoom"+(e.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this}),"zoom"),viewport:o((function(t){var e=this._private,r=!0,n=!0,i=[],a=!1,s=!1;if(!t)return this;if(Mut(t.zoom)||(r=!1),Iut(t.pan)||(n=!1),!r&&!n)return this;if(r){var o=t.zoom;o<e.minZoom||o>e.maxZoom||!e.zoomingEnabled?a=!0:(e.zoom=o,i.push("zoom"))}if(n&&(!a||!t.cancelOnFailedZoom)&&e.panningEnabled){var l=t.pan;Mut(l.x)&&(e.pan.x=l.x,s=!1),Mut(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:o((function(t){var e=this.getCenterPan(t);return e&&(this._private.pan=e,this.emit("pan viewport"),this.notify("viewport")),this}),"center"),getCenterPan:o((function(t,e){if(this._private.panningEnabled){if(Aut(t)){var r=t;t=this.mutableElements().filter(r)}else Put(t)||(t=this.mutableElements());if(0!==t.length){var n=t.boundingBox(),i=this.width(),a=this.height();return{x:(i-(e=void 0===e?this._private.zoom:e)*(n.x1+n.x2))/2,y:(a-e*(n.y1+n.y2))/2}}}}),"getCenterPan"),reset:o((function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this}),"reset"),invalidateSize:o((function(){this._private.sizeCache=null}),"invalidateSize"),size:o((function(){var t,e,r=this._private,n=r.container,i=this;return r.sizeCache=r.sizeCache||(n?(t=i.window().getComputedStyle(n),e=o((function(e){return parseFloat(t.getPropertyValue(e))}),"val"),{width:n.clientWidth-e("padding-left")-e("padding-right"),height:n.clientHeight-e("padding-top")-e("padding-bottom")}):{width:1,height:1})}),"size"),width:o((function(){return this.size().width}),"width"),height:o((function(){return this.size().height}),"height"),extent:o((function(){var t=this._private.pan,e=this._private.zoom,r=this.renderedExtent(),n={x1:(r.x1-t.x)/e,x2:(r.x2-t.x)/e,y1:(r.y1-t.y)/e,y2:(r.y2-t.y)/e};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}),"extent"),renderedExtent:o((function(){var t=this.width(),e=this.height();return{x1:0,y1:0,x2:t,y2:e,w:t,h:e}}),"renderedExtent"),multiClickDebounceTime:o((function(t){return t?(this._private.multiClickDebounceTime=t,this):this._private.multiClickDebounceTime}),"multiClickDebounceTime")};ckt.centre=ckt.center,ckt.autolockNodes=ckt.autolock,ckt.autoungrabifyNodes=ckt.autoungrabify;var hkt={data:Xvt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Xvt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Xvt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Xvt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};hkt.attr=hkt.data,hkt.removeAttr=hkt.removeData;var ukt=o((function(t){var e=this,r=(t=edt({},t)).container;r&&!Out(r)&&Out(r[0])&&(r=r[0]);var n=r?r._cyreg:null;(n=n||{})&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];r&&(r._cyreg=n),n.cy=e;var a=void 0!==wut&&void 0!==r&&!t.headless,s=t;s.layout=edt({name:a?"grid":"null"},s.layout),s.renderer=edt({name:a?"canvas":"null"},s.renderer);var l=o((function(t,e,r){return void 0!==e?e:void 0!==r?r:t}),"defVal"),c=this._private={container:r,ready:!1,options:s,elements:new Swt(this),listeners:[],aniEles:new Swt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:void 0===s.styleEnabled?a:s.styleEnabled,zoom:Mut(s.zoom)?s.zoom:1,pan:{x:Iut(s.pan)&&Mut(s.pan.x)?s.pan.x:0,y:Iut(s.pan)&&Mut(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var h=o((function(t,e){if(t.some(Wut))return Pmt.all(t).then(e);e(t)}),"loadExtData");c.styleEnabled&&e.setStyle([]);var u=edt({},s,s.renderer);e.initRenderer(u);var d=o((function(t,r,n){e.notifications(!1);var i=e.mutableElements();i.length>0&&i.remove(),null!=t&&(Iut(t)||Nut(t))&&e.add(t),e.one("layoutready",(function(t){e.notifications(!0),e.emit(t),e.one("load",r),e.emitAndNotify("load")})).one("layoutstop",(function(){e.one("done",n),e.emit("done")}));var a=edt({},e._private.options.layout);a.eles=e.elements(),e.layout(a).run()}),"setElesAndLayout");h([s.style,s.elements],(function(t){var r=t[0],a=t[1];c.styleEnabled&&e.style().append(r),d(a,(function(){e.startAnimationLoop(),c.ready=!0,Lut(s.ready)&&e.on("ready",s.ready);for(var t=0;t<i.length;t++){var r=i[t];e.on("ready",r)}n&&(n.readies=[]),e.emit("ready")}),s.done)}))}),"Core"),dkt=ukt.prototype;edt(dkt,{instanceString:o((function(){return"core"}),"instanceString"),isReady:o((function(){return this._private.ready}),"isReady"),destroyed:o((function(){return this._private.destroyed}),"destroyed"),ready:o((function(t){return this.isReady()?this.emitter().emit("ready",[],t):this.on("ready",t),this}),"ready"),destroy:o((function(){var t=this;if(!t.destroyed())return t.stopAnimationLoop(),t.destroyRenderer(),this.emit("destroy"),t._private.destroyed=!0,t}),"destroy"),hasElementWithId:o((function(t){return this._private.elements.hasElementWithId(t)}),"hasElementWithId"),getElementById:o((function(t){return this._private.elements.getElementById(t)}),"getElementById"),hasCompoundNodes:o((function(){return this._private.hasCompoundNodes}),"hasCompoundNodes"),headless:o((function(){return this._private.renderer.isHeadless()}),"headless"),styleEnabled:o((function(){return this._private.styleEnabled}),"styleEnabled"),addToPool:o((function(t){return this._private.elements.merge(t),this}),"addToPool"),removeFromPool:o((function(t){return this._private.elements.unmerge(t),this}),"removeFromPool"),container:o((function(){return this._private.container||null}),"container"),window:o((function(){if(null==this._private.container)return wut;var t=this._private.container.ownerDocument;return void 0===t||null==t?wut:t.defaultView||wut}),"window"),mount:o((function(t){if(null!=t){var e=this,r=e._private,n=r.options;return!Out(t)&&Out(t[0])&&(t=t[0]),e.stopAnimationLoop(),e.destroyRenderer(),r.container=t,r.styleEnabled=!0,e.invalidateSize(),e.initRenderer(edt({},n,n.renderer,{name:"null"===n.renderer.name?"canvas":n.renderer.name})),e.startAnimationLoop(),e.style(n.style),e.emit("mount"),e}}),"mount"),unmount:o((function(){var t=this;return t.stopAnimationLoop(),t.destroyRenderer(),t.initRenderer({name:"null"}),t.emit("unmount"),t}),"unmount"),options:o((function(){return Spt(this._private.options)}),"options"),json:o((function(t){var e=this,r=e._private,n=e.mutableElements(),i=o((function(t){return e.getElementById(t.id())}),"getFreshRef");if(Iut(t)){if(e.startBatch(),t.elements){var a={},s=o((function(t,r){for(var n=[],i=[],s=0;s<t.length;s++){var o=t[s];if(o.data.id){var l=""+o.data.id,c=e.getElementById(l);a[l]=!0,0!==c.length?i.push({ele:c,json:o}):r?(o.group=r,n.push(o)):n.push(o)}else Ept("cy.json() cannot handle elements without an ID attribute")}e.add(n);for(var h=0;h<i.length;h++){var u=i[h],d=u.ele,p=u.json;d.json(p)}}),"updateEles");if(Nut(t.elements))s(t.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var h=l[c],u=t.elements[h];Nut(u)&&s(u,h)}var d=e.collection();n.filter((function(t){return!a[t.id()]})).forEach((function(t){t.isParent()?d.merge(t):t.remove()})),d.forEach((function(t){return t.children().move({parent:null})})),d.forEach((function(t){return i(t).remove()}))}t.style&&e.style(t.style),null!=t.zoom&&t.zoom!==r.zoom&&e.zoom(t.zoom),t.pan&&(t.pan.x===r.pan.x&&t.pan.y===r.pan.y||e.pan(t.pan)),t.data&&e.data(t.data);for(var p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<p.length;g++){var f=p[g];null!=t[f]&&e[f](t[f])}return e.endBatch(),this}var m={};!!t?m.elements=this.elements().map((function(t){return t.json()})):(m.elements={},n.forEach((function(t){var e=t.group();m.elements[e]||(m.elements[e]=[]),m.elements[e].push(t.json())}))),this._private.styleEnabled&&(m.style=e.style().json()),m.data=Spt(e.data());var y=r.options;return m.zoomingEnabled=r.zoomingEnabled,m.userZoomingEnabled=r.userZoomingEnabled,m.zoom=r.zoom,m.minZoom=r.minZoom,m.maxZoom=r.maxZoom,m.panningEnabled=r.panningEnabled,m.userPanningEnabled=r.userPanningEnabled,m.pan=Spt(r.pan),m.boxSelectionEnabled=r.boxSelectionEnabled,m.renderer=Spt(y.renderer),m.hideEdgesOnViewport=y.hideEdgesOnViewport,m.textureOnViewport=y.textureOnViewport,m.wheelSensitivity=y.wheelSensitivity,m.motionBlur=y.motionBlur,m.multiClickDebounceTime=y.multiClickDebounceTime,m}),"json")}),dkt.$id=dkt.getElementById,[Lwt,Uwt,jwt,Wwt,Ywt,Hwt,Xwt,Kwt,lkt,ckt,hkt].forEach((function(t){edt(dkt,t)}));var pkt={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")},gkt={maximal:!1,acyclic:!1},fkt=o((function(t){return t.scratch("breadthfirst")}),"getInfo"),mkt=o((function(t,e){return t.scratch("breadthfirst",e)}),"setInfo");function ykt(t){this.options=edt({},pkt,gkt,t)}o(ykt,"BreadthFirstLayout"),ykt.prototype.run=function(){var t,e=this.options,r=e.cy,n=e.eles,i=n.nodes().filter((function(t){return t.isChildless()})),a=n,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=!!e.boundingBox,h=r.extent(),u=_gt(c?e.boundingBox:{x1:h.x1,y1:h.y1,w:h.w,h:h.h});if(Put(e.roots))t=e.roots;else if(Nut(e.roots)){for(var d=[],p=0;p<e.roots.length;p++){var g=e.roots[p],f=r.getElementById(g);d.push(f)}t=r.collection(d)}else if(Aut(e.roots))t=r.$(e.roots);else if(s)t=i.roots();else{var m=n.components();t=r.collection();for(var y=o((function(e){var r=m[e],n=r.maxDegree(!1),i=r.filter((function(t){return t.degree(!1)===n}));t=t.add(i)}),"_loop"),v=0;v<m.length;v++)y(v)}var x=[],b={},w=o((function(t,e){null==x[e]&&(x[e]=[]);var r=x[e].length;x[e].push(t),mkt(t,{index:r,depth:e})}),"addToDepth"),k=o((function(t,e){var r=fkt(t),n=r.depth,i=r.index;x[n][i]=null,t.isChildless()&&w(t,e)}),"changeDepth");a.bfs({roots:t,directed:e.directed,visit:o((function(t,e,r,n,i){var a=t[0],s=a.id();a.isChildless()&&w(a,i),b[s]=!0}),"visit")});for(var T=[],_=0;_<i.length;_++){var E=i[_];b[E.id()]||T.push(E)}var C=o((function(t){for(var e=x[t],r=0;r<e.length;r++){var n=e[r];null!=n?mkt(n,{depth:t,index:r}):(e.splice(r,1),r--)}}),"assignDepthsAt"),S=o((function(t,r){for(var i=fkt(t),a=t.incomers().filter((function(t){return t.isNode()&&n.has(t)})),s=-1,o=t.id(),l=0;l<a.length;l++){var c=a[l],h=fkt(c);s=Math.max(s,h.depth)}if(i.depth<=s){if(!e.acyclic&&r[o])return null;var u=s+1;return k(t,u),r[o]=u,!0}return!1}),"adjustMaximally");if(s&&l){var A=[],L={},N=o((function(t){return A.push(t)}),"enqueue"),I=o((function(){return A.shift()}),"dequeue");for(i.forEach((function(t){return A.push(t)}));A.length>0;){var R=I(),M=S(R,L);if(M)R.outgoers().filter((function(t){return t.isNode()&&n.has(t)})).forEach(N);else if(null===M){Ept("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var D=0;if(e.avoidOverlap)for(var O=0;O<i.length;O++){var P=i[O].layoutDimensions(e),B=P.w,$=P.h;D=Math.max(D,B,$)}var F={},z=o((function(t){if(F[t.id()])return F[t.id()];for(var e=fkt(t).depth,r=t.neighborhood(),n=0,a=0,s=0;s<r.length;s++){var o=r[s];if(!o.isEdge()&&!o.isParent()&&i.has(o)){var l=fkt(o);if(null!=l){var c=l.index,h=l.depth;if(null!=c&&null!=h){var u=x[h].length;h<e&&(n+=c/u,a++)}}}}return n/=a=Math.max(1,a),0===a&&(n=0),F[t.id()]=n,n}),"getWeightedPercent"),U=o((function(t,e){var r=z(t)-z(e);return 0===r?Jut(t.id(),e.id()):r}),"sortFn");void 0!==e.depthSort&&(U=e.depthSort);for(var G=x.length,q=0;q<G;q++)x[q].sort(U),C(q);for(var j=[],W=0;W<T.length;W++)j.push(T[W]);var Y=o((function(){for(var t=0;t<G;t++)C(t)}),"assignDepths");j.length&&(x.unshift(j),G=x.length,Y());for(var H=0,V=0;V<G;V++)H=Math.max(x[V].length,H);var X=u.x1+u.w/2,K=u.y1+u.h/2,Z=i.reduce((function(t,r){return n=r.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}),{w:-1===t.w?n.w:(t.w+n.w)/2,h:-1===t.h?n.h:(t.h+n.h)/2};var n}),{w:-1,h:-1}),Q=Math.max(1===G?0:c?(u.h-2*e.padding-Z.h)/(G-1):(u.h-2*e.padding-Z.h)/(G+1),D),J=x.reduce((function(t,e){return Math.max(t,e.length)}),0),tt=o((function(t){var r=fkt(t),n=r.depth,i=r.index;if(e.circle){var a=Math.min(u.w/2/G,u.h/2/G),s=(a=Math.max(a,D))*n+a-(G>0&&x[0].length<=3?a/2:0),o=2*Math.PI/x[n].length*i;return 0===n&&1===x[0].length&&(s=1),{x:X+s*Math.cos(o),y:K+s*Math.sin(o)}}var l=x[n].length,h=Math.max(1===l?0:c?(u.w-2*e.padding-Z.w)/((e.grid?J:l)-1):(u.w-2*e.padding-Z.w)/((e.grid?J:l)+1),D);return{x:X+(i+1-(l+1)/2)*h,y:K+(n+1-(G+1)/2)*Q}}),"getPosition");return n.nodes().layoutPositions(this,e,tt),this};var vkt={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:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function xkt(t){this.options=edt({},vkt,t)}o(xkt,"CircleLayout"),xkt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s,l=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.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;p<a.length;p++){var g=a[p].layoutDimensions(e),f=g.w,m=g.h;d=Math.max(d,f,m)}if(s=Mut(e.radius)?e.radius:a.length<=1?0:Math.min(l.h,l.w)/2-d,a.length>1&&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));s=Math.max(x,s)}var b=o((function(t,r){var n=e.startAngle+r*u*(i?1:-1),a=s*Math.cos(n),o=s*Math.sin(n);return{x:c+a,y:h+o}}),"getPos");return n.nodes().layoutPositions(this,e,b),this};var bkt,wkt={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:o((function(t){return t.degree()}),"concentric"),levelWidth:o((function(t){return t.maxDegree()/4}),"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function kkt(t){this.options=edt({},wkt,t)}o(kkt,"ConcentricLayout"),kkt.prototype.run=function(){for(var t=this.options,e=t,r=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o=s.x1+s.w/2,l=s.y1+s.h/2,c=[],h=0,u=0;u<a.length;u++){var d,p=a[u];d=e.concentric(p),c.push({value:d,node:p}),p._private.scratch.concentric=d}a.updateStyle();for(var g=0;g<a.length;g++){var f=a[g].layoutDimensions(e);h=Math.max(h,f.w,f.h)}c.sort((function(t,e){return e.value-t.value}));for(var m=e.levelWidth(a),y=[[]],v=y[0],x=0;x<c.length;x++){var b=c[x];if(v.length>0)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;E<y.length;E++){var C=y[E],S=void 0===e.sweep?2*Math.PI-2*Math.PI/C.length:e.sweep,A=C.dTheta=S/Math.max(1,C.length-1);if(C.length>1&&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 R=0,M=0,D=0;D<y.length;D++){var O=y[D].r-M;R=Math.max(R,O)}M=0;for(var P=0;P<y.length;P++){var B=y[P];0===P&&(M=B.r),B.r=M,M+=R}}for(var $={},F=0;F<y.length;F++)for(var z=y[F],U=z.dTheta,G=z.r,q=0;q<z.length;q++){var j=z[q],W=e.startAngle+(r?1:-1)*U*q,Y={x:o+G*Math.cos(W),y:l+G*Math.sin(W)};$[j.node.id()]=Y}return i.nodes().layoutPositions(this,e,(function(t){var e=t.id();return $[e]})),this};var Tkt={ready:o((function(){}),"ready"),stop:o((function(){}),"stop"),animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:o((function(t){return 2048}),"nodeRepulsion"),nodeOverlap:4,idealEdgeLength:o((function(t){return 32}),"idealEdgeLength"),edgeElasticity:o((function(t){return 32}),"edgeElasticity"),nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function _kt(t){this.options=edt({},Tkt,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges().filter((function(t){var r=t.source().data("id"),n=t.target().data("id"),i=e.some((function(t){return t.data("id")===r})),a=e.some((function(t){return t.data("id")===n}));return!i||!a}));this.options.eles=this.options.eles.not(r)}o(_kt,"CoseLayout"),_kt.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,!0!==t.animate&&!1!==t.animate||r.emit({type:"layoutstart",layout:r}),bkt=!0===t.debug;var n=Ekt(e,r,t);bkt&&undefined(n),t.randomize&&Akt(n);var i=ept(),a=o((function(){Nkt(n,e,t),!0===t.fit&&e.fit(t.padding)}),"refresh"),s=o((function(e){return!(r.stopped||e>=t.numIter)&&(Ikt(n,t),n.temperature=n.temperature*t.coolingFactor,!(n.temperature<t.minTemp))}),"mainLoop"),l=o((function(){if(!0===t.animate||!1===t.animate)a(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var e=t.eles.nodes(),i=Lkt(n,t,e);e.layoutPositions(r,t,i)}}),"done"),c=0,h=!0;if(!0===t.animate){var u=o((function e(){for(var r=0;h&&r<t.refresh;)h=s(c),c++,r++;h?(ept()-i>=t.animationThreshold&&a(),tpt(e)):(qkt(n,t),l())}),"frame");u()}else{for(;h;)h=s(c),c++;qkt(n,t),l()}return this},_kt.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},_kt.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ekt=o((function(t,e,r){for(var n=r.eles.edges(),i=r.eles.nodes(),a=_gt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:r.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},o=r.eles.components(),l={},c=0;c<o.length;c++)for(var h=o[c],u=0;u<h.length;u++){l[h[u].id()]=c}for(c=0;c<s.nodeSize;c++){var d=(y=i[c]).layoutDimensions(r);(M={}).isLocked=y.locked(),M.id=y.data("id"),M.parentId=y.data("parent"),M.cmptId=l[y.id()],M.children=[],M.positionX=y.position("x"),M.positionY=y.position("y"),M.offsetX=0,M.offsetY=0,M.height=d.w,M.width=d.h,M.maxX=M.positionX+M.width/2,M.minX=M.positionX-M.width/2,M.maxY=M.positionY+M.height/2,M.minY=M.positionY-M.height/2,M.padLeft=parseFloat(y.style("padding")),M.padRight=parseFloat(y.style("padding")),M.padTop=parseFloat(y.style("padding")),M.padBottom=parseFloat(y.style("padding")),M.nodeRepulsion=Lut(r.nodeRepulsion)?r.nodeRepulsion(y):r.nodeRepulsion,s.layoutNodes.push(M),s.idToIndex[M.id]=c}var p=[],g=0,f=-1,m=[];for(c=0;c<s.nodeSize;c++){var y,v=(y=s.layoutNodes[c]).parentId;null!=v?s.layoutNodes[s.idToIndex[v]].children.push(y.id):(p[++f]=y.id,m.push(y.id))}for(s.graphSet.push(m);g<=f;){var x=p[g++],b=s.idToIndex[x],w=s.layoutNodes[b].children;if(w.length>0){s.graphSet.push(w);for(c=0;c<w.length;c++)p[++f]=w[c]}}for(c=0;c<s.graphSet.length;c++){var k=s.graphSet[c];for(u=0;u<k.length;u++){var T=s.idToIndex[k[u]];s.indexToGraph[T]=c}}for(c=0;c<s.edgeSize;c++){var _=n[c],E={};E.id=_.data("id"),E.sourceId=_.data("source"),E.targetId=_.data("target");var C=Lut(r.idealEdgeLength)?r.idealEdgeLength(_):r.idealEdgeLength,S=Lut(r.edgeElasticity)?r.edgeElasticity(_):r.edgeElasticity,A=s.idToIndex[E.sourceId],L=s.idToIndex[E.targetId];if(s.indexToGraph[A]!=s.indexToGraph[L]){for(var N=Ckt(E.sourceId,E.targetId,s),I=s.graphSet[N],R=0,M=s.layoutNodes[A];-1===I.indexOf(M.id);)M=s.layoutNodes[s.idToIndex[M.parentId]],R++;for(M=s.layoutNodes[L];-1===I.indexOf(M.id);)M=s.layoutNodes[s.idToIndex[M.parentId]],R++;C*=R*r.nestingFactor}E.idealLength=C,E.elasticity=S,s.layoutEdges.push(E)}return s}),"createLayoutInfo"),Ckt=o((function(t,e,r){var n=Skt(t,e,0,r);return 2>n.count?0:n.graph}),"findLCA"),Skt=o((function t(e,r,n,i){var a=i.graphSet[n];if(-1<a.indexOf(e)&&-1<a.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<a.length;o++){var l=a[o],c=i.idToIndex[l],h=i.layoutNodes[c].children;if(0!==h.length){var u=t(e,r,i.indexToGraph[i.idToIndex[h[0]]],i);if(0!==u.count){if(1!==u.count)return u;if(2===++s)break}}}return{count:s,graph:n}}),"findLCA_aux"),Akt=o((function(t,e){for(var r=t.clientWidth,n=t.clientHeight,i=0;i<t.nodeSize;i++){var a=t.layoutNodes[i];0!==a.children.length||a.isLocked||(a.positionX=Math.random()*r,a.positionY=Math.random()*n)}}),"randomizePositions"),Lkt=o((function(t,e,r){var n=t.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return e.boundingBox&&(r.forEach((function(e){var r=t.layoutNodes[t.idToIndex[e.data("id")]];i.x1=Math.min(i.x1,r.positionX),i.x2=Math.max(i.x2,r.positionX),i.y1=Math.min(i.y1,r.positionY),i.y2=Math.max(i.y2,r.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(r,a){var s=t.layoutNodes[t.idToIndex[r.data("id")]];if(e.boundingBox){var o=(s.positionX-i.x1)/i.w,l=(s.positionY-i.y1)/i.h;return{x:n.x1+o*n.w,y:n.y1+l*n.h}}return{x:s.positionX,y:s.positionY}}}),"getScaleInBoundsFn"),Nkt=o((function(t,e,r){var n=r.layout,i=r.eles.nodes(),a=Lkt(t,r,i);i.positions(a),!0!==t.ready&&(t.ready=!0,n.one("layoutready",r.ready),n.emit({type:"layoutready",layout:this}))}),"refreshPositions"),Ikt=o((function(t,e,r){Rkt(t,e),Bkt(t),$kt(t,e),Fkt(t),zkt(t)}),"step"),Rkt=o((function(t,e){for(var r=0;r<t.graphSet.length;r++)for(var n=t.graphSet[r],i=n.length,a=0;a<i;a++)for(var s=t.layoutNodes[t.idToIndex[n[a]]],o=a+1;o<i;o++){var l=t.layoutNodes[t.idToIndex[n[o]]];Dkt(s,l,t,e)}}),"calculateNodeForces"),Mkt=o((function(t){return-t+2*t*Math.random()}),"randomDistance"),Dkt=o((function(t,e,r,n){if(t.cmptId===e.cmptId||r.isCompound){var i=e.positionX-t.positionX,a=e.positionY-t.positionY;0===i&&0===a&&(i=Mkt(1),a=Mkt(1));var s=Okt(t,e,i,a);if(s>0)var o=(c=n.nodeOverlap*s)*i/(f=Math.sqrt(i*i+a*a)),l=c*a/f;else{var c,h=Pkt(t,i,a),u=Pkt(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"),Okt=o((function(t,e,r,n){if(r>0)var i=t.maxX-e.minX;else i=e.maxX-t.minX;if(n>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"),Pkt=o((function(t,e,r){var n=t.positionX,i=t.positionY,a=t.height||1,s=t.width||1,o=r/e,l=a/s,c={};return 0===e&&0<r||0===e&&0>r?(c.x=n,c.y=i+a/2,c):0<e&&-1*l<=o&&o<=l?(c.x=n+s/2,c.y=i+s*r/2/e,c):0>e&&-1*l<=o&&o<=l?(c.x=n-s/2,c.y=i-s*r/2/e,c):0<r&&(o<=-1*l||o>=l)?(c.x=n+a*e/2/r,c.y=i+a/2,c):0>r&&(o<=-1*l||o>=l)?(c.x=n-a*e/2/r,c.y=i-a/2,c):c}),"findClippingPoint"),Bkt=o((function(t,e){for(var r=0;r<t.edgeSize;r++){var n=t.layoutEdges[r],i=t.idToIndex[n.sourceId],a=t.layoutNodes[i],s=t.idToIndex[n.targetId],o=t.layoutNodes[s],l=o.positionX-a.positionX,c=o.positionY-a.positionY;if(0!==l||0!==c){var h=Pkt(a,l,c),u=Pkt(o,-1*l,-1*c),d=u.x-h.x,p=u.y-h.y,g=Math.sqrt(d*d+p*p),f=Math.pow(n.idealLength-g,2)/n.elasticity;if(0!==g)var m=f*d/g,y=f*p/g;else m=0,y=0;a.isLocked||(a.offsetX+=m,a.offsetY+=y),o.isLocked||(o.offsetX-=m,o.offsetY-=y)}}}),"calculateEdgeForces"),$kt=o((function(t,e){if(0!==e.gravity)for(var r=0;r<t.graphSet.length;r++){var n=t.graphSet[r],i=n.length;if(0===r)var a=t.clientHeight/2,s=t.clientWidth/2;else{var o=t.layoutNodes[t.idToIndex[n[0]]],l=t.layoutNodes[t.idToIndex[o.parentId]];a=l.positionX,s=l.positionY}for(var c=0;c<i;c++){var h=t.layoutNodes[t.idToIndex[n[c]]];if(!h.isLocked){var u=a-h.positionX,d=s-h.positionY,p=Math.sqrt(u*u+d*d);if(p>1){var g=e.gravity*u/p,f=e.gravity*d/p;h.offsetX+=g,h.offsetY+=f}}}}}),"calculateGravityForces"),Fkt=o((function(t,e){var r=[],n=0,i=-1;for(r.push.apply(r,t.graphSet[0]),i+=t.graphSet[0].length;n<=i;){var a=r[n++],s=t.idToIndex[a],o=t.layoutNodes[s],l=o.children;if(0<l.length&&!o.isLocked){for(var c=o.offsetX,h=o.offsetY,u=0;u<l.length;u++){var d=t.layoutNodes[t.idToIndex[l[u]]];d.offsetX+=c,d.offsetY+=h,r[++i]=l[u]}o.offsetX=0,o.offsetY=0}}}),"propagateForces"),zkt=o((function(t,e){for(var r=0;r<t.nodeSize;r++){0<(i=t.layoutNodes[r]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(r=0;r<t.nodeSize;r++){if(!(0<(i=t.layoutNodes[r]).children.length||i.isLocked)){var n=Ukt(i.offsetX,i.offsetY,t.temperature);i.positionX+=n.x,i.positionY+=n.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Gkt(i,t)}}for(r=0;r<t.nodeSize;r++){var i;0<(i=t.layoutNodes[r]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}}),"updatePositions"),Ukt=o((function(t,e,r){var n=Math.sqrt(t*t+e*e);if(n>r)var i={x:r*t/n,y:r*e/n};else i={x:t,y:e};return i}),"limitForce"),Gkt=o((function t(e,r){var n=e.parentId;if(null!=n){var i=r.layoutNodes[r.idToIndex[n]],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.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(null==i.maxY||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(null==i.minY||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a?t(i,r):void 0}}),"updateAncestryBoundaries"),qkt=o((function(t,e){for(var r=t.layoutNodes,n=[],i=0;i<r.length;i++){var a=r[i],s=a.cmptId;(n[s]=n[s]||[]).push(a)}var o=0;for(i=0;i<n.length;i++){if(f=n[i]){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var l=0;l<f.length;l++){var c=f[l];f.x1=Math.min(f.x1,c.positionX-c.width/2),f.x2=Math.max(f.x2,c.positionX+c.width/2),f.y1=Math.min(f.y1,c.positionY-c.height/2),f.y2=Math.max(f.y2,c.positionY+c.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,o+=f.w*f.h}}n.sort((function(t,e){return e.w*e.h-t.w*t.h}));var h=0,u=0,d=0,p=0,g=Math.sqrt(o)*t.clientWidth/t.clientHeight;for(i=0;i<n.length;i++){var f;if(f=n[i]){for(l=0;l<f.length;l++){(c=f[l]).isLocked||(c.positionX+=h-f.x1,c.positionY+=u-f.y1)}h+=f.w+e.componentSpacing,d+=f.w+e.componentSpacing,p=Math.max(p,f.h),d>g&&(u+=p+e.componentSpacing,h=0,d=0,p=0)}}}),"separateComponents"),jkt={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:o((function(t){}),"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function Wkt(t){this.options=edt({},jkt,t)}o(Wkt,"GridLayout"),Wkt.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=_gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(0===a.h||0===a.w)n.nodes().layoutPositions(this,e,(function(t){return{x:a.x1,y:a.y1}}));else{var s=i.size(),l=Math.sqrt(s*a.h/a.w),c=Math.round(l),h=Math.round(a.w/a.h*l),u=o((function(t){if(null==t)return Math.min(c,h);Math.min(c,h)==c?c=t:h=t}),"small"),d=o((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(s/c);else if(null==p&&null!=g)h=g,c=Math.ceil(s/h);else if(h*c>s){var f=u(),m=d();(f-1)*m>=s?u(f-1):(m-1)*f>=s&&d(m-1)}else for(;h*c<s;){var y=u(),v=d();(v+1)*y>=s?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<i.length;w++){var k=i[w],T=k._private.position;null!=T.x&&null!=T.y||(T.x=0,T.y=0);var _=k.layoutDimensions(e),E=e.avoidOverlapPadding,C=_.w+E,S=_.h+E;x=Math.max(x,C),b=Math.max(b,S)}for(var A={},L=o((function(t,e){return!!A["c-"+t+"-"+e]}),"used"),N=o((function(t,e){A["c-"+t+"-"+e]=!0}),"use"),I=0,R=0,M=o((function(){++R>=h&&(R=0,I++)}),"moveToNextCell"),D={},O=0;O<i.length;O++){var P=i[O],B=e.position(P);if(B&&(void 0!==B.row||void 0!==B.col)){var $={row:B.row,col:B.col};if(void 0===$.col)for($.col=0;L($.row,$.col);)$.col++;else if(void 0===$.row)for($.row=0;L($.row,$.col);)$.row++;D[P.id()]=$,N($.row,$.col)}}var F=o((function(t,e){var r,n;if(t.locked()||t.isParent())return!1;var i=D[t.id()];if(i)r=i.col*x+x/2+a.x1,n=i.row*b+b/2+a.y1;else{for(;L(I,R);)M();r=R*x+x/2+a.x1,n=I*b+b/2+a.y1,N(I,R),M()}return{x:r,y:n}}),"getPos");i.layoutPositions(this,e,F)}return this};var Ykt={ready:o((function(){}),"ready"),stop:o((function(){}),"stop")};function Hkt(t){this.options=edt({},Ykt,t)}o(Hkt,"NullLayout"),Hkt.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions((function(){return{x:0,y:0}})),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},Hkt.prototype.stop=function(){return this};var Vkt={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function Xkt(t){this.options=edt({},Vkt,t)}o(Xkt,"PresetLayout"),Xkt.prototype.run=function(){var t=this.options,e=t.eles.nodes(),r=Lut(t.positions);function n(e){if(null==t.positions)return agt(e.position());if(r)return t.positions(e);var n=t.positions[e._private.data.id];return null==n?null:n}return o(n,"getPosition"),e.layoutPositions(this,t,(function(t,e){var r=n(t);return!t.locked()&&null!=r&&r})),this};var Kkt={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:o((function(t,e){return!0}),"animateFilter"),ready:void 0,stop:void 0,transform:o((function(t,e){return e}),"transform")};function Zkt(t){this.options=edt({},Kkt,t)}o(Zkt,"RandomLayout"),Zkt.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=_gt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=o((function(t,e){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}}),"getPos");return r.nodes().layoutPositions(this,t,i),this};var Qkt=[{name:"breadthfirst",impl:ykt},{name:"circle",impl:xkt},{name:"concentric",impl:kkt},{name:"cose",impl:_kt},{name:"grid",impl:Wkt},{name:"null",impl:Hkt},{name:"preset",impl:Xkt},{name:"random",impl:Zkt}];function Jkt(t){this.options=t,this.notifications=0}o(Jkt,"NullRenderer");var tTt=o((function(){}),"noop"),eTt=o((function(){throw new Error("A headless instance can not render images")}),"throwImgErr");Jkt.prototype={recalculateRenderedStyle:tTt,notify:o((function(){this.notifications++}),"notify"),init:tTt,isHeadless:o((function(){return!0}),"isHeadless"),png:eTt,jpg:eTt};var rTt,nTt,iTt={arrowShapeWidth:.3,registerArrowShapes:function(){var t=this.arrowShapes={},e=this,r=o((function(t,e,r,n,i,a,s){var o=i.x-r/2-s,l=i.x+r/2+s,c=i.y-r/2-s,h=i.y+r/2+s;return o<=t&&t<=l&&c<=e&&e<=h}),"bbCollide"),n=o((function(t,e,r,n,i){var a=t*Math.cos(n)-e*Math.sin(n),s=(t*Math.sin(n)+e*Math.cos(n))*r;return{x:a*r+i.x,y:s+i.y}}),"transform"),i=o((function(t,e,r,i){for(var a=[],s=0;s<t.length;s+=2){var o=t[s],l=t[s+1];a.push(n(o,l,e,r,i))}return a}),"transformPoints"),a=o((function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(n.x,n.y)}return e}),"pointsToArr"),s=o((function(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").pfValue*2}),"standardGap"),l=o((function(n,l){Aut(l)&&(l=t[l]),t[n]=edt({name:n,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:o((function(t,e,r,n,s,o){var l=a(i(this.points,r+2*o,n,s));return jgt(t,e,l)}),"collide"),roughCollide:r,draw:o((function(t,r,n,a){var s=i(this.points,r,n,a);e.arrowShapeImpl("polygon")(t,s)}),"draw"),spacing:o((function(t){return 0}),"spacing"),gap:s},l)}),"defineArrowShape");l("none",{collide:bpt,roughCollide:bpt,draw:kpt,spacing:wpt,gap:wpt}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:o((function(t,r,a,s,o){var l=i(this.points,r,a,s),c=this.controlPoint,h=n(c[0],c[1],r,a,s);e.arrowShapeImpl(this.name)(t,l,h)}),"draw"),gap:o((function(t){return.8*s(t)}),"gap")}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:o((function(t,e,r,n,s,o,l){var c=a(i(this.points,r+2*l,n,s)),h=a(i(this.pointsTee,r+2*l,n,s));return jgt(t,e,c)||jgt(t,e,h)}),"collide"),draw:o((function(t,r,n,a,s){var o=i(this.points,r,n,a),l=i(this.pointsTee,r,n,a);e.arrowShapeImpl(this.name)(t,o,l)}),"draw")}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:o((function(t,e,r,n,s,o,l){var c=s,h=Math.pow(c.x-t,2)+Math.pow(c.y-e,2)<=Math.pow((r+2*l)*this.radius,2),u=a(i(this.points,r+2*l,n,s));return jgt(t,e,u)||h}),"collide"),draw:o((function(t,r,n,a,s){var o=i(this.pointsTr,r,n,a);e.arrowShapeImpl(this.name)(t,o,a.x,a.y,this.radius*r)}),"draw"),spacing:o((function(t){return e.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.radius}),"spacing")}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:o((function(t,e){var r=this.baseCrossLinePts.slice(),n=e/t;return r[3]=r[3]-n,r[5]=r[5]-n,r}),"crossLinePts"),collide:o((function(t,e,r,n,s,o,l){var c=a(i(this.points,r+2*l,n,s)),h=a(i(this.crossLinePts(r,o),r+2*l,n,s));return jgt(t,e,c)||jgt(t,e,h)}),"collide"),draw:o((function(t,r,n,a,s){var o=i(this.points,r,n,a),l=i(this.crossLinePts(r,s),r,n,a);e.arrowShapeImpl(this.name)(t,o,l)}),"draw")}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:o((function(t){return.525*s(t)}),"gap")}),l("circle",{radius:.15,collide:o((function(t,e,r,n,i,a,s){var o=i;return Math.pow(o.x-t,2)+Math.pow(o.y-e,2)<=Math.pow((r+2*s)*this.radius,2)}),"collide"),draw:o((function(t,r,n,i,a){e.arrowShapeImpl(this.name)(t,i.x,i.y,this.radius*r)}),"draw"),spacing:o((function(t){return e.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.radius}),"spacing")}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:o((function(t){return 1}),"spacing"),gap:o((function(t){return 1}),"gap")}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:o((function(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}),"gap")}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:o((function(t){return.95*t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}),"gap")})}},aTt={projectIntoViewport:function(t,e){var r=this.cy,n=this.findContainerClientCoords(),i=n[0],a=n[1],s=n[4],o=r.pan(),l=r.zoom();return[((t-i)/s-o.x)/l,((e-a)/s-o.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=o((function(t){return parseFloat(r.getPropertyValue(t))}),"styleValue"),i=n("padding-left"),a=n("padding-right"),s=n("padding-top"),l=n("padding-bottom"),c=n("border-left-width"),h=n("border-right-width"),u=n("border-top-width"),d=(n("border-bottom-width"),t.clientWidth),p=t.clientHeight,g=i+a,f=s+l,m=c+h,y=e.width/(d+m),v=d-g,x=p-f,b=e.left+i+c,w=e.top+s+u;return this.containerBB=[b,w,v,x,y]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},findNearestElements:function(t,e,r,n){var i,a,s=this,l=this,c=l.getCachedZSortedEles(),h=[],u=l.cy.zoom(),d=l.cy.hasCompoundNodes(),p=(n?24:8)/u,g=(n?8:2)/u,f=(n?8:2)/u,m=1/0;function y(t,e){if(t.isNode()){if(a)return;a=t,h.push(t)}if(t.isEdge()&&(null==e||e<m))if(i){if(i.pstyle("z-compound-depth").value===t.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===t.pstyle("z-compound-depth").value)for(var r=0;r<h.length;r++)if(h[r].isEdge()){h[r]=t,i=t,m=null!=e?e:m;break}}else h.push(t),i=t,m=null!=e?e:m}function v(r){var n=r.outerWidth()+2*g,i=r.outerHeight()+2*g,a=n/2,o=i/2,c=r.position(),h="auto"===r.pstyle("corner-radius").value?"auto":r.pstyle("corner-radius").pfValue,u=r._private.rscratch;if(c.x-a<=t&&t<=c.x+a&&c.y-o<=e&&e<=c.y+o&&l.nodeShapes[s.getNodeShape(r)].checkPoint(t,e,0,n,i,c.x,c.y,h,u))return y(r,0),!0}function x(r){var n,i=r._private,a=i.rscratch,o=r.pstyle("width").pfValue,c=r.pstyle("arrow-scale").value,u=o/2+p,g=u*u,f=2*u,m=i.source,x=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var b=a.allpts,w=0;w+3<b.length;w+=2)if($gt(t,e,b[w],b[w+1],b[w+2],b[w+3],f)&&g>(n=qgt(t,e,b[w],b[w+1],b[w+2],b[w+3])))return y(r,n),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(b=a.allpts,w=0;w+5<a.allpts.length;w+=4)if(Fgt(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5],f)&&g>(n=Ggt(t,e,b[w],b[w+1],b[w+2],b[w+3],b[w+4],b[w+5])))return y(r,n),!0;m=m||i.source,x=x||i.target;var k=s.getArrowWidth(o,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;w<T.length;w++){var _=T[w],E=l.arrowShapes[r.pstyle(_.name+"-arrow-shape").value],C=r.pstyle("width").pfValue;if(E.roughCollide(t,e,k,_.angle,{x:_.x,y:_.y},C,p)&&E.collide(t,e,k,_.angle,{x:_.x,y:_.y},C,p))return y(r),!0}d&&h.length>0&&(v(m),v(x))}function b(t,e,r){return Ppt(t,e,r)}function w(r,n){var i,a=r._private,s=f;i=n?n+"-":"",r.boundingBox();var l=a.labelBounds[n||"main"],c=r.pstyle(i+"label").value;if("yes"===r.pstyle("text-events").strValue&&c){var h=b(a.rscratch,"labelX",n),u=b(a.rscratch,"labelY",n),d=b(a.rscratch,"labelAngle",n),p=r.pstyle(i+"text-margin-x").pfValue,g=r.pstyle(i+"text-margin-y").pfValue,m=l.x1-s-p,v=l.x2+s-p,x=l.y1-s-g,w=l.y2+s-g;if(d){var k=Math.cos(d),T=Math.sin(d),_=o((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(jgt(t,e,L))return y(r),!0}else if(Dgt(l,t,e))return y(r),!0}}r&&(c=c.interactive),o(y,"addEle"),o(v,"checkNode"),o(x,"checkEdge"),o(b,"preprop"),o(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,r,n){for(var i=this.getCachedZSortedEles().interactive,a=[],s=Math.min(t,r),o=Math.max(t,r),l=Math.min(e,n),c=Math.max(e,n),h=_gt({x1:t=s,y1:e=l,x2:r=o,y2:n=c}),u=0;u<i.length;u++){var d=i[u];if(d.isNode()){var p=d,g=p.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Mgt(h,g)&&!Pgt(g,h)&&a.push(p)}else{var f=d,m=f._private,y=m.rscratch;if(null!=y.startX&&null!=y.startY&&!Dgt(h,y.startX,y.startY))continue;if(null!=y.endX&&null!=y.endY&&!Dgt(h,y.endX,y.endY))continue;if("bezier"===y.edgeType||"multibezier"===y.edgeType||"self"===y.edgeType||"compound"===y.edgeType||"segments"===y.edgeType||"haystack"===y.edgeType){for(var v=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,x=!0,b=0;b<v.length;b++)if(!Ogt(h,v[b])){x=!1;break}x&&a.push(f)}else"haystack"!==y.edgeType&&"straight"!==y.edgeType||a.push(f)}}return a}},sTt={};sTt.calculateArrowAngles=function(t){var e,r,n,i,a,s,o=t._private.rscratch,l="haystack"===o.edgeType,c="bezier"===o.edgeType,h="multibezier"===o.edgeType,u="segments"===o.edgeType,d="compound"===o.edgeType,p="self"===o.edgeType;if(l?(n=o.haystackPts[0],i=o.haystackPts[1],a=o.haystackPts[2],s=o.haystackPts[3]):(n=o.arrowStartX,i=o.arrowStartY,a=o.arrowEndX,s=o.arrowEndY),f=o.midX,m=o.midY,u)e=n-o.segpts[0],r=i-o.segpts[1];else if(h||d||p||c){var g=o.allpts;e=n-bgt(g[0],g[2],g[4],.1),r=i-bgt(g[1],g[3],g[5],.1)}else e=n-f,r=i-m;o.srcArrowAngle=ggt(e,r);var f=o.midX,m=o.midY;if(l&&(f=(n+a)/2,m=(i+s)/2),e=a-n,r=s-i,u)if((g=o.allpts).length/2%2==0){var y=(E=g.length/2)-2;e=g[E]-g[y],r=g[E+1]-g[y+1]}else if(o.isRound)e=o.midVector[1],r=-o.midVector[0];else{y=(E=g.length/2-1)-2;e=g[E]-g[y],r=g[E+1]-g[y+1]}else if(h||d||p){var v,x,b,w,g=o.allpts;if(o.ctrlpts.length/2%2==0){var k=(T=(_=g.length/2-1)+2)+2;v=bgt(g[_],g[T],g[k],0),x=bgt(g[_+1],g[T+1],g[k+1],0),b=bgt(g[_],g[T],g[k],1e-4),w=bgt(g[_+1],g[T+1],g[k+1],1e-4)}else{var T,_;k=(T=g.length/2-1)+2;v=bgt(g[_=T-2],g[T],g[k],.4999),x=bgt(g[_+1],g[T+1],g[k+1],.4999),b=bgt(g[_],g[T],g[k],.5),w=bgt(g[_+1],g[T+1],g[k+1],.5)}e=b-v,r=w-x}if(o.midtgtArrowAngle=ggt(e,r),o.midDispX=e,o.midDispY=r,e*=-1,r*=-1,u)if((g=o.allpts).length/2%2==0);else if(!o.isRound){var E,C=(E=g.length/2-1)+2;e=-(g[C]-g[E]),r=-(g[C+1]-g[E+1])}if(o.midsrcArrowAngle=ggt(e,r),u)e=a-o.segpts[o.segpts.length-2],r=s-o.segpts[o.segpts.length-1];else if(h||d||p||c){var S=(g=o.allpts).length;e=a-bgt(g[S-6],g[S-4],g[S-2],.9),r=s-bgt(g[S-5],g[S-3],g[S-1],.9)}else e=a-f,r=s-m;o.tgtArrowAngle=ggt(e,r)},sTt.getArrowWidth=sTt.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(13.37*t,.9),29)*e,r[t+", "+e]=n,n)};var oTt,lTt,cTt,hTt,uTt,dTt,pTt,gTt,fTt,mTt,yTt,vTt,xTt,bTt,wTt,kTt={},TTt={},_Tt=o((function(t,e,r){r.x=e.x-t.x,r.y=e.y-t.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)}),"asVec"),ETt=o((function(t,e){e.x=-1*t.x,e.y=-1*t.y,e.nx=-1*t.nx,e.ny=-1*t.ny,e.ang=t.ang>0?-(Math.PI-t.ang):Math.PI+t.ang}),"invertVec"),CTt=o((function(t,e,r,n,i){if(t!==wTt?_Tt(e,t,kTt):ETt(TTt,kTt),_Tt(e,r,TTt),oTt=kTt.nx*TTt.ny-kTt.ny*TTt.nx,lTt=kTt.nx*TTt.nx-kTt.ny*-TTt.ny,uTt=Math.asin(Math.max(-1,Math.min(1,oTt))),Math.abs(uTt)<1e-6)return rTt=e.x,nTt=e.y,void(pTt=fTt=0);cTt=1,hTt=!1,lTt<0?uTt<0?uTt=Math.PI+uTt:(uTt=Math.PI-uTt,cTt=-1,hTt=!0):uTt>0&&(cTt=-1,hTt=!0),fTt=void 0!==e.radius?e.radius:n,dTt=uTt/2,mTt=Math.min(kTt.len/2,TTt.len/2),i?(gTt=Math.abs(Math.cos(dTt)*fTt/Math.sin(dTt)))>mTt?(gTt=mTt,pTt=Math.abs(gTt*Math.sin(dTt)/Math.cos(dTt))):pTt=fTt:(gTt=Math.min(mTt,fTt),pTt=Math.abs(gTt*Math.sin(dTt)/Math.cos(dTt))),xTt=e.x+TTt.nx*gTt,bTt=e.y+TTt.ny*gTt,rTt=xTt-TTt.ny*pTt*cTt,nTt=bTt+TTt.nx*pTt*cTt,yTt=e.x+kTt.nx*gTt,vTt=e.y+kTt.ny*gTt,wTt=e}),"calcCornerArc");function STt(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 ATt(t,e,r,n){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];return 0===n||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}:(CTt(t,e,r,n,i),{cx:rTt,cy:nTt,radius:pTt,startX:yTt,startY:vTt,stopX:xTt,stopY:bTt,startAngle:kTt.ang+Math.PI/2*cTt,endAngle:TTt.ang-Math.PI/2*cTt,counterClockwise:hTt})}o(STt,"drawPreparedRoundCorner"),o(ATt,"getRoundCorner");var LTt={};function NTt(t){var e=[];if(null!=t){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];e.push({x:n,y:i})}return e}}LTt.findMidptPtsEtc=function(t,e){var r,n=e.posPts,i=e.intersectionPts,a=e.vectorNormInverse,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=null!=s.units&&null!=l.units,h=o((function(t,e,r,n){var i=n-e,a=r-t,s=Math.sqrt(a*a+i*i);return{x:-i/s,y:a/s}}),"recalcVectorNormInverse");switch(t.pstyle("edge-distances").value){case"node-position":r=n;break;case"intersection":r=i;break;case"endpoints":if(c){var u=hut(this.manualEndptToPx(t.source()[0],s),2),d=u[0],p=u[1],g=hut(this.manualEndptToPx(t.target()[0],l),2),f=g[0],m=g[1],y={x1:d,y1:p,x2:f,y2:m};a=h(d,p,f,m),r=y}else Ept("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),r=i}return{midptPts:r,vectorNormInverse:a}},LTt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,i=n.rscratch;if(!i.haystack){var a=2*Math.random()*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=2*Math.random()*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,o=n.target,l=s.position(),c=o.position(),h=s.width(),u=o.width(),d=s.height(),p=o.height(),g=r.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*h*g+l.x,i.source.y*d*g+l.y,i.target.x*u*g+c.x,i.target.y*p*g+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},LTt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),a=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var h=0;h<o;h++){var u=n.pfValue[h],d=i.pfValue[h],p=1-u,g=u,f=this.findMidptPtsEtc(t,e),m=f.midptPts,y=f.vectorNormInverse,v={x:m.x1*p+m.x2*g,y:m.y1*p+m.y2*g};r.segpts.push(v.x+y.x*d,v.y+y.y*d),r.radii.push(void 0!==a.pfValue[h]?a.pfValue[h]:l),r.isArcRadius.push("arc-radius"===(void 0!==s.pfValue[h]?s.pfValue[h]:c))}},LTt.findLoopPoints=function(t,e,r,n){var i=t._private.rscratch,a=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,u=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var d=r,p=u;n&&(d=0,p=l);var g=c-Math.PI/2,f=g-h/2,m=g+h/2,y=String(c+"_"+h);d=void 0===a[y]?a[y]=0:++a[y],i.ctrlpts=[s.x+1.4*Math.cos(f)*p*(d/3+1),s.y+1.4*Math.sin(f)*p*(d/3+1),s.x+1.4*Math.cos(m)*p*(d/3+1),s.y+1.4*Math.sin(m)*p*(d/3+1)]},LTt.findCompoundLoopPoints=function(t,e,r,n){var i=t._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,c=e.tgtW,h=e.tgtH,u=t.pstyle("control-point-step-size").pfValue,d=t.pstyle("control-point-distances"),p=d?d.pfValue[0]:void 0,g=r,f=u;n&&(g=0,f=p);var m={x:a.x-o/2,y:a.y-l/2},y={x:s.x-c/2,y:s.y-h/2},v={x:Math.min(m.x,y.x),y:Math.min(m.y,y.y)},x=Math.max(.5,Math.log(.01*o)),b=Math.max(.5,Math.log(.01*c));i.ctrlpts=[v.x,v.y-(1+Math.pow(50,1.12)/100)*f*(g/3+1)*x,v.x-(1+Math.pow(50,1.12)/100)*f*(g/3+1)*b,v.y]},LTt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},LTt.findBezierPoints=function(t,e,r,n,i){var a=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),c=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,u=l.value[0],d=n;a.edgeType=d?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<c;p++){var g=(.5-e.eles.length/2+r)*s*(i?-1:1),f=void 0,m=mgt(g);d&&(h=o?o.pfValue[p]:s,u=l.value[p]);var y=void 0!==(f=n?h:void 0!==h?m*h:void 0)?f:g,v=1-u,x=u,b=this.findMidptPtsEtc(t,e),w=b.midptPts,k=b.vectorNormInverse,T={x:w.x1*v+w.x2*x,y:w.y1*v+w.y2*x};a.ctrlpts.push(T.x+k.x*y,T.y+k.y*y)}},LTt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",l="downward",c="upward",h=e.posPts,u=e.srcW,d=e.srcH,p=e.tgtW,g=e.tgtH,f="node-position"!==t.pstyle("edge-distances").value,m=t.pstyle("taxi-direction").value,y=m,v=t.pstyle("taxi-turn"),x="%"===v.units,b=v.pfValue,w=b<0,k=t.pstyle("taxi-turn-min-distance").pfValue,T=f?(u+p)/2:0,_=f?(d+g)/2:0,E=h.x2-h.x1,C=h.y2-h.y1,S=o((function(t,e){return t>0?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:n:y===c||y===l?(m=n,N=!0):y!==a&&y!==s||(m=i,N=!0);var I,R=m===n,M=R?L:A,D=R?C:E,O=mgt(D),P=!1;(N&&(x||w)||!(y===l&&D<0||y===c&&D>0||y===a&&D>0||y===s&&D<0)||(M=(O*=-1)*Math.abs(M),P=!0),x)?I=(b<0?1+b:b)*M:I=(b<0?M:0)+b*O;var B=o((function(t){return Math.abs(t)<k||Math.abs(t)>=Math.abs(M)}),"getIsTooClose"),$=B(I),F=B(Math.abs(M)-Math.abs(I));if(($||F)&&!P)if(R){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;r.segpts=[G,q,G,j]}else if(U){var W=(h.y1+h.y2)/2,Y=h.x1,H=h.x2;r.segpts=[Y,W,H,W]}else r.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;r.segpts=[Z,K,Q,K]}else if(X){var J=(h.x1+h.x2)/2,tt=h.y1,et=h.y2;r.segpts=[J,tt,J,et]}else r.segpts=[h.x2,h.y1]}else if(R){var rt=h.y1+I+(f?d/2*O:0),nt=h.x1,it=h.x2;r.segpts=[nt,rt,it,rt]}else{var at=h.x1+I+(f?u/2*O:0),st=h.y1,ot=h.y2;r.segpts=[at,st,at,ot]}if(r.isRound){var lt=t.pstyle("taxi-radius").value,ct="arc-radius"===t.pstyle("radius-type").value[0];r.radii=new Array(r.segpts.length/2).fill(lt),r.isArcRadius=new Array(r.segpts.length/2).fill(ct)}},LTt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if("bezier"===r.edgeType){var n=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=!Mut(r.startX)||!Mut(r.startY),m=!Mut(r.arrowStartX)||!Mut(r.arrowStartY),y=!Mut(r.endX)||!Mut(r.endY),v=!Mut(r.arrowEndX)||!Mut(r.arrowEndY),x=3*(this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth),b=ygt({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),w=b<x,k=ygt({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),T=k<x,_=!1;if(f||m||w){_=!0;var E={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},C=Math.sqrt(E.x*E.x+E.y*E.y),S={x:E.x/C,y:E.y/C},A=Math.max(a,s),L={x:r.ctrlpts[0]+2*S.x*A,y:r.ctrlpts[1]+2*S.y*A},N=c.intersectLine(n.x,n.y,a,s,L.x,L.y,0,u,p);w?(r.ctrlpts[0]=r.ctrlpts[0]+S.x*(x-b),r.ctrlpts[1]=r.ctrlpts[1]+S.y*(x-b)):(r.ctrlpts[0]=N[0]+S.x*x,r.ctrlpts[1]=N[1]+S.y*x)}if(y||v||T){_=!0;var I={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},R=Math.sqrt(I.x*I.x+I.y*I.y),M={x:I.x/R,y:I.y/R},D=Math.max(a,s),O={x:r.ctrlpts[0]+2*M.x*D,y:r.ctrlpts[1]+2*M.y*D},P=h.intersectLine(i.x,i.y,o,l,O.x,O.y,0,d,g);T?(r.ctrlpts[0]=r.ctrlpts[0]+M.x*(x-k),r.ctrlpts[1]=r.ctrlpts[1]+M.y*(x-k)):(r.ctrlpts[0]=P[0]+M.x*x,r.ctrlpts[1]=P[1]+M.y*x)}_&&this.findEndpoints(t)}},LTt.storeAllpts=function(t){var e=t._private.rscratch;if("multibezier"===e.edgeType||"bezier"===e.edgeType||"self"===e.edgeType||"compound"===e.edgeType){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);var n;e.allpts.push(e.endX,e.endY),e.ctrlpts.length/2%2==0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,.5,e.midX=bgt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],.5),e.midY=bgt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],.5))}else if("straight"===e.edgeType)e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if("segments"===e.edgeType){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var a=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(ATt({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:a},{x:e.allpts[i+2],y:e.allpts[i+3]},a,s))}}if(e.segpts.length%4==0){var o=e.segpts.length/2,l=o-2;e.midX=(e.segpts[l]+e.segpts[o])/2,e.midY=(e.segpts[l+1]+e.segpts[o+1])/2}else{var c=e.segpts.length/2-1;if(e.isRound){var h={x:e.segpts[c],y:e.segpts[c+1]},u=e.roundCorners[c/2],d=[h.x-u.cx,h.y-u.cy],p=u.radius/Math.sqrt(Math.pow(d[0],2)+Math.pow(d[1],2));d=d.map((function(t){return t*p})),e.midX=u.cx+d[0],e.midY=u.cy+d[1],e.midVector=d}else e.midX=e.segpts[c],e.midY=e.segpts[c+1]}}},LTt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Mut(e.startX)&&Mut(e.startY)&&Mut(e.endX)&&Mut(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ept("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},LTt.findEdgeControlPoints=function(t){var e=this;if(t&&0!==t.length){for(var r=this,n=r.cy.hasCompoundNodes(),i={map:new $pt,get:o((function(t){var e=this.map.get(t[0]);return null!=e?e.get(t[1]):null}),"get"),set:o((function(t,e){var r=this.map.get(t[0]);null==r&&(r=new $pt,this.map.set(t[0],r)),r.set(t[1],e)}),"set")},a=[],s=[],l=0;l<t.length;l++){var c=t[l],h=c._private,u=c.pstyle("curve-style").value;if(!c.removed()&&c.takesUpSpace())if("haystack"!==u){var d="unbundled-bezier"===u||u.endsWith("segments")||"straight"===u||"straight-triangle"===u||u.endsWith("taxi"),p="unbundled-bezier"===u||"bezier"===u,g=h.source,f=h.target,m=[g.poolIndex(),f.poolIndex()].sort(),y=i.get(m);null==y&&(y={eles:[]},i.set(m,y),a.push(m)),y.eles.push(c),d&&(y.hasUnbundled=!0),p&&(y.hasBezier=!0)}else s.push(c)}for(var v=o((function(t){var s=a[t],o=i.get(s),l=void 0;if(!o.hasUnbundled){var c=o.eles[0].parallelEdges().filter((function(t){return t.isBundledBezier()}));Dpt(o.eles),c.forEach((function(t){return o.eles.push(t)})),o.eles.sort((function(t,e){return t.poolIndex()-e.poolIndex()}))}var h=o.eles[0],u=h.source(),d=h.target();if(u.poolIndex()>d.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=r.nodeShapes[e.getNodeShape(u)],w=o.tgtShape=r.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;C<o.eles.length;C++){var S=o.eles[C],A=S[0]._private.rscratch,L=S.pstyle("curve-style").value,N="unbundled-bezier"===L||L.endsWith("segments")||L.endsWith("taxi"),I=!u.same(S.source());if(!o.calculatedIntersection&&u!==d&&(o.hasBezier||o.hasUnbundled)){o.calculatedIntersection=!0;var R=b.intersectLine(g.x,g.y,m,y,f.x,f.y,0,k,E),M=o.srcIntn=R,D=w.intersectLine(f.x,f.y,v,x,g.x,g.y,0,T,_),O=o.tgtIntn=D,P=o.intersectionPts={x1:R[0],x2:D[0],y1:R[1],y2:D[1]},B=o.posPts={x1:g.x,x2:f.x,y1:g.y,y2:f.y},$=D[1]-R[1],F=D[0]-R[0],z=Math.sqrt(F*F+$*$),U=o.vector={x:F,y:$},G=o.vectorNorm={x:U.x/z,y:U.y/z},q={x:-G.y,y:G.x};o.nodesOverlap=!Mut(z)||w.checkPoint(R[0],R[1],0,v,x,f.x,f.y,T,_)||b.checkPoint(D[0],D[1],0,m,y,g.x,g.y,k,E),o.vectorNormInverse=q,l={nodesOverlap:o.nodesOverlap,dirCounts:o.dirCounts,calculatedIntersection:!0,hasBezier:o.hasBezier,hasUnbundled:o.hasUnbundled,eles:o.eles,srcPos:f,srcRs:_,tgtPos:g,tgtRs:E,srcW:v,srcH:x,tgtW:m,tgtH:y,srcIntn:O,tgtIntn:M,srcShape:w,tgtShape:b,posPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},intersectionPts:{x1:P.x2,y1:P.y2,x2:P.x1,y2:P.y1},vector:{x:-U.x,y:-U.y},vectorNorm:{x:-G.x,y:-G.y},vectorNormInverse:{x:-q.x,y:-q.y}}}var j=I?l:o;A.nodesOverlap=j.nodesOverlap,A.srcIntn=j.srcIntn,A.tgtIntn=j.tgtIntn,A.isRound=L.startsWith("round"),n&&(u.isParent()||u.isChild()||d.isParent()||d.isChild())&&(u.parents().anySame(d)||d.parents().anySame(u)||u.same(d)&&u.isParent())?e.findCompoundLoopPoints(S,j,C,N):u===d?e.findLoopPoints(S,j,C,N):L.endsWith("segments")?e.findSegmentsPoints(S,j):L.endsWith("taxi")?e.findTaxiPoints(S,j):"straight"===L||!N&&o.eles.length%2==1&&C===Math.floor(o.eles.length/2)?e.findStraightEdgePoints(S):e.findBezierPoints(S,j,C,N,I),e.findEndpoints(S),e.tryToCorrectInvalidPoints(S,j),e.checkForInvalidEdgeWarning(S),e.storeAllpts(S),e.storeEdgeProjections(S),e.calculateArrowAngles(S),e.recalculateEdgeLabelProjections(S),e.calculateLabelAngles(S)}}),"_loop"),x=0;x<a.length;x++)v(x);this.findHaystackPoints(s)}},o(NTt,"getPts"),LTt.getSegmentPoints=function(t){var e=t[0]._private.rscratch;if(this.recalculateRenderedStyle(t),"segments"===e.edgeType)return NTt(e.segpts)},LTt.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if("bezier"===r||"multibezier"===r||"self"===r||"compound"===r)return NTt(e.ctrlpts)},LTt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var ITt={manualEndptToPx:function(t,e){var r=t.position(),n=t.outerWidth(),i=t.outerHeight(),a=t._private.rscratch;if(2===e.value.length){var s=[e.pfValue[0],e.pfValue[1]];return"%"===e.units[0]&&(s[0]=s[0]*n),"%"===e.units[1]&&(s[1]=s[1]*i),s[0]+=r.x,s[1]+=r.y,s}var o=e.pfValue[0];o=-Math.PI/2+o;var l=2*Math.max(n,i),c=[r.x+Math.cos(o)*l,r.y+Math.sin(o)*l];return this.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,n,i,c[0],c[1],0,"auto"===t.pstyle("corner-radius").value?"auto":t.pstyle("corner-radius").pfValue,a)},findEndpoints:function(t){var e,r,n,i,a,s=this,o=t.source()[0],l=t.target()[0],c=o.position(),h=l.position(),u=t.pstyle("target-arrow-shape").value,d=t.pstyle("source-arrow-shape").value,p=t.pstyle("target-distance-from-node").pfValue,g=t.pstyle("source-distance-from-node").pfValue,f=o._private.rscratch,m=l._private.rscratch,y=t.pstyle("curve-style").value,v=t._private.rscratch,x=v.edgeType,b="self"===x||"compound"===x,w="bezier"===x||"multibezier"===x||b,k="bezier"!==x,T="straight"===x||"segments"===x,_="segments"===x,E=w||k||T,C=b||"taxi"===y,S=t.pstyle("source-endpoint"),A=C?"outside-to-node":S.value,L="auto"===o.pstyle("corner-radius").value?"auto":o.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),I=C?"outside-to-node":N.value,R="auto"===l.pstyle("corner-radius").value?"auto":l.pstyle("corner-radius").pfValue;if(v.srcManEndpt=S,v.tgtManEndpt=N,w){var M=[v.ctrlpts[0],v.ctrlpts[1]];r=k?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:M,n=M}else if(T){var D=_?v.segpts.slice(0,2):[h.x,h.y];r=_?v.segpts.slice(v.segpts.length-2):[c.x,c.y],n=D}if("inside-to-node"===I)e=[h.x,h.y];else if(N.units)e=this.manualEndptToPx(l,N);else if("outside-to-line"===I)e=v.tgtIntn;else if("outside-to-node"===I||"outside-to-node-or-label"===I?i=r:"outside-to-line"!==I&&"outside-to-line-or-label"!==I||(i=[c.x,c.y]),e=s.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),i[0],i[1],0,R,m),"outside-to-node-or-label"===I||"outside-to-line-or-label"===I){var O=l._private.rscratch,P=O.labelWidth,B=O.labelHeight,$=O.labelX,F=O.labelY,z=P/2,U=B/2,G=l.pstyle("text-valign").value;"top"===G?F-=U:"bottom"===G&&(F+=U);var q=l.pstyle("text-halign").value;"left"===q?$-=z:"right"===q&&($+=z);var j=tft(i[0],i[1],[$-z,F-U,$+z,F-U,$+z,F+U,$-z,F+U],h.x,h.y);if(j.length>0){var W=c,Y=vgt(W,lgt(e)),H=vgt(W,lgt(j)),V=Y;if(H<Y&&(e=j,V=H),j.length>2)vgt(W,{x:j[2],y:j[3]})<V&&(e=[j[2],j[3]])}}var X=rft(e,r,s.arrowShapes[u].spacing(t)+p),K=rft(e,r,s.arrowShapes[u].gap(t)+p);if(v.endX=K[0],v.endY=K[1],v.arrowEndX=X[0],v.arrowEndY=X[1],"inside-to-node"===A)e=[c.x,c.y];else if(S.units)e=this.manualEndptToPx(o,S);else if("outside-to-line"===A)e=v.srcIntn;else if("outside-to-node"===A||"outside-to-node-or-label"===A?a=n:"outside-to-line"!==A&&"outside-to-line-or-label"!==A||(a=[h.x,h.y]),e=s.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),a[0],a[1],0,L,f),"outside-to-node-or-label"===A||"outside-to-line-or-label"===A){var Z=o._private.rscratch,Q=Z.labelWidth,J=Z.labelHeight,tt=Z.labelX,et=Z.labelY,rt=Q/2,nt=J/2,it=o.pstyle("text-valign").value;"top"===it?et-=nt:"bottom"===it&&(et+=nt);var at=o.pstyle("text-halign").value;"left"===at?tt-=rt:"right"===at&&(tt+=rt);var st=tft(a[0],a[1],[tt-rt,et-nt,tt+rt,et-nt,tt+rt,et+nt,tt-rt,et+nt],c.x,c.y);if(st.length>0){var ot=h,lt=vgt(ot,lgt(e)),ct=vgt(ot,lgt(st)),ht=lt;if(ct<lt&&(e=[st[0],st[1]],ht=ct),st.length>2)vgt(ot,{x:st[2],y:st[3]})<ht&&(e=[st[2],st[3]])}}var ut=rft(e,n,s.arrowShapes[d].spacing(t)+g),dt=rft(e,n,s.arrowShapes[d].gap(t)+g);v.startX=dt[0],v.startY=dt[1],v.arrowStartX=ut[0],v.arrowStartY=ut[1],E&&(Mut(v.startX)&&Mut(v.startY)&&Mut(v.endX)&&Mut(v.endY)?v.badLine=!1:v.badLine=!0)},getSourceEndpoint:function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),"haystack"===e.edgeType?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}},getTargetEndpoint:function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),"haystack"===e.edgeType?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}}},RTt={};function MTt(t,e,r){for(var n=o((function(t,e,r,n){return bgt(t,e,r,n)}),"qbezierAt$1"),i=e._private.rstyle.bezierPts,a=0;a<t.bezierProjPcts.length;a++){var s=t.bezierProjPcts[a];i.push({x:n(r[0],r[2],r[4],s),y:n(r[1],r[3],r[5],s)})}}o(MTt,"pushBezierPts"),RTt.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,"multibezier"===n||"bezier"===n||"self"===n||"compound"===n){e.rstyle.bezierPts=[];for(var i=0;i+5<r.allpts.length;i+=4)MTt(this,t,r.allpts.slice(i,i+6))}else if("segments"===n){var a=e.rstyle.linePts=[];for(i=0;i+1<r.allpts.length;i+=2)a.push({x:r.allpts[i],y:r.allpts[i+1]})}else if("haystack"===n){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},RTt.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var DTt={recalculateNodeLabelProjection:function(t){var e=t.pstyle("label").strValue;if(!Gut(e)){var r,n,i=t._private,a=t.width(),s=t.height(),o=t.padding(),l=t.position(),c=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,u=i.rscratch,d=i.rstyle;switch(c){case"left":r=l.x-a/2-o;break;case"right":r=l.x+a/2+o;break;default:r=l.x}switch(h){case"top":n=l.y-s/2-o;break;case"bottom":n=l.y+s/2+o;break;default:n=l.y}u.labelX=r,u.labelY=n,d.labelX=r,d.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}}},OTt=o((function(t,e){var r=Math.atan(e/t);return 0===t&&r<0&&(r*=-1),r}),"lineAngleFromDelta"),PTt=o((function(t,e){var r=e.x-t.x,n=e.y-t.y;return OTt(r,n)}),"lineAngle"),BTt=o((function(t,e,r,n){var i=Tgt(0,n-.001,1),a=Tgt(0,n+.001,1),s=wgt(t,e,r,i),o=wgt(t,e,r,a);return PTt(s,o)}),"bezierAngle");DTt.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,i=this,a={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(a.mid||a.source||a.target){e={x:n.midX,y:n.midY};var s=o((function(t,e,n){Bpt(r.rscratch,t,e,n),Bpt(r.rstyle,t,e,n)}),"setRs");s("labelX",null,e.x),s("labelY",null,e.y);var l=OTt(n.midDispX,n.midDispY);s("labelAutoAngle",null,l);var c=o((function t(){if(t.cache)return t.cache;for(var e=[],a=0;a+5<n.allpts.length;a+=4){var s={x:n.allpts[a],y:n.allpts[a+1]},l={x:n.allpts[a+2],y:n.allpts[a+3]},c={x:n.allpts[a+4],y:n.allpts[a+5]};e.push({p0:s,p1:l,p2:c,startDist:0,length:0,segments:[]})}var h=r.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(t,e,r,n,i){var a=ygt(e,r),s=t.segments[t.segments.length-1],o={p0:e,p1:r,t0:n,t1:i,startDist:s?s.startDist+s.length:0,length:a};t.segments.push(o),t.length+=a}o(d,"addSegment");for(var p=0;p<e.length;p++){var g=e[p],f=e[p-1];f&&(g.startDist=f.startDist+f.length),d(g,g.p0,h[p*u],0,i.bezierProjPcts[0]);for(var m=0;m<u-1;m++)d(g,h[p*u+m],h[p*u+m+1],i.bezierProjPcts[m],i.bezierProjPcts[m+1]);d(g,h[p*u+u-1],g.p2,i.bezierProjPcts[u-1],1)}return t.cache=e}),"createControlPointInfo"),h=o((function(r){var i,o="source"===r;if(a[r]){var l=t.pstyle(r+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var h,u=c(),d=0,p=0,g=0;g<u.length;g++){for(var f=u[o?g:u.length-1-g],m=0;m<f.segments.length;m++){var y=f.segments[o?m:f.segments.length-1-m],v=g===u.length-1&&m===f.segments.length-1;if(d=p,(p+=y.length)>=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=o?b.t0+k*w:b.t1-k*w;T=Tgt(0,T,1),e=wgt(x.p0,x.p1,x.p2,T),i=BTt(x.p0,x.p1,x.p2,T);break;case"straight":case"segments":case"haystack":for(var _,E,C,S,A=0,L=n.allpts.length,N=0;N+3<L&&(o?(C={x:n.allpts[N],y:n.allpts[N+1]},S={x:n.allpts[N+2],y:n.allpts[N+3]}):(C={x:n.allpts[L-2-N],y:n.allpts[L-1-N]},S={x:n.allpts[L-4-N],y:n.allpts[L-3-N]}),E=A,!((A+=_=ygt(C,S))>=l));N+=2);var I=(l-E)/_;I=Tgt(0,I,1),e=kgt(C,S,I),i=PTt(C,S)}s("labelX",r,e.x),s("labelY",r,e.y),s("labelAutoAngle",r,i)}}),"calculateEndProjection");h("source"),h("target"),this.applyLabelDimensions(t)}},DTt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},DTt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=this.calculateLabelDimensions(t,n),a=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Ppt(r.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;Bpt(r.rstyle,"labelWidth",e,u),Bpt(r.rscratch,"labelWidth",e,u),Bpt(r.rstyle,"labelHeight",e,d),Bpt(r.rscratch,"labelHeight",e,d),Bpt(r.rscratch,"labelLineHeight",e,h)},DTt.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=o((function(t,n){return n?(Bpt(r.rscratch,t,e,n),n):Ppt(r.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=s("labelKey");if(null!=c&&s("labelWrapKey")===c)return s("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;f<h.length;f++){var m=h[f],y=this.calculateLabelDimensions(t,m).width;if(d){var v=m.split("").join("");m=v}if(y>u){var x,b="",w=0,k=but(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)}s("labelWrapCachedLines",p),i=s("labelWrapCachedText",p.join("\n")),s("labelWrapKey",c)}else if("ellipsis"===l){var S=t.pstyle("text-max-width").pfValue,A="",L=!1;if(this.calculateLabelDimensions(t,i).width<S)return i;for(var N=0;N<i.length;N++){if(this.calculateLabelDimensions(t,A+i[N]+"…").width>S)break;A+=i[N],N===i.length-1&&(L=!0)}return L||(A+="…"),A}return i},DTt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if("auto"!==e)return e;if(!t.isNode())return"center";switch(r){case"left":return"right";case"right":return"left";default:return"center"}},DTt.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window().document,i=dpt(e,t._private.labelDimsKey),a=r.labelDimCache||(r.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=n.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;y<m.length;y++){var v=m[y],x=d.measureText(v),b=Math.ceil(x.width),w=l;g=Math.max(b,g),f+=w}return g+=0,f+=0,a[i]={width:g,height:f}},DTt.calculateLabelAngle=function(t,e){var r=t._private.rscratch,n=t.isEdge(),i=e?e+"-":"",a=t.pstyle(i+"text-rotation"),s=a.strValue;return"none"===s?0:n&&"autorotate"===s?r.labelAutoAngle:"autorotate"===s?0:a.pfValue},DTt.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var $Tt={},FTt=!1;$Tt.getNodeShape=function(t){var e=t.pstyle("shape").value;if("cutrectangle"===e&&(t.width()<28||t.height()<28))return FTt||(Ept("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),FTt=!0),"rectangle";if(t.isParent())return"rectangle"===e||"roundrectangle"===e||"round-rectangle"===e||"cutrectangle"===e||"cut-rectangle"===e||"barrel"===e?e:"rectangle";if("polygon"===e){var r=t.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(r).name}return e};var zTt={registerCalculationListeners:function(){var t=this.cy,e=t.collection(),r=this,n=o((function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.merge(t),r)for(var n=0;n<t.length;n++){var i=t[n],a=i._private,s=a.rstyle;s.clean=!1,s.cleanConnected=!1}}),"enqueue");r.binder(t).on("bounds.* dirty.*",o((function(t){var e=t.target;n(e)}),"onDirtyBounds")).on("style.* background.*",o((function(t){var e=t.target;n(e,!1)}),"onDirtyStyle"));var i=o((function(i){if(i){var a=r.onUpdateEleCalcsFns;e.cleanStyle();for(var s=0;s<e.length;s++){var o=e[s],l=o._private.rstyle;o.isNode()&&!l.cleanConnected&&(n(o.connectedEdges()),l.cleanConnected=!0)}if(a)for(var c=0;c<a.length;c++){(0,a[c])(i,e)}r.recalculateRenderedStyle(e),e=t.collection()}}),"updateEleCalcs");r.flushRenderedStyleQueue=function(){i(!0)},r.beforeRender(i,r.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(t){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(t)},recalculateRenderedStyle:function(t,e){var r=o((function(t){return t._private.rstyle.cleanConnected}),"isCleanConnected"),n=[],i=[];if(!this.destroyed){void 0===e&&(e=!0);for(var a=0;a<t.length;a++){var s=t[a],l=s._private,c=l.rstyle;!s.isEdge()||r(s.source())&&r(s.target())||(c.clean=!1),e&&c.clean||s.removed()||"none"!==s.pstyle("display").value&&("nodes"===l.group?i.push(s):n.push(s),c.clean=!0)}for(var h=0;h<i.length;h++){var u=i[h],d=u._private.rstyle,p=u.position();this.recalculateNodeLabelProjection(u),d.nodeX=p.x,d.nodeY=p.y,d.nodeW=u.pstyle("width").pfValue,d.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var f=n[g]._private,m=f.rstyle,y=f.rscratch;m.srcX=y.arrowStartX,m.srcY=y.arrowStartY,m.tgtX=y.arrowEndX,m.tgtY=y.arrowEndY,m.midX=y.midX,m.midY=y.midY,m.labelAngle=y.labelAngle,m.sourceLabelAngle=y.sourceLabelAngle,m.targetLabelAngle=y.targetLabelAngle}}}},UTt={updateCachedGrabbedEles:function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=(i=t[r])._private.rscratch;i.grabbed()&&!i.isParent()?e.push(i):n.inDragLayer?t.drag.push(i):t.nondrag.push(i)}for(r=0;r<e.length;r++){var i=e[r];t.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(ewt),e.interactive=e.filter((function(t){return t.interactive()})),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e}},GTt={};[aTt,sTt,LTt,ITt,RTt,DTt,$Tt,zTt,UTt].forEach((function(t){edt(GTt,t)}));var qTt={getCachedImage:function(t,e,r){var n=this.imageCache=this.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;var a=(i=n[t]=n[t]||{}).image=new Image;a.addEventListener("load",r),a.addEventListener("error",(function(){a.error=!0}));var s="data:";return t.substring(0,s.length).toLowerCase()===s||(e="null"===e?null:e,a.crossOrigin=e),a.src=t,a}},jTt={registerBinding:function(t,e,r,n){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var a=[],s=0;s<t.length;s++){var o=t[s];if(void 0!==o){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}return(l=this.binder(t)).on.apply(l,i)},binder:function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||qut(t);if(null==e.supportsPassiveEvents){var i=!1;try{var a=Object.defineProperty({},"passive",{get:o((function(){return i=!0,!0}),"get")});r.addEventListener("test",null,a)}catch(t){}e.supportsPassiveEvents=i}var s=o((function(r,i,a){var s=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(s[2]={capture:null!=a&&a,passive:!1,once:!1}),e.bindings.push({target:t,args:s}),(t.addEventListener||t.on).apply(t,s),this}),"on");return{on:s,addEventListener:s,addListener:s,bind:s}},nodeIsDraggable:function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},nodeIsGrabbable:function(t){return this.nodeIsDraggable(t)&&t.interactive()},load:function(){var t=this,e=t.cy.window(),r=o((function(t){return t.selected()}),"isSelected"),n=o((function(t){var e=t.getRootNode();if(e&&11===e.nodeType&&void 0!==e.host)return e}),"getShadowRoot"),i=o((function(e,r,n,i){null==e&&(e=t.cy);for(var a=0;a<r.length;a++){var s=r[a];e.emit({originalEvent:n,type:s,position:i})}}),"triggerEvents"),a=o((function(t){return t.shiftKey||t.metaKey||t.ctrlKey}),"isMultSelKeyDown"),s=o((function(e,r){var n=!0;if(t.cy.hasCompoundNodes()&&e&&e.pannable())for(var i=0;r&&i<r.length;i++){if((e=r[i]).isNode()&&e.isParent()&&!e.pannable()){n=!1;break}}else n=!0;return n}),"allowPanningPassthrough"),l=o((function(t){t[0]._private.grabbed=!0}),"setGrabbed"),c=o((function(t){t[0]._private.grabbed=!1}),"setFreed"),h=o((function(t){t[0]._private.rscratch.inDragLayer=!0}),"setInDragLayer"),u=o((function(t){t[0]._private.rscratch.inDragLayer=!1}),"setOutDragLayer"),d=o((function(t){t[0]._private.rscratch.isGrabTarget=!0}),"setGrabTarget"),p=o((function(t){t[0]._private.rscratch.isGrabTarget=!1}),"removeGrabTarget"),g=o((function(t,e){var r=e.addToList;r.has(t)||!t.grabbable()||t.locked()||(r.merge(t),l(t))}),"addToDragList"),f=o((function(t,e){if(t.cy().hasCompoundNodes()&&(null!=e.inDragLayer||null!=e.addToList)){var r=t.descendants();e.inDragLayer&&(r.forEach(h),r.connectedEdges().forEach(h)),e.addToList&&g(r,e)}}),"addDescendantsToDrag"),m=o((function(e,r){r=r||{};var n=e.cy().hasCompoundNodes();r.inDragLayer&&(e.forEach(h),e.neighborhood().stdFilter((function(t){return!n||t.isEdge()})).forEach(h)),r.addToList&&e.forEach((function(t){g(t,r)})),f(e,r),x(e,{inDragLayer:r.inDragLayer}),t.updateCachedGrabbedEles()}),"addNodesToDrag"),y=m,v=o((function(e){e&&(t.getCachedZSortedEles().forEach((function(t){c(t),u(t),p(t)})),t.updateCachedGrabbedEles())}),"freeDraggedElements"),x=o((function(t,e){if((null!=e.inDragLayer||null!=e.addToList)&&t.cy().hasCompoundNodes()){var r=t.ancestors().orphans();if(!r.same(t)){var n=r.descendants().spawnSelf().merge(r).unmerge(t).unmerge(t.descendants()),i=n.connectedEdges();e.inDragLayer&&(i.forEach(h),n.forEach(h)),e.addToList&&n.forEach((function(t){g(t,e)}))}}}),"updateAncestorsInDragLayer"),b=o((function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()}),"blurActiveDomElement"),w="undefined"!=typeof MutationObserver,k="undefined"!=typeof ResizeObserver;w?(t.removeObserver=new MutationObserver((function(e){for(var r=0;r<e.length;r++){var n=e[r].removedNodes;if(n)for(var i=0;i<n.length;i++){if(n[i]===t.container){t.destroy();break}}}})),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",(function(e){t.destroy()}));var T=Kdt((function(){t.cy.resize()}),100);w&&(t.styleObserver=new MutationObserver(T),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",T),k&&(t.resizeObserver=new ResizeObserver(T),t.resizeObserver.observe(t.container));var _=o((function(t,e){for(;null!=t;)e(t),t=t.parentNode}),"forEachUp"),E=o((function(){t.invalidateContainerClientCoordsCache()}),"invalidateCoords");_(t.container,(function(e){t.registerBinding(e,"transitionend",E),t.registerBinding(e,"animationend",E),t.registerBinding(e,"scroll",E)})),t.registerBinding(t.container,"contextmenu",(function(t){t.preventDefault()}));var C=o((function(){return 0!==t.selection[4]}),"inBoxSelection"),S=o((function(e){for(var r=t.findContainerClientCoords(),n=r[0],i=r[1],a=r[2],s=r[3],o=e.touches?e.touches:[e],l=!1,c=0;c<o.length;c++){var h=o[c];if(n<=h.clientX&&h.clientX<=n+a&&i<=h.clientY&&h.clientY<=i+s){l=!0;break}}if(!l)return!1;for(var u=t.container,d=e.target.parentNode,p=!1;d;){if(d===u){p=!0;break}d=d.parentNode}return!!p}),"eventInContainer");t.registerBinding(t.container,"mousedown",o((function(e){if(S(e)&&(1!==t.hoverData.which||1===e.which)){e.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=e.which;var r=t.cy,n=[e.clientX,e.clientY],a=t.projectIntoViewport(n[0],n[1]),s=t.selection,l=t.findNearestElements(a[0],a[1],!0,!1),c=l[0],h=t.dragData.possibleDragElements;t.hoverData.mdownPos=a,t.hoverData.mdownGPos=n;var u=o((function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout((function(){if(!t.hoverData.tapholdCancelled){var n=t.hoverData.down;n?n.emit({originalEvent:e,type:"taphold",position:{x:a[0],y:a[1]}}):r.emit({originalEvent:e,type:"taphold",position:{x:a[0],y:a[1]}})}}),t.tapholdDuration)}),"checkForTaphold");if(3==e.which){t.hoverData.cxtStarted=!0;var p={originalEvent:e,type:"cxttapstart",position:{x:a[0],y:a[1]}};c?(c.activate(),c.emit(p),t.hoverData.down=c):r.emit(p),t.hoverData.downTime=(new Date).getTime(),t.hoverData.cxtDragged=!1}else if(1==e.which){if(c&&c.activate(),null!=c&&t.nodeIsGrabbable(c)){var g=o((function(t){return{originalEvent:e,type:t,position:{x:a[0],y:a[1]}}}),"makeEvent"),f=o((function(t){t.emit(g("grab"))}),"triggerGrab");if(d(c),c.selected()){h=t.dragData.possibleDragElements=r.collection();var v=r.$((function(e){return e.isNode()&&e.selected()&&t.nodeIsGrabbable(e)}));m(v,{addToList:h}),c.emit(g("grabon")),v.forEach(f)}else h=t.dragData.possibleDragElements=r.collection(),y(c,{addToList:h}),c.emit(g("grabon")).emit(g("grab"));t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=c,t.hoverData.downs=l,t.hoverData.downTime=(new Date).getTime(),i(c,["mousedown","tapstart","vmousedown"],e,{x:a[0],y:a[1]}),null==c?(s[4]=1,t.data.bgActivePosistion={x:a[0],y:a[1]},t.redrawHint("select",!0),t.redraw()):c.pannable()&&(s[4]=1),u()}s[0]=s[2]=a[0],s[1]=s[3]=a[1]}}),"mousedownHandler"),!1);var A,L,N,I=n(t.container);t.registerBinding([e,I],"mousemove",o((function(e){if(t.hoverData.capture||S(e)){var r=!1,n=t.cy,l=n.zoom(),c=[e.clientX,e.clientY],h=t.projectIntoViewport(c[0],c[1]),u=t.hoverData.mdownPos,d=t.hoverData.mdownGPos,p=t.selection,g=null;t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.selecting||(g=t.findNearestElement(h[0],h[1],!0,!1));var f,y=t.hoverData.last,x=t.hoverData.down,b=[h[0]-p[2],h[1]-p[3]],w=t.dragData.possibleDragElements;if(d){var k=c[0]-d[0],T=k*k,_=c[1]-d[1],E=T+_*_;t.hoverData.isOverThresholdDrag=f=E>=t.desktopTapThreshold2}var C=a(e);f&&(t.hoverData.tapholdCancelled=!0);var A=o((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");r=!0,i(g,["mousemove","vmousemove","tapdrag"],e,{x:h[0],y:h[1]});var L=o((function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||n.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(f){var N={originalEvent:e,type:"cxtdrag",position:{x:h[0],y:h[1]}};x?x.emit(N):n.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(r=!0,n.panningEnabled()&&n.userPanningEnabled()){var I;if(t.hoverData.justStartedPan){var R=t.hoverData.mdownPos;I={x:(h[0]-R[0])*l,y:(h[1]-R[1])*l},t.hoverData.justStartedPan=!1}else I={x:b[0]*l,y:b[1]*l};n.panBy(I),n.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==y||(y&&i(y,["mouseout","tapdragout"],e,{x:h[0],y:h[1]}),g&&i(g,["mouseover","tapdragover"],e,{x:h[0],y:h[1]}),t.hoverData.last=g),x)if(f){if(n.boxSelectionEnabled()&&C)x&&x.grabbed()&&(v(w),x.emit("freeon"),w.emit("free"),t.dragData.didDrag&&(x.emit("dragfreeon"),w.emit("dragfree"))),L();else if(x&&x.grabbed()&&t.nodeIsDraggable(x)){var M=!t.dragData.didDrag;M&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||m(w,{inDragLayer:!0});var D={x:0,y:0};if(Mut(b[0])&&Mut(b[1])&&(D.x+=b[0],D.y+=b[1],M)){var O=t.hoverData.dragDelta;O&&Mut(O[0])&&Mut(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 A();r=!0}else if(f){if(t.hoverData.dragging||!n.boxSelectionEnabled()||!C&&n.panningEnabled()&&n.userPanningEnabled()){if(!t.hoverData.selecting&&n.panningEnabled()&&n.userPanningEnabled()){s(x,t.hoverData.downs)&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,p[4]=0,t.data.bgActivePosistion=lgt(u),t.redrawHint("select",!0),t.redraw())}}else L();x&&x.pannable()&&x.active()&&x.unactivate()}return p[2]=h[0],p[3]=h[1],r?(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1):void 0}}),"mousemoveHandler"),!1),t.registerBinding(e,"mouseup",o((function(e){if((1!==t.hoverData.which||1===e.which||!t.hoverData.capture)&&t.hoverData.capture){t.hoverData.capture=!1;var n=t.cy,s=t.projectIntoViewport(e.clientX,e.clientY),l=t.selection,c=t.findNearestElement(s[0],s[1],!0,!1),h=t.dragData.possibleDragElements,u=t.hoverData.down,d=a(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:s[0],y:s[1]}};if(u?u.emit(p):n.emit(p),!t.hoverData.cxtDragged){var g={originalEvent:e,type:"cxttap",position:{x:s[0],y:s[1]}};u?u.emit(g):n.emit(g)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(1===t.hoverData.which){if(i(c,["mouseup","tapend","vmouseup"],e,{x:s[0],y:s[1]}),t.dragData.didDrag||t.hoverData.dragged||t.hoverData.selecting||t.hoverData.isOverThresholdDrag||(i(u,["click","tap","vclick"],e,{x:s[0],y:s[1]}),L=!1,e.timeStamp-N<=n.multiClickDebounceTime()?(A&&clearTimeout(A),L=!0,N=null,i(u,["dblclick","dbltap","vdblclick"],e,{x:s[0],y:s[1]})):(A=setTimeout((function(){L||i(u,["oneclick","onetap","voneclick"],e,{x:s[0],y:s[1]})}),n.multiClickDebounceTime()),N=e.timeStamp)),null!=u||t.dragData.didDrag||t.hoverData.selecting||t.hoverData.dragged||a(e)||(n.$(r).unselect(["tapunselect"]),h.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=h=n.collection()),c!=u||t.dragData.didDrag||t.hoverData.selecting||null!=c&&c._private.selectable&&(t.hoverData.dragging||("additive"===n.selectionType()||d?c.selected()?c.unselect(["tapunselect"]):c.select(["tapselect"]):d||(n.$(r).unmerge(c).unselect(["tapunselect"]),c.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var f=n.collection(t.getAllInBox(l[0],l[1],l[2],l[3]));t.redrawHint("select",!0),f.length>0&&t.redrawHint("eles",!0),n.emit({type:"boxend",originalEvent:e,position:{x:s[0],y:s[1]}});var m=o((function(t){return t.selectable()&&!t.selected()}),"eleWouldBeSelected");"additive"===n.selectionType()||d||n.$(r).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 y=u&&u.grabbed();v(h),y&&(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 R,M,D,O,P,B,$,F,z,U,G,q,j,W=o((function(e){if(!t.scrollingPage){var r=t.cy,n=r.zoom(),i=r.pan(),a=t.projectIntoViewport(e.clientX,e.clientY),s=[a[0]*n+i.x,a[1]*n+i.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C())e.preventDefault();else if(r.panningEnabled()&&r.userPanningEnabled()&&r.zoomingEnabled()&&r.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=r.zoom()*Math.pow(10,o);"gesturechange"===e.type&&(l=t.gestureStartZoom*e.scale),r.zoom({level:l,renderedPosition:{x:s[0],y:s[1]}}),r.emit("gesturechange"===e.type?"pinchzoom":"scrollzoom")}}}),"wheelHandler");t.registerBinding(t.container,"wheel",W,!0),t.registerBinding(e,"scroll",o((function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout((function(){t.scrollingPage=!1}),250)}),"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",o((function(e){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||e.preventDefault()}),"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",(function(e){t.hasTouchStarted||W(e)}),!0),t.registerBinding(t.container,"mouseout",o((function(e){var r=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseout",position:{x:r[0],y:r[1]}})}),"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",o((function(e){var r=t.projectIntoViewport(e.clientX,e.clientY);t.cy.emit({originalEvent:e,type:"mouseover",position:{x:r[0],y:r[1]}})}),"mouseOverHandler"),!1);var Y,H,V,X,K,Z,Q,J=o((function(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}),"distance"),tt=o((function(t,e,r,n){return(r-t)*(r-t)+(n-e)*(n-e)}),"distanceSq");if(t.registerBinding(t.container,"touchstart",Y=o((function(e){if(t.hasTouchStarted=!0,S(e)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var r=t.cy,n=t.touchData.now,a=t.touchData.earlier;if(e.touches[0]){var s=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);n[0]=s[0],n[1]=s[1]}if(e.touches[1]){s=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);n[2]=s[0],n[3]=s[1]}if(e.touches[2]){s=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);n[4]=s[0],n[5]=s[1]}if(e.touches[1]){t.touchData.singleTouchMoved=!0,v(t.dragData.touchDragEles);var l=t.findContainerClientCoords();z=l[0],U=l[1],G=l[2],q=l[3],R=e.touches[0].clientX-z,M=e.touches[0].clientY-U,D=e.touches[1].clientX-z,O=e.touches[1].clientY-U,j=0<=R&&R<=G&&0<=D&&D<=G&&0<=M&&M<=q&&0<=O&&O<=q;var c=r.pan(),h=r.zoom();P=J(R,M,D,O),B=tt(R,M,D,O),F=[(($=[(R+D)/2,(M+O)/2])[0]-c.x)/h,($[1]-c.y)/h];if(B<4e4&&!e.touches[2]){var u=t.findNearestElement(n[0],n[1],!0,!0),p=t.findNearestElement(n[2],n[3],!0,!0);return u&&u.isNode()?(u.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),t.touchData.start=u):p&&p.isNode()?(p.activate().emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[1]}}),t.touchData.start=p):r.emit({originalEvent:e,type:"cxttapstart",position:{x:n[0],y:n[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])r.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var g=t.findNearestElements(n[0],n[1],!0,!0),f=g[0];if(null!=f&&(f.activate(),t.touchData.start=f,t.touchData.starts=g,t.nodeIsGrabbable(f))){var x=t.dragData.touchDragEles=r.collection(),w=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),f.selected()?(w=r.$((function(e){return e.selected()&&t.nodeIsGrabbable(e)})),m(w,{addToList:x})):y(f,{addToList:x}),d(f);var k=o((function(t){return{originalEvent:e,type:t,position:{x:n[0],y:n[1]}}}),"makeEvent");f.emit(k("grabon")),w?w.forEach((function(t){t.emit(k("grab"))})):f.emit(k("grab"))}i(f,["touchstart","tapstart","vmousedown"],e,{x:n[0],y:n[1]}),null==f&&(t.data.bgActivePosistion={x:s[0],y:s[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||i(t.touchData.start,["taphold"],e,{x:n[0],y:n[1]})}),t.tapholdDuration)}if(e.touches.length>=1){for(var T=t.touchData.startPosition=[null,null,null,null,null,null],_=0;_<n.length;_++)T[_]=a[_]=n[_];var E=e.touches[0];t.touchData.startGPosition=[E.clientX,E.clientY]}}}),"touchstartHandler"),!1),t.registerBinding(e,"touchmove",H=o((function(e){var r=t.touchData.capture;if(r||S(e)){var n=t.selection,a=t.cy,o=t.touchData.now,l=t.touchData.earlier,c=a.zoom();if(e.touches[0]){var h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}if(e.touches[1]){h=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=h[0],o[3]=h[1]}if(e.touches[2]){h=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=h[0],o[5]=h[1]}var u,d=t.touchData.startGPosition;if(r&&e.touches[0]&&d){for(var p=[],g=0;g<o.length;g++)p[g]=o[g]-l[g];var f=e.touches[0].clientX-d[0],y=f*f,x=e.touches[0].clientY-d[1];u=y+x*x>=t.touchTapThreshold2}if(r&&t.touchData.cxt){e.preventDefault();var b=e.touches[0].clientX-z,w=e.touches[0].clientY-U,k=e.touches[1].clientX-z,T=e.touches[1].clientY-U,_=tt(b,w,k,T);if(_/B>=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):a.emit(E)}}if(r&&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):a.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(r&&e.touches[2]&&a.boxSelectionEnabled())e.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||a.emit({originalEvent:e,type:"boxstart",position:{x:o[0],y:o[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,n[4]=1,n&&0!==n.length&&void 0!==n[0]?(n[2]=(o[0]+o[2]+o[4])/3,n[3]=(o[1]+o[3]+o[5])/3):(n[0]=(o[0]+o[2]+o[4])/3,n[1]=(o[1]+o[3]+o[5])/3,n[2]=(o[0]+o[2]+o[4])/3+1,n[3]=(o[1]+o[3]+o[5])/3+1),t.redrawHint("select",!0),t.redraw();else if(r&&e.touches[1]&&!t.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(e.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),Z=t.dragData.touchDragEles){t.redrawHint("drag",!0);for(var A=0;A<Z.length;A++){var L=Z[A]._private;L.grabbed=!1,L.rscratch.inDragLayer=!1}}var N=t.touchData.start,I=(b=e.touches[0].clientX-z,w=e.touches[0].clientY-U,k=e.touches[1].clientX-z,T=e.touches[1].clientY-U,J(b,w,k,T)),$=I/P;if(j){var G=(b-R+(k-D))/2,q=(w-M+(T-O))/2,W=a.zoom(),Y=W*$,H=a.pan(),V=F[0]*W+H.x,X=F[1]*W+H.y,K={x:-Y/W*(V-H.x-G)+V,y:-Y/W*(X-H.y-q)+X};if(N&&N.active()){var Z=t.dragData.touchDragEles;v(Z),t.redrawHint("drag",!0),t.redrawHint("eles",!0),N.unactivate().emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(N.emit("dragfreeon"),Z.emit("dragfree"))}a.viewport({zoom:Y,pan:K,cancelOnFailedZoom:!0}),a.emit("pinchzoom"),P=I,R=b,M=w,D=k,O=T,t.pinching=!0}if(e.touches[0]){h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}if(e.touches[1]){h=t.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=h[0],o[3]=h[1]}if(e.touches[2]){h=t.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=h[0],o[5]=h[1]}}else if(e.touches[0]&&!t.touchData.didSelect){var Q=t.touchData.start,et=t.touchData.last;if(t.hoverData.draggingEles||t.swipePanning||(C=t.findNearestElement(o[0],o[1],!0,!0)),r&&null!=Q&&e.preventDefault(),r&&null!=Q&&t.nodeIsDraggable(Q))if(u){Z=t.dragData.touchDragEles;var rt=!t.dragData.didDrag;rt&&m(Z,{inDragLayer:!0}),t.dragData.didDrag=!0;var nt={x:0,y:0};if(Mut(p[0])&&Mut(p[1]))if(nt.x+=p[0],nt.y+=p[1],rt)t.redrawHint("eles",!0),(it=t.touchData.dragDelta)&&Mut(it[0])&&Mut(it[1])&&(nt.x+=it[0],nt.y+=it[1]);t.hoverData.draggingEles=!0,Z.silentShift(nt).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==l[0]&&t.touchData.startPosition[1]==l[1]&&t.redrawHint("eles",!0),t.redraw()}else{var it;0===(it=t.touchData.dragDelta=t.touchData.dragDelta||[]).length?(it.push(p[0]),it.push(p[1])):(it[0]+=p[0],it[1]+=p[1])}if(i(Q||C,["touchmove","tapdrag","vmousemove"],e,{x:o[0],y:o[1]}),Q&&Q.grabbed()||C==et||(et&&et.emit({originalEvent:e,type:"tapdragout",position:{x:o[0],y:o[1]}}),C&&C.emit({originalEvent:e,type:"tapdragover",position:{x:o[0],y:o[1]}})),t.touchData.last=C,r)for(A=0;A<o.length;A++)o[A]&&t.touchData.startPosition[A]&&u&&(t.touchData.singleTouchMoved=!0);if(r&&(null==Q||Q.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){s(Q,t.touchData.starts)&&(e.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=lgt(t.touchData.startPosition)),t.swipePanning?(a.panBy({x:p[0]*c,y:p[1]*c}),a.emit("dragpan")):u&&(t.swipePanning=!0,a.panBy({x:f*c,y:x*c}),a.emit("dragpan"),Q&&(Q.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));h=t.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=h[0],o[1]=h[1]}}for(g=0;g<o.length;g++)l[g]=o[g];r&&e.touches.length>0&&!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",V=o((function(e){var r=t.touchData.start;t.touchData.capture=!1,r&&r.unactivate()}),"touchcancelHandler")),t.registerBinding(e,"touchend",X=o((function(e){var n=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 s,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(n&&n.unactivate(),t.touchData.cxt){if(s={originalEvent:e,type:"cxttapend",position:{x:h[0],y:h[1]}},n?n.emit(s):l.emit(s),!t.touchData.cxtDragged){var p={originalEvent:e,type:"cxttap",position:{x:h[0],y:h[1]}};n?n.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=o((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!=n&&n.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!=n){var y=n._private.grabbed;v(m),t.redrawHint("drag",!0),t.redrawHint("eles",!0),y&&(n.emit("freeon"),m.emit("free"),t.dragData.didDrag&&(n.emit("dragfreeon"),m.emit("dragfree"))),i(n,["touchend","tapend","vmouseup","tapdragout"],e,{x:h[0],y:h[1]}),n.unactivate(),t.touchData.start=null}else{var x=t.findNearestElement(h[0],h[1],!0,!0);i(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||(n||l.$(":selected").unselect(["tapunselect"]),i(n,["tap","vclick"],e,{x:h[0],y:h[1]}),K=!1,e.timeStamp-Q<=l.multiClickDebounceTime()?(Z&&clearTimeout(Z),K=!0,Q=null,i(n,["dbltap","vdblclick"],e,{x:h[0],y:h[1]})):(Z=setTimeout((function(){K||i(n,["onetap","voneclick"],e,{x:h[0],y:h[1]})}),l.multiClickDebounceTime()),Q=e.timeStamp)),null!=n&&!t.dragData.didDrag&&n._private.selectable&&T<t.touchTapThreshold2&&!t.pinching&&("single"===l.selectionType()?(l.$(r).unmerge(n).unselect(["tapunselect"]),n.select(["tapselect"])):n.selected()?n.unselect(["tapunselect"]):n.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}for(var _=0;_<h.length;_++)u[_]=h[_];t.dragData.didDrag=!1,0===e.touches.length&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),e.touches.length<2&&(1===e.touches.length&&(t.touchData.startGPosition=[e.touches[0].clientX,e.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())}}),"touchendHandler"),!1),"undefined"==typeof TouchEvent){var et=[],rt=o((function(t){return{clientX:t.clientX,clientY:t.clientY,force:1,identifier:t.pointerId,pageX:t.pageX,pageY:t.pageY,radiusX:t.width/2,radiusY:t.height/2,screenX:t.screenX,screenY:t.screenY,target:t.target}}),"makeTouch"),nt=o((function(t){return{event:t,touch:rt(t)}}),"makePointer"),it=o((function(t){et.push(nt(t))}),"addPointer"),at=o((function(t){for(var e=0;e<et.length;e++){if(et[e].event.pointerId===t.pointerId)return void et.splice(e,1)}}),"removePointer"),st=o((function(t){var e=et.filter((function(e){return e.event.pointerId===t.pointerId}))[0];e.event=t,e.touch=rt(t)}),"updatePointer"),ot=o((function(t){t.touches=et.map((function(t){return t.touch}))}),"addTouchesToEvent"),lt=o((function(t){return"mouse"===t.pointerType||4===t.pointerType}),"pointerIsMouse");t.registerBinding(t.container,"pointerdown",(function(t){lt(t)||(t.preventDefault(),it(t),ot(t),Y(t))})),t.registerBinding(t.container,"pointerup",(function(t){lt(t)||(at(t),ot(t),X(t))})),t.registerBinding(t.container,"pointercancel",(function(t){lt(t)||(at(t),ot(t),V(t))})),t.registerBinding(t.container,"pointermove",(function(t){lt(t)||(t.preventDefault(),st(t),ot(t),H(t))}))}}},WTt={generatePolygon:function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl("polygon",t,e,r,n,i,this.points)}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,o){return tft(i,a,this.points,t,e,r/2,n/2,s)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){return Wgt(t,e,this.points,a,s,n,i,[0,-1],r)}),"checkPoint")}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl(this.name,t,e,r,n,i)}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,o){return Xgt(i,a,t,e,r/2+s,n/2+s)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){return Kgt(t,e,n,i,a,s,r)}),"checkPoint")}},generateRoundPolygon:function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:o((function(t,r,n,i,a,s,o){if(void 0!==s[o]&&s[o+"-cx"]===t&&s[o+"-cy"]===r)return s[o];s[o]=new Array(e.length/2),s[o+"-cx"]=t,s[o+"-cy"]=r;var l=n/2,c=i/2;a="auto"===a?oft(n,i):a;for(var h=new Array(e.length/2),u=0;u<e.length/2;u++)h[u]={x:t+l*e[2*u],y:r+c*e[2*u+1]};var d,p,g,f,m=h.length;for(p=h[m-1],d=0;d<m;d++)g=h[d%m],f=h[(d+1)%m],s[o][d]=ATt(p,g,f,a),p=g,g=f;return s[o]}),"getOrCreateCorners"),draw:o((function(t,e,r,n,i,a,s){this.renderer.nodeShapeImpl("round-polygon",t,e,r,n,i,this.points,this.getOrCreateCorners(e,r,n,i,a,s,"drawCorners"))}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,o,l){return eft(i,a,this.points,t,e,r,n,s,this.getOrCreateCorners(t,e,r,n,o,l,"corners"))}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o,l){return Ygt(t,e,this.points,a,s,n,i,this.getOrCreateCorners(a,s,n,i,o,l,"corners"))}),"checkPoint")}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:nft(4,0),draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl(this.name,t,e,r,n,i,this.points,a)}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,o){return Bgt(i,a,t,e,r,n,s,o)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){var l=n/2,c=i/2;o="auto"===o?sft(n,i):o;var h=2*(o=Math.min(l,c,o));return!!Wgt(t,e,this.points,a,s,n,i-h,[0,-1],r)||(!!Wgt(t,e,this.points,a,s,n-h,i,[0,-1],r)||(!!Kgt(t,e,h,h,a-l+o,s-c+o,r)||(!!Kgt(t,e,h,h,a+l-o,s-c+o,r)||(!!Kgt(t,e,h,h,a+l-o,s+c-o,r)||!!Kgt(t,e,h,h,a-l+o,s+c-o,r)))))}),"checkPoint")}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:lft(),points:nft(4,0),draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl(this.name,t,e,r,n,i,null,a)}),"draw"),generateCutTrianglePts:o((function(t,e,r,n,i){var a="auto"===i?this.cornerLength:i,s=e/2,o=t/2,l=r-o,c=r+o,h=n-s,u=n+s;return{topLeft:[l,h+a,l+a,h,l+a,h+a],topRight:[c-a,h,c,h+a,c-a,h+a],bottomRight:[c,u-a,c-a,u,c-a,u-a],bottomLeft:[l+a,u,l,u-a,l+a,u-a]}}),"generateCutTrianglePts"),intersectLine:o((function(t,e,r,n,i,a,s,o){var l=this.generateCutTrianglePts(r+2*s,n+2*s,t,e,o),c=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return tft(i,a,c,t,e)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){var l="auto"===o?this.cornerLength:o;if(Wgt(t,e,this.points,a,s,n,i-2*l,[0,-1],r))return!0;if(Wgt(t,e,this.points,a,s,n-2*l,i,[0,-1],r))return!0;var c=this.generateCutTrianglePts(n,i,a,s);return jgt(t,e,c.topLeft)||jgt(t,e,c.topRight)||jgt(t,e,c.bottomRight)||jgt(t,e,c.bottomLeft)}),"checkPoint")}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:nft(4,0),draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl(this.name,t,e,r,n,i)}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,l){var c=this.generateBarrelBezierPts(r+2*s,n+2*s,t,e),h=o((function(t){var e=wgt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.15),r=wgt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.5),n=wgt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},.85);return[t[0],t[1],e.x,e.y,r.x,r.y,n.x,n.y,t[4],t[5]]}),"approximateBarrelCurvePts"),u=[].concat(h(c.topLeft),h(c.topRight),h(c.bottomRight),h(c.bottomLeft));return tft(i,a,u,t,e)}),"intersectLine"),generateBarrelBezierPts:o((function(t,e,r,n){var i=e/2,a=t/2,s=r-a,o=r+a,l=n-i,c=n+i,h=hft(t,e),u=h.heightOffset,d=h.widthOffset,p=h.ctrlPtOffsetPct*t,g={topLeft:[s,l+u,s+p,l,s+d,l],topRight:[o-d,l,o-p,l,o,l+u],bottomRight:[o,c-u,o-p,c,o-d,c],bottomLeft:[s+d,c,s+p,c,s,c-u]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g}),"generateBarrelBezierPts"),checkPoint:o((function(t,e,r,n,i,a,s,l){var c=hft(n,i),h=c.heightOffset,u=c.widthOffset;if(Wgt(t,e,this.points,a,s,n,i-2*h,[0,-1],r))return!0;if(Wgt(t,e,this.points,a,s,n-2*u,i,[0,-1],r))return!0;for(var d=this.generateBarrelBezierPts(n,i,a,s),p=o((function(t,e,r){var n=r[4],i=r[2],a=r[0],s=r[5],o=r[1],l=Math.min(n,a),c=Math.max(n,a),h=Math.min(s,o),u=Math.max(s,o);if(l<=t&&t<=c&&h<=e&&e<=u){var d=cft(n,i,a),p=zgt(d[0],d[1],d[2],t).filter((function(t){return 0<=t&&t<=1}));if(p.length>0)return p[0]}return null}),"getCurveT"),g=Object.keys(d),f=0;f<g.length;f++){var m=d[g[f]],y=p(t,e,m);if(null!=y){var v=m[5],x=m[3],b=m[1],w=bgt(v,x,b,y);if(m.isTop&&w<=e)return!0;if(m.isBottom&&e<=w)return!0}}return!1}),"checkPoint")}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:nft(4,0),draw:o((function(t,e,r,n,i,a){this.renderer.nodeShapeImpl(this.name,t,e,r,n,i,this.points,a)}),"draw"),intersectLine:o((function(t,e,r,n,i,a,s,o){var l=e-(n/2+s),c=Jgt(i,a,t,e,t-(r/2+s),l,t+(r/2+s),l,!1);return c.length>0?c:Bgt(i,a,t,e,r,n,s,o)}),"intersectLine"),checkPoint:o((function(t,e,r,n,i,a,s,o){var l=2*(o="auto"===o?sft(n,i):o);if(Wgt(t,e,this.points,a,s,n,i-l,[0,-1],r))return!0;if(Wgt(t,e,this.points,a,s,n-l,i,[0,-1],r))return!0;var c=n/2+2*r,h=i/2+2*r;return!!jgt(t,e,[a-c,s-h,a-c,s,a+c,s,a+c,s-h])||(!!Kgt(t,e,l,l,a+n/2-o,s+i/2-o,r)||!!Kgt(t,e,l,l,a-n/2+o,s+i/2-o,r))}),"checkPoint")}},registerNodeShapes:function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",nft(3,0)),this.generateRoundPolygon("round-triangle",nft(3,0)),this.generatePolygon("rectangle",nft(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r),this.generatePolygon("pentagon",nft(5,0)),this.generateRoundPolygon("round-pentagon",nft(5,0)),this.generatePolygon("hexagon",nft(6,0)),this.generateRoundPolygon("round-hexagon",nft(6,0)),this.generatePolygon("heptagon",nft(7,0)),this.generateRoundPolygon("round-heptagon",nft(7,0)),this.generatePolygon("octagon",nft(8,0)),this.generateRoundPolygon("round-octagon",nft(8,0));var n=new Array(20),i=aft(5,0),a=aft(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[2*o]*=s,a[2*o+1]*=s;for(o=0;o<5;o++)n[4*o]=i[2*o],n[4*o+1]=i[2*o+1],n[4*o+2]=a[2*o],n[4*o+3]=a[2*o+1];n=ift(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),t.makePolygon=function(t){var r,n="polygon-"+t.join("$");return(r=this[n])?r:e.generatePolygon(n,t)}}},YTt={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(t){t=t||Ipt();var e=this;void 0===e.averageRedrawTime&&(e.averageRedrawTime=0),void 0===e.lastRedrawTime&&(e.lastRedrawTime=0),void 0===e.lastDrawTime&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},beforeRender:function(t,e){if(!this.destroyed){null==e&&Tpt("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort((function(t,e){return e.priority-t.priority}))}}},HTt=o((function(t,e,r){for(var n=t.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(e,r)}),"beforeRenderCallbacks");YTt.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=o((function r(n){if(!t.destroyed){if(e.batching());else if(t.requestedFrame&&!t.skipFrame){HTt(t,!0,n);var i=ept();t.render(t.renderOptions);var a=t.lastDrawTime=ept();void 0===t.averageRedrawTime&&(t.averageRedrawTime=a-i),void 0===t.redrawCount&&(t.redrawCount=0),t.redrawCount++,void 0===t.redrawTotalTime&&(t.redrawTotalTime=0);var s=a-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else HTt(t,!1,n);t.skipFrame=!1,tpt(r)}}),"renderFn");tpt(r)}};var VTt=o((function(t){this.init(t)}),"BaseRenderer"),XTt=VTt.prototype;XTt.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],XTt.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var i=n.document,a=i.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=null!=i.getElementById(s);if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var c=i.createElement("style");c.id=s,c.textContent="."+o+" { position: relative; }",a.insertBefore(c,a.children[0])}"static"===n.getComputedStyle(r).getPropertyValue("position")&&Ept("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=Mut(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},XTt.notify=function(t,e){var r=this,n=r.cy;this.destroyed||("init"!==t?"destroy"!==t?(("add"===t||"remove"===t||"move"===t&&n.hasCompoundNodes()||"load"===t||"zorder"===t||"mount"===t)&&r.invalidateCachedZSortedEles(),"viewport"===t&&r.redrawHint("select",!0),"gc"===t&&r.redrawHint("gc",!0),"load"!==t&&"resize"!==t&&"mount"!==t||(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):r.destroy():r.load())},XTt.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r.target;(n.off||n.removeEventListener).apply(n,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch(t){}},XTt.isHeadless=function(){return!1},[iTt,GTt,qTt,jTt,WTt,YTt].forEach((function(t){edt(XTt,t)}));var KTt=1e3/60,ZTt={setupDequeueing:o((function(t){return o((function(){var e=this,r=this.renderer;if(!e.dequeueingSetup){e.dequeueingSetup=!0;var n=Kdt((function(){r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()}),t.deqRedrawThreshold),i=o((function(i,a){var s=ept(),o=r.averageRedrawTime,l=r.lastRedrawTime,c=[],h=r.cy.extent(),u=r.getPixelRatio();for(i||r.flushRenderedStyleQueue();;){var d=ept(),p=d-s,g=d-a;if(l<KTt){var f=KTt-(i?o:0);if(g>=t.deqFastCost*f)break}else if(i){if(p>=t.deqCost*l||p>=t.deqAvgCost*o)break}else if(g>=t.deqNoDrawCost*KTt)break;var m=t.deq(e,u,h);if(!(m.length>0))break;for(var y=0;y<m.length;y++)c.push(m[y])}c.length>0&&(t.onDeqd(e,c),!i&&t.shouldRedraw(e,c,u,h)&&n())}),"dequeue"),a=t.priority||kpt;r.beforeRender(i,a(e))}}),"setupDequeueingImpl")}),"setupDequeueing")},QTt=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bpt;sut(this,t),this.idsByKey=new $pt,this.keyForId=new $pt,this.cachesByLvl=new $pt,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return o(t,"ElementTextureCacheLookup"),lut(t,[{key:"getIdsFor",value:o((function(t){null==t&&Tpt("Can not get id list for null key");var e=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new zpt,e.set(t,r)),r}),"getIdsFor")},{key:"addIdForKey",value:o((function(t,e){null!=t&&this.getIdsFor(t).add(e)}),"addIdForKey")},{key:"deleteIdForKey",value:o((function(t,e){null!=t&&this.getIdsFor(t).delete(e)}),"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:o((function(t){return null==t?0:this.getIdsFor(t).size}),"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:o((function(t){var e=t.id(),r=this.keyForId.get(e),n=this.getKey(t);this.deleteIdForKey(r,e),this.addIdForKey(n,e),this.keyForId.set(e,n)}),"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:o((function(t){var e=t.id(),r=this.keyForId.get(e);this.deleteIdForKey(r,e),this.keyForId.delete(e)}),"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:o((function(t){var e=t.id();return this.keyForId.get(e)!==this.getKey(t)}),"keyHasChangedFor")},{key:"isInvalid",value:o((function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}),"isInvalid")},{key:"getCachesAt",value:o((function(t){var e=this.cachesByLvl,r=this.lvls,n=e.get(t);return n||(n=new $pt,e.set(t,n),r.push(t)),n}),"getCachesAt")},{key:"getCache",value:o((function(t,e){return this.getCachesAt(e).get(t)}),"getCache")},{key:"get",value:o((function(t,e){var r=this.getKey(t),n=this.getCache(r,e);return null!=n&&this.updateKeyMappingFor(t),n}),"get")},{key:"getForCachedKey",value:o((function(t,e){var r=this.keyForId.get(t.id());return this.getCache(r,e)}),"getForCachedKey")},{key:"hasCache",value:o((function(t,e){return this.getCachesAt(e).has(t)}),"hasCache")},{key:"has",value:o((function(t,e){var r=this.getKey(t);return this.hasCache(r,e)}),"has")},{key:"setCache",value:o((function(t,e,r){r.key=t,this.getCachesAt(e).set(t,r)}),"setCache")},{key:"set",value:o((function(t,e,r){var n=this.getKey(t);this.setCache(n,e,r),this.updateKeyMappingFor(t)}),"set")},{key:"deleteCache",value:o((function(t,e){this.getCachesAt(e).delete(t)}),"deleteCache")},{key:"delete",value:o((function(t,e){var r=this.getKey(t);this.deleteCache(r,e)}),"_delete")},{key:"invalidateKey",value:o((function(t){var e=this;this.lvls.forEach((function(r){return e.deleteCache(t,r)}))}),"invalidateKey")},{key:"invalidate",value:o((function(t){var e=t.id(),r=this.keyForId.get(e);this.deleteKeyMappingFor(t);var n=this.doesEleInvalidateKey(t);return n&&this.invalidateKey(r),n||0===this.getNumberOfIdsForKey(r)}),"invalidate")}]),t}(),JTt={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},t_t=Rpt({getKey:null,doesEleInvalidateKey:bpt,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:xpt,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),e_t=o((function(t,e){var r=this;r.renderer=t,r.onDequeues=[];var n=t_t(e);edt(r,n),r.lookup=new QTt(n.getKey,n.doesEleInvalidateKey),r.setupDequeueing()}),"ElementTextureCache"),r_t=e_t.prototype;r_t.reasons=JTt,r_t.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},r_t.getRetiredTextureQueue=function(t){var e=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return e[t]=e[t]||[]},r_t.getElementQueue=function(){var t=this.eleCacheQueue=this.eleCacheQueue||new Wpt((function(t,e){return e.reqs-t.reqs}));return t},r_t.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},r_t.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,l=s.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==n&&(n=Math.ceil(fgt(l*r))),n<-4)n=-4;else if(l>=7.99||n>3)return null;var h=Math.pow(2,n),u=e.h*h,d=e.w*h,p=s.eleTextBiggerThanMin(t,h);if(!this.isVisible(t,p))return null;var g,f=c.get(t,n);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=o((function(){return a.recycleTexture(g,d)||a.addTexture(g,d)}),"addNewTxr");y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidth<d&&(y=v());for(var x,b=o((function(t){return t&&t.scaledLabelShown===p}),"scalableFrom"),w=i&&i===JTt.dequeue,k=i&&i===JTt.highQuality,T=i&&i===JTt.downscale,_=n+1;_<=3;_++){var E=c.get(t,_);if(E){x=E;break}}var C=x&&x.level===n+1?x:null,S=o((function(){y.context.drawImage(C.texture.canvas,C.x,0,C.width,C.height,y.usedWidth,0,d,u)}),"downscale");if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,g),b(C))S();else if(b(x)){if(!k)return a.queueElement(t,x.level-1),x;for(var A=x.level;A>n;A--)C=a.getElement(t,e,r,A,JTt.downscale);S()}else{var L;if(!w&&!k&&!T)for(var N=n-1;N>=-4;N--){var I=c.get(t,N);if(I){L=I;break}}if(b(L))return a.queueElement(t,n),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:n,scale:h,width:d,height:u,scaledLabelShown:p},y.usedWidth+=Math.ceil(d+8),y.eleCaches.push(f),c.set(t,n,f),a.checkTextureFullness(y),f},r_t.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},r_t.invalidateElement=function(t){var e=this,r=e.lookup,n=[];if(r.isInvalid(t)){for(var i=-4;i<=3;i++){var a=r.getForCachedKey(t,i);a&&n.push(a)}if(r.invalidate(t))for(var s=0;s<n.length;s++){var o=n[s],l=o.texture;l.invalidatedWidth+=o.width,o.invalidated=!0,e.checkTextureUtility(l)}e.removeFromQueue(t)}},r_t.checkTextureUtility=function(t){t.invalidatedWidth>=.2*t.width&&this.retireTexture(t)},r_t.checkTextureFullness=function(t){var e=this.getTextureQueue(t.height);t.usedWidth/t.width>.8&&t.fullnessChecks>=10?Mpt(e,t):t.fullnessChecks++},r_t.retireTexture=function(t){var e=t.height,r=this.getTextureQueue(e),n=this.lookup;Mpt(r,t),t.retired=!0;for(var i=t.eleCaches,a=0;a<i.length;a++){var s=i[a];n.deleteCache(s.key,s.level)}Dpt(i),this.getRetiredTextureQueue(e).push(t)},r_t.addTexture=function(t,e){var r={};return this.getTextureQueue(t).push(r),r.eleCaches=[],r.height=t,r.width=Math.max(1024,e),r.usedWidth=0,r.invalidatedWidth=0,r.fullnessChecks=0,r.canvas=this.renderer.makeOffscreenCanvas(r.width,r.height),r.context=r.canvas.getContext("2d"),r},r_t.recycleTexture=function(t,e){for(var r=this.getTextureQueue(t),n=this.getRetiredTextureQueue(t),i=0;i<n.length;i++){var a=n[i];if(a.width>=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,Dpt(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Mpt(n,a),r.push(a),a}},r_t.queueElement=function(t,e){var r=this.getElementQueue(),n=this.getElementKeyToQueue(),i=this.getKey(t),a=n[i];if(a)a.level=Math.max(a.level,e),a.eles.merge(t),a.reqs++,r.updateItem(a);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(s),n[i]=s}},r_t.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<1&&r.size()>0;s++){var o=r.pop(),l=o.key,c=o.eles[0],h=a.hasCache(c,o.level);if(n[l]=null,!h){i.push(o);var u=e.getBoundingBox(c);e.getElement(c,u,t,o.level,JTt.dequeue)}}return i},r_t.removeFromQueue=function(t){var e=this.getElementQueue(),r=this.getElementKeyToQueue(),n=this.getKey(t),i=r[n];null!=i&&(1===i.eles.length?(i.reqs=vpt,e.updateItem(i),e.pop(),r[n]=null):i.eles.unmerge(t))},r_t.onDequeue=function(t){this.onDequeues.push(t)},r_t.offDequeue=function(t){Mpt(this.onDequeues,t)},r_t.setupDequeueing=ZTt.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:o((function(t,e,r){return t.dequeue(e,r)}),"deq"),onDeqd:o((function(t,e){for(var r=0;r<t.onDequeues.length;r++){(0,t.onDequeues[r])(e)}}),"onDeqd"),shouldRedraw:o((function(t,e,r,n){for(var i=0;i<e.length;i++)for(var a=e[i].eles,s=0;s<a.length;s++){var o=a[s].boundingBox();if(Mgt(o,n))return!0}return!1}),"shouldRedraw"),priority:o((function(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}),"priority")});var n_t=o((function(t){var e=this,r=e.renderer=t,n=r.cy;e.layersByLevel={},e.firstGet=!0,e.lastInvalidationTime=ept()-500,e.skipping=!1,e.eleTxrDeqs=n.collection(),e.scheduleElementRefinement=Kdt((function(){e.refineElementTextures(e.eleTxrDeqs),e.eleTxrDeqs.unmerge(e.eleTxrDeqs)}),50),r.beforeRender((function(t,r){r-e.lastInvalidationTime<=250?e.skipping=!0:e.skipping=!1}),r.beforeRenderPriorities.lyrTxrSkip);var i=o((function(t,e){return e.reqs-t.reqs}),"qSort");e.layersQueue=new Wpt(i),e.setupDequeueing()}),"LayeredTextureCache"),i_t=n_t.prototype,a_t=0,s_t=Math.pow(2,53)-1;i_t.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),i=Math.ceil(t.h*r),a=this.renderer.makeOffscreenCanvas(n,i),s={id:a_t=++a_t%s_t,bb:t,level:e,width:n,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,c=-s.bb.y1;return o.scale(r,r),o.translate(l,c),s},i_t.getLayers=function(t,e,r){var n=this,i=n.renderer.cy.zoom(),a=n.firstGet;if(n.firstGet=!1,null==r)if((r=Math.ceil(fgt(i*e)))<-4)r=-4;else if(i>=3.99||r>2)return null;n.validateLayersElesOrdering(r,t);var s,l,c=n.layersByLevel,h=Math.pow(2,r),u=c[r]=c[r]||[],d=n.levelIsComplete(r,t),p=o((function(){var e=o((function(e){if(n.validateLayersElesOrdering(e,t),n.levelIsComplete(e,t))return l=c[e],!0}),"canUseAsTmpLvl"),i=o((function(t){if(!l)for(var n=r+t;-4<=n&&n<=2&&!e(n);n+=t);}),"checkLvls");i(1),i(-1);for(var a=u.length-1;a>=0;a--){var s=u[a];s.invalid&&Mpt(u,s)}}),"checkTempLevels");if(d)return u;p();var g=o((function(){if(!s){s=_gt();for(var e=0;e<t.length;e++)Agt(s,t[e].boundingBox())}return s}),"getBb"),f=o((function(t){var e=(t=t||{}).after;g();var i=Math.ceil(s.w*h),a=Math.ceil(s.h*h);if(i>32767||a>32767)return null;if(i*a>16e6)return null;var o=n.makeLayer(s,r);if(null!=e){var l=u.indexOf(e)+1;u.splice(l,0,o)}else(void 0===t.insert||t.insert)&&u.unshift(o);return o}),"makeLayer");if(n.skipping&&!a)return null;for(var m=null,y=t.length/1,v=!a,x=0;x<t.length;x++){var b=t[x],w=b._private.rscratch,k=w.imgLayerCaches=w.imgLayerCaches||{},T=k[r];if(T)m=T;else{if((!m||m.eles.length>=y||!Pgt(m.bb,b.boundingBox()))&&!(m=f({insert:!0,after:m})))return null;l||v?n.queueLayer(m,b):n.drawEleInLayer(m,b,r,e),m.eles.push(b),k[r]=m}}return l||(v?null:u)},i_t.getEleLevelForLayerLevel=function(t,e){return t},i_t.drawEleInLayer=function(t,e,r,n){var i=this.renderer,a=t.context,s=e.boundingBox();0!==s.w&&0!==s.h&&e.visible()&&(r=this.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(a,!1),i.drawCachedElement(a,e,null,null,r,true),i.setImgSmoothing(a,!0))},i_t.levelIsComplete=function(t,e){var r=this.layersByLevel[t];if(!r||0===r.length)return!1;for(var n=0,i=0;i<r.length;i++){var a=r[i];if(a.reqs>0)return!1;if(a.invalid)return!1;n+=a.eles.length}return n===e.length},i_t.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var i=r[n],a=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){a=s;break}if(a<0)this.invalidateLayer(i);else{var o=a;for(s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}}},i_t.updateElementsInLayers=function(t,e){for(var r=But(t[0]),n=0;n<t.length;n++)for(var i=r?null:t[n],a=r?t[n]:t[n].ele,s=a._private.rscratch,o=s.imgLayerCaches=s.imgLayerCaches||{},l=-4;l<=2;l++){var c=o[l];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||e(c,a,i))}},i_t.haveLayers=function(){for(var t=!1,e=-4;e<=2;e++){var r=this.layersByLevel[e];if(r&&r.length>0){t=!0;break}}return t},i_t.invalidateElements=function(t){var e=this;0!==t.length&&(e.lastInvalidationTime=ept(),0!==t.length&&e.haveLayers()&&e.updateElementsInLayers(t,o((function(t,r,n){e.invalidateLayer(t)}),"invalAssocLayers")))},i_t.invalidateLayer=function(t){if(this.lastInvalidationTime=ept(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Mpt(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<r.length;i++){var a=r[i]._private.rscratch.imgLayerCaches;a&&(a[e]=null)}}},i_t.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,o((function(t,r,n){var i=t.replacement;if(i||((i=t.replacement=e.makeLayer(t.bb,t.level)).replaces=t,i.eles=t.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)e.queueLayer(i,i.eles[a])}),"refineEachEle"))},i_t.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},i_t.queueLayer=function(t,e){var r=this.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}},i_t.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],i=0;i<1&&0!==r.size();){var a=r.peek();if(a.replacement)r.pop();else if(a.replaces&&a!==a.replaces.replacement)r.pop();else if(a.invalid)r.pop();else{var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),0===n.length&&n.push(!0),0===a.elesQueue.length&&(r.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}}return n},i_t.applyLayerReplacement=function(t){var e=this.layersByLevel[t.level],r=t.replaces,n=e.indexOf(r);if(!(n<0||r.invalid)){e[n]=t;for(var i=0;i<t.eles.length;i++){var a=t.eles[i]._private,s=a.imgLayerCaches=a.imgLayerCaches||{};s&&(s[t.level]=t)}this.requestRedraw()}},i_t.requestRedraw=Kdt((function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()}),100),i_t.setupDequeueing=ZTt.setupDequeueing({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:o((function(t,e){return t.dequeue(e)}),"deq"),onDeqd:kpt,shouldRedraw:xpt,priority:o((function(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}),"priority")});var o_t,l_t={};function c_t(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function h_t(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];0===i&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function u_t(t,e,r){t.beginPath&&t.beginPath();for(var n=e,i=0;i<n.length;i++){var a=n[i];t.lineTo(a.x,a.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(i=1;i<s.length;i++){a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function d_t(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,2*Math.PI,!1);var a=e,s=a[0];t.moveTo(s.x,s.y);for(var o=0;o<a.length;o++){var l=a[o];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function p_t(t,e,r,n){t.arc(e,r,n,0,2*Math.PI,!1)}o(c_t,"polygon"),o(h_t,"triangleBackcurve"),o(u_t,"triangleTee"),o(d_t,"circleTriangle"),o(p_t,"circle"),l_t.arrowShapeImpl=function(t){return(o_t||(o_t={polygon:c_t,"triangle-backcurve":h_t,"triangle-tee":u_t,"circle-triangle":d_t,"triangle-cross":u_t,circle:p_t}))[t]};var g_t={drawElement:function(t,e,r,n,i,a){e.isNode()?this.drawNode(t,e,r,n,i,a):this.drawEdge(t,e,r,n,i,a)},drawElementOverlay:function(t,e){e.isNode()?this.drawNodeOverlay(t,e):this.drawEdgeOverlay(t,e)},drawElementUnderlay:function(t,e){e.isNode()?this.drawNodeUnderlay(t,e):this.drawEdgeUnderlay(t,e)},drawCachedElementPortion:function(t,e,r,n,i,a,s,o){var l=this,c=r.getBoundingBox(e);if(0!==c.w&&0!==c.h){var h=r.getElement(e,c,n,i,a);if(null!=h){var u=o(l,e);if(0===u)return;var d,p,g,f,m,y,v=s(l,e),x=c.x1,b=c.y1,w=c.w,k=c.h;if(0!==v){var T=r.getRotationPoint(e);g=T.x,f=T.y,t.translate(g,f),t.rotate(v),(m=l.getImgSmoothing(t))||l.setImgSmoothing(t,!0);var _=r.getRotationOffset(e);d=_.x,p=_.y}else d=x,p=b;1!==u&&(y=t.globalAlpha,t.globalAlpha=y*u),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,d,p,w,k),1!==u&&(t.globalAlpha=y),0!==v&&(t.rotate(-v),t.translate(-g,-f),m||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}}},f_t=o((function(){return 0}),"getZeroRotation"),m_t=o((function(t,e){return t.getTextAngle(e,null)}),"getLabelRotation"),y_t=o((function(t,e){return t.getTextAngle(e,"source")}),"getSourceLabelRotation"),v_t=o((function(t,e){return t.getTextAngle(e,"target")}),"getTargetLabelRotation"),x_t=o((function(t,e){return e.effectiveOpacity()}),"getOpacity"),b_t=o((function(t,e){return e.pstyle("text-opacity").pfValue*e.effectiveOpacity()}),"getTextOpacity");g_t.drawCachedElement=function(t,e,r,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,c=o.lblTxrCache,h=o.slbTxrCache,u=o.tlbTxrCache,d=e.boundingBox(),p=!0===a?l.reasons.highQuality:null;if(0!==d.w&&0!==d.h&&e.visible()&&(!n||Mgt(d,n))){var g=e.isEdge(),f=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,i,p,f_t,x_t),g&&f||s.drawCachedElementPortion(t,e,c,r,i,p,m_t,b_t),g&&!f&&(s.drawCachedElementPortion(t,e,h,r,i,p,y_t,b_t),s.drawCachedElementPortion(t,e,u,r,i,p,v_t,b_t)),s.drawElementOverlay(t,e)}},g_t.drawElements=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];this.drawElement(t,n)}},g_t.drawCachedElements=function(t,e,r,n){for(var i=0;i<e.length;i++){var a=e[i];this.drawCachedElement(t,a,r,n)}},g_t.drawCachedNodes=function(t,e,r,n){for(var i=0;i<e.length;i++){var a=e[i];a.isNode()&&this.drawCachedElement(t,a,r,n)}},g_t.drawLayeredElements=function(t,e,r,n){var i=this.data.lyrTxrCache.getLayers(e,r);if(i)for(var a=0;a<i.length;a++){var s=i[a],o=s.bb;0!==o.w&&0!==o.h&&t.drawImage(s.canvas,o.x1,o.y1,o.w,o.h)}else this.drawCachedElements(t,e,r,n)};var w_t={drawEdge:function(t,e,r){var n=!(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],s=this,l=e._private.rscratch;if((!a||e.visible())&&!l.badLine&&null!=l.allpts&&!isNaN(l.allpts[0])){var c;r&&(c=r,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=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;"straight-triangle"===d?(s.eleStrokeStyle(t,e,r),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=g,t.lineCap=f,s.eleStrokeStyle(t,e,r),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")}),"drawLine"),w=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;t.lineWidth=g+m,t.lineCap=f,m>0?(s.colorStrokeStyle(t,y[0],y[1],y[2],r),"straight-triangle"===d?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")):t.lineCap="butt"}),"drawLineOutline"),k=o((function(){i&&s.drawEdgeOverlay(t,e)}),"drawOverlay"),T=o((function(){i&&s.drawEdgeUnderlay(t,e)}),"drawUnderlay"),_=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;s.drawArrowheads(t,e,r)}),"drawArrows"),E=o((function(){s.drawElementText(t,e,null,n)}),"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(),r&&t.translate(c.x1,c.y1)}}},k_t=o((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,r){if(r.visible()){var n=r.pstyle("".concat(t,"-opacity")).value;if(0!==n){var i=this,a=i.usePaths(),s=r._private.rscratch,o=2*r.pstyle("".concat(t,"-padding")).pfValue,l=r.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],n),i.drawEdgePath(r,e,s.allpts,"solid")}}}}),"drawEdgeOverlayUnderlay");w_t.drawEdgeOverlay=k_t("overlay"),w_t.drawEdgeUnderlay=k_t("underlay"),w_t.drawEdgePath=function(t,e,r,n){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=r.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(n){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(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<r.length;d+=4)e.quadraticCurveTo(r[d],r[d+1],r[d+2],r[d+3]);break;case"straight":case"haystack":for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var g,f=but(a.roundCorners);try{for(f.s();!(g=f.n()).done;){STt(e,g.value)}}catch(t){f.e(t)}finally{f.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var m=2;m+1<r.length;m+=2)e.lineTo(r[m],r[m+1])}e=s,l?e.stroke(i):e.stroke(),e.setLineDash&&e.setLineDash([])},w_t.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,i=0;i+1<r.length;i+=2){var a=[r[i+2]-r[i],r[i+3]-r[i+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=[a[1]/s,-a[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[i]-l[0],r[i+1]-l[1]),e.lineTo(r[i]+l[0],r[i+1]+l[1]),e.lineTo(r[i+2],r[i+3]),e.closePath(),e.fill()}},w_t.drawArrowheads=function(t,e,r){var n=e._private.rscratch,i="haystack"===n.edgeType;i||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),i||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},w_t.drawArrowhead=function(t,e,r,n,i,a,s){if(!(isNaN(n)||null==n||isNaN(i)||null==i||isNaN(a)||null==a)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if("none"!==l){var c="hollow"===e.pstyle(r+"-arrow-fill").value?"both":"filled",h=e.pstyle(r+"-arrow-fill").value,u=e.pstyle("width").pfValue,d=e.pstyle(r+"-arrow-width"),p="match-line"===d.value?u:d.pfValue;"%"===d.units&&(p*=u);var g=e.pstyle("opacity").value;void 0===s&&(s=g);var f=t.globalCompositeOperation;1===s&&"hollow"!==h||(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,c,u,l,p,n,i,a),t.globalCompositeOperation=f);var m=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,m[0],m[1],m[2],s),o.colorStrokeStyle(t,m[0],m[1],m[2],s),o.drawArrowShape(e,t,h,u,l,p,n,i,a)}}},w_t.drawArrowShape=function(t,e,r,n,i,a,s,o,l){var c,h=this,u=this.usePaths()&&"triangle-cross"!==i,d=!1,p=e,g={x:s,y:o},f=t.pstyle("arrow-scale").value,m=this.getArrowWidth(n,f),y=h.arrowShapes[i];if(u){var v=h.arrowPathCache=h.arrowPathCache||[],x=dpt(i),b=v[x];null!=b?(c=e=b,d=!0):(c=e=new Path2D,v[x]=c)}d||(e.beginPath&&e.beginPath(),u?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,m,l,g,n),e.closePath&&e.closePath()),e=p,u&&(e.translate(s,o),e.rotate(l),e.scale(m,m)),"filled"!==r&&"both"!==r||(u?e.fill(c):e.fill()),"hollow"!==r&&"both"!==r||(e.lineWidth=a/(u?m:1),e.lineJoin="miter",u?e.stroke(c):e.stroke()),u&&(e.scale(1/m,1/m),e.rotate(-l),e.translate(-s,-o))};var T_t={safeDrawImage:function(t,e,r,n,i,a,s,o,l,c){if(!(i<=0||a<=0||l<=0||c<=0))try{t.drawImage(e,r,n,i,a,s,o,l,c)}catch(t){Ept(t)}},drawInscribedImage:function(t,e,r,n,i){var a=this,s=r.position(),o=s.x,l=s.y,c=r.cy().style(),h=c.getIndexedStyle.bind(c),u=h(r,"background-fit","value",n),d=h(r,"background-repeat","value",n),p=r.width(),g=r.height(),f=2*r.padding(),m=p+("inner"===h(r,"background-width-relative-to","value",n)?0:f),y=g+("inner"===h(r,"background-height-relative-to","value",n)?0:f),v=r._private.rscratch,x="node"===h(r,"background-clip","value",n),b=h(r,"background-image-opacity","value",n)*i,w=h(r,"background-image-smoothing","value",n),k=r.pstyle("corner-radius").value;"auto"!==k&&(k=r.pstyle("corner-radius").pfValue);var T=e.width||e.cachedW,_=e.height||e.cachedH;null!=T&&null!=_||(document.body.appendChild(e),T=e.cachedW=e.width||e.offsetWidth,_=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var E=T,C=_;if("auto"!==h(r,"background-width","value",n)&&(E="%"===h(r,"background-width","units",n)?h(r,"background-width","pfValue",n)*m:h(r,"background-width","pfValue",n)),"auto"!==h(r,"background-height","value",n)&&(C="%"===h(r,"background-height","units",n)?h(r,"background-height","pfValue",n)*y:h(r,"background-height","pfValue",n)),0!==E&&0!==C){if("contain"===u)E*=S=Math.min(m/E,y/C),C*=S;else if("cover"===u){var S;E*=S=Math.max(m/E,y/C),C*=S}var A=o-m/2,L=h(r,"background-position-x","units",n),N=h(r,"background-position-x","pfValue",n);A+="%"===L?(m-E)*N:N;var I=h(r,"background-offset-x","units",n),R=h(r,"background-offset-x","pfValue",n);A+="%"===I?(m-E)*R:R;var M=l-y/2,D=h(r,"background-position-y","units",n),O=h(r,"background-position-y","pfValue",n);M+="%"===D?(y-C)*O:O;var P=h(r,"background-offset-y","units",n),B=h(r,"background-offset-y","pfValue",n);M+="%"===P?(y-C)*B:B,v.pathCache&&(A-=o,M-=l,o=0,l=0);var $=t.globalAlpha;t.globalAlpha=b;var F=a.getImgSmoothing(t),z=!1;if("no"===w&&F?(a.setImgSmoothing(t,!1),z=!0):"yes"!==w||F||(a.setImgSmoothing(t,!0),z=!0),"no-repeat"===d)x&&(t.save(),v.pathCache?t.clip(v.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,m,y,k,v),t.clip())),a.safeDrawImage(t,e,0,0,T,_,A,M,E,C),x&&t.restore();else{var U=t.createPattern(e,d);t.fillStyle=U,a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,m,y,k,v),t.translate(A,M),t.fill(),t.translate(-A,-M)}t.globalAlpha=$,z&&a.setImgSmoothing(t,F)}}},__t={};function E_t(t,e,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+a,r),t.lineTo(e+n-a,r),t.quadraticCurveTo(e+n,r,e+n,r+a),t.lineTo(e+n,r+i-a),t.quadraticCurveTo(e+n,r+i,e+n-a,r+i),t.lineTo(e+a,r+i),t.quadraticCurveTo(e,r+i,e,r+i-a),t.lineTo(e,r+a),t.quadraticCurveTo(e,r,e+a,r),t.closePath(),s?t.stroke():t.fill()}__t.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(fgt(r*n));e=Math.pow(2,i)}return!(t.pstyle("font-size").pfValue*e<t.pstyle("min-zoomed-font-size").pfValue)},__t.drawElementText=function(t,e,r,n,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this;if(null==n){if(a&&!s.eleTextBiggerThanMin(e))return}else if(!1===n)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=!r;r&&(p=r,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),r&&t.translate(p.x1,p.y1)},__t.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if((e=this.fontCaches[r]).context===t)return e;return e={context:t},this.fontCaches.push(e),e},__t.setupTextStyle=function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+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)},o(E_t,"roundRect"),__t.getTextAngle=function(t,e){var r,n=t._private.rscratch,i=e?e+"-":"",a=t.pstyle(i+"text-rotation");if("autorotate"===a.strValue){var s=Ppt(n,"labelAngle",e);r=t.isEdge()?s:0}else r="none"===a.strValue?0:a.pfValue;return r},__t.drawText=function(t,e,r){var n=!(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"===r&&(r=null);var l,c,h=Ppt(s,"labelX",r),u=Ppt(s,"labelY",r),d=this.getLabelText(e,r);if(null!=d&&""!==d&&!isNaN(h)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p,g=r?r+"-":"",f=Ppt(s,"labelWidth",r),m=Ppt(s,"labelHeight",r),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=n?this.getTextAngle(e,r):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,R=m+2*E;if(k>0){var M=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",S?E_t(t,L,N,I,R,A):t.fillRect(L,N,I,R),t.fillStyle=M}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?E_t(t,L,N,I,R,A,"stroke"):t.strokeRect(L,N,I,R),"double"===$){var F=_/2;S?E_t(t,L+F,N+F,I-2*F,R-2*F,A,"stroke"):t.strokeRect(L+F,N+F,I-2*F,R-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=Ppt(s,"labelWrapCachedLines",r),G=Ppt(s,"labelLineHeight",r),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 W=0;W<U.length;W++)z>0&&t.strokeText(U[W],h,u),t.fillText(U[W],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 C_t={drawNode:function(t,e,r){var n,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=!(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(Mut(d.x)&&Mut(d.y)&&(!l||e.visible())){var p,g,f=l?e.effectiveOpacity():1,m=c.usePaths(),y=!1,v=e.padding();n=e.width()+2*v,i=e.height()+2*v,r&&(g=r,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;_<b.length;_++){var E=b[_],C=w[_]=null!=E&&"none"!==E;if(C){var S=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);T++,k[_]=c.getCachedImage(E,S,(function(){h.backgroundTimestamp=Date.now(),e.emitAndNotify("background")}))}}var A=e.pstyle("background-blacken").value,L=e.pstyle("border-width").pfValue,N=e.pstyle("background-opacity").value*f,I=e.pstyle("border-color").value,R=e.pstyle("border-style").value,M=e.pstyle("border-join").value,D=e.pstyle("border-cap").value,O=e.pstyle("border-position").value,P=e.pstyle("border-dash-pattern").pfValue,B=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*f,F=e.pstyle("outline-width").pfValue,z=e.pstyle("outline-color").value,U=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*f,q=e.pstyle("outline-offset").value,j=e.pstyle("corner-radius").value;"auto"!==j&&(j=e.pstyle("corner-radius").pfValue);var W=o((function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;c.eleFillStyle(t,e,r)}),"setupShapeColor"),Y=o((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$;c.colorStrokeStyle(t,I[0],I[1],I[2],e)}),"setupBorderColor"),H=o((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=o((function(t,e,r,n){var i,a=c.nodePathCache=c.nodePathCache||[],s=ppt("polygon"===r?r+","+n.join(","):r,""+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(n,i,X,K);p=Z.path,y=Z.cacheHit}var Q=o((function(){if(!y){var r=d;m&&(r={x:0,y:0}),c.nodeShapes[c.getNodeShape(e)].draw(p||t,r.x,r.y,n,i,j,u)}m?t.fill(p):t.fill()}),"drawShape"),J=o((function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=h.backgrounding,a=0,s=0;s<k.length;s++){var o=e.cy().style().getIndexedStyle(e,"background-image-containment","value",s);n&&"over"===o||!n&&"inside"===o?a++:w[s]&&k[s].complete&&!k[s].error&&(a++,c.drawInscribedImage(t,k[s],e,s,r))}h.backgrounding=!(a===T),i!==h.backgrounding&&e.updateStyle(!1)}),"drawImages"),tt=o((function(){var r=arguments.length>0&&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),r&&(m||c.nodeShapes[c.getNodeShape(e)].draw(t,d.x,d.y,n,i,j,u)))}),"drawPie"),et=o((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=(A>0?A:-A)*e,n=A>0?0:255;0!==A&&(c.colorFillStyle(t,n,n,n,r),m?t.fill(p):t.fill())}),"darken"),rt=o((function(){if(L>0){if(t.lineWidth=L,t.lineCap=D,t.lineJoin=M,t.setLineDash)switch(R){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(-n/2-L,-i/2-L,n+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"===R){t.lineWidth=L/3;var r=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(p):t.stroke(),t.globalCompositeOperation=r}t.setLineDash&&t.setLineDash([])}}),"drawBorder"),nt=o((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 r=d;m&&(r={x:0,y:0});var a=c.getNodeShape(e),s=L;"inside"===O&&(s=0),"outside"===O&&(s*=2);var o,l=(n+s+(F+q))/n,h=(i+s+(F+q))/i,u=n*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,r.x,r.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=n*(l=(n+f)/n),["round-hexagon","round-tag"].includes(a)||(p=i*(h=(i+f)/i)));for(var x=u/2,b=p/2,w=(j="auto"===j?oft(u,p):j)+(s+F+q)/2,k=new Array(g.length/2),T=new Array(g.length/2),_=0;_<g.length/2;_++)k[_]={x:r.x+y+x*g[2*_],y:r.y+v+b*g[2*_+1]};var E,C,S,A,N=k.length;for(C=k[N-1],E=0;E<N;E++)S=k[E%N],A=k[(E+1)%N],T[E]=ATt(C,S,A,w),C=S,S=A;c.drawRoundPolygonPath(o||t,r.x+y,r.y+v,n*l,i*h,g,T)}else if(["roundrectangle","round-rectangle"].includes(a))j="auto"===j?sft(u,p):j,c.drawRoundRectanglePath(o||t,r.x,r.y,u,p,j+(s+F+q)/2);else if(["cutrectangle","cut-rectangle"].includes(a))j="auto"===j?lft():j,c.drawCutRectanglePath(o||t,r.x,r.y,u,p,null,j+(s+F+q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(a))j="auto"===j?sft(u,p):j,c.drawBottomRoundRectanglePath(o||t,r.x,r.y,u,p,j+(s+F+q)/2);else if("barrel"===a)c.drawBarrelPath(o||t,r.x,r.y,u,p);else if(a.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(a)){g=Hgt(Vgt(g,(s+F+q)/n)),c.drawPolygonPath(o||t,r.x,r.y,n,i,g)}else{g=Hgt(Vgt(g,-((s+F+q)/n))),c.drawPolygonPath(o||t,r.x,r.y,n,i,g)}if(m?t.stroke(o):t.stroke(),"double"===U){t.lineWidth=s/3;var I=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(o):t.stroke(),t.globalCompositeOperation=I}t.setLineDash&&t.setLineDash([])}}),"drawOutline"),it=o((function(){s&&c.drawNodeOverlay(t,e,d,n,i)}),"drawOverlay"),at=o((function(){s&&c.drawNodeUnderlay(t,e,d,n,i)}),"drawUnderlay"),st=o((function(){c.drawElementText(t,e,null,a)}),"drawText"),ot="yes"===e.pstyle("ghost").value;if(ot){var lt=e.pstyle("ghost-offset-x").pfValue,ct=e.pstyle("ghost-offset-y").pfValue,ht=e.pstyle("ghost-opacity").value,ut=ht*f;t.translate(lt,ct),H(),nt(),W(ht*N),Q(),J(ut,!0),Y(ht*$),rt(),tt(0!==A||0!==L),J(ut,!1),et(ut),t.translate(-lt,-ct)}m&&t.translate(-d.x,-d.y),at(),m&&t.translate(d.x,d.y),H(),nt(),W(),Q(),J(f,!0),Y(),rt(),tt(0!==A||0!==L),J(f,!1),et(),m&&t.translate(-d.x,-d.y),st(),it(),r&&t.translate(g.x1,g.y1)}}},S_t=o((function(t){if(!["overlay","underlay"].includes(t))throw new Error("Invalid state");return function(e,r,n,i,a){if(r.visible()){var s=r.pstyle("".concat(t,"-padding")).pfValue,o=r.pstyle("".concat(t,"-opacity")).value,l=r.pstyle("".concat(t,"-color")).value,c=r.pstyle("".concat(t,"-shape")).value,h=r.pstyle("".concat(t,"-corner-radius")).value;if(o>0){if(n=n||r.position(),null==i||null==a){var u=r.padding();i=r.width()+2*u,a=r.height()+2*u}this.colorFillStyle(e,l[0],l[1],l[2],o),this.nodeShapes[c].draw(e,n.x,n.y,i+2*s,a+2*s,h),e.fill()}}}}),"drawNodeOverlayUnderlay");C_t.drawNodeOverlay=S_t("overlay"),C_t.drawNodeUnderlay=S_t("underlay"),C_t.hasPie=function(t){return(t=t[0])._private.hasPie},C_t.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=n.x,o=n.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*r,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 A_t,L_t={};function N_t(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function I_t(t,e,r){var n=N_t(t,t.VERTEX_SHADER,e),i=N_t(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function R_t(t,e,r){void 0===r&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function M_t(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function D_t(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return[a,s=Math.round(t.canvasHeight-s)]}function O_t(t,e,r){var n=t[0]/255,i=t[1]/255,a=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=i*s,o[2]=a*s,o[3]=s,o}function P_t(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function B_t(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function $_t(t,e){var r=t.createTexture();return r.buffer=function(e){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function F_t(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function z_t(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function U_t(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function G_t(t,e,r,n){var i=hut(F_t(t,e),2),a=i[0],s=i[1],o=z_t(t,s,n),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,o,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,a,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,a,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function q_t(t,e,r,n){var i=hut(F_t(t,r),3),a=i[0],s=i[1],o=i[2],l=z_t(t,s,e*a),c=a*o,h=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e*c,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),s===t.FLOAT?t.vertexAttribPointer(n,a,s,!1,c,0):s===t.INT&&t.vertexAttribIPointer(n,a,s,c,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var u=new Array(e),d=0;d<e;d++)u[d]=U_t(t,s,l,c,a,d);return h.dataArray=l,h.stride=c,h.size=a,h.getView=function(t){return u[t]},h.setPoint=function(t,e,r){var n=u[t];n[0]=e,n[1]=r},h.bufferSubData=function(e){t.bindBuffer(t.ARRAY_BUFFER,h),e?t.bufferSubData(t.ARRAY_BUFFER,0,l,0,e*a):t.bufferSubData(t.ARRAY_BUFFER,0,l)},h}function j_t(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(e,n){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}L_t.getPixelRatio=function(){var t=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},L_t.paintCache=function(t){for(var e,r=this.paintCaches=this.paintCaches||[],n=!0,i=0;i<r.length;i++)if((e=r[i]).context===t){n=!1;break}return n&&(e={context:t},r.push(e)),e},L_t.createGradientStyleFor=function(t,e,r,n,i){var a,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if("radial-gradient"===n)if(r.isEdge()){var c=r.sourceEndpoint(),h=r.targetEndpoint(),u=r.midpoint(),d=ygt(c,u),p=ygt(h,u);a=t.createRadialGradient(u.x,u.y,0,u.x,u.y,Math.max(d,p))}else{var g=s?{x:0,y:0}:r.position(),f=r.paddedWidth(),m=r.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(f,m))}else if(r.isEdge()){var y=r.sourceEndpoint(),v=r.targetEndpoint();a=t.createLinearGradient(y.x,y.y,v.x,v.y)}else{var x=s?{x:0,y:0}:r.position(),b=r.paddedWidth()/2,w=r.paddedHeight()/2;switch(r.pstyle("background-gradient-direction").value){case"to-bottom":a=t.createLinearGradient(x.x,x.y-w,x.x,x.y+w);break;case"to-top":a=t.createLinearGradient(x.x,x.y+w,x.x,x.y-w);break;case"to-left":a=t.createLinearGradient(x.x+b,x.y,x.x-b,x.y);break;case"to-right":a=t.createLinearGradient(x.x-b,x.y,x.x+b,x.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(x.x-b,x.y-w,x.x+b,x.y+w);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(x.x-b,x.y+w,x.x+b,x.y-w);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(x.x+b,x.y-w,x.x-b,x.y+w);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(x.x+b,x.y+w,x.x-b,x.y-w)}}if(!a)return null;for(var k=l.length===o.length,T=o.length,_=0;_<T;_++)a.addColorStop(k?l[_]:_/(T-1),"rgba("+o[_][0]+","+o[_][1]+","+o[_][2]+","+i+")");return a},L_t.gradientFillStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"background",e,r,n);if(!i)return null;t.fillStyle=i},L_t.colorFillStyle=function(t,e,r,n,i){t.fillStyle="rgba("+e+","+r+","+n+","+i+")"},L_t.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientFillStyle(t,e,n,r);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],r)}},L_t.gradientStrokeStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"line",e,r,n);if(!i)return null;t.strokeStyle=i},L_t.colorStrokeStyle=function(t,e,r,n,i){t.strokeStyle="rgba("+e+","+r+","+n+","+i+")"},L_t.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientStrokeStyle(t,e,n,r);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],r)}},L_t.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),i=n[2],a=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;t!==e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]&&t!==e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]||(s=o);var l,c=i*s,h=a*s;if(c!==e.canvasWidth||h!==e.canvasHeight){e.fontCaches=null;var u=r.canvasContainer;u.style.width=i+"px",u.style.height=a+"px";for(var d=0;d<e.CANVAS_LAYERS;d++)(l=r.canvases[d]).width=c,l.height=h,l.style.width=i+"px",l.style.height=a+"px";for(d=0;d<e.BUFFER_COUNT;d++)(l=r.bufferCanvases[d]).width=c,l.height=h,l.style.width=i+"px",l.style.height=a+"px";e.textureMult=1,s<=1&&(l=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,l.width=c*e.textureMult,l.height=h*e.textureMult),e.canvasWidth=c,e.canvasHeight=h,e.pixelRatio=s}},L_t.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},L_t.clearCanvas=function(){var t=this,e=t.data;function r(e){e.clearRect(0,0,t.canvasWidth,t.canvasHeight)}o(r,"clear"),r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])},L_t.render=function(t){var e=this;t=t||Ipt();var r=e.cy,n=t.forcedContext,i=t.drawAllLayers,a=t.drawOnlyNodeLayer,s=t.forcedZoom,l=t.forcedPan,c=void 0===t.forcedPxRatio?this.getPixelRatio():t.forcedPxRatio,h=e.data,u=h.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),p=void 0!==t.motionBlur?t.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,f=r.hasCompoundNodes(),m=e.hoverData.draggingEles,y=!(!e.hoverData.selecting&&!e.touchData.selecting),v=p=p&&!n&&e.motionBlurEnabled&&!y;n||(e.prevPxRatio!==c&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=c),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),p&&(null==e.mbFrames&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(v=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(u[e.NODE]=!0,u[e.SELECT_BOX]=!0);var x=r.style(),b=r.zoom(),w=void 0!==s?s:b,k=r.pan(),T={x:k.x,y:k.y},_={zoom:b,pan:{x:k.x,y:k.y}},E=e.prevViewport;void 0===E||_.zoom!==E.zoom||_.pan.x!==E.pan.x||_.pan.y!==E.pan.y||m&&!f||(e.motionBlurPxRatio=1),l&&(T=l),w*=c,T.x*=c,T.y*=c;var C=e.getCachedZSortedEles();function S(t,r,n,i,a){var s=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",e.colorFillStyle(t,255,255,255,e.motionBlurTransparency),t.fillRect(r,n,i,a),t.globalCompositeOperation=s}function A(t,r){var a,o,c,u;e.clearingMotionBlur||t!==h.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]&&t!==h.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]?(a=T,o=w,c=e.canvasWidth,u=e.canvasHeight):(a={x:k.x*g,y:k.y*g},o=b*g,c=e.canvasWidth*g,u=e.canvasHeight*g),t.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(t,0,0,c,u):n||void 0!==r&&!r||t.clearRect(0,0,c,u),i||(t.translate(a.x,a.y),t.scale(o,o)),l&&t.translate(l.x,l.y),s&&t.scale(s,s)}if(o(S,"mbclear"),o(A,"setContextTransform"),d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var L=e.data.bufferContexts[e.TEXTURE_BUFFER];L.setTransform(1,0,0,1,0,0),L.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:L,drawOnlyNodeLayer:!0,forcedPxRatio:c*e.textureMult}),(_=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}u[e.DRAG]=!1,u[e.NODE]=!1;var N=h.contexts[e.NODE],I=e.textureCache.texture;_=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),p?S(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var R=x.core("outside-texture-bg-color").value,M=x.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,R[0],R[1],R[2],M),N.fillRect(0,0,_.width,_.height);b=r.zoom();A(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/c,_.height/_.zoom/c),N.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/c,_.height/_.zoom/c)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),O=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),P=e.hideEdgesOnViewport&&O,B=[];if(B[e.NODE]=!u[e.NODE]&&p&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,B[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),B[e.DRAG]=!u[e.DRAG]&&p&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,B[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),u[e.NODE]||i||a||B[e.NODE]){var $=p&&!B[e.NODE]&&1!==g;A(N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:h.contexts[e.NODE]),p&&!$?"motionBlur":void 0),P?e.drawCachedNodes(N,C.nondrag,c,D):e.drawLayeredElements(N,C.nondrag,c,D),e.debug&&e.drawDebugPoints(N,C.nondrag),i||p||(u[e.NODE]=!1)}if(!a&&(u[e.DRAG]||i||B[e.DRAG])){$=p&&!B[e.DRAG]&&1!==g;A(N=n||($?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:h.contexts[e.DRAG]),p&&!$?"motionBlur":void 0),P?e.drawCachedNodes(N,C.drag,c,D):e.drawCachedElements(N,C.drag,c,D),e.debug&&e.drawDebugPoints(N,C.drag),i||p||(u[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,A),p&&1!==g){var F=h.contexts[e.NODE],z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],U=h.contexts[e.DRAG],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],q=o((function(t,r,n){t.setTransform(1,0,0,1,0,0),n||!v?t.clearRect(0,0,e.canvasWidth,e.canvasHeight):S(t,0,0,e.canvasWidth,e.canvasHeight);var i=g;t.drawImage(r,0,0,e.canvasWidth*i,e.canvasHeight*i,0,0,e.canvasWidth,e.canvasHeight)}),"drawMotionBlur");(u[e.NODE]||B[e.NODE])&&(q(F,z,B[e.NODE]),u[e.NODE]=!1),(u[e.DRAG]||B[e.DRAG])&&(q(U,G,B[e.DRAG]),u[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),p&&(e.motionBlurTimeout=setTimeout((function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,u[e.NODE]=!0,u[e.DRAG]=!0,e.redraw()}),100)),n||r.emit("render")},L_t.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,c=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=c||i.contexts[r.SELECT_BOX];if(e(h),1==r.selection[4]&&(r.hoverData.selecting||r.touchData.selecting)){var u=r.cy.zoom(),d=a.core("selection-box-border-width").value/u;h.lineWidth=d,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),d>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){u=r.cy.zoom();var p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/u,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var f=Math.round(1e3/g),m="1 frame = "+g+" ms = "+f+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!A_t){var y=h.measureText(m);A_t=y.actualBoundingBoxAscent}h.fillText(m,0,A_t);h.strokeRect(0,A_t+10,250,20),h.fillRect(0,A_t+10,250*Math.min(f/60,1),20)}o||(l[r.SELECT_BOX]=!1)}},o(N_t,"compileShader"),o(I_t,"createProgram"),o(R_t,"createTextureCanvas"),o(M_t,"getEffectivePanZoom"),o(D_t,"modelToRenderedPosition"),o(O_t,"toWebGLColor"),o(P_t,"indexToVec4"),o(B_t,"vec4ToIndex"),o($_t,"createTexture"),o(F_t,"getTypeInfo"),o(z_t,"createTypedArray"),o(U_t,"createTypedArrayView"),o(G_t,"createBufferStaticDraw"),o(q_t,"createBufferDynamicDraw"),o(j_t,"createPickingFrameBuffer");var W_t="undefined"!=typeof Float32Array?Float32Array:Array;function Y_t(){var t=new W_t(9);return W_t!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function H_t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function V_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=r[0],p=r[1],g=r[2],f=r[3],m=r[4],y=r[5],v=r[6],x=r[7],b=r[8];return t[0]=d*n+p*s+g*c,t[1]=d*i+p*o+g*h,t[2]=d*a+p*l+g*u,t[3]=f*n+m*s+y*c,t[4]=f*i+m*o+y*h,t[5]=f*a+m*l+y*u,t[6]=v*n+x*s+b*c,t[7]=v*i+x*o+b*h,t[8]=v*a+x*l+b*u,t}function X_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=d*n+p*s+c,t[7]=d*i+p*o+h,t[8]=d*a+p*l+u,t}function K_t(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=Math.sin(r),p=Math.cos(r);return t[0]=p*n+d*s,t[1]=p*i+d*o,t[2]=p*a+d*l,t[3]=p*s-d*n,t[4]=p*o-d*i,t[5]=p*l-d*a,t[6]=c,t[7]=h,t[8]=u,t}function Z_t(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Q_t(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),o(Y_t,"create"),o(H_t,"identity"),o(V_t,"multiply"),o(X_t,"translate"),o(K_t,"rotate"),o(Z_t,"scale"),o(Q_t,"projection");var J_t={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},tEt=Rpt({getKey:null,drawElement:null,getBoundingBox:null,getRotation:null,getRotationPoint:null,getRotationOffset:null,isVisible:null,getPadding:null}),eEt=function(){function t(e,r){sut(this,t),this.debugID=Math.floor(1e4*Math.random()),this.r=e,this.atlasSize=r.webglTexSize,this.rows=r.webglTexRows,this.enableWrapping=r.enableWrapping,this.texHeight=Math.floor(this.atlasSize/this.rows),this.maxTexWidth=this.atlasSize,this.texture=null,this.canvas=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=r.createTextureCanvas(e,this.atlasSize,this.atlasSize),this.scratch=r.createTextureCanvas(e,this.atlasSize,this.texHeight,"scratch")}return o(t,"Atlas"),lut(t,[{key:"getKeys",value:o((function(){return new Set(this.keyToLocation.keys())}),"getKeys")},{key:"getScale",value:o((function(t){var e=t.w,r=t.h,n=this.texHeight,i=this.maxTexWidth,a=n/r,s=e*a,o=r*a;return s>i&&(s=e*(a=i/e),o=r*a),{scale:a,texW:s,texH:o}}),"getScale")},{key:"draw",value:o((function(t,e,r){var n=this,i=this.atlasSize,a=this.rows,s=this.texHeight,l=this.getScale(e),c=l.scale,h=l.texW,u=l.texH,d=[null,null],p=o((function(t,n){if(r&&n){var i=n.context,a=t.x,o=t.row,l=a,h=s*o;i.save(),i.translate(l,h),i.scale(c,c),r(i,e),i.restore()}}),"drawAt"),g=o((function(){p(n.freePointer,n.canvas),d[0]={x:n.freePointer.x,y:n.freePointer.row*s,w:h,h:u},d[1]={x:n.freePointer.x+h,y:n.freePointer.row*s,w:0,h:u},n.freePointer.x+=h,n.freePointer.x==i&&(n.freePointer.x=0,n.freePointer.row++)}),"drawNormal"),f=o((function(){var t=n.scratch,e=n.canvas;t.clear(),p({x:0,row:0},t);var r=i-n.freePointer.x,a=h-r,o=s,l=n.freePointer.x,c=n.freePointer.row*s,g=r;e.context.drawImage(t,0,0,g,o,l,c,g,o),d[0]={x:l,y:c,w:g,h:u};var f=r,m=(n.freePointer.row+1)*s,y=a;e&&e.context.drawImage(t,f,0,y,o,0,m,y,o),d[1]={x:0,y:m,w:y,h:u},n.freePointer.x=a,n.freePointer.row++}),"drawWrapped"),m=o((function(){n.freePointer.x=0,n.freePointer.row++}),"moveToStartOfNextRow");if(this.freePointer.x+h<=i)g();else{if(this.freePointer.row>=a-1)return!1;this.freePointer.x===i?(m(),g()):this.enableWrapping?f():(m(),g())}return this.keyToLocation.set(t,d),this.needsBuffer=!0,d}),"draw")},{key:"getOffsets",value:o((function(t){return this.keyToLocation.get(t)}),"getOffsets")},{key:"isEmpty",value:o((function(){return 0===this.freePointer.x&&0===this.freePointer.row}),"isEmpty")},{key:"canFit",value:o((function(t){var e=this.atlasSize,r=this.rows,n=this.getScale(t).texW;return!(this.freePointer.x+n>e)||this.freePointer.row<r-1}),"canFit")},{key:"bufferIfNeeded",value:o((function(t){this.texture||(this.texture=$_t(t,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1)}),"bufferIfNeeded")},{key:"dispose",value:o((function(){this.texture&&(this.texture.deleteTexture(),this.texture=null,this.needsBuffer=!0)}),"dispose")}]),t}(),rEt=function(){function t(e,r){sut(this,t),this.r=e,this.opts=r,this.keyToIds=new Map,this.idToKey=new Map,this.atlases=[],this.styleKeyToAtlas=new Map,this.styleKeyNeedsRedraw=new Set,this.forceGC=!1}return o(t,"AtlasCollection"),lut(t,[{key:"getKeys",value:o((function(){return new Set(this.styleKeyToAtlas.keys())}),"getKeys")},{key:"getIdsFor",value:o((function(t){var e=this.keyToIds.get(t);return e||(e=new Set,this.keyToIds.set(t,e)),e}),"getIdsFor")},{key:"_createAtlas",value:o((function(){var t=this.r,e=this.opts;return new eEt(t,e)}),"_createAtlas")},{key:"_getScratchCanvas",value:o((function(){if(!this.scratch){var t=this.r,e=this.opts,r=e.webglTexSize,n=Math.floor(r/e.webglTexRows);this.scratch=e.createTextureCanvas(t,r,n,"scratch")}return this.scratch}),"_getScratchCanvas")},{key:"draw",value:o((function(t,e,r,n){if(this.styleKeyNeedsRedraw.has(e)){this.styleKeyNeedsRedraw.delete(e),this.deleteKey(t,e);var i=this.styleKeyToAtlas.get(e);i&&(i.forceGC=!0),this.styleKeyToAtlas.delete(e)}var a=this.styleKeyToAtlas.get(e);return a||((a=this.atlases[this.atlases.length-1])&&a.canFit(r)||(a=this._createAtlas(),this.atlases.push(a)),a.draw(e,r,n),this.styleKeyToAtlas.set(e,a),this.getIdsFor(e).add(t),this.idToKey.set(t,e)),a}),"draw")},{key:"getAtlas",value:o((function(t){return this.styleKeyToAtlas.get(t)}),"getAtlas")},{key:"hasAtlas",value:o((function(t){return this.styleKeyToAtlas.has(t)}),"hasAtlas")},{key:"deleteKey",value:o((function(t,e){this.idToKey.delete(t),this.getIdsFor(e).delete(t)}),"deleteKey")},{key:"checkKeyIsInvalid",value:o((function(t,e){if(!this.idToKey.has(t))return!1;var r=this.idToKey.get(t);return r!=e&&(this.deleteKey(t,r),!0)}),"checkKeyIsInvalid")},{key:"_getKeysToCollect",value:o((function(){var t,e=new Set,r=but(this.styleKeyToAtlas.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;0==this.getIdsFor(n).size&&e.add(n)}}catch(t){r.e(t)}finally{r.f()}return e}),"_getKeysToCollect")},{key:"gc",value:o((function(){var t=this,e=this.atlases.some((function(t){return t.forceGC})),r=this._getKeysToCollect();if(0!==r.size||e){var n,i=[],a=new Map,s=null,l=but(this.atlases);try{var c=o((function(){var e=n.value,o=e.getKeys(),l=nEt(r,o);if(0===l.size&&!e.forceGC)return i.push(e),o.forEach((function(t){return a.set(t,e)})),"continue";s||(s=t._createAtlas(),i.push(s));var c,h=but(o);try{for(h.s();!(c=h.n()).done;){var u=c.value;if(!l.has(u)){var d=hut(e.getOffsets(u),2),p=d[0],g=d[1];s.canFit({w:p.w+g.w,h:p.h})||(s=t._createAtlas(),i.push(s)),t._copyTextureToNewAtlas(u,e,s),a.set(u,s)}}}catch(t){h.e(t)}finally{h.f()}}),"_loop");for(l.s();!(n=l.n()).done;)c()}catch(t){l.e(t)}finally{l.f()}this.atlases=i,this.styleKeyToAtlas=a}else console.log("nothing to garbage collect")}),"gc")},{key:"_copyTextureToNewAtlas",value:o((function(t,e,r){var n=hut(e.getOffsets(t),2),i=n[0],a=n[1];if(0===a.w)r.draw(t,i,(function(t){t.drawImage(e.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h)}));else{var s=this._getScratchCanvas();s.clear(),s.context.drawImage(e.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h),s.context.drawImage(e.canvas,a.x,a.y,a.w,a.h,i.w,0,a.w,a.h);var o=i.w+a.w,l=i.h;r.draw(t,{w:o,h:l},(function(t){t.drawImage(s,0,0,o,l,0,0,o,l)}))}}),"_copyTextureToNewAtlas")},{key:"getCounts",value:o((function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}),"getCounts")}]),t}();function nEt(t,e){return t.intersection?t.intersection(e):new Set(uut(t).filter((function(t){return e.has(t)})))}o(nEt,"intersection");var iEt=function(){function t(e,r){sut(this,t),this.r=e;var n=r;this.globalOptions=n,this.maxAtlases=n.webglTexPerBatch,this.atlasSize=n.webglTexSize,this.renderTypes=new Map,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.batchAtlases=[],this._cacheScratchCanvas(n)}return o(t,"AtlasManager"),lut(t,[{key:"_cacheScratchCanvas",value:o((function(t){var e=-1,r=-1,n=null,i=t.createTextureCanvas;t.createTextureCanvas=function(t,a,s,o){return o?(n&&a==e&&s==r||(e=a,r=s,n=i(t,a,s)),n):i(t,a,s)}}),"_cacheScratchCanvas")},{key:"addRenderType",value:o((function(t,e){var r=new rEt(this.r,this.globalOptions),n=e;this.renderTypes.set(t,edt({type:t,atlasCollection:r},n))}),"addRenderType")},{key:"getRenderTypes",value:o((function(){return uut(this.renderTypes.values())}),"getRenderTypes")},{key:"getRenderTypeOpts",value:o((function(t){return this.renderTypes.get(t)}),"getRenderTypeOpts")},{key:"invalidate",value:o((function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.forceRedraw,i=void 0!==n&&n,a=r.filterEle,s=void 0===a?function(){return!0}:a,o=r.filterType,l=void 0===o?function(){return!0}:o,c=!1,h=but(t);try{for(h.s();!(e=h.n()).done;){var u=e.value;if(s(u)){var d,p=u.id(),g=but(this.getRenderTypes());try{for(g.s();!(d=g.n()).done;){var f=d.value;if(l(f.type)){var m=f.getKey(u);i?(f.atlasCollection.deleteKey(p,m),f.atlasCollection.styleKeyNeedsRedraw.add(m),c=!0):c|=f.atlasCollection.checkKeyIsInvalid(p,m)}}}catch(t){g.e(t)}finally{g.f()}}}}catch(t){h.e(t)}finally{h.f()}return c}),"invalidate")},{key:"gc",value:o((function(){var t,e=but(this.getRenderTypes());try{for(e.s();!(t=e.n()).done;){t.value.atlasCollection.gc()}}catch(t){e.e(t)}finally{e.f()}}),"gc")},{key:"isRenderable",value:o((function(t,e){var r=this.getRenderTypeOpts(e);return r&&r.isVisible(t)}),"isRenderable")},{key:"startBatch",value:o((function(){this.batchAtlases=[]}),"startBatch")},{key:"getAtlasCount",value:o((function(){return this.batchAtlases.length}),"getAtlasCount")},{key:"getAtlases",value:o((function(){return this.batchAtlases}),"getAtlases")},{key:"getOrCreateAtlas",value:o((function(t,e,r){var n=this.renderTypes.get(r),i=n.getKey(t),a=t.id();return n.atlasCollection.draw(a,i,e,(function(r){n.drawElement(r,t,e,!0,!0)}))}),"getOrCreateAtlas")},{key:"getAtlasIndexForBatch",value:o((function(t){var e=this.batchAtlases.indexOf(t);if(e<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return;this.batchAtlases.push(t),e=this.batchAtlases.length-1}return e}),"getAtlasIndexForBatch")},{key:"getIndexArray",value:o((function(){return Array.from({length:this.maxAtlases},(function(t,e){return e}))}),"getIndexArray")},{key:"getAtlasInfo",value:o((function(t,e){var r=this.renderTypes.get(e),n=r.getBoundingBox(t),i=this.getOrCreateAtlas(t,n,e),a=this.getAtlasIndexForBatch(i);if(void 0!==a){var s=r.getKey(t),o=hut(i.getOffsets(s),2),l=o[0];return{atlasID:a,tex:l,tex1:l,tex2:o[1],bb:n,type:e,styleKey:s}}}),"getAtlasInfo")},{key:"canAddToCurrentBatch",value:o((function(t,e){if(this.batchAtlases.length===this.maxAtlasesPerBatch){var r=this.renderTypes.get(e),n=r.getKey(t),i=r.atlasCollection.getAtlas(n);return i&&this.batchAtlases.includes(i)}return!0}),"canAddToCurrentBatch")},{key:"setTransformMatrix",value:o((function(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=e.bb,a=e.type,s=e.tex1,o=e.tex2,l=this.getRenderTypeOpts(a),c=l.getPadding?l.getPadding(r):0,h=s.w/(s.w+o.w);n||(h=1-h);var u,d,p=this.getAdjustedBB(i,c,n,h);H_t(t);var g=l.getRotation?l.getRotation(r):0;if(0!==g){var f=l.getRotationPoint(r),m=f.x,y=f.y;X_t(t,t,[m,y]),K_t(t,t,g);var v=l.getRotationOffset(r);u=v.x+p.xOffset,d=v.y}else u=p.x1,d=p.y1;X_t(t,t,[u,d]),Z_t(t,t,[p.w,p.h])}),"setTransformMatrix")},{key:"getTransformMatrix",value:o((function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Y_t();return this.setTransformMatrix(n,t,e,r),n}),"getTransformMatrix")},{key:"getAdjustedBB",value:o((function(t,e,r,n){var i=t.x1,a=t.y1,s=t.w,o=t.h;e&&(i-=e,a-=e,s+=2*e,o+=2*e);var l=0,c=s*n;return r&&n<1?s=c:!r&&n<1&&(i+=l=s-c,s=c),{x1:i,y1:a,w:s,h:o,xOffset:l}}),"getAdjustedBB")},{key:"getDebugInfo",value:o((function(){var t,e=[],r=but(this.renderTypes);try{for(r.s();!(t=r.n()).done;){var n=hut(t.value,2),i=n[0],a=n[1].atlasCollection.getCounts(),s=a.keyCount,o=a.atlasCount;e.push({type:i,keyCount:s,atlasCount:o})}}catch(t){r.e(t)}finally{r.f()}return e}),"getDebugInfo")}]),t}(),aEt=function(){function t(e,r,n){sut(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.maxAtlases=n.webglTexPerBatch,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,n.enableWrapping=!0,n.createTextureCanvas=R_t,this.atlasManager=new iEt(e,n),this.program=this.createShaderProgram(J_t.SCREEN),this.pickingProgram=this.createShaderProgram(J_t.PICKING),this.vao=this.createVAO(),this.debugInfo=[]}return o(t,"ElementDrawingWebGL"),lut(t,[{key:"addTextureRenderType",value:o((function(t,e){this.atlasManager.addRenderType(t,e)}),"addTextureRenderType")},{key:"invalidate",value:o((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.type,n=this.atlasManager;return r?n.invalidate(t,{filterType:o((function(t){return t===r}),"filterType"),forceRedraw:!0}):n.invalidate(t)}),"invalidate")},{key:"gc",value:o((function(){this.atlasManager.gc()}),"gc")},{key:"createShaderProgram",value:o((function(t){var e=this.gl,r="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; \n\n // what are we rendering?\n in int aVertType;\n\n // for picking\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex1; // x/y/w/h of texture in atlas\n in vec4 aTex2; \n\n // for any transforms that are needed\n in vec4 aScaleRotate1; // vectors use fewer attributes than matrices\n in vec2 aTranslate1;\n in vec4 aScaleRotate2;\n in vec2 aTranslate2;\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in float aLineWidth;\n in vec4 aEdgeColor;\n\n out vec2 vTexCoord;\n out vec4 vEdgeColor;\n flat out int vAtlasId;\n flat out vec4 vIndex;\n flat out int vVertType;\n\n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition;\n\n if(aVertType == ".concat(0,") {\n float texX;\n float texY;\n float texW;\n float texH;\n mat3 texMatrix;\n\n int vid = gl_VertexID;\n if(vid <= 5) {\n texX = aTex1.x;\n texY = aTex1.y;\n texW = aTex1.z;\n texH = aTex1.w;\n texMatrix = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n } else {\n texX = aTex2.x;\n texY = aTex2.y;\n texW = aTex2.z;\n texH = aTex2.w;\n texMatrix = mat3(\n vec3(aScaleRotate2.xy, 0.0),\n vec3(aScaleRotate2.zw, 0.0),\n vec3(aTranslate2, 1.0)\n );\n }\n\n if(vid == 1 || vid == 2 || vid == 4 || vid == 7 || vid == 8 || vid == 10) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5 || vid == 8 || vid == 10 || vid == 11) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * texMatrix * vec3(position, 1.0), 1.0);\n } \n else if(aVertType == ").concat(1," && vid < 6) {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(2," && vid < 6) {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0 = pointA;\n vec2 p1 = pointB;\n vec2 p2 = pointC;\n vec2 pos = position;\n if(position.x == 1.0) {\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth;\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vEdgeColor = aEdgeColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n mat3 transform = mat3(\n vec3(aScaleRotate1.xy, 0.0),\n vec3(aScaleRotate1.zw, 0.0),\n vec3(aTranslate1, 1.0)\n );\n gl_Position = vec4(uPanZoomMatrix * transform * vec3(position, 1.0), 1.0);\n vEdgeColor = aEdgeColor;\n } else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vIndex = aIndex;\n vVertType = aVertType;\n }\n "),n=this.atlasManager.getIndexArray(),i=I_t(e,r,"#version 300 es\n precision highp float;\n\n // define texture unit for each node in the batch\n ".concat(n.map((function(t){return"uniform sampler2D uTexture".concat(t,";")})).join("\n\t"),"\n\n uniform vec4 uBGColor;\n\n in vec2 vTexCoord;\n in vec4 vEdgeColor;\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n\n out vec4 outColor;\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n ").concat(n.map((function(t){return"if(vAtlasId == ".concat(t,") outColor = texture(uTexture").concat(t,", vTexCoord);")})).join("\n\telse "),"\n } else if(vVertType == ").concat(3,") {\n // blend arrow color with background (using premultiplied alpha)\n outColor.rgb = vEdgeColor.rgb + (uBGColor.rgb * (1.0 - vEdgeColor.a)); \n outColor.a = 1.0; // make opaque, masks out line under arrow\n } else {\n outColor = vEdgeColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));i.aPosition=e.getAttribLocation(i,"aPosition"),i.aIndex=e.getAttribLocation(i,"aIndex"),i.aVertType=e.getAttribLocation(i,"aVertType"),i.aAtlasId=e.getAttribLocation(i,"aAtlasId"),i.aTex1=e.getAttribLocation(i,"aTex1"),i.aTex2=e.getAttribLocation(i,"aTex2"),i.aScaleRotate1=e.getAttribLocation(i,"aScaleRotate1"),i.aTranslate1=e.getAttribLocation(i,"aTranslate1"),i.aScaleRotate2=e.getAttribLocation(i,"aScaleRotate2"),i.aTranslate2=e.getAttribLocation(i,"aTranslate2"),i.aPointAPointB=e.getAttribLocation(i,"aPointAPointB"),i.aPointCPointD=e.getAttribLocation(i,"aPointCPointD"),i.aLineWidth=e.getAttribLocation(i,"aLineWidth"),i.aEdgeColor=e.getAttribLocation(i,"aEdgeColor"),i.uPanZoomMatrix=e.getUniformLocation(i,"uPanZoomMatrix"),i.uAtlasSize=e.getUniformLocation(i,"uAtlasSize"),i.uBGColor=e.getUniformLocation(i,"uBGColor"),i.uTextures=[];for(var a=0;a<this.atlasManager.maxAtlases;a++)i.uTextures.push(e.getUniformLocation(i,"uTexture".concat(a)));return i}),"createShaderProgram")},{key:"createVAO",value:o((function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1],e=[].concat(t,t);this.vertexCount=e.length/2;var r=this.maxInstances,n=this.gl,i=this.program,a=n.createVertexArray();return n.bindVertexArray(a),G_t(n,"vec2",i.aPosition,e),this.indexBuffer=q_t(n,r,"vec4",i.aIndex),this.vertTypeBuffer=q_t(n,r,"int",i.aVertType),this.atlasIdBuffer=q_t(n,r,"int",i.aAtlasId),this.tex1Buffer=q_t(n,r,"vec4",i.aTex1),this.tex2Buffer=q_t(n,r,"vec4",i.aTex2),this.scaleRotate1Buffer=q_t(n,r,"vec4",i.aScaleRotate1),this.translate1Buffer=q_t(n,r,"vec2",i.aTranslate1),this.scaleRotate2Buffer=q_t(n,r,"vec4",i.aScaleRotate2),this.translate2Buffer=q_t(n,r,"vec2",i.aTranslate2),this.pointAPointBBuffer=q_t(n,r,"vec4",i.aPointAPointB),this.pointCPointDBuffer=q_t(n,r,"vec4",i.aPointCPointD),this.lineWidthBuffer=q_t(n,r,"float",i.aLineWidth),this.edgeColorBuffer=q_t(n,r,"vec4",i.aEdgeColor),n.bindVertexArray(null),a}),"createVAO")},{key:"buffers",get:o((function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter((function(t){return t.endsWith("Buffer")})).map((function(e){return t[e]}))),this._buffers}),"get")},{key:"startFrame",value:o((function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J_t.SCREEN;this.panZoomMatrix=t,this.debugInfo=e,this.renderTarget=r,this.startBatch()}),"startFrame")},{key:"startBatch",value:o((function(){this.instanceCount=0,this.atlasManager.startBatch()}),"startBatch")},{key:"endFrame",value:o((function(){this.endBatch()}),"endFrame")},{key:"getTempMatrix",value:o((function(){return this.tempMatrix=this.tempMatrix||Y_t()}),"getTempMatrix")},{key:"drawTexture",value:o((function(t,e,r){var n=this.atlasManager;if(n.isRenderable(t,r)){n.canAddToCurrentBatch(t,r)||this.endBatch();var i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=0,P_t(e,this.indexBuffer.getView(i));var a=n.getAtlasInfo(t,r,a),s=a.atlasID,o=a.tex1,l=a.tex2;this.atlasIdBuffer.getView(i)[0]=s;var c=this.tex1Buffer.getView(i);c[0]=o.x,c[1]=o.y,c[2]=o.w,c[3]=o.h;var h=this.tex2Buffer.getView(i);h[0]=l.x,h[1]=l.y,h[2]=l.w,h[3]=l.h;for(var u=this.getTempMatrix(),d=0,p=[1,2];d<p.length;d++){var g=p[d];n.setTransformMatrix(u,a,t,1===g);var f=this["scaleRotate".concat(g,"Buffer")].getView(i);f[0]=u[0],f[1]=u[1],f[2]=u[3],f[3]=u[4];var m=this["translate".concat(g,"Buffer")].getView(i);m[0]=u[6],m[1]=u[7]}this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}),"drawTexture")},{key:"drawEdgeArrow",value:o((function(t,e,r){var n,i,a,s=t._private.rscratch;if(("source"===r?(n=s.arrowStartX,i=s.arrowStartY,a=s.srcArrowAngle):(n=s.arrowEndX,i=s.arrowEndY,a=s.tgtArrowAngle),!(isNaN(n)||null==n||isNaN(i)||null==i||isNaN(a)||null==a))&&"none"!==t.pstyle(r+"-arrow-shape").value){var o=t.pstyle(r+"-arrow-color").value,l=t.pstyle("opacity").value*t.pstyle("line-opacity").value,c=t.pstyle("width").pfValue,h=t.pstyle("arrow-scale").value,u=this.r.getArrowWidth(c,h),d=this.getTempMatrix();H_t(d),X_t(d,d,[n,i]),Z_t(d,d,[u,u]),K_t(d,d,a);var p=this.instanceCount;this.vertTypeBuffer.getView(p)[0]=3,P_t(e,this.indexBuffer.getView(p)),O_t(o,l,this.edgeColorBuffer.getView(p));var g=this.scaleRotate1Buffer.getView(p);g[0]=d[0],g[1]=d[1],g[2]=d[3],g[3]=d[4];var f=this.translate1Buffer.getView(p);f[0]=d[6],f[1]=d[7],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}),"drawEdgeArrow")},{key:"drawEdgeLine",value:o((function(t,e){var r=t.pstyle("opacity").value,n=t.pstyle("line-opacity").value,i=t.pstyle("width").pfValue,a=t.pstyle("line-color").value,s=r*n,o=this.getEdgePoints(t);if(o.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==o.length){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=1,P_t(e,this.indexBuffer.getView(l)),O_t(a,s,this.edgeColorBuffer.getView(l)),this.lineWidthBuffer.getView(l)[0]=i;var c=this.pointAPointBBuffer.getView(l);c[0]=o[0],c[1]=o[1],c[2]=o[2],c[3]=o[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var h=0;h<o.length-2;h+=2){var u=this.instanceCount;this.vertTypeBuffer.getView(u)[0]=2,P_t(e,this.indexBuffer.getView(u)),O_t(a,s,this.edgeColorBuffer.getView(u)),this.lineWidthBuffer.getView(u)[0]=i;var d=o[h-2],p=o[h-1],g=o[h],f=o[h+1],m=o[h+2],y=o[h+3],v=o[h+4],x=o[h+5];0==h&&(d=2*g-m+.001,p=2*f-y+.001),h==o.length-4&&(v=2*m-g+.001,x=2*y-f+.001);var b=this.pointAPointBBuffer.getView(u);b[0]=d,b[1]=p,b[2]=g,b[3]=f;var w=this.pointCPointDBuffer.getView(u);w[0]=m,w[1]=y,w[2]=v,w[3]=x,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}),"drawEdgeLine")},{key:"getEdgePoints",value:o((function(t){var e=t._private.rscratch.allpts;if(4==e.length)return e;var r=this.getNumSegments(t);return this.getCurveSegmentPoints(e,r)}),"getEdgePoints")},{key:"getNumSegments",value:o((function(t){return Math.min(Math.max(15,5),this.maxInstances)}),"getNumSegments")},{key:"getCurveSegmentPoints",value:o((function(t,e){if(4==t.length)return t;for(var r=Array(2*(e+1)),n=0;n<=e;n++)if(0==n)r[0]=t[0],r[1]=t[1];else if(n==e)r[2*n]=t[t.length-2],r[2*n+1]=t[t.length-1];else{var i=n/e;this.setCurvePoint(t,i,r,2*n)}return r}),"getCurveSegmentPoints")},{key:"setCurvePoint",value:o((function(t,e,r,n){if(!(t.length<=2)){for(var i=Array(t.length-2),a=0;a<i.length;a+=2){var s=(1-e)*t[a]+e*t[a+2],o=(1-e)*t[a+1]+e*t[a+3];i[a]=s,i[a+1]=o}return this.setCurvePoint(i,e,r,n)}r[n]=t[0],r[n+1]=t[1]}),"setCurvePoint")},{key:"endBatch",value:o((function(){var t=this.gl,e=this.vao,r=this.vertexCount,n=this.instanceCount;if(0!==n){var i=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(i),t.bindVertexArray(e);var a,s=but(this.buffers);try{for(s.s();!(a=s.n()).done;){a.value.bufferSubData(n)}}catch(t){s.e(t)}finally{s.f()}for(var o=this.atlasManager.getAtlases(),l=0;l<o.length;l++)o[l].bufferIfNeeded(t);for(var c=0;c<o.length;c++)t.activeTexture(t.TEXTURE0+c),t.bindTexture(t.TEXTURE_2D,o[c].texture),t.uniform1i(i.uTextures[c],c);t.uniformMatrix3fv(i.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(i.uAtlasSize,this.atlasManager.atlasSize);var h=O_t(this.bgColor,1);t.uniform4fv(i.uBGColor,h),t.drawArraysInstanced(t.TRIANGLES,0,r,n),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debugInfo&&this.debugInfo.push({count:n,atlasCount:o.length}),this.startBatch()}}),"endBatch")},{key:"getDebugInfo",value:o((function(){return this.debugInfo}),"getDebugInfo")},{key:"getAtlasDebugInfo",value:o((function(){return this.atlasManager.getDebugInfo()}),"getAtlasDebugInfo")}]),t}();function sEt(t,e){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(e,")")}o(sEt,"fillStyle");var oEt=function(){function t(e){sut(this,t),this.r=e}return o(t,"OverlayUnderlayRenderer"),lut(t,[{key:"getStyleKey",value:o((function(t,e){var r=this.getStyle(t,e),n=r.shape,i=r.opacity,a=r.color;if(!n)return null;var s=e.width(),o=e.height(),l=sEt(a,i);return dpt("".concat(n,"-").concat(s,"-").concat(o,"-").concat(l))}),"getStyleKey")},{key:"isVisible",value:o((function(t,e){return e.pstyle("".concat(t,"-opacity")).value>0}),"isVisible")},{key:"getStyle",value:o((function(t,e){return{opacity:e.pstyle("".concat(t,"-opacity")).value,color:e.pstyle("".concat(t,"-color")).value,shape:e.pstyle("".concat(t,"-shape")).value}}),"getStyle")},{key:"getPadding",value:o((function(t,e){return e.pstyle("".concat(t,"-padding")).pfValue}),"getPadding")},{key:"draw",value:o((function(t,e,r,n){if(this.isVisible(t,r)){var i=this.r,a=n.w,s=n.h,o=a/2,l=s/2,c=this.getStyle(t,r),h=c.shape,u=c.color,d=c.opacity;e.save(),e.fillStyle=sEt(u,d),"round-rectangle"===h||"roundrectangle"===h?i.drawRoundRectanglePath(e,o,l,a,s,"auto"):"ellipse"===h&&i.drawEllipsePath(e,o,l,a,s),e.fill(),e.restore()}}),"draw")}]),t}();function lEt(t){var e=t&&t.style&&t.style.backgroundColor||"white";return sdt(e)}o(lEt,"getBGColor");var cEt={};function hEt(t){var e=t.render;t.render=function(r){r=r||{};var n=t.cy;t.webgl&&(n.zoom()>7.99?(uEt(t),e.call(t,r)):(dEt(t),bEt(t,r,J_t.SCREEN)))};var r=t.matchCanvasSize;t.matchCanvasSize=function(e){r.call(t,e),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0},t.findNearestElements=function(e,r,n,i){return xEt(t,e,r)};var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0};var i=t.notify;t.notify=function(e,r){i.call(t,e,r),"viewport"===e||"bounds"===e?t.pickingFrameBuffer.needsDraw=!0:"background"===e&&t.eleDrawing.invalidate(r,{type:"node-body"})}}function uEt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function dEt(t){var e=o((function(e){e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.canvasWidth,t.canvasHeight),e.restore()}),"clear");e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function pEt(t){var e=t.canvasWidth,r=t.canvasHeight,n=M_t(t),i=n.pan,a=n.zoom,s=Y_t();X_t(s,s,[i.x,i.y]),Z_t(s,s,[a,a]);var o=Y_t();Q_t(o,e,r);var l=Y_t();return V_t(l,o,s),l}function gEt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=M_t(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function fEt(t,e){t.drawSelectionRectangle(e,(function(e){return gEt(t,e)}))}function mEt(t){var e=t.data.contexts[t.NODE];e.save(),gEt(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function yEt(t){var e=o((function(e,r,n){for(var i=e.atlasManager.getRenderTypeOpts(r),a=t.data.contexts[t.NODE],s=i.atlasCollection.atlases,o=0;o<s.length;o++){var l=s[o].canvas,c=l.width,h=l.height,u=c*o,d=l.height*n;a.save(),a.scale(.125,.125),a.drawImage(l,u,d),a.strokeStyle="black",a.rect(u,d,c,h),a.stroke(),a.restore()}}),"draw"),r=0;e(t.eleDrawing,"node-body",r++),e(t.eleDrawing,"node-label",r++)}function vEt(t,e,r,n,i){var a,s,o,l,c=M_t(t),h=c.pan,u=c.zoom;if(void 0===n||void 0===i){var d=hut(D_t(t,h,u,e,r),2);a=d[0]-3,s=d[1]-3,o=6,l=6}else{var p=hut(D_t(t,h,u,e,r),2),g=p[0],f=p[1],m=hut(D_t(t,h,u,n,i),2),y=m[0],v=m[1];a=g,s=v,o=Math.abs(y-g),l=Math.abs(v-f)}if(0===o||0===l)return[];var x=t.data.contexts[t.WEBGL];x.bindFramebuffer(x.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(x.viewport(0,0,x.canvas.width,x.canvas.height),bEt(t,null,J_t.PICKING),t.pickingFrameBuffer.needsDraw=!1);var b=o*l,w=new Uint8Array(4*b);x.readPixels(a,s,o,l,x.RGBA,x.UNSIGNED_BYTE,w),x.bindFramebuffer(x.FRAMEBUFFER,null);for(var k=new Set,T=0;T<b;T++){var _=B_t(w.slice(4*T,4*T+4))-1;_>=0&&k.add(_)}return k}function xEt(t,e,r){var n,i,a,s=vEt(t,e,r),o=t.getCachedZSortedEles(),l=but(s);try{for(l.s();!(a=l.n()).done;){var c=o[a.value];if(!n&&c.isNode()&&(n=c),!i&&c.isEdge()&&(i=c),n&&i)break}}catch(t){l.e(t)}finally{l.f()}return[n,i].filter(Boolean)}function bEt(t,e,r){var n,i;t.webglDebug&&(i=[],n=performance.now());var a=t.eleDrawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&fEt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var l=o((function(t,e){e+=1,t.isNode()?(a.drawTexture(t,e,"node-underlay"),a.drawTexture(t,e,"node-body"),a.drawTexture(t,e,"node-label"),a.drawTexture(t,e,"node-overlay")):(a.drawEdgeLine(t,e),a.drawEdgeArrow(t,e,"source"),a.drawEdgeArrow(t,e,"target"),a.drawTexture(t,e,"edge-label"))}),"draw"),c=t.data.contexts[t.WEBGL];r.screen?(c.clearColor(0,0,0,0),c.enable(c.BLEND),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA)):c.disable(c.BLEND),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT),c.viewport(0,0,c.canvas.width,c.canvas.height);var h=pEt(t),u=t.getCachedZSortedEles();if(s=u.length,a.startFrame(h,i,r),r.screen){for(var d=0;d<u.nondrag.length;d++)l(u.nondrag[d],d);for(var p=0;p<u.drag.length;p++)l(u.drag[p],-1)}else if(r.picking)for(var g=0;g<u.length;g++)l(u[g],g);a.endFrame(),t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,a.gc()),r.screen&&t.webglDebugShowAtlases&&(mEt(t),yEt(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var f,m=performance.now(),y=0,v=0,x=but(i);try{for(x.s();!(f=x.n()).done;){var b=f.value;y++,v+=b.count}}catch(t){x.e(t)}finally{x.f()}Math.ceil(m-n);var w="".concat(s," elements, ").concat(v," rectangles, ").concat(y," batches");console.log("WebGL (".concat(r.name,") - ").concat(w))}}cEt.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL],i=t.cy.container();t.bgColor=lEt(i),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,console.log("max texture units",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),console.log("max texture size",n.getParameter(n.MAX_TEXTURE_SIZE)),console.log("webgl options",t),r.pickingFrameBuffer=j_t(n),r.pickingFrameBuffer.needsDraw=!0;var a=o((function(t){return r.getTextAngle(t,null)}),"getLabelRotation"),s=o((function(t){var e=t.pstyle("label");return e&&e.value}),"isLabelVisible");r.eleDrawing=new aEt(r,n,t);var l=new oEt(r);r.eleDrawing.addTextureRenderType("node-body",tEt({getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement,isVisible:o((function(t){return t.visible()}),"isVisible")})),r.eleDrawing.addTextureRenderType("node-label",tEt({getKey:e.getLabelKey,getBoundingBox:e.getLabelBox,drawElement:e.drawLabel,getRotation:a,getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s})),r.eleDrawing.addTextureRenderType("node-overlay",tEt({getBoundingBox:e.getElementBox,getKey:o((function(t){return l.getStyleKey("overlay",t)}),"getKey"),drawElement:o((function(t,e,r){return l.draw("overlay",t,e,r)}),"drawElement"),isVisible:o((function(t){return l.isVisible("overlay",t)}),"isVisible"),getPadding:o((function(t){return l.getPadding("overlay",t)}),"getPadding")})),r.eleDrawing.addTextureRenderType("node-underlay",tEt({getBoundingBox:e.getElementBox,getKey:o((function(t){return l.getStyleKey("underlay",t)}),"getKey"),drawElement:o((function(t,e,r){return l.draw("underlay",t,e,r)}),"drawElement"),isVisible:o((function(t){return l.isVisible("underlay",t)}),"isVisible"),getPadding:o((function(t){return l.getPadding("underlay",t)}),"getPadding")})),r.eleDrawing.addTextureRenderType("edge-label",tEt({getKey:e.getLabelKey,getBoundingBox:e.getLabelBox,drawElement:e.drawLabel,getRotation:a,getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s}));var c=Kdt((function(){console.log("garbage collect flag set"),r.data.gc=!0}),1e4);r.onUpdateEleCalcs((function(t,e){var n=!1;e&&e.length>0&&(n|=r.eleDrawing.invalidate(e)),n&&c()})),hEt(r)},o(hEt,"overrideCanvasRendererFunctions"),o(uEt,"clearWebgl"),o(dEt,"clearCanvas"),o(pEt,"createPanZoomMatrix"),o(gEt,"setContextTransform"),o(fEt,"drawSelectionRectangle"),o(mEt,"drawAxes"),o(yEt,"drawAtlases"),o(vEt,"getPickingIndexes"),o(xEt,"findNearestElementsWebgl"),o(bEt,"renderWebgl");var wEt,kEt={drawPolygonPath:function(t,e,r,n,i,a){var s=n/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],r+o*a[1]);for(var l=1;l<a.length/2;l++)t.lineTo(e+s*a[2*l],r+o*a[2*l+1]);t.closePath()},drawRoundPolygonPath:function(t,e,r,n,i,a,s){s.forEach((function(e){return STt(t,e)})),t.closePath()},drawRoundRectanglePath:function(t,e,r,n,i,a){var s=n/2,o=i/2,l="auto"===a?sft(n,i):Math.min(a,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()},drawBottomRoundRectanglePath:function(t,e,r,n,i,a){var s=n/2,o=i/2,l="auto"===a?sft(n,i):a;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()},drawCutRectanglePath:function(t,e,r,n,i,a,s){var o=n/2,l=i/2,c="auto"===s?lft():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+c,r-l),t.lineTo(e+o-c,r-l),t.lineTo(e+o,r-l+c),t.lineTo(e+o,r+l-c),t.lineTo(e+o-c,r+l),t.lineTo(e-o+c,r+l),t.lineTo(e-o,r+l-c),t.lineTo(e-o,r-l+c),t.closePath()},drawBarrelPath:function(t,e,r,n,i){var a=n/2,s=i/2,o=e-a,l=e+a,c=r-s,h=r+s,u=hft(n,i),d=u.widthOffset,p=u.heightOffset,g=u.ctrlPtOffsetPct*d;t.beginPath&&t.beginPath(),t.moveTo(o,c+p),t.lineTo(o,h-p),t.quadraticCurveTo(o+g,h,o+d,h),t.lineTo(l-d,h),t.quadraticCurveTo(l-g,h,l,h-p),t.lineTo(l,c+p),t.quadraticCurveTo(l-g,c,l-d,c),t.lineTo(o+d,c),t.quadraticCurveTo(o+g,c,o,c+p),t.closePath()}},TEt=Math.sin(0),_Et=Math.cos(0),EEt={},CEt={},SEt=Math.PI/40;for(wEt=0*Math.PI;wEt<2*Math.PI;wEt+=SEt)EEt[wEt]=Math.sin(wEt),CEt[wEt]=Math.cos(wEt);kEt.drawEllipsePath=function(t,e,r,n,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,i/2,0,0,2*Math.PI);else for(var a,s,o=n/2,l=i/2,c=0*Math.PI;c<2*Math.PI;c+=SEt)a=e-o*EEt[c]*TEt+o*CEt[c]*_Et,s=r+l*CEt[c]*TEt+l*EEt[c]*_Et,0===c?t.moveTo(a,s):t.lineTo(a,s);t.closePath()};var AEt={};function LEt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return new Blob([n],{type:e})}function NEt(t){var e=t.indexOf(",");return t.substr(e+1)}function IEt(t,e,r){var n=o((function(){return e.toDataURL(r,t.quality)}),"getB64Uri");switch(t.output){case"blob-promise":return new Pmt((function(n,i){try{e.toBlob((function(t){null!=t?n(t):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),r,t.quality)}catch(t){i(t)}}));case"blob":return LEt(NEt(n()),r);case"base64":return NEt(n());default:return n()}}AEt.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},AEt.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements().boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(r.w):n[2],a=t.full?Math.ceil(r.h):n[3],s=Mut(t.maxWidth)||Mut(t.maxHeight),o=this.getPixelRatio(),l=1;if(void 0!==t.scale)i*=t.scale,a*=t.scale,l=t.scale;else if(s){var c=1/0,h=1/0;Mut(t.maxWidth)&&(c=l*t.maxWidth/i),Mut(t.maxHeight)&&(h=l*t.maxHeight/a),i*=l=Math.min(c,h),a*=l}s||(i*=o,a*=o,l*=o);var u=document.createElement("canvas");u.width=i,u.height=a,u.style.width=i+"px",u.style.height=a+"px";var d=u.getContext("2d");if(i>0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)d.translate(-r.x1*l,-r.y1*l),d.scale(l,l),this.drawElements(d,p),d.scale(1/l,1/l),d.translate(r.x1*l,r.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},o(LEt,"b64ToBlob"),o(NEt,"b64UriToB64"),o(IEt,"output"),AEt.png=function(t){return IEt(t,this.bufferCanvasImage(t),"image/png")},AEt.jpg=function(t){return IEt(t,this.bufferCanvasImage(t),"image/jpeg")};var REt={nodeShapeImpl:function(t,e,r,n,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,i,a);case"polygon":return this.drawPolygonPath(e,r,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,i,a,o);case"barrel":return this.drawBarrelPath(e,r,n,i,a)}}},MEt=OEt,DEt=OEt.prototype;function OEt(t){var e=this,r=e.cy.window().document;t.webgl&&(DEt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(DEt.CANVAS_LAYERS),contexts:new Array(DEt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(DEt.CANVAS_LAYERS),bufferCanvases:new Array(DEt.BUFFER_COUNT),bufferContexts:new Array(DEt.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var a=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=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"};Yut()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var c=0;c<DEt.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=r.createElement("canvas"),u=DEt.CANVAS_TYPES[c];e.data.contexts[c]=h.getContext(u),e.data.contexts[c]||Tpt("Could not create canvas of type "+u),Object.keys(l).forEach((function(t){h.style[t]=l[t]})),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(DEt.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[DEt.NODE].setAttribute("data-id","layer"+DEt.NODE+"-node"),e.data.canvases[DEt.SELECT_BOX].setAttribute("data-id","layer"+DEt.SELECT_BOX+"-selectbox"),e.data.canvases[DEt.DRAG].setAttribute("data-id","layer"+DEt.DRAG+"-drag"),e.data.canvases[DEt.WEBGL]&&e.data.canvases[DEt.WEBGL].setAttribute("data-id","layer"+DEt.WEBGL+"-webgl");for(c=0;c<DEt.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=r.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var d=_gt(),p=o((function(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}),"getBoxCenter"),g=o((function(t){return{x:-t.w/2,y:-t.h/2}}),"getCenterOffset"),f=o((function(t){var e=t[0]._private;return!(e.oldBackgroundTimestamp===e.backgroundTimestamp)}),"backgroundTimestampHasChanged"),m=o((function(t){return t[0]._private.nodeKey}),"getStyleKey"),y=o((function(t){return t[0]._private.labelStyleKey}),"getLabelKey"),v=o((function(t){return t[0]._private.sourceLabelStyleKey}),"getSourceLabelKey"),x=o((function(t){return t[0]._private.targetLabelStyleKey}),"getTargetLabelKey"),b=o((function(t,r,n,i,a){return e.drawElement(t,r,n,!1,!1,a)}),"drawElement"),w=o((function(t,r,n,i,a){return e.drawElementText(t,r,n,i,"main",a)}),"drawLabel"),k=o((function(t,r,n,i,a){return e.drawElementText(t,r,n,i,"source",a)}),"drawSourceLabel"),T=o((function(t,r,n,i,a){return e.drawElementText(t,r,n,i,"target",a)}),"drawTargetLabel"),_=o((function(t){return t.boundingBox(),t[0]._private.bodyBounds}),"getElementBox"),E=o((function(t){return t.boundingBox(),t[0]._private.labelBounds.main||d}),"getLabelBox"),C=o((function(t){return t.boundingBox(),t[0]._private.labelBounds.source||d}),"getSourceLabelBox"),S=o((function(t){return t.boundingBox(),t[0]._private.labelBounds.target||d}),"getTargetLabelBox"),A=o((function(t,e){return e}),"isLabelVisibleAtScale"),L=o((function(t){return p(_(t))}),"getElementRotationPoint"),N=o((function(t,e,r){var n=t?t+"-":"";return{x:e.x+r.pstyle(n+"text-margin-x").pfValue,y:e.y+r.pstyle(n+"text-margin-y").pfValue}}),"addTextMargin"),I=o((function(t,e,r){var n=t[0]._private.rscratch;return{x:n[e],y:n[r]}}),"getRsPt"),R=o((function(t){return N("",I(t,"labelX","labelY"),t)}),"getLabelRotationPoint"),M=o((function(t){return N("source",I(t,"sourceLabelX","sourceLabelY"),t)}),"getSourceLabelRotationPoint"),D=o((function(t){return N("target",I(t,"targetLabelX","targetLabelY"),t)}),"getTargetLabelRotationPoint"),O=o((function(t){return g(_(t))}),"getElementRotationOffset"),P=o((function(t){return g(C(t))}),"getSourceLabelRotationOffset"),B=o((function(t){return g(S(t))}),"getTargetLabelRotationOffset"),$=o((function(t){var e=E(t),r=g(E(t));if(t.isNode()){switch(t.pstyle("text-halign").value){case"left":r.x=-e.w-(e.leftPad||0);break;case"right":r.x=-(e.rightPad||0)}switch(t.pstyle("text-valign").value){case"top":r.y=-e.h-(e.topPad||0);break;case"bottom":r.y=-(e.botPad||0)}}return r}),"getLabelRotationOffset"),F=e.data.eleTxrCache=new e_t(e,{getKey:m,doesEleInvalidateKey:f,drawElement:b,getBoundingBox:_,getRotationPoint:L,getRotationOffset:O,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=e.data.lblTxrCache=new e_t(e,{getKey:y,drawElement:w,getBoundingBox:E,getRotationPoint:R,getRotationOffset:$,isVisible:A}),U=e.data.slbTxrCache=new e_t(e,{getKey:v,drawElement:k,getBoundingBox:C,getRotationPoint:M,getRotationOffset:P,isVisible:A}),G=e.data.tlbTxrCache=new e_t(e,{getKey:x,drawElement:T,getBoundingBox:S,getRotationPoint:D,getRotationOffset:B,isVisible:A}),q=e.data.lyrTxrCache=new n_t(e);e.onUpdateEleCalcs(o((function(t,e){F.invalidateElements(e),z.invalidateElements(e),U.invalidateElements(e),G.invalidateElements(e),q.invalidateElements(e);for(var r=0;r<e.length;r++){var n=e[r]._private;n.oldBackgroundTimestamp=n.backgroundTimestamp}}),"invalidateTextureCaches"));var j=o((function(t){for(var e=0;e<t.length;e++)q.enqueueElementRefinement(t[e].ele)}),"refineInLayers");F.onDequeue(j),z.onDequeue(j),U.onDequeue(j),G.onDequeue(j),t.webgl&&e.initWebgl(t,{getStyleKey:m,getLabelKey:y,drawElement:b,drawLabel:w,getElementBox:_,getLabelBox:E,getElementRotationPoint:L,getElementRotationOffset:O,getLabelRotationPoint:R,getLabelRotationOffset:$})}DEt.CANVAS_LAYERS=3,DEt.SELECT_BOX=0,DEt.DRAG=1,DEt.NODE=2,DEt.WEBGL=3,DEt.CANVAS_TYPES=["2d","2d","2d","webgl2"],DEt.BUFFER_COUNT=3,DEt.TEXTURE_BUFFER=0,DEt.MOTIONBLUR_BUFFER_NODE=1,DEt.MOTIONBLUR_BUFFER_DRAG=2,o(OEt,"CanvasRenderer"),DEt.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[DEt.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[DEt.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[DEt.SELECT_BOX]=e;break;case"gc":r.data.gc=!0}};var PEt="undefined"!=typeof Path2D;DEt.path2dEnabled=function(t){if(void 0===t)return this.pathsEnabled;this.pathsEnabled=!!t},DEt.usePaths=function(){return PEt&&this.pathsEnabled},DEt.setImgSmoothing=function(t,e){null!=t.imageSmoothingEnabled?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},DEt.getImgSmoothing=function(t){return null!=t.imageSmoothingEnabled?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},DEt.makeOffscreenCanvas=function(t,e){var r;"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":aut(OffscreenCanvas))?r=new OffscreenCanvas(t,e):((r=this.cy.window().document.createElement("canvas")).width=t,r.height=e);return r},[l_t,g_t,w_t,T_t,__t,C_t,L_t,cEt,kEt,AEt,REt].forEach((function(t){edt(DEt,t)}));var BEt=[{type:"layout",extensions:Qkt},{type:"renderer",extensions:[{name:"null",impl:Jkt},{name:"base",impl:VTt},{name:"canvas",impl:MEt}]}],$Et={},FEt={};function zEt(t,e,r){var n=r,i=o((function(r){Ept("Can not register `"+e+"` for `"+t+"` since `"+r+"` already exists in the prototype and can not be overridden")}),"overrideErr");if("core"===t){if(ukt.prototype[e])return i(e);ukt.prototype[e]=r}else if("collection"===t){if(Swt.prototype[e])return i(e);Swt.prototype[e]=r}else if("layout"===t){for(var a=o((function(t){this.options=t,r.call(this,t),Iut(this._private)||(this._private={}),this._private.cy=t.cy,this._private.listeners=[],this.createEmitter()}),"Layout"),s=a.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var h=l[c];s[h]=s[h]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var u=r.prototype.stop;s.stop=function(){var t=this.options;if(t&&t.animate){var e=this.animations;if(e)for(var r=0;r<e.length;r++)e[r].stop()}return u?u.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=o((function(t){return t._private.cy}),"getCy"),p={addEventFields:o((function(t,e){e.layout=t,e.cy=d(t),e.target=t}),"addEventFields"),bubble:o((function(){return!0}),"bubble"),parent:o((function(t){return d(t)}),"parent")};edt(s,{createEmitter:o((function(){return this._private.emitter=new jbt(p,this),this}),"createEmitter"),emitter:o((function(){return this._private.emitter}),"emitter"),on:o((function(t,e){return this.emitter().on(t,e),this}),"on"),one:o((function(t,e){return this.emitter().one(t,e),this}),"one"),once:o((function(t,e){return this.emitter().one(t,e),this}),"once"),removeListener:o((function(t,e){return this.emitter().removeListener(t,e),this}),"removeListener"),removeAllListeners:o((function(){return this.emitter().removeAllListeners(),this}),"removeAllListeners"),emit:o((function(t,e){return this.emitter().emit(t,e),this}),"emit")}),Xvt.eventAliasesOn(s),n=a}else if("renderer"===t&&"null"!==e&&"base"!==e){var g=UEt("renderer","base"),f=g.prototype,m=r,y=r.prototype,v=o((function(){g.apply(this,arguments),m.apply(this,arguments)}),"Renderer"),x=v.prototype;for(var b in f){var w=f[b];if(null!=y[b])return i(b);x[b]=w}for(var k in y)x[k]=y[k];f.clientFunctions.forEach((function(t){x[t]=x[t]||function(){Tpt("Renderer does not implement `renderer."+t+"()` on its prototype")}})),n=v}else if("__proto__"===t||"constructor"===t||"prototype"===t)return Tpt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return ldt({map:$Et,keys:[t,e],value:n})}function UEt(t,e){return cdt({map:$Et,keys:[t,e]})}function GEt(t,e,r,n,i){return ldt({map:FEt,keys:[t,e,r,n],value:i})}function qEt(t,e,r,n){return cdt({map:FEt,keys:[t,e,r,n]})}o(zEt,"setExtension"),o(UEt,"getExtension"),o(GEt,"setModule"),o(qEt,"getModule");var jEt=o((function(){return 2===arguments.length?UEt.apply(null,arguments):3===arguments.length?zEt.apply(null,arguments):4===arguments.length?qEt.apply(null,arguments):5===arguments.length?GEt.apply(null,arguments):void Tpt("Invalid extension access syntax")}),"extension");ukt.prototype.extension=jEt,BEt.forEach((function(t){t.extensions.forEach((function(e){zEt(t.type,e.name,e.impl)}))}));var WEt=o((function t(){if(!(this instanceof t))return new t;this.length=0}),"Stylesheet"),YEt=WEt.prototype;YEt.instanceString=function(){return"stylesheet"},YEt.selector=function(t){return this[this.length++]={selector:t,properties:[]},this},YEt.css=function(t,e){var r=this.length-1;if(Aut(t))this[r].properties.push({name:t,value:e});else if(Iut(t))for(var n=t,i=Object.keys(n),a=0;a<i.length;a++){var s=i[a],o=n[s];if(null!=o){var l=skt.properties[s]||skt.properties[Xut(s)];if(null!=l){var c=l.name,h=o;this[r].properties.push({name:c,value:h})}}}return this},YEt.style=YEt.css,YEt.generateStyle=function(t){var e=new skt(t);return this.appendToStyle(e)},YEt.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,i=r.properties;t.selector(n);for(var a=0;a<i.length;a++){var s=i[a];t.css(s.name,s.value)}}return t};var HEt=o((function(t){return void 0===t&&(t={}),Iut(t)?new ukt(t):Aut(t)?jEt.apply(jEt,arguments):void 0}),"cytoscape");HEt.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(HEt),t.apply(null,e),this},HEt.warnings=function(t){return _pt(t)},HEt.version="3.31.0",HEt.stylesheet=HEt.Stylesheet=WEt;
/*! Bundled license information:
cytoscape/dist/cytoscape.esm.mjs:
(*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*)
(*!
Event object based on jQuery events, MIT license
https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*)
(*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
(*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
*/
var VEt=l({"../../node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.layoutBase=n():r.layoutBase=n()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?o((function(){return t.default}),"getDefault"):o((function(){return t}),"getModuleExports");return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=26)}([function(t,e,r){function n(){}o(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){var n=r(2),i=r(8),a=r(9);function s(t,e,r){n.call(this,r),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=r,this.bendpoints=[],this.source=t,this.target=e}for(var l in o(s,"LEdge"),s.prototype=Object.create(n.prototype),n)s[l]=n[l];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.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"},s.prototype.getOtherEndInGraph=function(t,e){for(var r=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(r.getOwner()==e)return r;if(r.getOwner()==n)break;r=r.getOwner().getParent()}return null},s.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))},s.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=s},function(t,e,r){function n(t){this.vGraphObject=t}o(n,"LGraphObject"),t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(13),s=r(0),l=r(16),c=r(4);function h(t,e,r,s){null==r&&null==s&&(s=e),n.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!=r&&null!=e?new a(e.x,e.y,r.width,r.height):new a}for(var u in o(h,"LNode"),h.prototype=Object.create(n.prototype),n)h[u]=n[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=[],r=this;return r.edges.forEach((function(n){if(n.target==t){if(n.source!=r)throw"Incorrect edge source!";e.push(n)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.source!=r&&n.target!=r)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(r){if(r.source==e)t.add(r.target);else{if(r.target!=e)throw"Incorrect incidency!";t.add(r.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),r=0;r<e.length;r++)e[r].withChildren().forEach((function(e){t.add(e)}));return t},h.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),r=0;r<e.length;r++)t+=e[r].getNoOfChildren();return 0==t&&(t=1),t},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var t,e,r=-s.INITIAL_WORLD_BOUNDARY,n=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+l.nextDouble()*(n-r)+r;var i=-s.INITIAL_WORLD_BOUNDARY,a=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+l.nextDouble()*(a-i)+i,this.rect.x=t,this.rect.y=e},h.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),r=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>r&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-r)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-r),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>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new c(e,r),i=t.inverseTransformPoint(n);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,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(0),s=r(6),l=r(3),c=r(1),h=r(13),u=r(12),d=r(11);function p(t,e,r){n.call(this,r),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 s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in o(p,"LGraph"),p.prototype=Object.create(n.prototype),n)p[g]=n[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,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.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 r=e.edges.slice(),n=r.length,i=0;i<n;i++)(a=r[i]).isInterGraph?this.graphManager.remove(a):a.source.owner.remove(a);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof c){var a;if(null==(a=t))throw"Edge is null!";if(null==a.source||null==a.target)throw"Source and/or target is null!";if(null==a.source.owner||null==a.target.owner||a.source.owner!=this||a.target.owner!=this)throw"Source and/or target owner is invalid!";var s,o=a.source.edges.indexOf(a),h=a.target.edges.indexOf(a);if(!(o>-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,r,n=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l<o;l++){var c=s[l];n>(t=c.getTop())&&(n=t),a>(e=c.getLeft())&&(a=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-r,this.top=n-r,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,r,n,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<p;g++){var f=d[g];t&&null!=f.child&&f.updateBounds(),o>(e=f.getLeft())&&(o=e),l<(r=f.getRight())&&(l=r),c>(n=f.getTop())&&(c=n),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,r,n,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d<u;d++){var p=t[d];s>(e=p.getLeft())&&(s=e),o<(r=p.getRight())&&(o=r),l>(n=p.getTop())&&(l=n),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,r=e.length,n=0;n<r;n++){t+=e[n].calcEstimatedSize()}return this.estimatedSize=0==t?a.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,r,n=new d,i=new Set,a=this.nodes[0];for(a.withChildren().forEach((function(t){n.push(t),i.add(t)}));0!==n.length;)for(var s=(e=(a=n.shift()).getEdges()).length,o=0;o<s;o++){if(null!=(r=e[o].getOtherEndInGraph(a,this))&&!i.has(r))r.withChildren().forEach((function(t){n.push(t),i.add(t)}))}if(this.isConnected=!1,i.size>=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,r){var n,i=r(1);function a(t){n=r(5),this.layout=t,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},a.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&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=r,r=t;var a=(n=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 r.isInterGraph=!1,a.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},a.prototype.remove=function(t){if(t instanceof n){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 r,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o<s;o++)r=a[o],e.remove(r);var l,c=[];s=(c=c.concat(e.getNodes())).length;for(o=0;o<s;o++)l=c[o],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var h=this.graphs.indexOf(e);this.graphs.splice(h,1),e.parent=null}else if(t instanceof i){if(null==(r=t))throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(null==r.source||null==r.target)throw"Source and/or target is null!";if(-1==r.source.edges.indexOf(r)||-1==r.target.edges.indexOf(r))throw"Source and/or target doesn't know this edge!";h=r.source.edges.indexOf(r);if(r.source.edges.splice(h,1),h=r.target.edges.indexOf(r),r.target.edges.splice(h,1),null==r.source.owner||null==r.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==r.source.owner.getGraphManager().edges.indexOf(r))throw"Not in owner graph manager's edge list!";h=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(h,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),r=e.length,n=0;n<r;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var r=0;r<e.length;r++)t=t.concat(e[r].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var r,n=t.getOwner();;){if(null==(r=n.getParent()))break;if(r==e)return!0;if(null==(n=r.getOwner()))break}for(n=e.getOwner();;){if(null==(r=n.getParent()))break;if(r==t)return!0;if(null==(n=r.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var t,e,r,n,i,a=this.getAllEdges(),s=a.length,o=0;o<s;o++)if(e=(t=a[o]).source,r=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=r,e!=r){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=r,i=r.getOwner();null==t.lca;){if(i==n){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},a.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var r=t.getOwner();;){if(null==r)break;for(var n=e.getOwner();;){if(null==n)break;if(n==r)return n;n=n.getParent().getOwner()}r=r.getParent().getOwner()}return r},a.prototype.calcInclusionTreeDepths=function(t,e){var r;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),i=n.length,a=0;a<i;a++)(r=n[a]).inclusionTreeDepth=e,null!=r.child&&this.calcInclusionTreeDepths(r.child,e+1)},a.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,r=0;r<e;r++)if(t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=a},function(t,e,r){var n=r(0);function i(){}for(var a in o(i,"FDLayoutConstants"),n)i[a]=n[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,r){var n=r(12);function i(){}o(i,"IGeometry"),i.calcSeparationAmount=function(t,e,r,n){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),r[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),r[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[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*r[0],o=r[1]/a;r[0]<o?o=r[0]:s=r[1],r[0]=-1*i[0]*(o/2+n),r[1]=-1*i[1]*(s/2+n)},i.decideDirectionsForOverlappingNodes=function(t,e,r){t.getCenterX()<e.getCenterX()?r[0]=-1:r[0]=1,t.getCenterY()<e.getCenterY()?r[1]=-1:r[1]=1},i.getIntersection2=function(t,e,r){var n=t.getCenterX(),i=t.getCenterY(),a=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return r[0]=n,r[1]=i,r[2]=a,r[3]=s,!0;var o=t.getX(),l=t.getY(),c=t.getRight(),h=t.getX(),u=t.getBottom(),d=t.getRight(),p=t.getWidthHalf(),g=t.getHeightHalf(),f=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),x=e.getBottom(),b=e.getRight(),w=e.getWidthHalf(),k=e.getHeightHalf(),T=!1,_=!1;if(n===a){if(i>s)return r[0]=n,r[1]=l,r[2]=a,r[3]=x,!1;if(i<s)return r[0]=n,r[1]=u,r[2]=a,r[3]=m,!1}else if(i===s){if(n>a)return r[0]=o,r[1]=i,r[2]=y,r[3]=s,!1;if(n<a)return r[0]=c,r[1]=i,r[2]=f,r[3]=s,!1}else{var E=t.height/t.width,C=e.height/e.width,S=(s-i)/(a-n),A=void 0,L=void 0,N=void 0,I=void 0,R=void 0,M=void 0;if(-E===S?n>a?(r[0]=h,r[1]=u,T=!0):(r[0]=c,r[1]=l,T=!0):E===S&&(n>a?(r[0]=o,r[1]=l,T=!0):(r[0]=d,r[1]=u,T=!0)),-C===S?a>n?(r[2]=v,r[3]=x,_=!0):(r[2]=y,r[3]=m,_=!0):C===S&&(a>n?(r[2]=f,r[3]=m,_=!0):(r[2]=b,r[3]=x,_=!0)),T&&_)return!1;if(n>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=n+-g/S,r[0]=N,r[1]=I;break;case 2:N=d,I=i+p*S,r[0]=N,r[1]=I;break;case 3:I=u,N=n+g/S,r[0]=N,r[1]=I;break;case 4:N=h,I=i+-p*S,r[0]=N,r[1]=I}if(!_)switch(L){case 1:M=m,R=a+-k/S,r[2]=R,r[3]=M;break;case 2:R=b,M=s+w*S,r[2]=R,r[3]=M;break;case 3:M=x,R=a+k/S,r[2]=R,r[3]=M;break;case 4:R=v,M=s+-w*S,r[2]=R,r[3]=M}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=r.x,y=r.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new n((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r<t?i+=Math.PI:n<e&&(i+=this.TWO_PI)):i=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,r,n){var i=t.x,a=t.y,s=e.x,o=e.y,l=r.x,c=r.y,h=n.x,u=n.y,d=(s-i)*(u-c)-(h-l)*(o-a);if(0===d)return!1;var p=((u-c)*(h-i)+(l-h)*(u-a))/d,g=((a-o)*(h-i)+(s-i)*(u-a))/d;return 0<p&&p<1&&0<g&&g<1},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,r){function n(){}o(n,"IMath"),n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=o((function(t){return{value:t,next:null,prev:null}}),"nodeFrom"),s=o((function(t,e,r,n){return null!==t?t.next=e:n.head=e,null!==r?r.prev=e:n.tail=e,e.prev=t,e.next=r,n.length++,e}),"add"),l=o((function(t,e){var r=t.prev,n=t.next;return null!==r?r.next=n:e.head=n,null!==n?n.prev=r:e.tail=r,t.prev=t.next=null,e.length--,t}),"_remove"),c=function(){function t(e){var r=this;i(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return r.push(t)}))}return o(t,"LinkedList"),n(t,[{key:"size",value:o((function(){return this.length}),"size")},{key:"insertBefore",value:o((function(t,e){return s(e.prev,a(t),e,this)}),"insertBefore")},{key:"insertAfter",value:o((function(t,e){return s(e,a(t),e.next,this)}),"insertAfter")},{key:"insertNodeBefore",value:o((function(t,e){return s(e.prev,t,e,this)}),"insertNodeBefore")},{key:"insertNodeAfter",value:o((function(t,e){return s(e,t,e.next,this)}),"insertNodeAfter")},{key:"push",value:o((function(t){return s(this.tail,a(t),null,this)}),"push")},{key:"unshift",value:o((function(t){return s(null,a(t),this.head,this)}),"unshift")},{key:"remove",value:o((function(t){return l(t,this)}),"remove")},{key:"pop",value:o((function(){return l(this.tail,this).value}),"pop")},{key:"popNode",value:o((function(){return l(this.tail,this)}),"popNode")},{key:"shift",value:o((function(){return l(this.head,this).value}),"shift")},{key:"shiftNode",value:o((function(){return l(this.head,this)}),"shiftNode")},{key:"get_object_at",value:o((function(t){if(t<=this.length()){for(var e=1,r=this.head;e<t;)r=r.next,e++;return r.value}}),"get_object_at")},{key:"set_object_at",value:o((function(t,e){if(t<=this.length()){for(var r=1,n=this.head;r<t;)n=n.next,r++;n.value=e}}),"set_object_at")}]),t}();t.exports=c},function(t,e,r){function n(t,e,r){this.x=null,this.y=null,null==t&&null==e&&null==r?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==r?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==r&&(r=t,this.x=r.x,this.y=r.y)}o(n,"Point"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,r){"Point"==t.constructor.name&&null==e&&null==r?(r=t,this.setLocation(r.x,r.y)):"number"==typeof t&&"number"==typeof e&&null==r&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,r){function n(t,e,r,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=r&&null!=n&&(this.x=t,this.y=e,this.width=r,this.height=n)}o(n,"RectangleD"),n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x)&&(!(this.getBottom()<t.y)&&(!(t.getRight()<this.x)&&!(t.getBottom()<this.y)))},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,r){var n="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};function i(){}o(i,"UniqueIDGeneretor"),i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}o(n,"_toConsumableArray");var i=r(0),a=r(6),s=r(3),l=r(1),c=r(5),h=r(4),u=r(17),d=r(27);function p(t){d.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}o(p,"Layout"),p.RANDOM_SEED=1,p.prototype=Object.create(d.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var t=new a(this);return this.graphManager=t,t},p.prototype.newGraph=function(t){return new c(null,this.graphManager,t)},p.prototype.newNode=function(t){return new s(this.graphManager,t)},p.prototype.newEdge=function(t){return new l(null,null,t)},p.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var r=this.graphManager.getRoot().getNodes();for(e=0;e<r.length;e++)r[e];this.update(this.graphManager.getRoot())}},p.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var r=e.getChild().getNodes(),n=0;n<r.length;n++)update(r[n]);if(null!=e.vGraphObject)e.vGraphObject.update(e)}else if(t instanceof l){var i=t;if(null!=i.vGraphObject)i.vGraphObject.update(i)}else if(t instanceof c){var a=t;if(null!=a.vGraphObject)a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(t){if(null==t)this.transform(new h(0,0));else{var e=new u,r=this.graphManager.getRoot().updateLeftTop();if(null!=r){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(r.x),e.setDeviceOrgY(r.y);for(var n=this.getAllNodes(),i=0;i<n.length;i++)n[i].transform(e)}}},p.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,r,n=t.getNodes(),i=0;i<n.length;i++)null==(r=(e=n[i]).getChild())||0==r.getNodes().length?e.scatter():(this.positionNodesRandomly(r),e.updateBounds())},p.prototype.getFlatForest=function(){for(var t=[],e=!0,r=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<r.length;a++)null!=r[a].getChild()&&(i=!1);if(!i)return t;var s=new Set,o=[],l=new Map,c=[];for(c=c.concat(r);c.length>0&&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<u.length;a++){var d=u[a].getOtherEnd(h);if(l.get(h)!=d){if(s.has(d)){e=!1;break}o.push(d),l.set(d,h)}}}if(e){var p=[].concat(n(s));t.push(p);for(a=0;a<p.length;a++){var g=p[a],f=c.indexOf(g);f>-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),n.add(a);var s=this.newEdge(null);this.graphManager.add(s,r,a),e.add(a),r=a}s=this.newEdge(null);return this.graphManager.add(s,r,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},p.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var r=t[e];if(r.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(r),a=0;a<i.length;a++){var s=i[a],o=new h(s.getCenterX(),s.getCenterY()),l=r.bendpoints.get(a);l.x=o.x,l.y=o.y,s.getOwner().remove(s)}this.graphManager.add(r,r.source,r.target)}}},p.transform=function(t,e,r,n){if(null!=r&&null!=n){var i=e;if(t<=50)i-=(e-e/r)/50*(50-t);else i+=(e*n-e)/50*(t-50);return i}var a,s;return t<=50?(a=9*e/500,s=e/10):(a=9*e/50,s=-8*e),a*t+s},p.findCenterOfTree=function(t){var e=[];e=e.concat(t);var r=[],n=new Map,i=!1,a=null;1!=e.length&&2!=e.length||(i=!0,a=e[0]);for(var s=0;s<e.length;s++){var o=(h=e[s]).getNeighborsList().size;n.set(h,h.getNeighborsList().size),1==o&&r.push(h)}var l=[];for(l=l.concat(r);!i;){var c=[];c=c.concat(l),l=[];for(s=0;s<e.length;s++){var h=e[s],u=e.indexOf(h);u>=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&l.push(t),n.set(t,e)}}))}r=r.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,r){function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(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}o(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,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}o(n,"_toConsumableArray");var i=r(15),a=r(7),s=r(0),l=r(8),c=r(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.springConstant=a.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=a.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var u in o(h,"FDLayout"),h.prototype=Object.create(i.prototype),i)h[u]=i[u];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,i,o,l=this.getGraphManager().getAllEdges(),c=0;c<l.length;c++)(t=l[c]).idealLength=this.idealEdgeLength,t.isInterGraph&&(r=t.getSource(),n=t.getTarget(),i=t.getSourceInLca().getEstimatedSize(),o=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=i+o-2*s.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=a.DEFAULT_EDGE_LENGTH*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+n.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.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(),r=0;r<e.length;r++)t=e[r],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,r,n,i,s=!(arguments.length>0&&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.length;t++)r=l[t],this.calculateRepulsionForceOfANode(r,i,s,o),i.add(r);else for(t=0;t<l.length;t++)for(r=l[t],e=t+1;e<l.length;e++)n=l[e],r.getOwner()==n.getOwner()&&this.calcRepulsionForce(r,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),r=0;r<e.length;r++)t=e[r],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var r,n,i,a,s=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(r=t.getLength())&&(i=(n=this.springConstant*(r-e))*(t.lengthX/r),a=n*(t.lengthY/r),s.springForceX+=i,s.springForceY+=a,o.springForceX-=i,o.springForceY-=a)},h.prototype.calcRepulsionForce=function(t,e){var r,n,i,s,o,h,u,d=t.getRect(),p=e.getRect(),g=new Array(2),f=new Array(4);if(d.intersects(p)){l.calcSeparationAmount(d,p,g,a.DEFAULT_EDGE_LENGTH/2),h=2*g[0],u=2*g[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*h,t.repulsionForceY-=m*u,e.repulsionForceX+=m*h,e.repulsionForceY+=m*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(r=p.getCenterX()-d.getCenterX(),n=p.getCenterY()-d.getCenterY()):(l.getIntersection(d,p,f),r=f[2]-f[0],n=f[3]-f[1]),Math.abs(r)<a.MIN_REPULSION_DIST&&(r=c.sign(r)*a.MIN_REPULSION_DIST),Math.abs(n)<a.MIN_REPULSION_DIST&&(n=c.sign(n)*a.MIN_REPULSION_DIST),i=r*r+n*n,s=Math.sqrt(i),h=(o=this.repulsionConstant*t.noOfChildren*e.noOfChildren/i)*r/s,u=o*n/s,t.repulsionForceX-=h,t.repulsionForceY-=u,e.repulsionForceX+=h,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,r,n,i,a,s,o,l;r=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-r,a=t.getCenterY()-n,s=Math.abs(i)+t.getWidth()/2,o=Math.abs(a)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(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<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),r=0;r<e.length;r++)(t=e[r]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,r;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),i=0;i<e;i++)n[i]=new Array(r);for(i=0;i<e;i++)for(var a=0;a<r;a++)n[i][a]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,r){var n,i,a,s;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),a=parseInt(Math.floor((t.getRect().y-r)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-r)/this.repulsionRange));for(var o=n;o<=i;o++)for(var l=a;l<=s;l++)this.grid[o][l].push(t),t.setGridCoordinates(n,i,a,s)},h.prototype.updateGrid=function(){var t,e,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<r.length;t++)e=r[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,r,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&r||i){var s,o=new Set;t.surrounding=new Array;for(var l=this.grid,c=t.startX-1;c<t.finishX+2;c++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(c<0||h<0||c>=l.length||h>=l[0].length))for(var u=0;u<l[c][h].length;u++)if(s=l[c][h][u],t.getOwner()==s.getOwner()&&t!=s&&!e.has(s)&&!o.has(s)){var d=Math.abs(t.getCenterX()-s.getCenterX())-(t.getWidth()/2+s.getWidth()/2),p=Math.abs(t.getCenterY()-s.getCenterY())-(t.getHeight()/2+s.getHeight()/2);d<=this.repulsionRange&&p<=this.repulsionRange&&o.add(s)}t.surrounding=[].concat(n(o))}for(c=0;c<t.surrounding.length;c++)this.calcRepulsionForce(t,t.surrounding[c])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,r){var n=r(1),i=r(7);function a(t,e,r){n.call(this,t,e,r),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var s in o(a,"FDLayoutEdge"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];t.exports=a},function(t,e,r){var n=r(3);function i(t,e,r,i){n.call(this,t,e,r,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in o(i,"FDLayoutNode"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];i.prototype.setGridCoordinates=function(t,e,r,n){this.startX=t,this.finishX=e,this.startY=r,this.finishY=n},t.exports=i},function(t,e,r){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}o(n,"DimensionD"),n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,r){var n=r(14);function i(){this.map={},this.keys=[]}o(i,"HashMap"),i.prototype.put=function(t,e){var r=n.createID(t);this.contains(r)||(this.map[r]=e,this.keys.push(t))},i.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=n.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,r){var n=r(14);function i(){this.set={}}o(i,"HashSet"),i.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[n.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[n.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),r=e.length,n=0;n<r;n++)t.push(this.set[e[n]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,r=0;r<e;r++){var n=t[r];this.add(n)}},t.exports=i},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=r(11),s=function(){function t(e,r){i(this,t),null===r&&void 0===r||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof a?e.size():e.length,this._quicksort(e,0,n-1)}return o(t,"Quicksort"),n(t,[{key:"_quicksort",value:o((function(t,e,r){if(e<r){var n=this._partition(t,e,r);this._quicksort(t,e,n),this._quicksort(t,n+1,r)}}),"_quicksort")},{key:"_partition",value:o((function(t,e,r){for(var n=this._get(t,e),i=e,a=r;;){for(;this.compareFunction(n,this._get(t,a));)a--;for(;this.compareFunction(this._get(t,i),n);)i++;if(!(i<a))return a;this._swap(t,i,a),i++,a--}}),"_partition")},{key:"_get",value:o((function(t,e){return t instanceof a?t.get_object_at(e):t[e]}),"_get")},{key:"_set",value:o((function(t,e,r){t instanceof a?t.set_object_at(e,r):t[e]=r}),"_set")},{key:"_swap",value:o((function(t,e,r){var n=this._get(t,e);this._set(t,e,this._get(t,r)),this._set(t,r,n)}),"_swap")},{key:"_defaultCompareFunction",value:o((function(t,e){return e>t}),"_defaultCompareFunction")}]),t}();t.exports=s},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=function(){function t(e,r){var n=arguments.length>2&&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=r,this.match_score=n,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[o][l]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return o(t,"NeedlemanWunsch"),n(t,[{key:"getScore",value:o((function(){return this.score}),"getScore")},{key:"getAlignments",value:o((function(){return this.alignments}),"getAlignments")},{key:"computeGrids",value:o((function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var n=1;n<this.jMax;n++){var i=[this.sequence1[r-1]===this.sequence2[n-1]?this.grid[r-1][n-1]+this.match_score:this.grid[r-1][n-1]+this.mismatch_penalty,this.grid[r-1][n]+this.gap_penalty,this.grid[r][n-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[r][n]=i[a[0]],this.tracebackGrid[r][n]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}),"computeGrids")},{key:"alignmentTraceback",value:o((function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],r=this.tracebackGrid[e.pos[0]][e.pos[1]];r[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),r[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),r[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}),"alignmentTraceback")},{key:"getAllIndexes",value:o((function(t,e){for(var r=[],n=-1;-1!==(n=t.indexOf(e,n+1));)r.push(n);return r}),"getAllIndexes")},{key:"arrayAllMaxIndexes",value:o((function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}),"arrayAllMaxIndexes")}]),t}();t.exports=a},function(t,e,r){var n=o((function(){}),"layoutBase");n.FDLayout=r(18),n.FDLayoutConstants=r(7),n.FDLayoutEdge=r(19),n.FDLayoutNode=r(20),n.DimensionD=r(21),n.HashMap=r(22),n.HashSet=r(23),n.IGeometry=r(8),n.IMath=r(9),n.Integer=r(10),n.Point=r(12),n.PointD=r(4),n.RandomSeed=r(16),n.RectangleD=r(13),n.Transform=r(17),n.UniqueIDGeneretor=r(14),n.Quicksort=r(24),n.LinkedList=r(11),n.LGraphObject=r(2),n.LGraph=r(5),n.LEdge=r(1),n.LGraphManager=r(6),n.LNode=r(3),n.Layout=r(15),n.LayoutConstants=r(0),n.NeedlemanWunsch=r(25),t.exports=n},function(t,e,r){function n(){this.listeners=[]}o(n,"Emitter");var i=n.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var r=this.listeners.length;r>=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r<this.listeners.length;r++){var n=this.listeners[r];t===n.event&&n.callback(e)}},t.exports=n}])}))}}),XEt=l({"../../node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n(VEt()):"function"==typeof define&&define.amd?define(["layout-base"],n):"object"==typeof t?t.coseBase=n(VEt()):r.coseBase=n(r.layoutBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?o((function(){return t.default}),"getDefault"):o((function(){return t}),"getModuleExports");return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(e,r){e.exports=t},function(t,e,r){var n=r(0).FDLayoutConstants;function i(){}for(var a in o(i,"CoSEConstants"),n)i[a]=n[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=i},function(t,e,r){var n=r(0).FDLayoutEdge;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEEdge"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},function(t,e,r){var n=r(0).LGraph;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEGraph"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},function(t,e,r){var n=r(0).LGraphManager;function i(t){n.call(this,t)}for(var a in o(i,"CoSEGraphManager"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},function(t,e,r){var n=r(0).FDLayoutNode,i=r(0).IMath;function a(t,e,r,i){n.call(this,t,e,r,i)}for(var s in o(a,"CoSENode"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];a.prototype.move=function(){var t=this.graphManager.getLayout();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)),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 r,n=this.getChild().getNodes(),i=0;i<n.length;i++)null==(r=n[i]).getChild()?(r.moveBy(t,e),r.displacementX+=t,r.displacementY+=e):r.propogateDisplacementToChildren(t,e)},a.prototype.setPred1=function(t){this.pred1=t},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(t){this.next=t},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(t){this.processed=t},a.prototype.isProcessed=function(){return processed},t.exports=a},function(t,e,r){var n=r(0).FDLayout,i=r(4),a=r(3),s=r(5),l=r(2),c=r(1),h=r(0).FDLayoutConstants,u=r(0).LayoutConstants,d=r(0).Point,p=r(0).PointD,g=r(0).Layout,f=r(0).Integer,m=r(0).IGeometry,y=r(0).LGraph,v=r(0).Transform;function x(){n.call(this),this.toBeTiled={}}for(var b in o(x,"CoSELayout"),x.prototype=Object.create(n.prototype),n)x[b]=n[b];x.prototype.newGraphManager=function(){var t=new i(this);return this.graphManager=t,t},x.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},x.prototype.newNode=function(t){return new s(this.graphManager,t)},x.prototype.newEdge=function(t){return new l(null,null,t)},x.prototype.initParameters=function(){n.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.springConstant=h.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=h.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=h.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},x.prototype.layout=function(){return u.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.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()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),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 r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r<t.length;r++){var n=t[r].rect,i=t[r].id;e[i]={id:i,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===h.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},x.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,r=[],n=this.graphManager.getGraphs(),i=n.length;for(e=0;e<i;e++)(t=n[e]).updateConnected(),t.isConnected||(r=r.concat(t.getNodes()));return r},x.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,r=new Set;for(e=0;e<t.length;e++){var n=t[e];if(!r.has(n)){var i=n.getSource(),a=n.getTarget();if(i==a)n.getBendpoints().push(new p),n.getBendpoints().push(new p),this.createDummyNodesForBendpoints(n),r.add(n);else{var s=[];if(s=(s=s.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i)),!r.has(s[0])){var o;if(s.length>1)for(o=0;o<s.length;o++){var l=s[o];l.getBendpoints().push(new p),this.createDummyNodesForBendpoints(l)}s.forEach((function(t){r.add(t)}))}}}if(r.size==t.length)break}},x.prototype.positionNodesRadially=function(t){for(var e=new d(0,0),r=Math.ceil(Math.sqrt(t.length)),n=0,i=0,a=0,s=new p(0,0),o=0;o<t.length;o++){o%r==0&&(a=0,i=n,0!=o&&(i+=c.DEFAULT_COMPONENT_SEPERATION),n=0);var l=t[o],h=g.findCenterOfTree(l);e.x=a,e.y=i,(s=x.radialLayout(l,h,e)).y>n&&(n=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,r){var n=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(e,null,0,359,0,n);var i=y.calculateBounds(t),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(r.x),a.setWorldOrgY(r.y);for(var s=0;s<t.length;s++){t[s].transform(a)}var o=new p(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(o)},x.branchRadialLayout=function(t,e,r,n,i,a){var s=(n-r+1)/2;s<0&&(s+=180);var o=(s+r)%360*m.TWO_PI/360,l=i*Math.cos(o),c=i*Math.sin(o);t.setCenter(l,c);var h=[],u=(h=h.concat(t.getEdges())).length;null!=e&&u--;for(var d,p=0,g=h.length,f=t.getEdgesBetween(e);f.length>1;){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(n-r)/u,w=d;p!=u;w=++w%g){var k=h[w].getOtherEnd(t);if(k!=e){var T=(r+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,r=0;r<t.length;r++){var n=t[r].getDiagonal();n>e&&(e=n)}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 r=[],n=this.graphManager.getAllNodes(),i=0;i<n.length;i++){var a=(o=n[i]).getParent();0!==this.getNodeDegreeWithChildren(o)||null!=a.id&&this.getToBeTiled(a)||r.push(o)}for(i=0;i<r.length;i++){var o,l=(o=r[i]).getParent().id;void 0===e[l]&&(e[l]=[]),e[l]=e[l].concat(o)}Object.keys(e).forEach((function(r){if(e[r].length>1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),a=new s(t.graphManager);a.id=n,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=a;var o=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c<e[r].length;c++){var h=e[r][c];l.remove(h),o.add(h)}}}))},x.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var r=0;r<this.compoundOrder.length;r++)e[this.compoundOrder[r].id]=this.compoundOrder[r],t[this.compoundOrder[r].id]=[].concat(this.compoundOrder[r].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[r].getChild()),this.compoundOrder[r].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},x.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(r){var n=t.idToDummyNode[r];e[r]=t.tileNodes(t.memberGroups[r],n.paddingLeft+n.paddingRight),n.rect.width=e[r].width,n.rect.height=e[r].height}))},x.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i)}},x.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,a=n.paddingTop;t.adjustLocations(e[r],n.rect.x,n.rect.y,i,a)}))},x.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i<n.length;i++){var a=n[i];if(this.getNodeDegree(a)>0)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(),r=0,n=0;n<e.length;n++){var i=e[n];i.getSource().id!==i.getTarget().id&&(r+=1)}return r},x.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var r=t.getChild().getNodes(),n=0;n<r.length;n++){var i=r[n];e+=this.getNodeDegreeWithChildren(i)}return e},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var r=t[e];null!=r.getChild()&&this.fillCompexOrderByDFS(r.getChild().getNodes()),this.getToBeTiled(r)&&this.compoundOrder.push(r)}},x.prototype.adjustLocations=function(t,e,r,n,i){r+=i;for(var a=e+=n,s=0;s<t.rows.length;s++){var o=t.rows[s];e=a;for(var l=0,c=0;c<o.length;c++){var h=o[c];h.rect.x=e,h.rect.y=r,e+=h.rect.width+t.horizontalPadding,h.rect.height>l&&(l=h.rect.height)}r+=l+t.verticalPadding}},x.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height}))},x.prototype.tileNodes=function(t,e){var r={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.height<e.rect.width*e.rect.height?1:0}));for(var n=0;n<t.length;n++){var i=t[n];0==r.rows.length?this.insertNodeToRow(r,i,0,e):this.canAddHorizontal(r,i.rect.width,i.rect.height)?this.insertNodeToRow(r,i,this.getShortestRowIndex(r),e):this.insertNodeToRow(r,i,r.rows.length,e),this.shiftToLastRow(r)}return r},x.prototype.insertNodeToRow=function(t,e,r,n){var i=n;if(r==t.rows.length){t.rows.push([]),t.rowWidth.push(i),t.rowHeight.push(0)}var a=t.rowWidth[r]+e.rect.width;t.rows[r].length>0&&(a+=t.horizontalPadding),t.rowWidth[r]=a,t.width<a&&(t.width=a);var s=e.rect.height;r>0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[r]&&(o=t.rowHeight[r],t.rowHeight[r]=s,o=t.rowHeight[r]-o),t.height+=o,t.rows[r].push(e)},x.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<r&&(e=n,r=t.rowWidth[n]);return e},x.prototype.getLongestRowIndex=function(t){for(var e=-1,r=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>r&&(e=n,r=t.rowWidth[n]);return e},x.prototype.canAddHorizontal=function(t,e,r){var n=this.getShortestRowIndex(t);if(n<0)return!0;var i=t.rowWidth[n];if(i+t.horizontalPadding+e<=t.width)return!0;var a,s,o=0;return t.rowHeight[n]<r&&n>0&&(o=r+t.verticalPadding-t.rowHeight[n]),a=t.width-i>=e+t.horizontalPadding?(t.height+o)/(i+e+t.horizontalPadding):(t.height+o)/t.width,o=r+t.verticalPadding,(s=t.width<e?(t.height+o)/e:(t.height+o)/t.width)<1&&(s=1/s),a<1&&(a=1/a),a<s},x.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),r=t.rowWidth.length-1,n=t.rows[e],i=n[n.length-1],a=i.width+t.horizontalPadding;if(t.width-t.rowWidth[r]>a&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[r]=t.rowWidth[r]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;o<n.length;o++)n[o].height>s&&(s=n[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=s,t.rowHeight[r]<i.height+t.verticalPadding&&(t.rowHeight[r]=i.height+t.verticalPadding);var c=t.rowHeight[e]+t.rowHeight[r];t.height+=c-l,this.shiftToLastRow(t)}},x.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var t,e=[],r=!0;r;){var n=this.graphManager.getAllNodes(),i=[];r=!1;for(var a=0;a<n.length;a++)1!=(t=n[a]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(i.push([t,t.getEdges()[0],t.getOwner()]),r=!0);if(1==r){for(var s=[],o=0;o<i.length;o++)1==i[o][0].getEdges().length&&(s.push(i[o]),i[o][0].getOwner().remove(i[o][0]));e.push(s),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},x.prototype.growTree=function(t){for(var e,r=t[t.length-1],n=0;n<r.length;n++)e=r[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(t){var e,r,n=t[0],i=(r=n==t[1].source?t[1].target:t[1].source).startX,a=r.finishX,s=r.startY,o=r.finishY,l=[0,0,0,0];if(s>0)for(var c=i;c<=a;c++)l[0]+=this.grid[c][s-1].length+this.grid[c][s].length-1;if(a<this.grid.length-1)for(c=s;c<=o;c++)l[1]+=this.grid[a+1][c].length+this.grid[a][c].length-1;if(o<this.grid[0].length-1)for(c=i;c<=a;c++)l[2]+=this.grid[c][o+1].length+this.grid[c][o].length-1;if(i>0)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;g<l.length;g++)l[g]<p?(p=l[g],u=1,d=g):l[g]==p&&u++;if(3==u&&0==p)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==u&&0==p){var m=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==m?0:1:0==l[0]&&0==l[2]?0==m?0:2:0==l[0]&&0==l[3]?0==m?0:3:0==l[1]&&0==l[2]?0==m?1:2:0==l[1]&&0==l[3]?0==m?1:3:0==m?2:3}else if(4==u&&0==p){e=m=Math.floor(4*Math.random())}else e=d;0==e?n.setCenter(r.getCenterX(),r.getCenterY()-r.getHeight()/2-h.DEFAULT_EDGE_LENGTH-n.getHeight()/2):1==e?n.setCenter(r.getCenterX()+r.getWidth()/2+h.DEFAULT_EDGE_LENGTH+n.getWidth()/2,r.getCenterY()):2==e?n.setCenter(r.getCenterX(),r.getCenterY()+r.getHeight()/2+h.DEFAULT_EDGE_LENGTH+n.getHeight()/2):n.setCenter(r.getCenterX()-r.getWidth()/2-h.DEFAULT_EDGE_LENGTH-n.getWidth()/2,r.getCenterY())},t.exports=x},function(t,e,r){var n={};n.layoutBase=r(0),n.CoSEConstants=r(1),n.CoSEEdge=r(2),n.CoSEGraph=r(3),n.CoSEGraphManager=r(4),n.CoSELayout=r(6),n.CoSENode=r(5),t.exports=n}])}))}}),KEt=l({"../../node_modules/.pnpm/cytoscape-cose-bilkent@4.1.0_cytoscape@3.31.0/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n(XEt()):"function"==typeof define&&define.amd?define(["cose-base"],n):"object"==typeof t?t.cytoscapeCoseBilkent=n(XEt()):r.cytoscapeCoseBilkent=n(r.coseBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?o((function(){return t.default}),"getDefault"):o((function(){return t}),"getModuleExports");return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(e,r){e.exports=t},function(t,e,r){var n=r(0).layoutBase.LayoutConstants,i=r(0).layoutBase.FDLayoutConstants,a=r(0).CoSEConstants,s=r(0).CoSELayout,l=r(0).CoSENode,c=r(0).layoutBase.PointD,h=r(0).layoutBase.DimensionD,u={ready:o((function(){}),"ready"),stop:o((function(){}),"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function d(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r}function p(t){this.options=d(u,t),g(this.options)}o(d,"extend"),o(p,"_CoSELayout");var g=o((function(t){null!=t.nodeRepulsion&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=t.nodeRepulsion),null!=t.idealEdgeLength&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=t.idealEdgeLength),null!=t.edgeElasticity&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=t.edgeElasticity),null!=t.nestingFactor&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),"draft"==t.quality?n.QUALITY=0:"proof"==t.quality?n.QUALITY=2:n.QUALITY=1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=!t.randomize,a.ANIMATE=i.ANIMATE=n.ANIMATE=t.animate,a.TILE=t.tile,a.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal}),"getUserOptions");p.prototype.run=function(){var t,e,r=this.options;this.idToLNode={};var n=this.layout=new s,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var a=n.newGraphManager();this.gm=a;var l=this.options.eles.nodes(),c=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(l),n);for(var h=0;h<c.length;h++){var u=c[h],d=this.idToLNode[u.data("source")],p=this.idToLNode[u.data("target")];if(d!==p&&0==d.getEdgesBetween(p).length)a.add(n.newEdge(),d,p).id=u.id()}var g=o((function(t,e){"number"==typeof t&&(t=e);var r=t.data("id"),n=i.idToLNode[r];return{x:n.getRect().getCenterX(),y:n.getRect().getCenterY()}}),"getPositions"),f=o((function a(){for(var s,l=o((function(){r.fit&&r.cy.fit(r.eles,r.padding),t||(t=!0,i.cy.one("layoutready",r.ready),i.cy.trigger({type:"layoutready",layout:i}))}),"afterReposition"),c=i.options.refresh,h=0;h<c&&!s;h++)s=i.stopped||i.layout.tick();if(s)return n.checkLayoutSuccess()&&!n.isSubLayout&&n.doPostLayout(),n.tilingPostLayout&&n.tilingPostLayout(),n.isLayoutFinished=!0,i.options.eles.nodes().positions(g),l(),i.cy.one("layoutstop",i.options.stop),i.cy.trigger({type:"layoutstop",layout:i}),e&&cancelAnimationFrame(e),void(t=!1);var u=i.layout.getPositionsData();r.eles.nodes().positions((function(t,e){if("number"==typeof t&&(t=e),!t.isParent()){for(var r=t.id(),n=u[r],i=t;null==n&&(n=u[i.data("parent")]||u["DummyCompound_"+i.data("parent")],u[r]=n,null!=(i=i.parent()[0])););return null!=n?{x:n.x,y:n.y}:{x:t.position("x"),y:t.position("y")}}})),l(),e=requestAnimationFrame(a)}),"iterateAnimated");return n.addListener("layoutstarted",(function(){"during"===i.options.animate&&(e=requestAnimationFrame(f))})),n.runLayout(),"during"!==this.options.animate&&(i.options.eles.nodes().not(":parent").layoutPositions(i,i.options,g),t=!1),this},p.prototype.getTopMostNodes=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].id()]=!0;return t.filter((function(t,r){"number"==typeof t&&(t=r);for(var n=t.parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0}))},p.prototype.processChildrenList=function(t,e,r){for(var n=e.length,i=0;i<n;i++){var a,s,o=e[i],u=o.children(),d=o.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((a=null!=o.outerWidth()&&null!=o.outerHeight()?t.add(new l(r.graphManager,new c(o.position("x")-d.w/2,o.position("y")-d.h/2),new h(parseFloat(d.w),parseFloat(d.h)))):t.add(new l(this.graphManager))).id=o.data("id"),a.paddingLeft=parseInt(o.css("padding")),a.paddingTop=parseInt(o.css("padding")),a.paddingRight=parseInt(o.css("padding")),a.paddingBottom=parseInt(o.css("padding")),this.options.nodeDimensionsIncludeLabels&&o.isParent()){var p=o.boundingBox({includeLabels:!0,includeNodes:!1}).w,g=o.boundingBox({includeLabels:!0,includeNodes:!1}).h,f=o.css("text-halign");a.labelWidth=p,a.labelHeight=g,a.labelPos=f}if(this.idToLNode[o.data("id")]=a,isNaN(a.rect.x)&&(a.rect.x=0),isNaN(a.rect.y)&&(a.rect.y=0),null!=u&&u.length>0)s=r.getGraphManager().add(r.newGraph(),a),this.processChildrenList(s,u,r)}},p.prototype.stop=function(){return this.stopped=!0,this};var f=o((function(t){t("layout","cose-bilkent",p)}),"register");"undefined"!=typeof cytoscape&&f(cytoscape),t.exports=f}])}))}}),ZEt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",a[o].id),n.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 16:n.getLogger().trace("Icon: ",a[o]),n.decorateNode({icon:a[o]});break;case 17:case 21:n.decorateNode({class:a[o]});break;case 18:n.getLogger().trace("SPACELIST");break;case 19:n.getLogger().trace("Node: ",a[o].id),n.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 20:n.decorateNode({icon:a[o]});break;case 25:n.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:n.getType(a[o-2],a[o])};break;case 26:this.$={id:a[o],descr:a[o],type:n.nodeType.DEFAULT};break;case 27:n.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:n.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:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:l},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,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:s,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:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},x=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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,o(b,"Parser"),b.prototype=v,v.Parser=b,new b}();ZEt.parser=ZEt;var QEt=ZEt,JEt=[],tCt=0,eCt={},rCt=o((()=>{JEt=[],tCt=0,eCt={}}),"clear"),nCt=o((function(t){for(let e=JEt.length-1;e>=0;e--)if(JEt[e].level<t)return JEt[e];return null}),"getParent"),iCt=o((()=>JEt.length>0?JEt[0]:null),"getMindmap"),aCt=o(((t,e,r,n)=>{y.info("addNode",t,e,r,n);const i=Qr();let a=i.mindmap?.padding??Lt.mindmap.padding;switch(n){case sCt.ROUNDED_RECT:case sCt.RECT:case sCt.HEXAGON:a*=2}const s={id:tCt++,nodeId:hr(e,i),level:t,descr:hr(r,i),type:n,children:[],width:i.mindmap?.maxNodeWidth??Lt.mindmap.maxNodeWidth,padding:a},o=nCt(t);if(o)o.children.push(s),JEt.push(s);else{if(0!==JEt.length)throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")');JEt.push(s)}}),"addNode"),sCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},oCt=o(((t,e)=>{switch(y.debug("In get type",t,e),t){case"[":return sCt.RECT;case"(":return")"===e?sCt.ROUNDED_RECT:sCt.CLOUD;case"((":return sCt.CIRCLE;case")":return sCt.CLOUD;case"))":return sCt.BANG;case"{{":return sCt.HEXAGON;default:return sCt.DEFAULT}}),"getType"),lCt=o(((t,e)=>{eCt[t]=e}),"setElementForId"),cCt=o((t=>{if(!t)return;const e=Qr(),r=JEt[JEt.length-1];t.icon&&(r.icon=hr(t.icon,e)),t.class&&(r.class=hr(t.class,e))}),"decorateNode"),hCt=o((t=>{switch(t){case sCt.DEFAULT:return"no-border";case sCt.RECT:return"rect";case sCt.ROUNDED_RECT:return"rounded-rect";case sCt.CIRCLE:return"circle";case sCt.CLOUD:return"cloud";case sCt.BANG:return"bang";case sCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),uCt=o((()=>y),"getLogger"),dCt=o((t=>eCt[t]),"getElementById"),pCt={clear:rCt,addNode:aCt,getMindmap:iCt,nodeType:sCt,getType:oCt,setElementForId:lCt,decorateNode:cCt,type2Str:hCt,getLogger:uCt,getElementById:dCt},gCt=p(KEt(),1),fCt=o((function(t,e,r,n){e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-5} v${10-r.height} q0,-5 5,-5 h${r.width-10} q5,0 5,5 v${r.height-5} H0 Z`),e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)}),"defaultBkg"),mCt=o((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)}),"rectBkg"),yCt=o((function(t,e,r){const n=r.width,i=r.height,a=.15*n,s=.25*n,o=.35*n,l=.2*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 0 0,1 ${.25*n},${-1*n*.1}\n a${o},${o} 1 0,1 ${.4*n},${-1*n*.1}\n a${s},${s} 1 0,1 ${.35*n},${1*n*.2}\n\n a${a},${a} 1 0,1 ${.15*n},${1*i*.35}\n a${l},${l} 1 0,1 ${-1*n*.15},${1*i*.65}\n\n a${s},${a} 1 0,1 ${-1*n*.25},${.15*n}\n a${o},${o} 1 0,1 ${-1*n*.5},0\n a${a},${a} 1 0,1 ${-1*n*.25},${-1*n*.15}\n\n a${a},${a} 1 0,1 ${-1*n*.1},${-1*i*.35}\n a${l},${l} 1 0,1 ${.1*n},${-1*i*.65}\n\n H0 V0 Z`)}),"cloudBkg"),vCt=o((function(t,e,r){const n=r.width,i=r.height,a=.15*n;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${a},${a} 1 0,0 ${.25*n},${-1*i*.1}\n a${a},${a} 1 0,0 ${.25*n},0\n a${a},${a} 1 0,0 ${.25*n},0\n a${a},${a} 1 0,0 ${.25*n},${1*i*.1}\n\n a${a},${a} 1 0,0 ${.15*n},${1*i*.33}\n a${.8*a},${.8*a} 1 0,0 0,${1*i*.34}\n a${a},${a} 1 0,0 ${-1*n*.15},${1*i*.33}\n\n a${a},${a} 1 0,0 ${-1*n*.25},${.15*i}\n a${a},${a} 1 0,0 ${-1*n*.25},0\n a${a},${a} 1 0,0 ${-1*n*.25},0\n a${a},${a} 1 0,0 ${-1*n*.25},${-1*i*.15}\n\n a${a},${a} 1 0,0 ${-1*n*.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*n},${-1*i*.33}\n\n H0 V0 Z`)}),"bangBkg"),xCt=o((function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)}),"circleBkg");function bCt(t,e,r,n,i){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(i.width-e)/2+", "+r+")")}o(bCt,"insertPolygonShape");var wCt=o((function(t,e,r){const n=r.height,i=n/4,a=r.width-r.padding+2*i;bCt(e,a,n,[{x:i,y:0},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:i,y:-n},{x:0,y:-n/2}],r)}),"hexagonBkg"),kCt=o((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)}),"roundedRectBkg"),TCt=o((async function(t,e,r,n,i){const a=i.htmlLabels,s=n%11,o=e.append("g");r.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+l);const c=o.append("g"),h=o.append("g"),u=r.descr.replace(/(<br\/*>)/g,"\n");await v_(h,u,{useHtmlLabels:a,width:r.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]=Dk(i.fontSize);if(r.height=d.height+1.1*p*.5+r.padding,r.width=d.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE){r.height+=50,r.width+=50;o.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")")}else{r.width+=50;const t=r.height;r.height=Math.max(t,60);const e=Math.abs(r.height-t);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+e/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+(25+r.width/2)+", "+(e/2+r.padding/2)+")")}else if(a){const t=(r.width-d.width)/2,e=(r.height-d.height)/2;h.attr("transform","translate("+t+", "+e+")")}else{const t=r.width/2,e=r.padding/2;h.attr("transform","translate("+t+", "+e+")")}switch(r.type){case t.nodeType.DEFAULT:fCt(t,c,r,s);break;case t.nodeType.ROUNDED_RECT:kCt(t,c,r,s);break;case t.nodeType.RECT:mCt(t,c,r,s);break;case t.nodeType.CIRCLE:c.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),xCt(t,c,r,s);break;case t.nodeType.CLOUD:yCt(t,c,r,s);break;case t.nodeType.BANG:vCt(t,c,r,s);break;case t.nodeType.HEXAGON:wCt(t,c,r,s)}return t.setElementForId(r.id,o),r.height}),"drawNode"),_Ct=o((function(t,e){const r=t.getElementById(e.id),n=e.x||0,i=e.y||0;r.attr("transform","translate("+n+","+i+")")}),"positionNode");async function ECt(t,e,r,n,i){await TCt(t,e,r,n,i),r.children&&await Promise.all(r.children.map(((r,a)=>ECt(t,e,r,n<0?a:n,i))))}function CCt(t,e){e.edges().map(((e,r)=>{const n=e.data();if(e[0]._private.bodyBounds){const i=e[0]._private.rscratch;y.trace("Edge: ",r,n),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-"+n.section+" edge-depth-"+n.depth)}}))}function SCt(t,e,r,n){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:n,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach((i=>{SCt(i,e,r,n+1),e.add({group:"edges",data:{id:`${t.id}_${i.id}`,source:t.id,target:i.id,depth:n,section:i.section}})}))}function ACt(t,e){return new Promise((r=>{const n=Ga("body").append("div").attr("id","cy").attr("style","display:none"),i=HEt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});n.remove(),SCt(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=>{y.info("Ready",t),r(i)}))}))}function LCt(t,e){e.nodes().map(((e,r)=>{const n=e.data();n.x=e.position().x,n.y=e.position().y,_Ct(t,n);const i=t.getElementById(n.nodeId);y.info("Id:",r,"Position: (",e.position().x,", ",e.position().y,")",n),i.attr("transform",`translate(${e.position().x-n.width/2}, ${e.position().y-n.height/2})`),i.attr("attr",`apa-${r})`)}))}HEt.use(gCt.default),o(ECt,"drawNodes"),o(CCt,"drawEdges"),o(SCt,"addNodes"),o(ACt,"layoutMindmap"),o(LCt,"positionNodes");var NCt=o((async(t,e,r,n)=>{y.debug("Rendering mindmap diagram\n"+t);const i=n.db,a=i.getMindmap();if(!a)return;const s=Qr();s.htmlLabels=!1;const o=ag(e),l=o.append("g");l.attr("class","mindmap-edges");const c=o.append("g");c.attr("class","mindmap-nodes"),await ECt(i,c,a,-1,s);const h=await ACt(a,s);CCt(l,h),LCt(i,h),Mr(void 0,o,s.mindmap?.padding??Lt.mindmap.padding,s.mindmap?.useMaxWidth??Lt.mindmap.useMaxWidth)}),"draw"),ICt={draw:NCt},RCt=o((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],it(t["lineColor"+e])?t["lineColor"+e]=st(t["lineColor"+e],20):t["lineColor"+e]=ot(t["lineColor"+e],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=""+(17-3*r);e+=`\n .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {\n fill: ${t["cScale"+r]};\n }\n .section-${r-1} text {\n fill: ${t["cScaleLabel"+r]};\n }\n .node-icon-${r-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+r]};\n }\n .section-edge-${r-1}{\n stroke: ${t["cScale"+r]};\n }\n .edge-depth-${r-1}{\n stroke-width: ${n};\n }\n .section-${r-1} line {\n stroke: ${t["cScaleInv"+r]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e}),"genSections"),MCt={db:pCt,renderer:ICt,parser:QEt,styles:o((t=>`\n .edge {\n stroke-width: 3;\n }\n ${RCt(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")},DCt=Object.freeze({__proto__:null,diagram:MCt}),OCt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 6:case 7:return n;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",a[o-1].id),n.addNode(a[o-2].length,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 16:n.getLogger().info("Node: ",a[o].id),n.addNode(a[o-1].length,a[o].id,a[o].descr,a[o].type);break;case 17:n.getLogger().trace("Icon: ",a[o]),n.decorateNode({icon:a[o]});break;case 18:case 23:n.decorateNode({class:a[o]});break;case 19:n.getLogger().trace("SPACELIST");break;case 20:n.getLogger().trace("Node: ",a[o-1].id),n.addNode(0,a[o-1].id,a[o-1].descr,a[o-1].type,a[o]);break;case 21:n.getLogger().trace("Node: ",a[o].id),n.addNode(0,a[o].id,a[o].descr,a[o].type);break;case 22:n.decorateNode({icon:a[o]});break;case 27:n.getLogger().trace("node found ..",a[o-2]),this.$={id:a[o-1],descr:a[o-1],type:n.getType(a[o-2],a[o])};break;case 28:this.$={id:a[o],descr:a[o],type:0};break;case 29:n.getLogger().trace("node found ..",a[o-3]),this.$={id:a[o-3],descr:a[o-1],type:n.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:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},t(c,[2,3]),{1:[2,2]},t(c,[2,4]),t(c,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:l},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,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:s,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:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},k=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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 r=/\n\s*/g;return e.yytext=e.yytext.replace(r,"<br/>"),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,o(T,"Parser"),T.prototype=w,w.Parser=T,new T}();OCt.parser=OCt;var PCt=OCt,BCt=[],$Ct=[],FCt=0,zCt={},UCt=o((()=>{BCt=[],$Ct=[],FCt=0,zCt={}}),"clear"),GCt=o((t=>{if(0===BCt.length)return null;const e=BCt[0].level;let r=null;for(let t=BCt.length-1;t>=0;t--)if(BCt[t].level!==e||r||(r=BCt[t]),BCt[t].level<e)throw new Error('Items without section detected, found section ("'+BCt[t].label+'")');return t===r?.level?null:r}),"getSection"),qCt=o((function(){return $Ct}),"getSections"),jCt=o((function(){const t=[],e=qCt(),r=Qr();for(const n of e){const e={id:n.id,label:hr(n.label??"",r),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:r.look};t.push(e);const i=BCt.filter((t=>t.parentId===n.id));for(const e of i){const i={id:e.id,parentId:n.id,label:hr(e.label??"",r),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:Qr()}}),"getData"),WCt=o(((t,e,r,n,i)=>{const a=Qr();let s=a.mindmap?.padding??Lt.mindmap.padding;switch(n){case YCt.ROUNDED_RECT:case YCt.RECT:case YCt.HEXAGON:s*=2}const o={id:hr(e,a)||"kbn"+FCt++,level:t,label:hr(r,a),width:a.mindmap?.maxNodeWidth??Lt.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(void 0!==i){let t;t=i.includes("\n")?i+"\n":"{\n"+i+"\n}";const e=oy(t,{schema:sy});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=GCt(t);l?o.parentId=l.id||"kbn"+FCt++:$Ct.push(o),BCt.push(o)}),"addNode"),YCt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},HCt=o(((t,e)=>{switch(y.debug("In get type",t,e),t){case"[":return YCt.RECT;case"(":return")"===e?YCt.ROUNDED_RECT:YCt.CLOUD;case"((":return YCt.CIRCLE;case")":return YCt.CLOUD;case"))":return YCt.BANG;case"{{":return YCt.HEXAGON;default:return YCt.DEFAULT}}),"getType"),VCt=o(((t,e)=>{zCt[t]=e}),"setElementForId"),XCt=o((t=>{if(!t)return;const e=Qr(),r=BCt[BCt.length-1];t.icon&&(r.icon=hr(t.icon,e)),t.class&&(r.cssClasses=hr(t.class,e))}),"decorateNode"),KCt=o((t=>{switch(t){case YCt.DEFAULT:return"no-border";case YCt.RECT:return"rect";case YCt.ROUNDED_RECT:return"rounded-rect";case YCt.CIRCLE:return"circle";case YCt.CLOUD:return"cloud";case YCt.BANG:return"bang";case YCt.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str"),ZCt=o((()=>y),"getLogger"),QCt=o((t=>zCt[t]),"getElementById"),JCt={clear:UCt,addNode:WCt,getSections:qCt,getData:jCt,nodeType:YCt,getType:HCt,setElementForId:VCt,decorateNode:XCt,type2Str:KCt,getLogger:ZCt,getElementById:QCt},tSt=o((async(t,e,r,n)=>{y.debug("Rendering kanban diagram\n"+t);const i=n.db.getData(),a=Qr();a.htmlLabels=!1;const s=ag(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 r=await XE(o,t);d=Math.max(d,r?.labelBBox?.height),u.push(r)}let p=0;for(const t of c){const e=u[p];p+=1;const r=a?.kanban?.sectionWidth||200,n=3*-r/2+d;let s=n;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=r-15;const n=(await GS(l,e,{config:a})).node().getBBox();e.y=s+n.height/2,await WS(e),s=e.y+n.height/2+5}const c=e.cluster.select("rect"),h=Math.max(s-n+30,50)+(d-25);c.attr("height",h)}Mr(void 0,s,a.mindmap?.padding??Lt.kanban.padding,a.mindmap?.useMaxWidth??Lt.kanban.useMaxWidth)}),"draw"),eSt={draw:tSt},rSt=o((t=>{let e="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)t["lineColor"+e]=t["lineColor"+e]||t["cScaleInv"+e],it(t["lineColor"+e])?t["lineColor"+e]=st(t["lineColor"+e],20):t["lineColor"+e]=ot(t["lineColor"+e],20);const r=o(((e,r)=>t.darkMode?ot(e,r):st(e,r)),"adjuster");for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {\n fill: ${r(t["cScale"+n],10)};\n stroke: ${r(t["cScale"+n],10)};\n\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.background};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${t.background};\n stroke: ${t.nodeBorder};\n text-decoration: underline;\n }\n `}return e}),"genSections"),nSt={db:JCt,renderer:eSt,parser:PCt,styles:o((t=>`\n .edge {\n stroke-width: 3;\n }\n ${rSt(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")},iSt=Object.freeze({__proto__:null,diagram:nSt}),aSt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 7:const t=n.findOrCreateNode(a[o-4].trim().replaceAll('""','"')),e=n.findOrCreateNode(a[o-2].trim().replaceAll('""','"')),r=parseFloat(a[o].trim());n.addLink(t,e,r);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:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},a=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,r,n){switch(r){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 s(){this.yy={}}return i.lexer=a,o(s,"Parser"),s.prototype=i,i.Parser=s,new s}();aSt.parser=aSt;var sSt=aSt,oSt=[],lSt=[],cSt=new Map,hSt=o((()=>{oSt=[],lSt=[],cSt=new Map,qr()}),"clear"),uSt=class{constructor(t,e,r=0){this.source=t,this.target=e,this.value=r}static{o(this,"SankeyLink")}},dSt=o(((t,e,r)=>{oSt.push(new uSt(t,e,r))}),"addLink"),pSt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},gSt=o((t=>{t=Lr.sanitizeText(t,Qr());let e=cSt.get(t);return void 0===e&&(e=new pSt(t),cSt.set(t,e),lSt.push(e)),e}),"findOrCreateNode"),fSt=o((()=>lSt),"getNodes"),mSt=o((()=>oSt),"getLinks"),ySt=o((()=>({nodes:lSt.map((t=>({id:t.ID}))),links:oSt.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),vSt={nodesMap:cSt,getConfig:o((()=>Qr().sankey),"getConfig"),getNodes:fSt,getLinks:mSt,getGraph:ySt,addLink:dSt,findOrCreateNode:gSt,getAccTitle:Wr,setAccTitle:jr,getAccDescription:Hr,setAccDescription:Yr,getDiagramTitle:Xr,setDiagramTitle:Vr,clear:hSt};function xSt(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function bSt(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function wSt(t,e){let r=0;if(void 0===e)for(let e of t)(e=+e)&&(r+=e);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function kSt(t){return t.target.depth}function TSt(t){return t.depth}function _St(t,e){return e-1-t.height}function ESt(t,e){return t.sourceLinks.length?t.depth:e-1}function CSt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?bSt(t.sourceLinks,kSt)-1:0}function SSt(t){return function(){return t}}function ASt(t,e){return NSt(t.source,e.source)||t.index-e.index}function LSt(t,e){return NSt(t.target,e.target)||t.index-e.index}function NSt(t,e){return t.y0-e.y0}function ISt(t){return t.value}function RSt(t){return t.index}function MSt(t){return t.nodes}function DSt(t){return t.links}function OSt(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function PSt({nodes:t}){for(const e of t){let t=e.y0,r=t;for(const r of e.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const t of e.targetLinks)t.y1=r+t.width/2,r+=t.width}}function BSt(){let t,e,r,n=0,i=0,a=1,s=1,l=24,c=8,h=RSt,u=ESt,d=MSt,p=DSt,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),PSt(t),t}function m({nodes:t,links:e}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const n=new Map(t.map(((e,r)=>[h(e,r,t),e])));for(const[t,r]of e.entries()){r.index=t;let{source:e,target:i}=r;"object"!=typeof e&&(e=r.source=OSt(n,e)),"object"!=typeof i&&(i=r.target=OSt(n,i)),e.sourceLinks.push(r),i.targetLinks.push(r)}if(null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}function y({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(wSt(e.sourceLinks,ISt),wSt(e.targetLinks,ISt)):e.fixedValue}function v({nodes:t}){const e=t.length;let r=new Set(t),n=new Set,i=0;for(;r.size;){for(const t of r){t.depth=i;for(const{target:e}of t.sourceLinks)n.add(e)}if(++i>e)throw new Error("circular link");r=n,n=new Set}}function x({nodes:t}){const e=t.length;let r=new Set(t),n=new Set,i=0;for(;r.size;){for(const t of r){t.height=i;for(const{source:e}of t.targetLinks)n.add(e)}if(++i>e)throw new Error("circular link");r=n,n=new Set}}function b({nodes:t}){const r=xSt(t,(t=>t.depth))+1,i=(a-n-l)/(r-1),s=new Array(r);for(const e of t){const t=Math.max(0,Math.min(r-1,Math.floor(u.call(null,e,r))));e.layer=t,e.x0=n+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 r=bSt(e,(e=>(s-i-(e.length-1)*t)/wSt(e,ISt)));for(const n of e){let e=i;for(const i of n){i.y0=e,i.y1=e+i.value*r,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*r}e=(s-e+t)/(n.length+1);for(let t=0;t<n.length;++t){const r=n[t];r.y0+=e*(t+1),r.y1+=e*(t+1)}L(n)}}function k(e){const r=b(e);t=Math.min(c,(s-i)/(xSt(r,(t=>t.length))-1)),w(r);for(let t=0;t<g;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/g);_(r,e,n),T(r,e,n)}}function T(t,r,n){for(let i=1,a=t.length;i<a;++i){const a=t[i];for(const t of a){let e=0,n=0;for(const{source:r,value:i}of t.targetLinks){let a=i*(t.layer-r.layer);e+=N(r,t)*a,n+=a}if(!(n>0))continue;let i=(e/n-t.y0)*r;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(NSt),E(a,n)}}function _(t,r,n){for(let i=t.length-2;i>=0;--i){const a=t[i];for(const t of a){let e=0,n=0;for(const{target:r,value:i}of t.sourceLinks){let a=i*(r.layer-t.layer);e+=I(t,r)*a,n+=a}if(!(n>0))continue;let i=(e/n-t.y0)*r;t.y0+=i,t.y1+=i,A(t)}void 0===e&&a.sort(NSt),E(a,n)}}function E(e,r){const n=e.length>>1,a=e[n];S(e,a.y0-t,n-1,r),C(e,a.y1+t,n+1,r),S(e,s,e.length-1,r),C(e,i,0,r)}function C(e,r,n,i){for(;n<e.length;++n){const a=e[n],s=(r-a.y0)*i;s>1e-6&&(a.y0+=s,a.y1+=s),r=a.y1+t}}function S(e,r,n,i){for(;n>=0;--n){const a=e[n],s=(a.y1-r)*i;s>1e-6&&(a.y0-=s,a.y1-=s),r=a.y0-t}}function A({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(LSt);for(const{target:{targetLinks:e}}of t)e.sort(ASt)}}function L(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(LSt),r.sort(ASt)}function N(e,r){let n=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:a}of e.sourceLinks){if(i===r)break;n+=a+t}for(const{source:t,width:i}of r.targetLinks){if(t===e)break;n-=i}return n}function I(e,r){let n=r.y0-(r.targetLinks.length-1)*t/2;for(const{source:i,width:a}of r.targetLinks){if(i===e)break;n+=a+t}for(const{target:t,width:i}of e.sourceLinks){if(t===r)break;n-=i}return n}return o(f,"sankey"),f.update=function(t){return PSt(t),t},f.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:SSt(t),f):h},f.nodeAlign=function(t){return arguments.length?(u="function"==typeof t?t:SSt(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:SSt(t),f):d},f.links=function(t){return arguments.length?(p="function"==typeof t?t:SSt(t),f):p},f.linkSort=function(t){return arguments.length?(r=t,f):r},f.size=function(t){return arguments.length?(n=i=0,a=+t[0],s=+t[1],f):[a-n,s-i]},f.extent=function(t){return arguments.length?(n=+t[0][0],a=+t[1][0],i=+t[0][1],s=+t[1][1],f):[[n,i],[a,s]]},f.iterations=function(t){return arguments.length?(g=+t,f):g},o(m,"computeNodeLinks"),o(y,"computeNodeValues"),o(v,"computeNodeDepths"),o(x,"computeNodeHeights"),o(b,"computeNodeLayers"),o(w,"initializeNodeBreadths"),o(k,"computeNodeBreadths"),o(T,"relaxLeftToRight"),o(_,"relaxRightToLeft"),o(E,"resolveCollisions"),o(C,"resolveCollisionsTopToBottom"),o(S,"resolveCollisionsBottomToTop"),o(A,"reorderNodeLinks"),o(L,"reorderLinks"),o(N,"targetTop"),o(I,"sourceTop"),f}o(xSt,"max"),o(bSt,"min"),o(wSt,"sum"),o(kSt,"targetDepth"),o(TSt,"left"),o(_St,"right"),o(ESt,"justify"),o(CSt,"center"),o(SSt,"constant"),o(ASt,"ascendingSourceBreadth"),o(LSt,"ascendingTargetBreadth"),o(NSt,"ascendingBreadth"),o(ISt,"value"),o(RSt,"defaultId"),o(MSt,"defaultNodes"),o(DSt,"defaultLinks"),o(OSt,"find"),o(PSt,"computeLinkBreadths"),o(BSt,"Sankey");var $St=Math.PI,FSt=2*$St,zSt=1e-6,USt=FSt-zSt;function GSt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function qSt(){return new GSt}o(GSt,"Path"),o(qSt,"path"),GSt.prototype=qSt.prototype={constructor:GSt,moveTo:o((function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)}),"moveTo"),closePath:o((function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}),"closePath"),lineTo:o((function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)}),"lineTo"),quadraticCurveTo:o((function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)}),"quadraticCurveTo"),bezierCurveTo:o((function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)}),"bezierCurveTo"),arcTo:o((function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,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>zSt)if(Math.abs(h*o-l*c)>zSt&&i){var d=r-a,p=n-s,g=o*o+l*l,f=d*d+p*p,m=Math.sqrt(g),y=Math.sqrt(u),v=i*Math.tan(($St-Math.acos((g+u-f)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>zSt&&(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:o((function(t,e,r,n,i,a){t=+t,e=+e,a=!!a;var s=(r=+r)*Math.cos(n),o=r*Math.sin(n),l=t+s,c=e+o,h=1^a,u=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>zSt||Math.abs(this._y1-c)>zSt)&&(this._+="L"+l+","+c),r&&(u<0&&(u=u%FSt+FSt),u>USt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>zSt&&(this._+="A"+r+","+r+",0,"+ +(u>=$St)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))}),"arc"),rect:o((function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"}),"rect"),toString:o((function(){return this._}),"toString")};var jSt=qSt;function WSt(t){return o((function(){return t}),"constant")}function YSt(t){return t[0]}function HSt(t){return t[1]}o(WSt,"default"),o(YSt,"x"),o(HSt,"y");var VSt=Array.prototype.slice;function XSt(t){return t.source}function KSt(t){return t.target}function ZSt(t){var e=XSt,r=KSt,n=YSt,i=HSt,a=null;function s(){var s,o=VSt.call(arguments),l=e.apply(this,o),c=r.apply(this,o);if(a||(a=s=jSt()),t(a,+n.apply(this,(o[0]=l,o)),+i.apply(this,o),+n.apply(this,(o[0]=c,o)),+i.apply(this,o)),s)return a=null,s+""||null}return o(s,"link"),s.source=function(t){return arguments.length?(e=t,s):e},s.target=function(t){return arguments.length?(r=t,s):r},s.x=function(t){return arguments.length?(n="function"==typeof t?t:WSt(+t),s):n},s.y=function(t){return arguments.length?(i="function"==typeof t?t:WSt(+t),s):i},s.context=function(t){return arguments.length?(a=null==t?null:t,s):a},s}function QSt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function JSt(){return ZSt(QSt)}function tAt(t){return[t.source.x1,t.y0]}function eAt(t){return[t.target.x0,t.y1]}function rAt(){return JSt().source(tAt).target(eAt)}o(XSt,"linkSource"),o(KSt,"linkTarget"),o(ZSt,"link"),o(QSt,"curveHorizontal"),o(JSt,"linkHorizontal"),o(tAt,"horizontalSource"),o(eAt,"horizontalTarget"),o(rAt,"default");var nAt=class t{static{o(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+")"}},iAt={left:TSt,right:_St,center:CSt,justify:ESt},aAt=o((function(t,e,r,n){const{securityLevel:i,sankey:a}=Qr(),s=tn.sankey;let l;"sandbox"===i&&(l=Ga("#i"+e));const c=Ga("sandbox"===i?l.nodes()[0].contentDocument.body:"body"),h="sandbox"===i?c.select(`[id="${e}"]`):Ga(`[id="${e}"]`),u=a?.width??s.width,d=a?.height??s.width,p=a?.useMaxWidth??s.useMaxWidth,g=a?.nodeAlignment??s.nodeAlignment,f=a?.prefix??s.prefix,m=a?.suffix??s.suffix,y=a?.showValues??s.showValues,v=n.db.getGraph(),x=iAt[g],b=BSt().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(y?15:0)).nodeAlign(x).extent([[0,0],[u,d]]);b(v);const w=So(Ih);h.append("g").attr("class","nodes").selectAll(".node").data(v.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=nAt.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=o((({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-size",14).selectAll("text").data(v.nodes).join("text").attr("x",(t=>t.x0<u/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(y?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<u/2?"start":"end")).text(k);const T=h.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(v.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),_=a?.linkColor??"gradient";if("gradient"===_){const t=T.append("linearGradient").attr("id",(t=>(t.uid=nAt.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=o((t=>t.uid),"coloring");break;case"source":E=o((t=>w(t.source.id)),"coloring");break;case"target":E=o((t=>w(t.target.id)),"coloring");break;default:E=_}T.append("path").attr("d",rAt()).attr("stroke",E).attr("stroke-width",(t=>Math.max(1,t.width))),Mr(void 0,h,0,p)}),"draw"),sAt={draw:aAt},oAt=o((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),lAt=o((t=>`.label {\n font-family: ${t.fontFamily};\n }`),"getStyles"),cAt=sSt.parse.bind(sSt);sSt.parse=t=>cAt(oAt(t));var hAt={styles:lAt,parser:sSt,db:vSt,renderer:sAt},uAt=Object.freeze({__proto__:null,diagram:hAt}),dAt={packet:[]},pAt=structuredClone(dAt),gAt=Lt.packet,fAt=o((()=>{const t=Ok({...gAt,...Gt().packet});return t.showBits&&(t.paddingY+=10),t}),"getConfig"),mAt=o((()=>pAt.packet),"getPacket"),yAt={pushWord:o((t=>{t.length>0&&pAt.packet.push(t)}),"pushWord"),getPacket:mAt,getConfig:fAt,clear:o((()=>{qr(),pAt=structuredClone(dAt)}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},vAt=o((t=>{IX(t,yAt);let e=-1,r=[],n=1;const{bitsPerRow:i}=yAt.getConfig();for(let{start:a,end:s,label:o}of t.blocks){if(s&&s<a)throw new Error(`Packet block ${a} - ${s} is invalid. End must be greater than start.`);if(a!==e+1)throw new Error(`Packet block ${a} - ${s??a} is not contiguous. It should start from ${e+1}.`);for(e=s??a,y.debug(`Packet block ${a} - ${e} with label ${o}`);r.length<=i+1&&yAt.getPacket().length<1e4;){const[t,e]=xAt({start:a,end:s,label:o},n,i);if(r.push(t),t.end+1===n*i&&(yAt.pushWord(r),r=[],n++),!e)break;({start:a,end:s,label:o}=e)}}yAt.pushWord(r)}),"populate"),xAt=o(((t,e,r)=>{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*r?[t,void 0]:[{start:t.start,end:e*r-1,label:t.label},{start:e*r,end:t.end,label:t.label}]}),"getNextFittingBlock"),bAt={parse:o((async t=>{const e=await Tet("packet",t);y.debug(e),vAt(e)}),"parse")},wAt=o(((t,e,r,n)=>{const i=n.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=ag(e);f.attr("viewbox",`0 0 ${g} ${p}`),Rr(f,p,g,a.useMaxWidth);for(const[t,e]of h.entries())kAt(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"),kAt=o(((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const c=t.append("g"),h=r*(n+a)+a;for(const t of e){const e=t.start%o*s+1,r=(t.end-t.start+1)*s-i;if(c.append("rect").attr("x",e).attr("y",h).attr("width",r).attr("height",n).attr("class","packetBlock"),c.append("text").attr("x",e+r/2).attr("y",h+n/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?r/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+r).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(t.end)}}),"drawWord"),TAt={draw:wAt},_At={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},EAt=o((({packet:t}={})=>{const e=Ok(_At,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"),CAt={parser:bAt,db:yAt,renderer:TAt,styles:EAt},SAt=Object.freeze({__proto__:null,diagram:CAt}),AAt={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},LAt={axes:[],curves:[],options:AAt},NAt=structuredClone(LAt),IAt=Lt.radar,RAt=o((()=>Ok({...IAt,...Gt().radar})),"getConfig"),MAt=o((()=>NAt.axes),"getAxes"),DAt=o((()=>NAt.curves),"getCurves"),OAt=o((()=>NAt.options),"getOptions"),PAt=o((t=>{NAt.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes"),BAt=o((t=>{NAt.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:$At(t.entries)})))}),"setCurves"),$At=o((t=>{if(null==t[0].axis)return t.map((t=>t.value));const e=MAt();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map((e=>{const r=t.find((t=>t.axis?.$refText===e.name));if(void 0===r)throw new Error("Missing entry for axis "+e.label);return r.value}))}),"computeCurveEntries"),FAt=o((t=>{const e=t.reduce(((t,e)=>(t[e.name]=e,t)),{});NAt.options={showLegend:e.showLegend?.value??AAt.showLegend,ticks:e.ticks?.value??AAt.ticks,max:e.max?.value??AAt.max,min:e.min?.value??AAt.min,graticule:e.graticule?.value??AAt.graticule}}),"setOptions"),zAt={getAxes:MAt,getCurves:DAt,getOptions:OAt,setAxes:PAt,setCurves:BAt,setOptions:FAt,getConfig:RAt,clear:o((()=>{qr(),NAt=structuredClone(LAt)}),"clear"),setAccTitle:jr,getAccTitle:Wr,setDiagramTitle:Vr,getDiagramTitle:Xr,getAccDescription:Hr,setAccDescription:Yr},UAt=o((t=>{IX(t,zAt);const{axes:e,curves:r,options:n}=t;zAt.setAxes(e),zAt.setCurves(r),zAt.setOptions(n)}),"populate"),GAt={parse:o((async t=>{const e=await Tet("radar",t);y.debug(e),UAt(e)}),"parse")},qAt=o(((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),c=i.getDiagramTitle(),h=ag(e),u=jAt(h,l),d=o.max??Math.max(...s.map((t=>Math.max(...t.entries)))),p=o.min,g=Math.min(l.width,l.height)/2;WAt(u,a,g,o.ticks,o.graticule),YAt(u,a,g,l),HAt(u,a,s,p,d,o.graticule,l),KAt(u,s,o.showLegend,l),u.append("text").attr("class","radarTitle").text(c).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw"),jAt=o(((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i=e.marginLeft+e.width/2,a=e.marginTop+e.height/2;return t.attr("viewbox",`0 0 ${r} ${n}`).attr("width",r).attr("height",n),t.append("g").attr("transform",`translate(${i}, ${a})`)}),"drawFrame"),WAt=o(((t,e,r,n,i)=>{if("circle"===i)for(let e=0;e<n;e++){const i=r*(e+1)/n;t.append("circle").attr("r",i).attr("class","radarGraticule")}else if("polygon"===i){const i=e.length;for(let a=0;a<n;a++){const s=r*(a+1)/n,o=e.map(((t,e)=>{const r=2*e*Math.PI/i-Math.PI/2;return`${s*Math.cos(r)},${s*Math.sin(r)}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule"),YAt=o(((t,e,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a].label,o=2*a*Math.PI/i-Math.PI/2;t.append("line").attr("x1",0).attr("y1",0).attr("x2",r*n.axisScaleFactor*Math.cos(o)).attr("y2",r*n.axisScaleFactor*Math.sin(o)).attr("class","radarAxisLine"),t.append("text").text(s).attr("x",r*n.axisLabelFactor*Math.cos(o)).attr("y",r*n.axisLabelFactor*Math.sin(o)).attr("class","radarAxisLabel")}}),"drawAxes");function HAt(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach(((e,r)=>{if(e.entries.length!==o)return;const c=e.entries.map(((t,e)=>{const r=2*Math.PI*e/o-Math.PI/2,a=VAt(t,n,i,l);return{x:a*Math.cos(r),y:a*Math.sin(r)}}));"circle"===a?t.append("path").attr("d",XAt(c,s.curveTension)).attr("class",`radarCurve-${r}`):"polygon"===a&&t.append("polygon").attr("points",c.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${r}`)}))}function VAt(t,e,r,n){return n*(Math.min(Math.max(t,e),r)-e)/(r-e)}function XAt(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i<r;i++){const a=t[(i-1+r)%r],s=t[i],o=t[(i+1)%r],l=t[(i+2)%r],c={x:s.x+(o.x-a.x)*e,y:s.y+(o.y-a.y)*e},h={x:o.x-(l.x-s.x)*e,y:o.y-(l.y-s.y)*e};n+=` C${c.x},${c.y} ${h.x},${h.y} ${o.x},${o.y}`}return`${n} Z`}function KAt(t,e,r,n){if(!r)return;const i=3*(n.width/2+n.marginRight)/4,a=3*-(n.height/2+n.marginTop)/4;e.forEach(((e,r)=>{const n=t.append("g").attr("transform",`translate(${i}, ${a+20*r})`);n.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${r}`),n.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)}))}o(HAt,"drawCurves"),o(VAt,"relativeRadius"),o(XAt,"closedRoundCurve"),o(KAt,"drawLegend");var ZAt={draw:qAt},QAt=o(((t,e)=>{let r="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=t[`cScale${n}`];r+=`\n\t\t.radarCurve-${n} {\n\t\t\tcolor: ${i};\n\t\t\tfill: ${i};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${i};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${n} {\n\t\t\tfill: ${i};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${i};\n\t\t}\n\t\t`}return r}),"genIndexStyles"),JAt=o((t=>{const e=Ok(bt(),Gt().themeVariables);return{themeVariables:e,radarOptions:Ok(e.radar,t)}}),"buildRadarStyleOptions"),tLt=o((({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=JAt(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${r.axisColor};\n\t\tstroke-width: ${r.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${r.axisLabelFontSize}px;\n\t\tcolor: ${r.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${r.graticuleColor};\n\t\tfill-opacity: ${r.graticuleOpacity};\n\t\tstroke: ${r.graticuleColor};\n\t\tstroke-width: ${r.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${r.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${QAt(e,r)}\n\t`}),"styles"),eLt={parser:GAt,db:zAt,renderer:ZAt,styles:tLt},rLt=Object.freeze({__proto__:null,diagram:eLt}),nLt=function(){var t=o((function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r}),"o"),e=[1,7],r=[1,13],n=[1,14],i=[1,15],a=[1,19],s=[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:o((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:o((function(t,e,r,n,i,a,s){var o=a.length-1;switch(i){case 4:n.getLogger().debug("Rule: separator (NL) ");break;case 5:n.getLogger().debug("Rule: separator (Space) ");break;case 6:n.getLogger().debug("Rule: separator (EOF) ");break;case 7:n.getLogger().debug("Rule: hierarchy: ",a[o-1]),n.setHierarchy(a[o-1]);break;case 8:n.getLogger().debug("Stop NL ");break;case 9:n.getLogger().debug("Stop EOF ");break;case 10:n.getLogger().debug("Stop NL2 ");break;case 11:n.getLogger().debug("Stop EOF2 ");break;case 12:n.getLogger().debug("Rule: statement: ",a[o]),"number"==typeof a[o].length?this.$=a[o]:this.$=[a[o]];break;case 13:n.getLogger().debug("Rule: statement #2: ",a[o-1]),this.$=[a[o-1]].concat(a[o]);break;case 14:n.getLogger().debug("Rule: link: ",a[o],t),this.$={edgeTypeStr:a[o],label:""};break;case 15:n.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]),r=n.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:n.getLogger().debug("Rule: (nodeStatement link node) ",a[o-2],a[o-1],a[o]," typestr: ",a[o-1].edgeTypeStr);const i=n.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:n.typeStr2Type(a[o].typeStr),directions:a[o].directions}];break;case 24:n.getLogger().debug("Rule: nodeStatement (abc88 node size) ",a[o-1],a[o]),this.$={id:a[o-1].id,label:a[o-1].label,type:n.typeStr2Type(a[o-1].typeStr),directions:a[o-1].directions,widthInColumns:parseInt(a[o],10)};break;case 25:n.getLogger().debug("Rule: nodeStatement (node) ",a[o]),this.$={id:a[o].id,label:a[o].label,type:n.typeStr2Type(a[o].typeStr),directions:a[o].directions,widthInColumns:1};break;case 26:n.getLogger().debug("APA123",this?this:"na"),n.getLogger().debug("COLUMNS: ",a[o]),this.$={type:"column-setting",columns:"auto"===a[o]?-1:parseInt(a[o])};break;case 27:n.getLogger().debug("Rule: id-block statement : ",a[o-2],a[o-1]),n.generateId(),this.$={...a[o-2],type:"composite",children:a[o-1]};break;case 28:n.getLogger().debug("Rule: blockStatement : ",a[o-2],a[o-1],a[o]);const s=n.generateId();this.$={id:s,type:"composite",label:"",children:a[o-1]};break;case 29:n.getLogger().debug("Rule: node (NODE_ID separator): ",a[o]),this.$={id:a[o]};break;case 30:n.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:n.getLogger().debug("Rule: dirList: ",a[o]),this.$=[a[o]];break;case 32:n.getLogger().debug("Rule: dirList: ",a[o-1],a[o]),this.$=[a[o-1]].concat(a[o]);break;case 33:n.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:n.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:r,29:n,31:i,32:a,40:s,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:r,29:n,31:i,32:a,40:s,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:r,29:n,31:i,32:a,40:s,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:r,29:n,31:i,32:a,40:s,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:o((function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,r=[0],n=[],i=[null],a=[],s=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){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t}function b(){var t;return"number"!=typeof(t=n.pop()||g.lex()||d)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(x,"popStack"),o(b,"lex");for(var w,k,T,_,E,C,S,A,L={};;){if(k=r[r.length-1],this.defaultActions[k]?T=this.defaultActions[k]:(null==w&&(w=b()),T=s[k]&&s[k][w]),void 0===T||!T.length||!T[0]){var N="";for(E in A=[],s[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:r.push(w),i.push(g.yytext),a.push(g.yylloc),r.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&&(r=r.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),r.push(this.productions_[T[1]][0]),i.push(L.$),a.push(L._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}),"parse")},v=function(){var t={EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((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:o((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:o((function(t){var e=t.length,r=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 n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.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:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[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:o((function(){return this._more=!0,this}),"more"),reject:o((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:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((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:o((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:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var r,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,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[n]))&&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:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:o((function(t,e,r,n){switch(r){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,o(x,"Parser"),x.prototype=y,y.Parser=x,new x}();nLt.parser=nLt;var iLt=nLt,aLt=new Map,sLt=[],oLt=new Map,lLt="color",cLt="fill",hLt=Qr(),uLt=new Map,dLt=o((t=>Lr.sanitizeText(t,hLt)),"sanitizeText"),pLt=o((function(t,e=""){let r=uLt.get(t);r||(r={id:t,styles:[],textStyles:[]},uLt.set(t,r)),null!=e&&e.split(",").forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(lLt).exec(t)){const t=e.replace(cLt,"bgFill").replace(lLt,cLt);r.textStyles.push(t)}r.styles.push(e)}))}),"addStyleClass"),gLt=o((function(t,e=""){const r=aLt.get(t);null!=e&&(r.styles=e.split(","))}),"addStyle2Node"),fLt=o((function(t,e){t.split(",").forEach((function(t){let r=aLt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},aLt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)}))}),"setCssClass"),mLt=o(((t,e)=>{const r=t.flat(),n=[];for(const t of r)if(t.label&&(t.label=dLt(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=(oLt.get(t.id)??0)+1;oLt.set(t.id,e),t.id=e+"-"+t.id,sLt.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=aLt.get(t.id);if(void 0===e?aLt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&&mLt(t.children,t),"space"===t.type){const e=t.width??1;for(let r=0;r<e;r++){const e=j$(t);e.id=e.id+"-"+r,aLt.set(e.id,e),n.push(e)}}else void 0===e&&n.push(t)}else t?.stylesStr&&gLt(t.id,t?.stylesStr);else fLt(t.id,t?.styleClass??"");else pLt(t.id,t.css);e.children=n}),"populateBlockDatabase"),yLt=[],vLt={id:"root",type:"composite",children:[],columns:-1},xLt=o((()=>{y.debug("Clear called"),qr(),vLt={id:"root",type:"composite",children:[],columns:-1},aLt=new Map([["root",vLt]]),yLt=[],uLt=new Map,sLt=[],oLt=new Map}),"clear");function bLt(t){switch(y.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return y.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 wLt(t){return y.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function kLt(t){switch(t.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}o(bLt,"typeStr2Type"),o(wLt,"edgeTypeStr2Type"),o(kLt,"edgeStrToEdgeData");var TLt=0,_Lt=o((()=>(TLt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+TLt)),"generateId"),ELt=o((t=>{vLt.children=t,mLt(t,vLt),yLt=vLt.children}),"setHierarchy"),CLt=o((t=>{const e=aLt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1}),"getColumns"),SLt=o((()=>[...aLt.values()]),"getBlocksFlat"),ALt=o((()=>yLt||[]),"getBlocks"),LLt=o((()=>sLt),"getEdges"),NLt=o((t=>aLt.get(t)),"getBlock"),ILt=o((t=>{aLt.set(t.id,t)}),"setBlock"),RLt=o((()=>console),"getLogger"),MLt=o((function(){return uLt}),"getClasses"),DLt={getConfig:o((()=>Gt().block),"getConfig"),typeStr2Type:bLt,edgeTypeStr2Type:wLt,edgeStrToEdgeData:kLt,getLogger:RLt,getBlocksFlat:SLt,getBlocks:ALt,getEdges:LLt,setHierarchy:ELt,getBlock:NLt,setBlock:ILt,getColumns:CLt,getClasses:MLt,clear:xLt,generateId:_Lt},OLt=o(((t,e)=>{const r=tt,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return J(n,i,a,e)}),"fade"),PLt=o((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: ${OLt(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${OLt(t.mainBkg,.5)};\n fill: ${OLt(t.clusterBkg,.5)};\n stroke: ${OLt(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"),BLt=o(((t,e,r,n)=>{e.forEach((e=>{HLt[e](t,r,n)}))}),"insertMarkers"),$Lt=o(((t,e,r)=>{y.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",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",r+"_"+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"),FLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),zLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),ULt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),GLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),qLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+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",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",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"),jLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),WLt=o(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),YLt=o(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb"),HLt={extension:$Lt,composition:FLt,aggregation:zLt,dependency:ULt,lollipop:GLt,point:qLt,circle:jLt,cross:WLt,barb:YLt},VLt=BLt,XLt=Qr()?.block?.padding??8;function KLt(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)}}o(KLt,"calculateBlockPosition");var ZLt=o((t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};y.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),"space"!==n.type&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}}),"getMaxChildSize");function QLt(t,e,r=0,n=0){y.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"sieblingWidth",r),t?.size?.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(t.children?.length>0){for(const r of t.children)QLt(r,e);const s=ZLt(t);i=s.width,a=s.height,y.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const e of t.children)e.size&&(y.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)+XLt*((e.widthInColumns??1)-1),e.size.height=a,e.size.x=0,e.size.y=0,y.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${i} maxHeight:${a}`));for(const r of t.children)QLt(r,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&&o<l&&(c=o);const h=Math.ceil(l/c);let u=c*(i+XLt)+XLt,d=h*(a+XLt)+XLt;if(u<r){y.debug(`Detected to small siebling: abc95 ${t.id} sieblingWidth ${r} sieblingHeight ${n} width ${u}`),u=r,d=n;const e=(r-c*XLt-XLt)/c,s=(n-h*XLt-XLt)/h;y.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",i),y.debug("Size indata abc88",t.id,"childHeight",s,"maxHeight",a),y.debug("Size indata abc88 xSize",c,"padding",XLt);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=s,r.size.x=0,r.size.y=0)}if(y.debug(`abc95 (finale calc) ${t.id} xSize ${c} ySize ${h} columns ${o}${t.children.length} width=${Math.max(u,t.size?.width||0)}`),u<(t?.size?.width||0)){u=t?.size?.width||0;const e=o>0?Math.min(t.children.length,o):t.children.length;if(e>0){const r=(u-e*XLt-XLt)/e;y.debug("abc95 (growing to fit) width",t.id,u,t.size?.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:u,height:d,x:0,y:0}}y.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function JLt(t,e){y.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const r=t.columns??-1;if(y.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,n=t.children.length*e+(t.children.length-1)*XLt;y.debug("widthOfChildren 88",n,"posX");let i=0;y.debug("abc91 block?.size?.x",t.id,t?.size?.x);let a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-XLt,s=0;for(const e of t.children){const n=t;if(!e.size)continue;const{width:o,height:l}=e.size,{px:c,py:h}=KLt(r,i);if(h!=s&&(s=h,a=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-XLt,y.debug("New row in layout for block",t.id," and child ",e.id,s)),y.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${i} (px, py) ${c},${h} (${n?.size?.x},${n?.size?.y}) parent: ${n.id} width: ${o}${XLt}`),n.size){const t=o/2;e.size.x=a+XLt+t,y.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${a} new startingPosX${e.size.x} ${t} padding=${XLt} 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=n.size.y-n.size.height/2+h*(l+XLt)+l/2+XLt,y.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${a}${XLt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${o*(e?.widthInColumns??1)/2}`)}e.children&&JLt(e),i+=e?.widthInColumns??1,y.debug("abc88 columnsPos",e,i)}}y.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function tNt(t,{minX:e,minY:r,maxX:n,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/2<e&&(e=a-o/2),s-l/2<r&&(r=s-l/2),a+o/2>n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=tNt(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}function eNt(t){const e=t.getBlock("root");if(!e)return;QLt(e,t,0,0),JLt(e),y.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=tNt(e);return{x:r,y:n,width:i-r,height:a-n}}function rNt(t,e){e&&t.attr("style",e)}function nNt(t){const e=Ga(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=r.append("span");return a.html(n),rNt(a,t.labelStyle),a.attr("class",i),rNt(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}o(QLt,"setBlockSizes"),o(JLt,"layoutBlocks"),o(tNt,"findBounds"),o(eNt,"layout"),o(rNt,"applyStyle"),o(nNt,"addHtmlLabel");var iNt=o(((t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),yr(Qr().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),y.debug("vertexText"+i);return nNt({isNode:n,label:y_($k(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 n=[];n="string"==typeof i?i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?i:[];for(const e of n){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"),r?n.setAttribute("class","title-row"):n.setAttribute("class","row"),n.textContent=e.trim(),t.appendChild(n)}return t}}),"createLabel"),aNt=o(((t,e,r,n,i)=>{e.arrowTypeStart&&oNt(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&oNt(t,"end",e.arrowTypeEnd,r,n,i)}),"addEdgeMarkers"),sNt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},oNt=o(((t,e,r,n,i,a)=>{const s=sNt[r];if(!s)return void y.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)}),"addEdgeMarker"),lNt={},cNt={},hNt=o(((t,e)=>{const r=Qr(),n=yr(r.flowchart.htmlLabels),i="markdown"===e.labelType?v_(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):iNt(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(n){const t=i.children[0],e=Ga(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+")"),lNt[e.id]=a,e.width=l.width,e.height=l.height,e.startLabelLeft){const r=iNt(e.startLabelLeft,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].startLeft=n,uNt(o,e.startLabelLeft)}if(e.startLabelRight){const r=iNt(e.startLabelRight,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=n.node().appendChild(r),i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].startRight=n,uNt(o,e.startLabelRight)}if(e.endLabelLeft){const r=iNt(e.endLabelLeft,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].endLeft=n,uNt(o,e.endLabelLeft)}if(e.endLabelRight){const r=iNt(e.endLabelRight,e.labelStyle),n=t.insert("g").attr("class","edgeTerminals"),i=n.insert("g").attr("class","inner");o=i.node().appendChild(r);const a=r.getBBox();i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.node().appendChild(r),cNt[e.id]||(cNt[e.id]={}),cNt[e.id].endRight=n,uNt(o,e.endLabelRight)}return i}),"insertEdgeLabel");function uNt(t,e){Qr().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}o(uNt,"setTerminalWidth");var dNt=o(((t,e)=>{y.debug("Moving label abc88 ",t.id,t.label,lNt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Qr(),{subGraphTitleTotalMargin:i}=qy(n);if(t.label){const n=lNt[t.id];let a=t.x,s=t.y;if(r){const n=Pk.calcLabelPosition(r);y.debug("Moving label "+t.label+" from (",a,",",s,") to (",n.x,",",n.y,") abc88"),e.updatedPath&&(a=n.x,s=n.y)}n.attr("transform",`translate(${a}, ${s+i/2})`)}if(t.startLabelLeft){const e=cNt[t.id].startLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.startLabelRight){const e=cNt[t.id].startRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelLeft){const e=cNt[t.id].endLeft;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}if(t.endLabelRight){const e=cNt[t.id].endRight;let n=t.x,i=t.y;if(r){const e=Pk.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);n=e.x,i=e.y}e.attr("transform",`translate(${n}, ${i})`)}}),"positionEdgeLabel"),pNt=o(((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o}),"outsideNode"),gNt=o(((t,e,r)=>{y.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,c=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let t=r.y<e.y?e.y-l-i:i-l-e.y;o=h*t/c;const n={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(n.x=e.x,n.y=e.y),0===h&&(n.x=e.x),0===c&&(n.y=e.y),y.debug(`abc89 topp/bott calc, Q ${c}, q ${t}, R ${h}, r ${o}`,n),n}{o=r.x<e.x?e.x-s-n:n-s-e.x;let t=c*o/h,i=r.x<e.x?r.x+h-o:r.x-h+o,a=r.y<e.y?r.y+t:r.y-t;return y.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`,{_x:i,_y:a}),0===o&&(i=e.x,a=e.y),0===h&&(i=e.x),0===c&&(a=e.y),{x:i,y:a}}}),"intersection"),fNt=o(((t,e)=>{y.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach((t=>{if(pNt(e,t)||i)n=t,i||r.push(t);else{const a=gNt(e,n,t);let s=!1;r.forEach((t=>{s=s||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))||r.push(a),i=!0}})),r}),"cutPathAtIntersect"),mNt=o((function(t,e,r,n,i,a,s){let o=r.points;y.debug("abc88 InsertEdge: edge=",r,"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,r.points.length-1),o.unshift(c.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(y.debug("to cluster abc88",n[r.toCluster]),o=fNt(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(y.debug("from cluster abc88",n[r.fromCluster]),o=fNt(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const u=o.filter((t=>!Number.isNaN(t.y)));let d=Tu;!r.curve||"graph"!==i&&"flowchart"!==i||(d=r.curve);const{x:p,y:g}=XS(r),f=gu().x(p).y(g).curve(d);let m;switch(r.thickness){case"normal":m="edge-thickness-normal";break;case"thick":case"invisible":m="edge-thickness-thick";break;default:m=""}switch(r.pattern){case"solid":m+=" edge-pattern-solid";break;case"dotted":m+=" edge-pattern-dotted";break;case"dashed":m+=" edge-pattern-dashed"}const v=t.append("path").attr("d",f(u)).attr("id",r.id).attr("class"," "+m+(r.classes?" "+r.classes:"")).attr("style",r.style);let x="";(Qr().flowchart.arrowMarkerAbsolute||Qr().state.arrowMarkerAbsolute)&&(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,x=x.replace(/\(/g,"\\("),x=x.replace(/\)/g,"\\)")),aNt(v,r,x,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b}),"insertEdge"),yNt=o((t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e}),"expandAndDeduplicateDirections"),vNt=o(((t,e,r)=>{const n=yNt(t),i=e.height+2*r.padding,a=i/2,s=e.width+2*a+r.padding,o=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.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}]:n.has("right")&&n.has("left")&&n.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}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:a,y:-i},{x:s-a,y:-i},{x:s,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:s,y:-i+a},{x:0,y:-i}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:s,y:0},{x:0,y:-a},{x:0,y:-i+a},{x:s,y:-i}]:n.has("right")&&n.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}]:n.has("up")&&n.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}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:s,y:-a},{x:0,y:-i}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:0,y:-i}]:n.has("left")&&n.has("up")?[{x:s,y:0},{x:0,y:-a},{x:s,y:-i}]:n.has("left")&&n.has("down")?[{x:s,y:0},{x:0,y:0},{x:s,y:-i}]:n.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}]:n.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}]:n.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}]:n.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 xNt(t,e){return t.intersect(e)}o(xNt,"intersectNode");var bNt=xNt;function wNt(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),c=Math.abs(e*r*s/l);n.x<i&&(c=-c);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+c,y:a+h}}o(wNt,"intersectEllipse");var kNt=wNt;function TNt(t,e,r){return kNt(t,e,e,r)}o(TNt,"intersectCircle");var _Nt=TNt;function ENt(t,e,r,n){var i,a,s,o,l,c,h,u,d,p,g,f,m;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,d=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(0!==d&&0!==p&&CNt(d,p)||(a=n.y-r.y,o=r.x-n.x,c=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+c,u=a*e.x+o*e.y+c,0!==h&&0!==u&&CNt(h,u)||0==(g=i*o-a*s))))return f=Math.abs(g/2),{x:(m=s*c-o*l)<0?(m-f)/g:(m+f)/g,y:(m=a*l-i*c)<0?(m-f)/g:(m+f)/g}}function CNt(t,e){return t*e>0}o(ENt,"intersectLine"),o(CNt,"sameSign");var SNt=ENt,ANt=LNt;function LNt(t,e,r){var n=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=n-t.width/2-s,c=i-t.height/2-o,h=0;h<e.length;h++){var u=e[h],d=e[h<e.length-1?h+1:0],p=SNt(t,r,{x:l+u.x,y:c+u.y},{x:l+d.x,y:c+d.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort((function(t,e){var n=t.x-r.x,i=t.y-r.y,a=Math.sqrt(n*n+i*i),s=e.x-r.x,o=e.y-r.y,l=Math.sqrt(s*s+o*o);return a<l?-1:a===l?0:1})),a[0]):t}o(LNt,"intersectPolygon");var NNt=o(((t,e)=>{var r,n,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),r=0===o?0:c*s/o,n=c):(s<0&&(l=-l),r=l,n=0===s?0:l*o/s),{x:i+r,y:a+n}}),"intersectRect"),INt={node:bNt,circle:_Nt,ellipse:kNt,polygon:ANt,rect:NNt},RNt=o((async(t,e,r,n)=>{const i=Qr();let a;const s=e.useHtmlLabels||yr(i.flowchart.htmlLabels);a=r||"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?v_(c,hr($k(h),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):u.appendChild(iNt(hr($k(h),i),e.labelStyle,!1,n));let p=d.getBBox();const g=e.padding/2;if(yr(i.flowchart.htmlLabels)){const t=d.children[0],e=Ga(d),r=t.getElementsByTagName("img");if(r){const t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map((e=>new Promise((r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,r=5,n=parseInt(t,10)*r+"px";e.style.minWidth=n,e.style.maxWidth=n}else e.style.width="100%";r(e)}o(n,"setupImage"),setTimeout((()=>{e.complete&&n()})),e.addEventListener("error",n),e.addEventListener("load",n)})))))}p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return s?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"),MNt=o(((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height}),"updateNodeBounds");function DNt(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}o(DNt,"insertPolygonShape");var ONt=o((async(t,e)=>{e.useHtmlLabels||Qr().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes,!0);y.info("Classes = ",e.classes);const a=r.insert("rect",":first-child");return a.attr("rx",e.rx).attr("ry",e.ry).attr("x",-n.width/2-i).attr("y",-n.height/2-i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"note"),PNt=ONt,BNt=o((t=>t?" "+t:""),"formatClass"),$Nt=o(((t,e)=>`${e||"node default"}${BNt(t.classes)} ${BNt(t.class)}`),"getClassesFromNode"),FNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding+(n.height+e.padding),a=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];y.info("Question main (Circle)");const s=DNt(r,i,i,a);return s.attr("style",e.style),MNt(e,s),e.intersect=function(t){return y.warn("Intersect called"),INt.polygon(e,a,t)},r}),"question"),zNt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}],i=r.insert("polygon",":first-child").attr("points",n.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 INt.circle(e,14,t)},r}),"choice"),UNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.height+e.padding,a=i/4,s=n.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=DNt(r,s,i,o);return l.attr("style",e.style),MNt(e,l),e.intersect=function(t){return INt.polygon(e,o,t)},r}),"hexagon"),GNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,void 0,!0),i=n.height+2*e.padding,a=i/2,s=n.width+2*a+e.padding,o=vNt(e.directions,n,e),l=DNt(r,s,i,o);return l.attr("style",e.style),MNt(e,l),e.intersect=function(t){return INt.polygon(e,o,t)},r}),"block_arrow"),qNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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 DNt(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return INt.polygon(e,s,t)},r}),"rect_left_inv_arrow"),jNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"lean_right"),WNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"lean_left"),YNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"trapezoid"),HNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"inv_trapezoid"),VNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"rect_right_inv_arrow"),XNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.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=r.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 MNt(e,c),e.intersect=function(t){const r=INt.rect(e,t),n=r.x-e.x;if(0!=a&&(Math.abs(n)<e.width/2||Math.abs(n)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let i=s*s*(1-n*n/(a*a));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),r.y+=i}return r},r}),"cylinder"),KNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,c=e.positioned?-o/2:-n.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&&(JNt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"rect"),ZNt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,c=e.positioned?-o/2:-n.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&&(JNt(a,e.props.borders,s,o),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},r}),"composite"),QNt=o((async(t,e)=>{const{shapeSvg:r}=await RNt(t,e,"label",!0);y.trace("Classes = ",e.class);const n=r.insert("rect",":first-child");if(n.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(JNt(n,e.props.borders,0,0),t.delete("borders")),t.forEach((t=>{y.warn(`Unknown node property ${t}`)}))}return MNt(e,n),e.intersect=function(t){return INt.rect(e,t)},r}),"labelRect");function JNt(t,e,r,n){const i=[],a=o((t=>{i.push(t,0)}),"addBorder"),s=o((t=>{i.push(0,t)}),"skipBorder");e.includes("t")?(y.debug("add top border"),a(r)):s(r),e.includes("r")?(y.debug("add right border"),a(n)):s(n),e.includes("b")?(y.debug("add bottom border"),a(r)):s(r),e.includes("l")?(y.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}o(JNt,"applyNodePropertyBorders");var tIt=o(((t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";l="object"==typeof o?o[0]:o,y.info("Label text abc79",l,o,"object"==typeof o);const c=s.node().appendChild(iNt(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(yr(Qr().flowchart.htmlLabels)){const t=c.children[0],e=Ga(c);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}y.info("Text 2",o);const u=o.slice(1,o.length);let d=c.getBBox();const p=s.node().appendChild(iNt(u.join?u.join("<br/>"):u,e.labelStyle,!0,!0));if(yr(Qr().flowchart.htmlLabels)){const t=p.children[0],e=Ga(p);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}const g=e.padding/2;return Ga(p).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+g+5)+")"),Ga(c).attr("transform","translate( "+(h.width<d.width?0:-(d.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-g+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-g).attr("y",-h.height/2-g).attr("width",h.width+e.padding).attr("height",h.height+e.padding),a.attr("class","divider").attr("x1",-h.width/2-g).attr("x2",h.width/2+g).attr("y1",-h.height/2-g+d.height+g).attr("y2",-h.height/2-g+d.height+g),MNt(e,i),e.intersect=function(t){return INt.rect(e,t)},n}),"rectWithTitle"),eIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.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 MNt(e,s),e.intersect=function(t){return INt.rect(e,t)},r}),"stadium"),rIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,$Nt(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),y.info("Circle main"),MNt(e,a),e.intersect=function(t){return y.info("Circle intersect",e,n.width/2+i,t),INt.circle(e,n.width/2+i,t)},r}),"circle"),nIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await RNt(t,e,$Nt(e,void 0),!0),a=r.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",n.width/2+i+5).attr("width",n.width+e.padding+10).attr("height",n.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),y.info("DoubleCircle main"),MNt(e,s),e.intersect=function(t){return y.info("DoubleCircle intersect",e,n.width/2+i+5,t),INt.circle(e,n.width/2+i+5,t)},r}),"doublecircle"),iIt=o((async(t,e)=>{const{shapeSvg:r,bbox:n}=await RNt(t,e,$Nt(e,void 0),!0),i=n.width+e.padding,a=n.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=DNt(r,i,a,s);return o.attr("style",e.style),MNt(e,o),e.intersect=function(t){return INt.polygon(e,s,t)},r}),"subroutine"),aIt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),MNt(e,n),e.intersect=function(t){return INt.circle(e,7,t)},r}),"start"),sIt=o(((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;"LR"===r&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return MNt(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return INt.rect(e,t)},n}),"forkJoin"),oIt=o(((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),MNt(e,i),e.intersect=function(t){return INt.circle(e,7,t)},r}),"end"),lIt=o(((t,e)=>{const r=e.padding/2;let n;n=e.classes?"node "+e.classes:"node default";const i=t.insert("g").attr("class",n).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(iNt(p,e.labelStyle,!0,!0));let f=g.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=g.children[0],e=Ga(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&&(Qr().flowchart.htmlLabels?m+="&lt;"+e.classData.type+"&gt;":m+="<"+e.classData.type+">");const y=h.node().appendChild(iNt(m,e.labelStyle,!0,!0));Ga(y).attr("class","classTitle");let v=y.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=y.children[0],e=Ga(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 r=t.getDisplayDetails();let n=r.displayText;Qr().flowchart.htmlLabels&&(n=n.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const i=h.node().appendChild(iNt(n,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=i.children[0],e=Ga(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 r=t.getDisplayDetails();let n=r.displayText;Qr().flowchart.htmlLabels&&(n=n.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const i=h.node().appendChild(iNt(n,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=i.getBBox();if(yr(Qr().flowchart.htmlLabels)){const t=i.children[0],e=Ga(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;Ga(g).attr("transform","translate( "+(-1*l/2+t)+", "+-1*c/2+")"),u=f.height+4}let w=(l-v.width)/2;return Ga(y).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,s.attr("class","divider").attr("x1",-l/2-r).attr("x2",l/2+r).attr("y1",-c/2-r+8+u).attr("y2",-c/2-r+8+u),u+=8,x.forEach((t=>{Ga(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-r).attr("x2",l/2+r).attr("y1",-c/2-r+8+u).attr("y2",-c/2-r+8+u),u+=8,b.forEach((t=>{Ga(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-r).attr("y",-c/2-r).attr("width",l+e.padding).attr("height",c+e.padding),MNt(e,a),e.intersect=function(t){return INt.rect(e,t)},i}),"class_box"),cIt={rhombus:FNt,composite:ZNt,question:FNt,rect:KNt,labelRect:QNt,rectWithTitle:tIt,choice:zNt,circle:rIt,doublecircle:nIt,stadium:eIt,hexagon:UNt,block_arrow:GNt,rect_left_inv_arrow:qNt,lean_right:jNt,lean_left:WNt,trapezoid:YNt,inv_trapezoid:HNt,rect_right_inv_arrow:VNt,cylinder:XNt,start:aIt,end:oIt,note:PNt,subroutine:iIt,fork:sIt,join:sIt,class_box:lIt},hIt={},uIt=o((async(t,e,r)=>{let n,i;if(e.link){let a;"sandbox"===Qr().securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await cIt[e.shape](n,e,r)}else i=await cIt[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),hIt[e.id]=n,e.haveCallback&&hIt[e.id].attr("class",hIt[e.id].attr("class")+" clickable"),n}),"insertNode"),dIt=o((t=>{const e=hIt[t.id];y.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode");function pIt(t,e,r=!1){const n=t;let i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i+=" flowchart-label";let a,s=0,o="";switch(n.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=yk(n?.styles??[]),c=n.label,h=n.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:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:a??Gt()?.block?.padding??0}}async function gIt(t,e,r){const n=pIt(e,0,!1);if("group"===n.type)return;const i=Gt(),a=await uIt(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}async function fIt(t,e,r){const n=pIt(e,0,!0);if("space"!==r.getBlock(n.id).type){const r=Gt();await uIt(t,n,{config:r}),e.intersect=n?.intersect,dIt(n)}}async function mIt(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await mIt(t,i.children,r,n)}async function yIt(t,e,r){await mIt(t,e,r,gIt)}async function vIt(t,e,r){await mIt(t,e,r,fIt)}async function xIt(t,e,r,n,i){const a=new Cj({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of r)t.size&&a.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const r of e)if(r.start&&r.end){const e=n.getBlock(r.start),s=n.getBlock(r.end);if(e?.size&&s?.size){const n=e.size,o=s.size,l=[{x:n.x,y:n.y},{x:n.x+(o.x-n.x)/2,y:n.y+(o.y-n.y)/2},{x:o.x,y:o.y}];mNt(t,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),r.label&&(await hNt(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:l,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),dNt({...r,x:l[1].x,y:l[1].y},{originalPath:l}))}}}o(pIt,"getNodeFromBlock"),o(gIt,"calculateBlockSize"),o(fIt,"insertBlockPositioned"),o(mIt,"performOperations"),o(yIt,"calculateBlockSizes"),o(vIt,"insertBlocks"),o(xIt,"insertEdges");var bIt=o((function(t,e){return e.db.getClasses()}),"getClasses"),wIt=o((async function(t,e,r,n){const{securityLevel:i,block:a}=Gt(),s=n.db;let o;"sandbox"===i&&(o=Ga("#i"+e));const l=Ga("sandbox"===i?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===i?l.select(`[id="${e}"]`):Ga(`[id="${e}"]`);VLt(c,["point","circle","cross"],n.type,e);const h=s.getBlocks(),u=s.getBlocksFlat(),d=s.getEdges(),p=c.insert("g").attr("class","block");await yIt(p,h,s);const g=eNt(s);if(await vIt(p,h,s),await xIt(p,d,u,s,e),g){const t=g,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,n=t.width+10,{useMaxWidth:i}=a;Rr(c,r,n,!!i),y.debug("Here Bounds",g,t),c.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}}),"draw"),kIt={parser:iLt,db:DLt,renderer:{draw:wIt,getClasses:bIt},styles:PLt},TIt=Object.freeze({__proto__:null,diagram:kIt}),_It=l({"../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.layoutBase=n():r.layoutBase=n()}),"webpackUniversalModuleDefinition")(t,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return o(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?o((function(){return t.default}),"getDefault"):o((function(){return t}),"getModuleExports");return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=28)}([function(t,e,r){function n(){}o(n,"LayoutConstants"),n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){var n=r(2),i=r(8),a=r(9);function s(t,e,r){n.call(this,r),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=r,this.bendpoints=[],this.source=t,this.target=e}for(var l in o(s,"LEdge"),s.prototype=Object.create(n.prototype),n)s[l]=n[l];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.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"},s.prototype.getOtherEndInGraph=function(t,e){for(var r=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(r.getOwner()==e)return r;if(r.getOwner()==n)break;r=r.getOwner().getParent()}return null},s.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))},s.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=s},function(t,e,r){function n(t){this.vGraphObject=t}o(n,"LGraphObject"),t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(13),s=r(0),l=r(16),c=r(5);function h(t,e,r,s){null==r&&null==s&&(s=e),n.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!=r&&null!=e?new a(e.x,e.y,r.width,r.height):new a}for(var u in o(h,"LNode"),h.prototype=Object.create(n.prototype),n)h[u]=n[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=[],r=this;return r.edges.forEach((function(n){if(n.target==t){if(n.source!=r)throw"Incorrect edge source!";e.push(n)}})),e},h.prototype.getEdgesBetween=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.source!=r&&n.target!=r)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},h.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(r){if(r.source==e)t.add(r.target);else{if(r.target!=e)throw"Incorrect incidency!";t.add(r.source)}})),t},h.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),r=0;r<e.length;r++)e[r].withChildren().forEach((function(e){t.add(e)}));return t},h.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),r=0;r<e.length;r++)t+=e[r].getNoOfChildren();return 0==t&&(t=1),t},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var t,e,r=-s.INITIAL_WORLD_BOUNDARY,n=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+l.nextDouble()*(n-r)+r;var i=-s.INITIAL_WORLD_BOUNDARY,a=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+l.nextDouble()*(a-i)+i,this.rect.x=t,this.rect.y=e},h.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),r=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>e?(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(r+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>r?(this.rect.y-=(this.labelHeight-r)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(r+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>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new c(e,r),i=t.inverseTransformPoint(n);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,r){var n=r(0);function i(){}for(var a in o(i,"FDLayoutConstants"),n)i[a]=n[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,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}o(n,"PointD"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),a=r(0),s=r(7),l=r(3),c=r(1),h=r(13),u=r(12),d=r(11);function p(t,e,r){n.call(this,r),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 s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var g in o(p,"LGraph"),p.prototype=Object.create(n.prototype),n)p[g]=n[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,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.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 r=e.edges.slice(),n=r.length,i=0;i<n;i++)(a=r[i]).isInterGraph?this.graphManager.remove(a):a.source.owner.remove(a);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof c){var a;if(null==(a=t))throw"Edge is null!";if(null==a.source||null==a.target)throw"Source and/or target is null!";if(null==a.source.owner||null==a.target.owner||a.source.owner!=this||a.target.owner!=this)throw"Source and/or target owner is invalid!";var s,o=a.source.edges.indexOf(a),h=a.target.edges.indexOf(a);if(!(o>-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,r,n=i.MAX_VALUE,a=i.MAX_VALUE,s=this.getNodes(),o=s.length,l=0;l<o;l++){var c=s[l];n>(t=c.getTop())&&(n=t),a>(e=c.getLeft())&&(a=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=a-r,this.top=n-r,new u(this.left,this.top))},p.prototype.updateBounds=function(t){for(var e,r,n,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<p;g++){var f=d[g];t&&null!=f.child&&f.updateBounds(),o>(e=f.getLeft())&&(o=e),l<(r=f.getRight())&&(l=r),c>(n=f.getTop())&&(c=n),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,r,n,a,s=i.MAX_VALUE,o=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,u=t.length,d=0;d<u;d++){var p=t[d];s>(e=p.getLeft())&&(s=e),o<(r=p.getRight())&&(o=r),l>(n=p.getTop())&&(l=n),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,r=e.length,n=0;n<r;n++){t+=e[n].calcEstimatedSize()}return this.estimatedSize=0==t?a.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,r,n=new d,i=new Set,a=this.nodes[0];for(a.withChildren().forEach((function(t){n.push(t),i.add(t)}));0!==n.length;)for(var s=(e=(a=n.shift()).getEdges()).length,o=0;o<s;o++){if(null!=(r=e[o].getOtherEndInGraph(a,this))&&!i.has(r))r.withChildren().forEach((function(t){n.push(t),i.add(t)}))}if(this.isConnected=!1,i.size>=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,r){var n,i=r(1);function a(t){n=r(6),this.layout=t,this.graphs=[],this.edges=[]}o(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},a.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&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=r,r=t;var a=(n=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 r.isInterGraph=!1,a.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},a.prototype.remove=function(t){if(t instanceof n){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 r,a=[],s=(a=a.concat(e.getEdges())).length,o=0;o<s;o++)r=a[o],e.remove(r);var l,c=[];s=(c=c.concat(e.getNodes())).length;for(o=0;o<s;o++)l=c[o],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var h=this.graphs.indexOf(e);this.graphs.splice(h,1),e.parent=null}else if(t instanceof i){if(null==(r=t))throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(null==r.source||null==r.target)throw"Source and/or target is null!";if(-1==r.source.edges.indexOf(r)||-1==r.target.edges.indexOf(r))throw"Source and/or target doesn't know this edge!";h=r.source.edges.indexOf(r);if(r.source.edges.splice(h,1),h=r.target.edges.indexOf(r),r.target.edges.splice(h,1),null==r.source.owner||null==r.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==r.source.owner.getGraphManager().edges.indexOf(r))throw"Not in owner graph manager's edge list!";h=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(h,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),r=e.length,n=0;n<r;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var r=0;r<e.length;r++)t=t.concat(e[r].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var r,n=t.getOwner();;){if(null==(r=n.getParent()))break;if(r==e)return!0;if(null==(n=r.getOwner()))break}for(n=e.getOwner();;){if(null==(r=n.getParent()))break;if(r==t)return!0;if(null==(n=r.getOwner()))break}return!1},a.prototype.calcLowestCommonAncestors=function(){for(var t,e,r,n,i,a=this.getAllEdges(),s=a.length,o=0;o<s;o++)if(e=(t=a[o]).source,r=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=r,e!=r){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=r,i=r.getOwner();null==t.lca;){if(i==n){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},a.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var r=t.getOwner();;){if(null==r)break;for(var n=e.getOwner();;){if(null==n)break;if(n==r)return n;n=n.getParent().getOwner()}r=r.getParent().getOwner()}return r},a.prototype.calcInclusionTreeDepths=function(t,e){var r;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),i=n.length,a=0;a<i;a++)(r=n[a]).inclusionTreeDepth=e,null!=r.child&&this.calcInclusionTreeDepths(r.child,e+1)},a.prototype.includesInvalidEdge=function(){for(var t,e=[],r=this.edges.length,n=0;n<r;n++)t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(n=0;n<e.length;n++)this.remove(e[n]);return!1},t.exports=a},function(t,e,r){var n=r(12);function i(){}o(i,"IGeometry"),i.calcSeparationAmount=function(t,e,r,n){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),r[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),r[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[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*r[0],o=r[1]/a;r[0]<o?o=r[0]:s=r[1],r[0]=-1*i[0]*(o/2+n),r[1]=-1*i[1]*(s/2+n)},i.decideDirectionsForOverlappingNodes=function(t,e,r){t.getCenterX()<e.getCenterX()?r[0]=-1:r[0]=1,t.getCenterY()<e.getCenterY()?r[1]=-1:r[1]=1},i.getIntersection2=function(t,e,r){var n=t.getCenterX(),i=t.getCenterY(),a=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return r[0]=n,r[1]=i,r[2]=a,r[3]=s,!0;var o=t.getX(),l=t.getY(),c=t.getRight(),h=t.getX(),u=t.getBottom(),d=t.getRight(),p=t.getWidthHalf(),g=t.getHeightHalf(),f=e.getX(),m=e.getY(),y=e.getRight(),v=e.getX(),x=e.getBottom(),b=e.getRight(),w=e.getWidthHalf(),k=e.getHeightHalf(),T=!1,_=!1;if(n===a){if(i>s)return r[0]=n,r[1]=l,r[2]=a,r[3]=x,!1;if(i<s)return r[0]=n,r[1]=u,r[2]=a,r[3]=m,!1}else if(i===s){if(n>a)return r[0]=o,r[1]=i,r[2]=y,r[3]=s,!1;if(n<a)return r[0]=c,r[1]=i,r[2]=f,r[3]=s,!1}else{var E=t.height/t.width,C=e.height/e.width,S=(s-i)/(a-n),A=void 0,L=void 0,N=void 0,I=void 0,R=void 0,M=void 0;if(-E===S?n>a?(r[0]=h,r[1]=u,T=!0):(r[0]=c,r[1]=l,T=!0):E===S&&(n>a?(r[0]=o,r[1]=l,T=!0):(r[0]=d,r[1]=u,T=!0)),-C===S?a>n?(r[2]=v,r[3]=x,_=!0):(r[2]=y,r[3]=m,_=!0):C===S&&(a>n?(r[2]=f,r[3]=m,_=!0):(r[2]=b,r[3]=x,_=!0)),T&&_)return!1;if(n>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=n+-g/S,r[0]=N,r[1]=I;break;case 2:N=d,I=i+p*S,r[0]=N,r[1]=I;break;case 3:I=u,N=n+g/S,r[0]=N,r[1]=I;break;case 4:N=h,I=i+-p*S,r[0]=N,r[1]=I}if(!_)switch(L){case 1:M=m,R=a+-k/S,r[2]=R,r[3]=M;break;case 2:R=b,M=s+w*S,r[2]=R,r[3]=M;break;case 3:M=x,R=a+k/S,r[2]=R,r[3]=M;break;case 4:R=v,M=s+-w*S,r[2]=R,r[3]=M}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var a,s,o,l,c,h,u,d=t.x,p=t.y,g=e.x,f=e.y,m=r.x,y=r.y,v=i.x,x=i.y;return 0===(u=(a=f-p)*(l=m-v)-(s=x-y)*(o=d-g))?null:new n((o*(h=v*y-m*x)-l*(c=g*p-d*f))/u,(s*c-a*h)/u)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r<t?i+=Math.PI:n<e&&(i+=this.TWO_PI)):i=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,r,n){var i=t.x,a=t.y,s=e.x,o=e.y,l=r.x,c=r.y,h=n.x,u=n.y,d=(s-i)*(u-c)-(h-l)*(o-a);if(0===d)return!1;var p=((u-c)*(h-i)+(l-h)*(u-a))/d,g=((a-o)*(h-i)+(s-i)*(u-a))/d;return 0<p&&p<1&&0<g&&g<1},i.findCircleLineIntersections=function(t,e,r,n,i,a,s){var o=(r-t)*(r-t)+(n-e)*(n-e),l=2*((t-i)*(r-t)+(e-a)*(n-e)),c=(t-i)*(t-i)+(e-a)*(e-a)-s*s;if(l*l-4*o*c>=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,r){function n(){}o(n,"IMath"),n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}o(n,"Integer"),n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=o((function(t){return{value:t,next:null,prev:null}}),"nodeFrom"),s=o((function(t,e,r,n){return null!==t?t.next=e:n.head=e,null!==r?r.prev=e:n.tail=e,e.prev=t,e.next=r,n.length++,e}),"add"),l=o((function(t,e){var r=t.prev,n=t.next;return null!==r?r.next=n:e.head=n,null!==n?n.prev=r:e.tail=r,t.prev=t.next=null,e.length--,t}),"_remove"),c=function(){function t(e){var r=this;i(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return r.push(t)}))}return o(t,"LinkedList"),n(t,[{key:"size",value:o((function(){return this.length}),"size")},{key:"insertBefore",value:o((function(t,e){return s(e.prev,a(t),e,this)}),"insertBefore")},{key:"insertAfter",value:o((function(t,e){return s(e,a(t),e.next,this)}),"insertAfter")},{key:"insertNodeBefore",value:o((function(t,e){return s(e.prev,t,e,this)}),"insertNodeBefore")},{key:"insertNodeAfter",value:o((function(t,e){return s(e,t,e.next,this)}),"insertNodeAfter")},{key:"push",value:o((function(t){return s(this.tail,a(t),null,this)}),"push")},{key:"unshift",value:o((function(t){return s(null,a(t),this.head,this)}),"unshift")},{key:"remove",value:o((function(t){return l(t,this)}),"remove")},{key:"pop",value:o((function(){return l(this.tail,this).value}),"pop")},{key:"popNode",value:o((function(){return l(this.tail,this)}),"popNode")},{key:"shift",value:o((function(){return l(this.head,this).value}),"shift")},{key:"shiftNode",value:o((function(){return l(this.head,this)}),"shiftNode")},{key:"get_object_at",value:o((function(t){if(t<=this.length()){for(var e=1,r=this.head;e<t;)r=r.next,e++;return r.value}}),"get_object_at")},{key:"set_object_at",value:o((function(t,e){if(t<=this.length()){for(var r=1,n=this.head;r<t;)n=n.next,r++;n.value=e}}),"set_object_at")}]),t}();t.exports=c},function(t,e,r){function n(t,e,r){this.x=null,this.y=null,null==t&&null==e&&null==r?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==r?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==r&&(r=t,this.x=r.x,this.y=r.y)}o(n,"Point"),n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,r){"Point"==t.constructor.name&&null==e&&null==r?(r=t,this.setLocation(r.x,r.y)):"number"==typeof t&&"number"==typeof e&&null==r&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,r){function n(t,e,r,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=r&&null!=n&&(this.x=t,this.y=e,this.width=r,this.height=n)}o(n,"RectangleD"),n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x)&&(!(this.getBottom()<t.y)&&(!(t.getRight()<this.x)&&!(t.getBottom()<this.y)))},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,r){var n="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};function i(){}o(i,"UniqueIDGeneretor"),i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}o(n,"_toConsumableArray");var i=r(0),a=r(7),s=r(3),l=r(1),c=r(6),h=r(5),u=r(17),d=r(29);function p(t){d.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}o(p,"Layout"),p.RANDOM_SEED=1,p.prototype=Object.create(d.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var t=new a(this);return this.graphManager=t,t},p.prototype.newGraph=function(t){return new c(null,this.graphManager,t)},p.prototype.newNode=function(t){return new s(this.graphManager,t)},p.prototype.newEdge=function(t){return new l(null,null,t)},p.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var r=this.graphManager.getRoot().getNodes();for(e=0;e<r.length;e++)r[e];this.update(this.graphManager.getRoot())}},p.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var r=e.getChild().getNodes(),n=0;n<r.length;n++)update(r[n]);if(null!=e.vGraphObject)e.vGraphObject.update(e)}else if(t instanceof l){var i=t;if(null!=i.vGraphObject)i.vGraphObject.update(i)}else if(t instanceof c){var a=t;if(null!=a.vGraphObject)a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(t){if(null==t)this.transform(new h(0,0));else{var e=new u,r=this.graphManager.getRoot().updateLeftTop();if(null!=r){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(r.x),e.setDeviceOrgY(r.y);for(var n=this.getAllNodes(),i=0;i<n.length;i++)n[i].transform(e)}}},p.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,r,n=t.getNodes(),i=0;i<n.length;i++)null==(r=(e=n[i]).getChild())||0==r.getNodes().length?e.scatter():(this.positionNodesRandomly(r),e.updateBounds())},p.prototype.getFlatForest=function(){for(var t=[],e=!0,r=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<r.length;a++)null!=r[a].getChild()&&(i=!1);if(!i)return t;var s=new Set,o=[],l=new Map,c=[];for(c=c.concat(r);c.length>0&&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<u.length;a++){var d=u[a].getOtherEnd(h);if(l.get(h)!=d){if(s.has(d)){e=!1;break}o.push(d),l.set(d,h)}}}if(e){var p=[].concat(n(s));t.push(p);for(a=0;a<p.length;a++){var g=p[a],f=c.indexOf(g);f>-1&&c.splice(f,1)}s=new Set,l=new Map}else t=[]}return t},p.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),n.add(a);var s=this.newEdge(null);this.graphManager.add(s,r,a),e.add(a),r=a}s=this.newEdge(null);return this.graphManager.add(s,r,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},p.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var r=t[e];if(r.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(r),a=0;a<i.length;a++){var s=i[a],o=new h(s.getCenterX(),s.getCenterY()),l=r.bendpoints.get(a);l.x=o.x,l.y=o.y,s.getOwner().remove(s)}this.graphManager.add(r,r.source,r.target)}}},p.transform=function(t,e,r,n){if(null!=r&&null!=n){var i=e;if(t<=50)i-=(e-e/r)/50*(50-t);else i+=(e*n-e)/50*(t-50);return i}var a,s;return t<=50?(a=9*e/500,s=e/10):(a=9*e/50,s=-8*e),a*t+s},p.findCenterOfTree=function(t){var e=[];e=e.concat(t);var r=[],n=new Map,i=!1,a=null;1!=e.length&&2!=e.length||(i=!0,a=e[0]);for(var s=0;s<e.length;s++){var o=(h=e[s]).getNeighborsList().size;n.set(h,h.getNeighborsList().size),1==o&&r.push(h)}var l=[];for(l=l.concat(r);!i;){var c=[];c=c.concat(l),l=[];for(s=0;s<e.length;s++){var h=e[s],u=e.indexOf(h);u>=0&&e.splice(u,1),h.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&l.push(t),n.set(t,e)}}))}r=r.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,r){function n(){}o(n,"RandomSeed"),n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(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}o(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,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}o(n,"_toConsumableArray");var i=r(15),a=r(4),s=r(0),l=r(8),c=r(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var u in o(h,"FDLayout"),h.prototype=Object.create(i.prototype),i)h[u]=i[u];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,i,o,l,c=this.getGraphManager().getAllEdges(),h=0;h<c.length;h++)e=(t=c[h]).idealLength,t.isInterGraph&&(n=t.getSource(),i=t.getTarget(),o=t.getSourceInLca().getEstimatedSize(),l=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=o+l-2*s.SIMPLE_NODE_SIZE),r=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+i.getInclusionTreeDepth()-2*r))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.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(),r=0;r<e.length;r++)t=e[r],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,r,n,i,s=!(arguments.length>0&&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.length;t++)r=l[t],this.calculateRepulsionForceOfANode(r,i,s,o),i.add(r);else for(t=0;t<l.length;t++)for(r=l[t],e=t+1;e<l.length;e++)n=l[e],r.getOwner()==n.getOwner()&&this.calcRepulsionForce(r,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),r=0;r<e.length;r++)t=e[r],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var r,n,i,a,s=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(r=t.getLength())&&(i=(n=t.edgeElasticity*(r-e))*(t.lengthX/r),a=n*(t.lengthY/r),s.springForceX+=i,s.springForceY+=a,o.springForceX-=i,o.springForceY-=a)},h.prototype.calcRepulsionForce=function(t,e){var r,n,i,s,o,h,u,d=t.getRect(),p=e.getRect(),g=new Array(2),f=new Array(4);if(d.intersects(p)){l.calcSeparationAmount(d,p,g,a.DEFAULT_EDGE_LENGTH/2),h=2*g[0],u=2*g[1];var m=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=m*h,t.repulsionForceY-=m*u,e.repulsionForceX+=m*h,e.repulsionForceY+=m*u}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(r=p.getCenterX()-d.getCenterX(),n=p.getCenterY()-d.getCenterY()):(l.getIntersection(d,p,f),r=f[2]-f[0],n=f[3]-f[1]),Math.abs(r)<a.MIN_REPULSION_DIST&&(r=c.sign(r)*a.MIN_REPULSION_DIST),Math.abs(n)<a.MIN_REPULSION_DIST&&(n=c.sign(n)*a.MIN_REPULSION_DIST),i=r*r+n*n,s=Math.sqrt(i),h=(o=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/i)*r/s,u=o*n/s,t.repulsionForceX-=h,t.repulsionForceY-=u,e.repulsionForceX+=h,e.repulsionForceY+=u},h.prototype.calcGravitationalForce=function(t){var e,r,n,i,a,s,o,l;r=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-r,a=t.getCenterY()-n,s=Math.abs(i)+t.getWidth()/2,o=Math.abs(a)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(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<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),r=0;r<e.length;r++)(t=e[r]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,r;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),i=0;i<e;i++)n[i]=new Array(r);for(i=0;i<e;i++)for(var a=0;a<r;a++)n[i][a]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,r){var n,i,a,s;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),a=parseInt(Math.floor((t.getRect().y-r)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-r)/this.repulsionRange));for(var o=n;o<=i;o++)for(var l=a;l<=s;l++)this.grid[o][l].push(t),t.setGridCoordinates(n,i,a,s)},h.prototype.updateGrid=function(){var t,e,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<r.length;t++)e=r[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,r,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&r||i){var s,o=new Set;t.surrounding=new Array;for(var l=this.grid,c=t.startX-1;c<t.finishX+2;c++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(c<0||h<0||c>=l.length||h>=l[0].length))for(var u=0;u<l[c][h].length;u++)if(s=l[c][h][u],t.getOwner()==s.getOwner()&&t!=s&&!e.has(s)&&!o.has(s)){var d=Math.abs(t.getCenterX()-s.getCenterX())-(t.getWidth()/2+s.getWidth()/2),p=Math.abs(t.getCenterY()-s.getCenterY())-(t.getHeight()/2+s.getHeight()/2);d<=this.repulsionRange&&p<=this.repulsionRange&&o.add(s)}t.surrounding=[].concat(n(o))}for(c=0;c<t.surrounding.length;c++)this.calcRepulsionForce(t,t.surrounding[c])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,r){var n=r(1),i=r(4);function a(t,e,r){n.call(this,t,e,r),this.idealLength=i.DEFAULT_EDGE_LENGTH,this.edgeElasticity=i.DEFAULT_SPRING_STRENGTH}for(var s in o(a,"FDLayoutEdge"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];t.exports=a},function(t,e,r){var n=r(3),i=r(4);function a(t,e,r,a){n.call(this,t,e,r,a),this.nodeRepulsion=i.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var s in o(a,"FDLayoutNode"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];a.prototype.setGridCoordinates=function(t,e,r,n){this.startX=t,this.finishX=e,this.startY=r,this.finishY=n},t.exports=a},function(t,e,r){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}o(n,"DimensionD"),n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,r){var n=r(14);function i(){this.map={},this.keys=[]}o(i,"HashMap"),i.prototype.put=function(t,e){var r=n.createID(t);this.contains(r)||(this.map[r]=e,this.keys.push(t))},i.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=n.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,r){var n=r(14);function i(){this.set={}}o(i,"HashSet"),i.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[n.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[n.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),r=e.length,n=0;n<r;n++)t.push(this.set[e[n]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,r=0;r<e;r++){var n=t[r];this.add(n)}},t.exports=i},function(t,e,r){function n(){}o(n,"Matrix"),n.multMat=function(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var i=0;i<e[0].length;i++){r[n][i]=0;for(var a=0;a<t[0].length;a++)r[n][i]+=t[n][a]*e[a][i]}}return r},n.transpose=function(t){for(var e=[],r=0;r<t[0].length;r++){e[r]=[];for(var n=0;n<t.length;n++)e[r][n]=t[n][r]}return e},n.multCons=function(t,e){for(var r=[],n=0;n<t.length;n++)r[n]=t[n]*e;return r},n.minusOp=function(t,e){for(var r=[],n=0;n<t.length;n++)r[n]=t[n]-e[n];return r},n.dotProduct=function(t,e){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[n];return r},n.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},n.normalize=function(t){for(var e=[],r=this.mag(t),n=0;n<t.length;n++)e[n]=t[n]/r;return e},n.multGamma=function(t){for(var e=[],r=0,n=0;n<t.length;n++)r+=t[n];r*=-1/t.length;for(var i=0;i<t.length;i++)e[i]=r+t[i];return e},n.multL=function(t,e,r){for(var n=[],i=[],a=[],s=0;s<e[0].length;s++){for(var o=0,l=0;l<e.length;l++)o+=-.5*e[l][s]*t[l];i[s]=o}for(var c=0;c<r.length;c++){for(var h=0,u=0;u<r.length;u++)h+=r[c][u]*i[u];a[c]=h}for(var d=0;d<e.length;d++){for(var p=0,g=0;g<e[0].length;g++)p+=e[d][g]*a[g];n[d]=p}return n},t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=r(11),s=function(){function t(e,r){i(this,t),null===r&&void 0===r||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof a?e.size():e.length,this._quicksort(e,0,n-1)}return o(t,"Quicksort"),n(t,[{key:"_quicksort",value:o((function(t,e,r){if(e<r){var n=this._partition(t,e,r);this._quicksort(t,e,n),this._quicksort(t,n+1,r)}}),"_quicksort")},{key:"_partition",value:o((function(t,e,r){for(var n=this._get(t,e),i=e,a=r;;){for(;this.compareFunction(n,this._get(t,a));)a--;for(;this.compareFunction(this._get(t,i),n);)i++;if(!(i<a))return a;this._swap(t,i,a),i++,a--}}),"_partition")},{key:"_get",value:o((function(t,e){return t instanceof a?t.get_object_at(e):t[e]}),"_get")},{key:"_set",value:o((function(t,e,r){t instanceof a?t.set_object_at(e,r):t[e]=r}),"_set")},{key:"_swap",value:o((function(t,e,r){var n=this._get(t,e);this._set(t,e,this._get(t,r)),this._set(t,r,n)}),"_swap")},{key:"_defaultCompareFunction",value:o((function(t,e){return e>t}),"_defaultCompareFunction")}]),t}();t.exports=s},function(t,e,r){function n(){}o(n,"SVD"),n.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,r,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],r=o((function t(e){if(0==e.length)return 0;for(var r=[],n=0;n<e[0];n++)r.push(t(e.slice(1)));return r}),"allocate"),r(e)),this.V=function(t){var e=o((function t(e){if(0==e.length)return 0;for(var r=[],n=0;n<e[0];n++)r.push(t(e.slice(1)));return r}),"allocate");return e(t)}([this.n,this.n]);for(var a=function(t){for(var e=[];t-- >0;)e.push(0);return e}(this.n),s=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<Math.max(l,c);h++){if(h<l){this.s[h]=0;for(var u=h;u<this.m;u++)this.s[h]=n.hypot(this.s[h],t[u][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var d=h;d<this.m;d++)t[d][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var p=h+1;p<this.n;p++){if(function(t,e){return t&&e}(h<l,0!==this.s[h])){for(var g=0,f=h;f<this.m;f++)g+=t[f][h]*t[f][p];g=-g/t[h][h];for(var m=h;m<this.m;m++)t[m][p]+=g*t[m][h]}a[p]=t[h][p]}if(function(t,e){return e}(0,h<l))for(var y=h;y<this.m;y++)this.U[y][h]=t[y][h];if(h<c){a[h]=0;for(var v=h+1;v<this.n;v++)a[h]=n.hypot(a[h],a[v]);if(0!==a[h]){a[h+1]<0&&(a[h]=-a[h]);for(var x=h+1;x<this.n;x++)a[x]/=a[h];a[h+1]+=1}if(a[h]=-a[h],function(t,e){return t&&e}(h+1<this.m,0!==a[h])){for(var b=h+1;b<this.m;b++)s[b]=0;for(var w=h+1;w<this.n;w++)for(var k=h+1;k<this.m;k++)s[k]+=a[w]*t[k][w];for(var T=h+1;T<this.n;T++)for(var _=-a[T]/a[h+1],E=h+1;E<this.m;E++)t[E][T]+=_*s[E]}for(var C=h+1;C<this.n;C++)this.V[C][h]=a[C]}}var S=Math.min(this.n,this.m+1);l<this.n&&(this.s[l]=t[l][l]),this.m<S&&(this.s[S-1]=0),c+1<S&&(a[c]=t[c][S-1]),a[S-1]=0;for(var A=l;A<i;A++){for(var L=0;L<this.m;L++)this.U[L][A]=0;this.U[A][A]=1}for(var N=l-1;N>=0;N--)if(0!==this.s[N]){for(var I=N+1;I<i;I++){for(var R=0,M=N;M<this.m;M++)R+=this.U[M][N]*this.U[M][I];R=-R/this.U[N][N];for(var D=N;D<this.m;D++)this.U[D][I]+=R*this.U[D][N]}for(var O=N;O<this.m;O++)this.U[O][N]=-this.U[O][N];this.U[N][N]=1+this.U[N][N];for(var P=0;P<N-1;P++)this.U[P][N]=0}else{for(var B=0;B<this.m;B++)this.U[B][N]=0;this.U[N][N]=1}for(var $=this.n-1;$>=0;$--){if(function(t,e){return t&&e}($<c,0!==a[$]))for(var F=$+1;F<i;F++){for(var z=0,U=$+1;U<this.n;U++)z+=this.V[U][$]*this.V[U][F];z=-z/this.V[$+1][$];for(var G=$+1;G<this.n;G++)this.V[G][F]+=z*this.V[G][$]}for(var q=0;q<this.n;q++)this.V[q][$]=0;this.V[$][$]=1}for(var j=S-1,W=Math.pow(2,-52),Y=Math.pow(2,-966);S>0;){var H=void 0,V=void 0;for(H=S-2;H>=-1&&-1!==H;H--)if(Math.abs(a[H])<=Y+W*(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])<=Y+W*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=n.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 rt=0;rt<this.n;rt++)J=tt*this.V[rt][Q]+et*this.V[rt][S-1],this.V[rt][S-1]=-et*this.V[rt][Q]+tt*this.V[rt][S-1],this.V[rt][Q]=J}break;case 2:var nt=a[H-1];a[H-1]=0;for(var it=H;it<S;it++){var at=n.hypot(this.s[it],nt),st=this.s[it]/at,ot=nt/at;this.s[it]=at,nt=-ot*a[it],a[it]=st*a[it];for(var lt=0;lt<this.m;lt++)at=st*this.U[lt][it]+ot*this.U[lt][H-1],this.U[lt][H-1]=-ot*this.U[lt][it]+st*this.U[lt][H-1],this.U[lt][it]=at}break;case 3:var ct=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(a[S-2])),Math.abs(this.s[H])),Math.abs(a[H])),ht=this.s[S-1]/ct,ut=this.s[S-2]/ct,dt=a[S-2]/ct,pt=this.s[H]/ct,gt=a[H]/ct,ft=((ut+ht)*(ut-ht)+dt*dt)/2,mt=ht*dt*(ht*dt),yt=0;(function(t,e){return t||e})(0!==ft,0!==mt)&&(yt=Math.sqrt(ft*ft+mt),ft<0&&(yt=-yt),yt=mt/(ft+yt));for(var vt=(pt+ht)*(pt-ht)+yt,xt=pt*gt,bt=H;bt<S-1;bt++){var wt=n.hypot(vt,xt),kt=vt/wt,Tt=xt/wt;bt!==H&&(a[bt-1]=wt),vt=kt*this.s[bt]+Tt*a[bt],a[bt]=kt*a[bt]-Tt*this.s[bt],xt=Tt*this.s[bt+1],this.s[bt+1]=kt*this.s[bt+1];for(var _t=0;_t<this.n;_t++)wt=kt*this.V[_t][bt]+Tt*this.V[_t][bt+1],this.V[_t][bt+1]=-Tt*this.V[_t][bt]+kt*this.V[_t][bt+1],this.V[_t][bt]=wt;if(kt=vt/(wt=n.hypot(vt,xt)),Tt=xt/wt,this.s[bt]=wt,vt=kt*a[bt]+Tt*this.s[bt+1],this.s[bt+1]=-Tt*a[bt]+kt*this.s[bt+1],xt=Tt*a[bt+1],a[bt+1]=kt*a[bt+1],bt<this.m-1)for(var Et=0;Et<this.m;Et++)wt=kt*this.U[Et][bt]+Tt*this.U[Et][bt+1],this.U[Et][bt+1]=-Tt*this.U[Et][bt]+kt*this.U[Et][bt+1],this.U[Et][bt]=wt}a[S-2]=vt;break;case 4:if(this.s[H]<=0){this.s[H]=this.s[H]<0?-this.s[H]:0;for(var Ct=0;Ct<=j;Ct++)this.V[Ct][H]=-this.V[Ct][H]}for(;H<j&&!(this.s[H]>=this.s[H+1]);){var St=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=St,H<this.n-1)for(var At=0;At<this.n;At++)St=this.V[At][H+1],this.V[At][H+1]=this.V[At][H],this.V[At][H]=St;if(H<this.m-1)for(var Lt=0;Lt<this.m;Lt++)St=this.U[Lt][H+1],this.U[Lt][H+1]=this.U[Lt][H],this.U[Lt][H]=St;H++}S--}}return{U:this.U,V:this.V,S:this.s}},n.hypot=function(t,e){var r=void 0;return Math.abs(t)>Math.abs(e)?(r=e/t,r=Math.abs(t)*Math.sqrt(1+r*r)):0!=e?(r=t/e,r=Math.abs(e)*Math.sqrt(1+r*r)):r=0,r},t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=function(){function t(e,r){var n=arguments.length>2&&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=r,this.match_score=n,this.mismatch_penalty=a,this.gap_penalty=s,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[o][l]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return o(t,"NeedlemanWunsch"),n(t,[{key:"getScore",value:o((function(){return this.score}),"getScore")},{key:"getAlignments",value:o((function(){return this.alignments}),"getAlignments")},{key:"computeGrids",value:o((function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var n=1;n<this.jMax;n++){var i=[this.sequence1[r-1]===this.sequence2[n-1]?this.grid[r-1][n-1]+this.match_score:this.grid[r-1][n-1]+this.mismatch_penalty,this.grid[r-1][n]+this.gap_penalty,this.grid[r][n-1]+this.gap_penalty],a=this.arrayAllMaxIndexes(i);this.grid[r][n]=i[a[0]],this.tracebackGrid[r][n]=[a.includes(0),a.includes(1),a.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}),"computeGrids")},{key:"alignmentTraceback",value:o((function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],r=this.tracebackGrid[e.pos[0]][e.pos[1]];r[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),r[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),r[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}),"alignmentTraceback")},{key:"getAllIndexes",value:o((function(t,e){for(var r=[],n=-1;-1!==(n=t.indexOf(e,n+1));)r.push(n);return r}),"getAllIndexes")},{key:"arrayAllMaxIndexes",value:o((function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}),"arrayAllMaxIndexes")}]),t}();t.exports=a},function(t,e,r){var n=o((function(){}),"layoutBase");n.FDLayout=r(18),n.FDLayoutConstants=r(4),n.FDLayoutEdge=r(19),n.FDLayoutNode=r(20),n.DimensionD=r(21),n.HashMap=r(22),n.HashSet=r(23),n.IGeometry=r(8),n.IMath=r(9),n.Integer=r(10),n.Point=r(12),n.PointD=r(5),n.RandomSeed=r(16),n.RectangleD=r(13),n.Transform=r(17),n.UniqueIDGeneretor=r(14),n.Quicksort=r(25),n.LinkedList=r(11),n.LGraphObject=r(2),n.LGraph=r(6),n.LEdge=r(1),n.LGraphManager=r(7),n.LNode=r(3),n.Layout=r(15),n.LayoutConstants=r(0),n.NeedlemanWunsch=r(27),n.Matrix=r(24),n.SVD=r(26),t.exports=n},function(t,e,r){function n(){this.listeners=[]}o(n,"Emitter");var i=n.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var r=this.listeners.length;r>=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r<this.listeners.length;r++){var n=this.listeners[r];t===n.event&&n.callback(e)}},t.exports=n}])}))}}),EIt=l({"../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n(_It()):"function"==typeof define&&define.amd?define(["layout-base"],n):"object"==typeof t?t.coseBase=n(_It()):r.coseBase=n(r.layoutBase)}),"webpackUniversalModuleDefinition")(t,(function(t){return(()=>{var e={45:(t,e,r)=>{var n={};n.layoutBase=r(551),n.CoSEConstants=r(806),n.CoSEEdge=r(767),n.CoSEGraph=r(880),n.CoSEGraphManager=r(578),n.CoSELayout=r(765),n.CoSENode=r(991),n.ConstraintHandler=r(902),t.exports=n},806:(t,e,r)=>{var n=r(551).FDLayoutConstants;function i(){}for(var a in o(i,"CoSEConstants"),n)i[a]=n[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.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,r)=>{var n=r(551).FDLayoutEdge;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEEdge"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},880:(t,e,r)=>{var n=r(551).LGraph;function i(t,e,r){n.call(this,t,e,r)}for(var a in o(i,"CoSEGraph"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},578:(t,e,r)=>{var n=r(551).LGraphManager;function i(t){n.call(this,t)}for(var a in o(i,"CoSEGraphManager"),i.prototype=Object.create(n.prototype),n)i[a]=n[a];t.exports=i},765:(t,e,r)=>{var n=r(551).FDLayout,i=r(578),a=r(880),s=r(991),l=r(767),c=r(806),h=r(902),u=r(551).FDLayoutConstants,d=r(551).LayoutConstants,p=r(551).Point,g=r(551).PointD,f=r(551).DimensionD,m=r(551).Layout,y=r(551).Integer,v=r(551).IGeometry,x=r(551).LGraph,b=r(551).Transform,w=r(551).LinkedList;function k(){n.call(this),this.toBeTiled={},this.constraints={}}for(var T in o(k,"CoSELayout"),k.prototype=Object.create(n.prototype),n)k[T]=n[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 s(this.graphManager,t)},k.prototype.newEdge=function(t){return new l(null,null,t)},k.prototype.initParameters=function(){n.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(){n.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()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),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 r=!this.isTreeGrowing&&!this.isGrowthFinished,n=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,n),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},k.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r<t.length;r++){var n=t[r].rect,i=t[r].id;e[i]={id:i,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},k.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},k.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(e=0;e<t.length;e++)t[e].move()},k.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),r=0;r<e.length;r++){var n=e[r];this.idToNodeMap.set(n.id,n)}var i=o((function e(r){for(var n,i=r.getChild().getNodes(),a=0,s=0;s<i.length;s++)null==(n=i[s]).getChild()?t.fixedNodeSet.has(n.id)&&(a+=100):a+=e(n);return a}),"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)}));for(e=this.graphManager.getAllNodes(),r=0;r<e.length;r++)if(null!=(n=e[r]).getChild()){var a=i(n);a>0&&(n.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var s=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(r=0;r<h.length;r++)this.dummyToNodeForVerticalAlignment.set("dummy"+r,[]),h[r].forEach((function(e){s.set(e,"dummy"+r),t.dummyToNodeForVerticalAlignment.get("dummy"+r).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+r)}))}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(r=0;r<u.length;r++)this.dummyToNodeForHorizontalAlignment.set("dummy"+r,[]),u[r].forEach((function(e){l.set(e,"dummy"+r),t.dummyToNodeForHorizontalAlignment.get("dummy"+r).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+r)}))}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,r,n;for(n=t.length-1;n>=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),r=t[n],t[n]=t[e],t[e]=r;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 r=s.has(e.left)?s.get(e.left):e.left,n=s.has(e.right)?s.get(e.right):e.right;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.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.nodeToRelativeConstraintMapHorizontal.get(r).push({right:n,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(n).push({left:r,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=s.has(t.left)?s.get(t.left):t.left,r=s.has(t.right)?s.get(t.right):t.right;d.has(e)?d.get(e).push(r):d.set(e,[r]),d.has(r)?d.get(r).push(e):d.set(r,[e])}else{var n=l.has(t.top)?l.get(t.top):t.top,i=l.has(t.bottom)?l.get(t.bottom):t.bottom;p.has(n)?p.get(n).push(i):p.set(n,[i]),p.has(i)?p.get(i).push(n):p.set(i,[n])}}));var g=o((function(t,e){var r=[],n=[],i=new w,a=new Set,s=0;return t.forEach((function(o,l){if(!a.has(l)){r[s]=[],n[s]=!1;var c=l;for(i.push(c),a.add(c),r[s].push(c);0!=i.length;){c=i.shift(),e.has(c)&&(n[s]=!0),t.get(c).forEach((function(t){a.has(t)||(i.push(t),a.add(t),r[s].push(t))}))}s++}})),{components:r,isFixed:n}}),"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 r=t.idToNodeMap.get(e.nodeId);r.displacementX=0,r.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,r=0;r<e.length;r++){for(var n=0,i=0;i<e[r].length;i++){if(this.fixedNodeSet.has(e[r][i])){n=0;break}n+=this.idToNodeMap.get(e[r][i]).displacementX}var a=n/e[r].length;for(i=0;i<e[r].length;i++)this.idToNodeMap.get(e[r][i]).displacementX=a}if(this.constraints.alignmentConstraint.horizontal){var s=this.constraints.alignmentConstraint.horizontal;for(r=0;r<s.length;r++){var o=0;for(i=0;i<s[r].length;i++){if(this.fixedNodeSet.has(s[r][i])){o=0;break}o+=this.idToNodeMap.get(s[r][i]).displacementY}var l=o/s[r].length;for(i=0;i<s[r].length;i++)this.idToNodeMap.get(s[r][i]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var r=0;r=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(n){var i;n.right?(i=t.nodeToTempPositionMapHorizontal.get(n.right)-t.nodeToTempPositionMapHorizontal.get(e)-r)<n.gap&&(r-=n.gap-i):(i=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(n.left)+r)<n.gap&&(r+=n.gap-i)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+r),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=r})):t.idToNodeMap.get(e).displacementX=r}})),this.nodesInRelativeVertical.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var r=0;r=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(n){var i;n.bottom?(i=t.nodeToTempPositionMapVertical.get(n.bottom)-t.nodeToTempPositionMapVertical.get(e)-r)<n.gap&&(r-=n.gap-i):(i=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(n.top)+r)<n.gap&&(r+=n.gap-i)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+r),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=r})):t.idToNodeMap.get(e).displacementY=r}}));else{for(r=0;r<this.componentsOnHorizontal.length;r++){var h=this.componentsOnHorizontal[r];if(this.fixedComponentsOnHorizontal[r])for(i=0;i<h.length;i++)this.dummyToNodeForVerticalAlignment.has(h[i])?this.dummyToNodeForVerticalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(h[i]).displacementX=0;else{var u=0,d=0;for(i=0;i<h.length;i++){if(this.dummyToNodeForVerticalAlignment.has(h[i]))u+=(g=this.dummyToNodeForVerticalAlignment.get(h[i])).length*this.idToNodeMap.get(g[0]).displacementX,d+=g.length;else u+=this.idToNodeMap.get(h[i]).displacementX,d++}var p=u/d;for(i=0;i<h.length;i++)this.dummyToNodeForVerticalAlignment.has(h[i])?this.dummyToNodeForVerticalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementX=p})):this.idToNodeMap.get(h[i]).displacementX=p}}for(r=0;r<this.componentsOnVertical.length;r++){h=this.componentsOnVertical[r];if(this.fixedComponentsOnVertical[r])for(i=0;i<h.length;i++)this.dummyToNodeForHorizontalAlignment.has(h[i])?this.dummyToNodeForHorizontalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(h[i]).displacementY=0;else{for(u=0,d=0,i=0;i<h.length;i++){var g;if(this.dummyToNodeForHorizontalAlignment.has(h[i]))u+=(g=this.dummyToNodeForHorizontalAlignment.get(h[i])).length*this.idToNodeMap.get(g[0]).displacementY,d+=g.length;else u+=this.idToNodeMap.get(h[i]).displacementY,d++}for(p=u/d,i=0;i<h.length;i++)this.dummyToNodeForHorizontalAlignment.has(h[i])?this.dummyToNodeForHorizontalAlignment.get(h[i]).forEach((function(e){t.idToNodeMap.get(e).displacementY=p})):this.idToNodeMap.get(h[i]).displacementY=p}}}},k.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,r=[],n=this.graphManager.getGraphs(),i=n.length;for(e=0;e<i;e++)(t=n[e]).updateConnected(),t.isConnected||(r=r.concat(t.getNodes()));return r},k.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,r=new Set;for(e=0;e<t.length;e++){var n=t[e];if(!r.has(n)){var i=n.getSource(),a=n.getTarget();if(i==a)n.getBendpoints().push(new g),n.getBendpoints().push(new g),this.createDummyNodesForBendpoints(n),r.add(n);else{var s=[];if(s=(s=s.concat(i.getEdgeListToNode(a))).concat(a.getEdgeListToNode(i)),!r.has(s[0])){var o;if(s.length>1)for(o=0;o<s.length;o++){var l=s[o];l.getBendpoints().push(new g),this.createDummyNodesForBendpoints(l)}s.forEach((function(t){r.add(t)}))}}}if(r.size==t.length)break}},k.prototype.positionNodesRadially=function(t){for(var e=new p(0,0),r=Math.ceil(Math.sqrt(t.length)),n=0,i=0,a=0,s=new g(0,0),o=0;o<t.length;o++){o%r==0&&(a=0,i=n,0!=o&&(i+=c.DEFAULT_COMPONENT_SEPERATION),n=0);var l=t[o],h=m.findCenterOfTree(l);e.x=a,e.y=i,(s=k.radialLayout(l,h,e)).y>n&&(n=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,r){var n=Math.max(this.maxDiagonalInTree(t),c.DEFAULT_RADIAL_SEPARATION);k.branchRadialLayout(e,null,0,359,0,n);var i=x.calculateBounds(t),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(r.x),a.setWorldOrgY(r.y);for(var s=0;s<t.length;s++){t[s].transform(a)}var o=new g(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(o)},k.branchRadialLayout=function(t,e,r,n,i,a){var s=(n-r+1)/2;s<0&&(s+=180);var o=(s+r)%360*v.TWO_PI/360,l=i*Math.cos(o),c=i*Math.sin(o);t.setCenter(l,c);var h=[],u=(h=h.concat(t.getEdges())).length;null!=e&&u--;for(var d,p=0,g=h.length,f=t.getEdgesBetween(e);f.length>1;){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(n-r)/u,b=d;p!=u;b=++b%g){var w=h[b].getOtherEnd(t);if(w!=e){var T=(r+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,r=0;r<t.length;r++){var n=t[r].getDiagonal();n>e&&(e=n)}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 r=[],n=this.graphManager.getAllNodes(),i=0;i<n.length;i++){var a=(o=n[i]).getParent();0!==this.getNodeDegreeWithChildren(o)||null!=a.id&&this.getToBeTiled(a)||r.push(o)}for(i=0;i<r.length;i++){var o,l=(o=r[i]).getParent().id;void 0===e[l]&&(e[l]=[]),e[l]=e[l].concat(o)}Object.keys(e).forEach((function(r){if(e[r].length>1){var n="DummyCompound_"+r;t.memberGroups[n]=e[r];var i=e[r][0].getParent(),a=new s(t.graphManager);a.id=n,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,t.idToDummyNode[n]=a;var o=t.getGraphManager().add(t.newGraph(),a),l=i.getChild();l.add(a);for(var c=0;c<e[r].length;c++){var h=e[r][c];l.remove(h),o.add(h)}}}))},k.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var r=0;r<this.compoundOrder.length;r++)e[this.compoundOrder[r].id]=this.compoundOrder[r],t[this.compoundOrder[r].id]=[].concat(this.compoundOrder[r].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[r].getChild()),this.compoundOrder[r].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},k.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(r){var n=t.idToDummyNode[r];if(e[r]=t.tileNodes(t.memberGroups[r],n.paddingLeft+n.paddingRight),n.rect.width=e[r].width,n.rect.height=e[r].height,n.setCenter(e[r].centerX,e[r].centerY),n.labelMarginLeft=0,n.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var i=n.rect.width,a=n.rect.height;n.labelWidth&&("left"==n.labelPosHorizontal?(n.rect.x-=n.labelWidth,n.setWidth(i+n.labelWidth),n.labelMarginLeft=n.labelWidth):"center"==n.labelPosHorizontal&&n.labelWidth>i?(n.rect.x-=(n.labelWidth-i)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-i)/2):"right"==n.labelPosHorizontal&&n.setWidth(i+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(a+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>a?(n.rect.y-=(n.labelHeight-a)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-a)/2):"bottom"==n.labelPosVertical&&n.setHeight(a+n.labelHeight))}}))},k.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,n=e.paddingLeft,i=e.paddingTop,a=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,n,i,a,s)}},k.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var n=t.idToDummyNode[r],i=n.paddingLeft,a=n.paddingTop,s=n.labelMarginLeft,o=n.labelMarginTop;t.adjustLocations(e[r],n.rect.x,n.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 r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var n=r.getNodes(),i=0;i<n.length;i++){var a=n[i];if(this.getNodeDegree(a)>0)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(),r=0,n=0;n<e.length;n++){var i=e[n];i.getSource().id!==i.getTarget().id&&(r+=1)}return r},k.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var r=t.getChild().getNodes(),n=0;n<r.length;n++){var i=r[n];e+=this.getNodeDegreeWithChildren(i)}return e},k.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},k.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var r=t[e];null!=r.getChild()&&this.fillCompexOrderByDFS(r.getChild().getNodes()),this.getToBeTiled(r)&&this.compoundOrder.push(r)}},k.prototype.adjustLocations=function(t,e,r,n,i,a,s){r+=i+s;for(var o=e+=n+a,l=0;l<t.rows.length;l++){var c=t.rows[l];e=o;for(var h=0,u=0;u<c.length;u++){var d=c[u];d.rect.x=e,d.rect.y=r,e+=d.rect.width+t.horizontalPadding,d.rect.height>h&&(h=d.rect.height)}r+=h+t.verticalPadding}},k.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var i=e[n];if(r.tiledMemberPack[n]=r.tileNodes(t[n],i.paddingLeft+i.paddingRight),i.rect.width=r.tiledMemberPack[n].width,i.rect.height=r.tiledMemberPack[n].height,i.setCenter(r.tiledMemberPack[n].centerX,r.tiledMemberPack[n].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 r=this.tileNodesByFavoringDim(t,e,!0),n=this.tileNodesByFavoringDim(t,e,!1),i=this.getOrgRatio(r);return this.getOrgRatio(n)<i?n:r},k.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},k.prototype.calcIdealRowWidth=function(t,e){var r=c.TILING_PADDING_VERTICAL,n=c.TILING_PADDING_HORIZONTAL,i=t.length,a=0,s=0,o=0;t.forEach((function(t){a+=t.getWidth(),s+=t.getHeight(),t.getWidth()>o&&(o=t.getWidth())}));var l,h=a/i,u=s/i,d=Math.pow(r-n,2)+4*(h+n)*(u+r)*i,p=(n-r+Math.sqrt(d))/(2*(h+n));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var g=l*(h+n)-n;return o>g&&(g=o),g+=2*n},k.prototype.tileNodesByFavoringDim=function(t,e,r){var n=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,s={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:n,horizontalPadding:i,centerX:0,centerY:0};a&&(s.idealRowWidth=this.calcIdealRowWidth(t,r));var l=o((function(t){return t.rect.width*t.rect.height}),"getNodeArea"),h=o((function(t,e){return l(e)-l(t)}),"areaCompareFcn");t.sort((function(t,e){var r=h;return s.idealRowWidth?(r=a)(t.id,e.id):r(t,e)}));for(var u=0,d=0,p=0;p<t.length;p++){u+=(g=t[p]).getCenterX(),d+=g.getCenterY()}s.centerX=u/t.length,s.centerY=d/t.length;for(p=0;p<t.length;p++){var g=t[p];if(0==s.rows.length)this.insertNodeToRow(s,g,0,e);else if(this.canAddHorizontal(s,g.rect.width,g.rect.height)){var f=s.rows.length-1;s.idealRowWidth||(f=this.getShortestRowIndex(s)),this.insertNodeToRow(s,g,f,e)}else this.insertNodeToRow(s,g,s.rows.length,e);this.shiftToLastRow(s)}return s},k.prototype.insertNodeToRow=function(t,e,r,n){var i=n;if(r==t.rows.length){t.rows.push([]),t.rowWidth.push(i),t.rowHeight.push(0)}var a=t.rowWidth[r]+e.rect.width;t.rows[r].length>0&&(a+=t.horizontalPadding),t.rowWidth[r]=a,t.width<a&&(t.width=a);var s=e.rect.height;r>0&&(s+=t.verticalPadding);var o=0;s>t.rowHeight[r]&&(o=t.rowHeight[r],t.rowHeight[r]=s,o=t.rowHeight[r]-o),t.height+=o,t.rows[r].push(e)},k.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<r&&(e=n,r=t.rowWidth[n]);return e},k.prototype.getLongestRowIndex=function(t){for(var e=-1,r=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>r&&(e=n,r=t.rowWidth[n]);return e},k.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var n=t.rows.length-1;return t.rowWidth[n]+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]<r&&i>0&&(l=r+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=r+t.verticalPadding,(o=t.width<e?(t.height+l)/e:(t.height+l)/t.width)<1&&(o=1/o),s<1&&(s=1/s),s<o},k.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),r=t.rowWidth.length-1,n=t.rows[e],i=n[n.length-1],a=i.width+t.horizontalPadding;if(t.width-t.rowWidth[r]>a&&e!=r){n.splice(-1,1),t.rows[r].push(i),t.rowWidth[e]=t.rowWidth[e]-a,t.rowWidth[r]=t.rowWidth[r]+a,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,o=0;o<n.length;o++)n[o].height>s&&(s=n[o].height);e>0&&(s+=t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=s,t.rowHeight[r]<i.height+t.verticalPadding&&(t.rowHeight[r]=i.height+t.verticalPadding);var c=t.rowHeight[e]+t.rowHeight[r];t.height+=c-l,this.shiftToLastRow(t)}},k.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},k.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},k.prototype.reduceTrees=function(){for(var t,e=[],r=!0;r;){var n=this.graphManager.getAllNodes(),i=[];r=!1;for(var a=0;a<n.length;a++)if(1==(t=n[a]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(c.PURE_INCREMENTAL){var s=t.getEdges()[0].getOtherEnd(t),o=new f(t.getCenterX()-s.getCenterX(),t.getCenterY()-s.getCenterY());i.push([t,t.getEdges()[0],t.getOwner(),o])}else i.push([t,t.getEdges()[0],t.getOwner()]);r=!0}if(1==r){for(var l=[],h=0;h<i.length;h++)1==i[h][0].getEdges().length&&(l.push(i[h]),i[h][0].getOwner().remove(i[h][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},k.prototype.growTree=function(t){for(var e,r=t[t.length-1],n=0;n<r.length;n++)e=r[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},k.prototype.findPlaceforPrunedNode=function(t){var e,r,n=t[0];if(r=n==t[1].source?t[1].target:t[1].source,c.PURE_INCREMENTAL)n.setCenter(r.getCenterX()+t[3].getWidth(),r.getCenterY()+t[3].getHeight());else{var i=r.startX,a=r.finishX,s=r.startY,o=r.finishY,l=[0,0,0,0];if(s>0)for(var h=i;h<=a;h++)l[0]+=this.grid[h][s-1].length+this.grid[h][s].length-1;if(a<this.grid.length-1)for(h=s;h<=o;h++)l[1]+=this.grid[a+1][h].length+this.grid[a][h].length-1;if(o<this.grid[0].length-1)for(h=i;h<=a;h++)l[2]+=this.grid[h][o+1].length+this.grid[h][o].length-1;if(i>0)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<l.length;f++)l[f]<g?(g=l[f],d=1,p=f):l[f]==g&&d++;if(3==d&&0==g)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==d&&0==g){var m=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==m?0:1:0==l[0]&&0==l[2]?0==m?0:2:0==l[0]&&0==l[3]?0==m?0:3:0==l[1]&&0==l[2]?0==m?1:2:0==l[1]&&0==l[3]?0==m?1:3:0==m?2:3}else if(4==d&&0==g){e=m=Math.floor(4*Math.random())}else e=p;0==e?n.setCenter(r.getCenterX(),r.getCenterY()-r.getHeight()/2-u.DEFAULT_EDGE_LENGTH-n.getHeight()/2):1==e?n.setCenter(r.getCenterX()+r.getWidth()/2+u.DEFAULT_EDGE_LENGTH+n.getWidth()/2,r.getCenterY()):2==e?n.setCenter(r.getCenterX(),r.getCenterY()+r.getHeight()/2+u.DEFAULT_EDGE_LENGTH+n.getHeight()/2):n.setCenter(r.getCenterX()-r.getWidth()/2-u.DEFAULT_EDGE_LENGTH-n.getWidth()/2,r.getCenterY())}},t.exports=k},991:(t,e,r)=>{var n=r(551).FDLayoutNode,i=r(551).IMath;function a(t,e,r,i){n.call(this,t,e,r,i)}for(var s in o(a,"CoSENode"),a.prototype=Object.create(n.prototype),n)a[s]=n[s];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 r,n=this.getChild().getNodes(),i=0;i<n.length;i++)null==(r=n[i]).getChild()?(r.displacementX+=t,r.displacementY+=e):r.propogateDisplacementToChildren(t,e)},a.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(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.setPred1=function(t){this.pred1=t},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(t){this.next=t},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(t){this.processed=t},a.prototype.isProcessed=function(){return processed},t.exports=a},902:(t,e,r)=>{function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}o(n,"_toConsumableArray");var i=r(806),a=r(551).LinkedList,s=r(551).Matrix,l=r(551).SVD;function c(){}o(c,"ConstraintHandler"),c.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var r=new Map,c=new Map,h=[],u=[],d=t.getAllNodes(),p=0,g=0;g<d.length;g++){var f=d[g];null==f.getChild()&&(c.set(f.id,p++),h.push(f.getCenterX()),u.push(f.getCenterY()),r.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=i.DEFAULT_EDGE_LENGTH+r.get(t.left).getWidth()/2+r.get(t.right).getWidth()/2:t.gap=i.DEFAULT_EDGE_LENGTH+r.get(t.top).getHeight()/2+r.get(t.bottom).getHeight()/2)}));var m=o((function(t,e){return{x:t.x-e.x,y:t.y-e.y}}),"calculatePositionDiff"),y=o((function(t){var e=0,r=0;return t.forEach((function(t){e+=h[c.get(t)],r+=u[c.get(t)]})),{x:e/t.size,y:r/t.size}}),"calculateAvgPosition"),v=o((function(t,e,r,i,s){function l(t,e){var r=new Set(t),n=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var l=s.value;r.add(l)}}catch(t){i=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(i)throw a}}return r}o(l,"setUnion");var d=new Map;t.forEach((function(t,e){d.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){d.set(t.id,d.get(t.id)+1)}))}));var p=new Map,g=new Map,f=new a;d.forEach((function(t,n){0==t?(f.push(n),r||("horizontal"==e?p.set(n,c.has(n)?h[c.get(n)]:i.get(n)):p.set(n,c.has(n)?u[c.get(n)]:i.get(n)))):p.set(n,Number.NEGATIVE_INFINITY),r&&g.set(n,new Set([n]))})),r&&s.forEach((function(t){var n=[];if(t.forEach((function(t){r.has(t)&&n.push(t)})),n.length>0){var a=0;n.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/=n.length,t.forEach((function(t){r.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=o((function(){var n=f.shift();t.get(n).forEach((function(t){if(p.get(t.id)<p.get(n)+t.gap)if(r&&r.has(t.id)){var a=void 0;if(a="horizontal"==e?c.has(t.id)?h[c.get(t.id)]:i.get(t.id):c.has(t.id)?u[c.get(t.id)]:i.get(t.id),p.set(t.id,a),a<p.get(n)+t.gap){var s=p.get(n)+t.gap-a;g.get(n).forEach((function(t){p.set(t,p.get(t)-s)}))}}else p.set(t.id,p.get(n)+t.gap);d.set(t.id,d.get(t.id)-1),0==d.get(t.id)&&f.push(t.id),r&&g.set(t.id,l(g.get(n),g.get(t.id)))}))}),"_loop");0!=f.length;)m();if(r){var y=new Set;t.forEach((function(t,e){0==t.length&&y.add(e)}));var v=[];g.forEach((function(t,e){if(y.has(e)){var i=!1,a=!0,s=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var h=l.value;r.has(h)&&(i=!0)}}catch(t){s=!0,o=t}finally{try{!a&&c.return&&c.return()}finally{if(s)throw o}}if(!i){var u=!1,d=void 0;v.forEach((function(e,r){e.has([].concat(n(t))[0])&&(u=!0,d=r)})),u?t.forEach((function(t){v[d].add(t)})):v.push(new Set(t))}}})),v.forEach((function(t,r){var n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=!0,d=!1,g=void 0;try{for(var f,m=t[Symbol.iterator]();!(l=(f=m.next()).done);l=!0){var y=f.value,v=void 0;v="horizontal"==e?c.has(y)?h[c.get(y)]:i.get(y):c.has(y)?u[c.get(y)]:i.get(y);var x=p.get(y);v<n&&(n=v),v>s&&(s=v),x<a&&(a=x),x>o&&(o=x)}}catch(t){d=!0,g=t}finally{try{!l&&m.return&&m.return()}finally{if(d)throw g}}var b=(n+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=o((function(t){var e=0,r=0,n=0,i=0;if(t.forEach((function(t){t.left?h[c.get(t.left)]-h[c.get(t.right)]>=0?e++:r++:u[c.get(t.top)]-u[c.get(t.bottom)]>=0?n++:i++})),e>r&&n>i)for(var a=0;a<c.size;a++)h[a]=-1*h[a],u[a]=-1*u[a];else if(e>r)for(var s=0;s<c.size;s++)h[s]=-1*h[s];else if(n>i)for(var o=0;o<c.size;o++)u[o]=-1*u[o]}),"applyReflectionForRelativePlacement"),b=o((function(t){var e=[],r=new a,n=new Set,i=0;return t.forEach((function(a,s){if(!n.has(s)){e[i]=[];var o=s;for(r.push(o),n.add(o),e[i].push(o);0!=r.length;){o=r.shift(),t.get(o).forEach((function(t){n.has(t.id)||(r.push(t.id),n.add(t.id),e[i].push(t.id))}))}i++}})),e}),"findComponents"),w=o((function(t){var e=new Map;return t.forEach((function(t,r){e.set(r,[])})),t.forEach((function(t,r){t.forEach((function(t){e.get(r).push(t),e.get(t.id).push({id:r,gap:t.gap,direction:t.direction})}))})),e}),"dagToUndirected"),k=o((function(t){var e=new Map;return t.forEach((function(t,r){e.set(r,[])})),t.forEach((function(t,r){t.forEach((function(t){e.get(t.id).push({id:r,gap:t.gap,direction:t.direction})}))})),e}),"dagToReversed"),T=[],_=[],E=!1,C=!1,S=new Set,A=new Map,L=new Map,N=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){S.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(A.has(t.left)?A.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):A.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),A.has(t.right)||A.set(t.right,[])):(A.has(t.top)?A.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):A.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),A.has(t.bottom)||A.set(t.bottom,[]))})),L=w(A),N=b(L)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)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 r=e.alignmentConstraint.vertical,i=o((function(e){var i=new Set;r[e].forEach((function(t){i.add(t)}));var a=new Set([].concat(n(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,r[e].forEach((function(e){T[t]=[s,u[c.get(e)]],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop2"),a=0;a<r.length;a++)i(a);E=!0}if(e.alignmentConstraint.horizontal){for(var s=e.alignmentConstraint.horizontal,l=o((function(e){var r=new Set;s[e].forEach((function(t){r.add(t)}));var i=new Set([].concat(n(r)).filter((function(t){return S.has(t)}))),a=void 0;a=i.size>0?h[c.get(i.values().next().value)]:y(r).y,s[e].forEach((function(e){T[t]=[h[c.get(e)],a],_[t]=[h[c.get(e)],u[c.get(e)]],t++}))}),"_loop3"),d=0;d<s.length;d++)l(d);E=!0}e.relativePlacementConstraint&&(C=!0)}();else if(e.relativePlacementConstraint){for(var I=0,R=0,M=0;M<N.length;M++)N[M].length>I&&(I=N[M].length,R=M);if(I<L.size/2)x(e.relativePlacementConstraint),E=!1,C=!1;else{var D=new Map,O=new Map,P=[];N[R].forEach((function(t){A.get(t).forEach((function(e){"horizontal"==e.direction?(D.has(t)?D.get(t).push(e):D.set(t,[e]),D.has(e.id)||D.set(e.id,[]),P.push({left:t,right:e.id})):(O.has(t)?O.get(t).push(e):O.set(t,[e]),O.has(e.id)||O.set(e.id,[]),P.push({top:t,bottom:e.id}))}))})),x(P),C=!1;var B=v(D,"horizontal"),$=v(O,"vertical");N[R].forEach((function(t,e){_[e]=[h[c.get(t)],u[c.get(t)]],T[e]=[],B.has(t)?T[e][0]=B.get(t):T[e][0]=h[c.get(t)],$.has(t)?T[e][1]=$.get(t):T[e][1]=u[c.get(t)]})),E=!0}}if(E){for(var F,z=s.transpose(T),U=s.transpose(_),G=0;G<z.length;G++)z[G]=s.multGamma(z[G]),U[G]=s.multGamma(U[G]);var q=s.multMat(z,s.transpose(U)),j=l.svd(q);F=s.multMat(j.V,s.transpose(j.U));for(var W=0;W<c.size;W++){var Y=[h[W],u[W]],H=[F[0][0],F[1][0]],V=[F[0][1],F[1][1]];h[W]=s.dotProduct(Y,H),u[W]=s.dotProduct(Y,V)}C&&x(e.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var X={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r={x:h[c.get(t.nodeId)],y:u[c.get(t.nodeId)]},n=t.position,i=m(n,r);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=o((function(t){var e=new Set;K[t].forEach((function(t){e.add(t)}));var r=new Set([].concat(n(e)).filter((function(t){return S.has(t)}))),i=void 0;i=r.size>0?h[c.get(r.values().next().value)]:y(e).x,e.forEach((function(t){S.has(t)||(h[c.get(t)]=i)}))}),"_loop4"),Q=0;Q<K.length;Q++)Z(Q);if(e.alignmentConstraint.horizontal)for(var J=e.alignmentConstraint.horizontal,tt=o((function(t){var e=new Set;J[t].forEach((function(t){e.add(t)}));var r=new Set([].concat(n(e)).filter((function(t){return S.has(t)}))),i=void 0;i=r.size>0?u[c.get(r.values().next().value)]:y(e).y,e.forEach((function(t){S.has(t)||(u[c.get(t)]=i)}))}),"_loop5"),et=0;et<J.length;et++)tt(et)}e.relativePlacementConstraint&&function(){var t=new Map,r=new Map,n=new Map,i=new Map,a=new Map,s=new Map,l=new Set,d=new Set;if(S.forEach((function(t){l.add(t),d.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var p=e.alignmentConstraint.vertical,g=o((function(e){n.set("dummy"+e,[]),p[e].forEach((function(r){t.set(r,"dummy"+e),n.get("dummy"+e).push(r),S.has(r)&&l.add("dummy"+e)})),a.set("dummy"+e,h[c.get(p[e][0])])}),"_loop6"),f=0;f<p.length;f++)g(f);if(e.alignmentConstraint.horizontal)for(var m=e.alignmentConstraint.horizontal,y=o((function(t){i.set("dummy"+t,[]),m[t].forEach((function(e){r.set(e,"dummy"+t),i.get("dummy"+t).push(e),S.has(e)&&d.add("dummy"+t)})),s.set("dummy"+t,u[c.get(m[t][0])])}),"_loop7"),x=0;x<m.length;x++)y(x)}var T=new Map,_=new Map,E=o((function(e){A.get(e).forEach((function(n){var i=void 0,a=void 0;"horizontal"==n.direction?(i=t.get(e)?t.get(e):e,a=t.get(n.id)?{id:t.get(n.id),gap:n.gap,direction:n.direction}:n,T.has(i)?T.get(i).push(a):T.set(i,[a]),T.has(a.id)||T.set(a.id,[])):(i=r.get(e)?r.get(e):e,a=r.get(n.id)?{id:r.get(n.id),gap:n.gap,direction:n.direction}:n,_.has(i)?_.get(i).push(a):_.set(i,[a]),_.has(a.id)||_.set(a.id,[]))}))}),"_loop8"),C=!0,L=!1,N=void 0;try{for(var I,R=A.keys()[Symbol.iterator]();!(C=(I=R.next()).done);C=!0){E(I.value)}}catch(t){L=!0,N=t}finally{try{!C&&R.return&&R.return()}finally{if(L)throw N}}var M=w(T),D=w(_),O=b(M),P=b(D),B=k(T),$=k(_),F=[],z=[];O.forEach((function(t,e){F[e]=[],t.forEach((function(t){0==B.get(t).length&&F[e].push(t)}))})),P.forEach((function(t,e){z[e]=[],t.forEach((function(t){0==$.get(t).length&&z[e].push(t)}))}));var U=v(T,"horizontal",l,a,F),G=v(_,"vertical",d,s,z),q=o((function(t){n.get(t)?n.get(t).forEach((function(e){h[c.get(e)]=U.get(t)})):h[c.get(t)]=U.get(t)}),"_loop9"),j=!0,W=!1,Y=void 0;try{for(var H,V=U.keys()[Symbol.iterator]();!(j=(H=V.next()).done);j=!0){q(H.value)}}catch(t){W=!0,Y=t}finally{try{!j&&V.return&&V.return()}finally{if(W)throw Y}}var X=o((function(t){i.get(t)?i.get(t).forEach((function(e){u[c.get(e)]=G.get(t)})):u[c.get(t)]=G.get(t)}),"_loop10"),K=!0,Z=!1,Q=void 0;try{for(var J,tt=G.keys()[Symbol.iterator]();!(K=(J=tt.next()).done);K=!0){X(J.value)}}catch(t){Z=!0,Q=t}finally{try{!K&&tt.return&&tt.return()}finally{if(Z)throw Q}}}()}for(var rt=0;rt<d.length;rt++){var nt=d[rt];null==nt.getChild()&&nt.setCenter(h[c.get(nt.id)],u[c.get(nt.id)])}},t.exports=c},551:e=>{e.exports=t}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}return o(n,"__webpack_require__"),n(45)})()}))}}),CIt=l({"../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.31.0/node_modules/cytoscape-fcose/cytoscape-fcose.js"(t,e){o((function(r,n){"object"==typeof t&&"object"==typeof e?e.exports=n(EIt()):"function"==typeof define&&define.amd?define(["cose-base"],n):"object"==typeof t?t.cytoscapeFcose=n(EIt()):r.cytoscapeFcose=n(r.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,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return r.forEach((function(e){Object.keys(e).forEach((function(r){return t[r]=e[r]}))})),t}},548:(t,e,r)=>{var n=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(i)throw a}}return r}return o(t,"sliceIterator"),function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=r(140).layoutBase.LinkedList,a={getTopMostNodes:function(t){for(var e={},r=0;r<t.length;r++)e[t[r].id()]=!0;return t.filter((function(t,r){"number"==typeof t&&(t=r);for(var n=t.parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0}))},connectComponents:function(t,e,r,n){var a=new i,s=new Set,l=[],c=void 0,h=void 0,u=void 0,d=!1,p=1,g=[],f=[],m=o((function(){var n=t.collection();f.push(n);var i=r[0],m=t.collection();m.merge(i).merge(i.descendants().intersection(e)),l.push(i),m.forEach((function(t){a.push(t),s.add(t),n.merge(t)}));for(var y=o((function(){i=a.shift();var o=t.collection();i.neighborhood().nodes().forEach((function(t){e.intersection(i.edgesWith(t)).length>0&&o.merge(t)}));for(var h=0;h<o.length;h++){var u=o[h];if(null!=(c=r.intersection(u.union(u.ancestors())))&&!s.has(c[0]))c.union(c.descendants()).forEach((function(t){a.push(t),s.add(t),n.merge(t),r.has(t)&&l.push(t)}))}}),"_loop2");0!=a.length;)y();if(n.forEach((function(t){e.intersection(t.connectedEdges()).forEach((function(t){n.has(t.source())&&n.has(t.target())&&n.merge(t)}))})),l.length==r.length&&(d=!0),!d||d&&p>1){h=l[0],u=h.connectedEdges().length,l.forEach((function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,h=t)})),g.push(h.id());var v=t.collection();v.merge(l[0]),l.forEach((function(t){v.merge(t)})),l=[],r=r.difference(v),p++}}),"_loop");do{m()}while(!d);return n&&g.length>0&&n.set("dummy"+(n.size+1),g),f},relocateComponent:function(t,e,r){if(!r.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if("draft"==r.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=n(p,2),f=g[0],m=g[1],y=r.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;x<i&&(i=x),b>a&&(a=b),w<s&&(s=w),k>o&&(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 r=e[t],n=r.getRect().x,l=r.getRect().x+r.getRect().width,c=r.getRect().y,h=r.getRect().y+r.getRect().height;n<i&&(i=n),l>a&&(a=l),c<s&&(s=c),h>o&&(o=h)}));var E=t.x-(a+i)/2,C=t.y-(o+s)/2;Object.keys(e).forEach((function(t){var r=e[t];r.setCenter(r.getCenterX()+E,r.getCenterY()+C)}))}}},calcBoundingBox:function(t,e,r,n){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<p;g++){var f=d[g];i>(l=e[n.get(f.id())]-f.width()/2)&&(i=l),a<(c=e[n.get(f.id())]+f.width()/2)&&(a=c),s>(h=r[n.get(f.id())]-f.height()/2)&&(s=h),o<(u=r[n.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 r=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||r.merge(t)})),r}};t.exports=a},816:(t,e,r)=>{var n=r(548),i=r(140).CoSELayout,a=r(140).CoSENode,s=r(140).layoutBase.PointD,l=r(140).layoutBase.DimensionD,c=r(140).layoutBase.LayoutConstants,h=r(140).layoutBase.FDLayoutConstants,u=r(140).CoSEConstants,d=o((function(t,e){var r=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=o((function(t){return"function"==typeof t}),"isFn"),b=o((function(t,e){return x(t)?t(e):t}),"optFn"),w=n.calcParentsWithoutChildren(r,d),k=o((function t(e,r,i,o){for(var c=r.length,h=0;h<c;h++){var u=r[h],d=null;0==u.intersection(w).length&&(d=u.children());var p=void 0,g=u.layoutDimensions({nodeDimensionsIncludeLabels:o.nodeDimensionsIncludeLabels});if(null!=u.outerWidth()&&null!=u.outerHeight())if(o.randomize)if(u.isParent()){var x=n.calcBoundingBox(u,m,y,f);p=0==u.intersection(w).length?e.add(new a(i.graphManager,new s(x.topLeftX,x.topLeftY),new l(x.width,x.height))):e.add(new a(i.graphManager,new s(x.topLeftX,x.topLeftY),new l(parseFloat(g.w),parseFloat(g.h))))}else p=e.add(new a(i.graphManager,new s(m[f.get(u.id())]-g.w/2,y[f.get(u.id())]-g.h/2),new l(parseFloat(g.w),parseFloat(g.h))));else p=e.add(new a(i.graphManager,new s(u.position("x")-g.w/2,u.position("y")-g.h/2),new l(parseFloat(g.w),parseFloat(g.h))));else p=e.add(new a(this.graphManager));if(p.id=u.data("id"),p.nodeRepulsion=b(o.nodeRepulsion,u),p.paddingLeft=parseInt(u.css("padding")),p.paddingTop=parseInt(u.css("padding")),p.paddingRight=parseInt(u.css("padding")),p.paddingBottom=parseInt(u.css("padding")),o.nodeDimensionsIncludeLabels&&(p.labelWidth=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,p.labelHeight=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,p.labelPosVertical=u.css("text-valign"),p.labelPosHorizontal=u.css("text-halign")),v[u.data("id")]=p,isNaN(p.rect.x)&&(p.rect.x=0),isNaN(p.rect.y)&&(p.rect.y=0),null!=d&&d.length>0){t(i.getGraphManager().add(i.newGraph(),p),d,i,o)}}}),"processChildrenList"),T=o((function(e,r,n){for(var i=0,a=0,s=0;s<n.length;s++){var o=n[s],l=v[o.data("source")],c=v[o.data("target")];if(l&&c&&l!==c&&0==l.getEdgesBetween(c).length){var d=r.add(e.newEdge(),l,c);d.id=o.id(),d.idealLength=b(t.idealEdgeLength,o),d.edgeElasticity=b(t.edgeElasticity,o),i+=d.idealLength,a++}}null!=t.idealEdgeLength&&(a>0?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"),_=o((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(),n.getTopMostNodes(p),E,t),T(E,C,g),_(E,t),E.runLayout(),v}),"coseLayout");t.exports={coseLayout:d}},212:(t,e,r)=>{var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return o(t,"defineProperties"),function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(i,"_classCallCheck");var a=r(658),s=r(548),l=r(657).spectralLayout,c=r(816).coseLayout,h=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:o((function(t){return 4500}),"nodeRepulsion"),idealEdgeLength:o((function(t){return 50}),"idealEdgeLength"),edgeElasticity:o((function(t){return.45}),"edgeElasticity"),nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:o((function(){}),"ready"),stop:o((function(){}),"stop")}),u=function(){function t(e){i(this,t),this.options=a({},h,e)}return o(t,"Layout"),n(t,[{key:"run",value:o((function(){var t=this.options,e=t.cy,r=t.eles,n=[],i=[],a=void 0,h=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var u=void 0,d=!1;if(e.layoutUtilities&&t.packComponents&&((u=e.layoutUtilities("get"))||(u=e.layoutUtilities()),d=!0),r.nodes().length>0)if(d){var p=s.getTopMostNodes(t.eles.nodes());if((a=s.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,n.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,r){g.merge(t.nodes()[r]),e.isParent()||(m.nodeIndexes.set(t.nodes()[r].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),n.push(m);for(var x=y.length-1;x>=0;x--)a.splice(y[x],1),n.splice(y[x],1),h.splice(y[x],1)}}a.forEach((function(e,r){t.eles=e,i.push(c(t,n[r])),s.relocateComponent(h[r],i[r],t)}))}else a.forEach((function(e,r){s.relocateComponent(h[r],n[r],t)}));var b=new Set;if(a.length>1){var w=[],k=r.filter((function(t){return"none"==t.css("display")}));a.forEach((function(e,r){var a=void 0;if("draft"==t.quality&&(a=n[r].nodeIndexes),e.nodes().not(k).length>0){var o={edges:[],nodes:[]},l=void 0;e.nodes().not(k).forEach((function(e){if("draft"==t.quality)if(e.isParent()){var c=s.calcBoundingBox(e,n[r].xCoords,n[r].yCoords,a);o.nodes.push({x:c.topLeftX,y:c.topLeftY,width:c.width,height:c.height})}else l=a.get(e.id()),o.nodes.push({x:n[r].xCoords[l]-e.boundingbox().w/2,y:n[r].yCoords[l]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else i[r][e.id()]&&o.nodes.push({x:i[r][e.id()].getLeft(),y:i[r][e.id()].getTop(),width:i[r][e.id()].getWidth(),height:i[r][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=s.calcBoundingBox(l,n[r].xCoords,n[r].yCoords,a);d.push(g.topLeftX+g.width/2),d.push(g.topLeftY+g.height/2)}else d.push(n[r].xCoords[h]),d.push(n[r].yCoords[h]);if(c.isParent()){var f=s.calcBoundingBox(c,n[r].xCoords,n[r].yCoords,a);p.push(f.topLeftX+f.width/2),p.push(f.topLeftY+f.height/2)}else p.push(n[r].xCoords[u]),p.push(n[r].yCoords[u]);o.edges.push({startX:d[0],startY:d[1],endX:p[0],endY:p[1]})}else i[r][l.id()]&&i[r][c.id()]&&o.edges.push({startX:i[r][l.id()].getCenterX(),startY:i[r][l.id()].getCenterY(),endX:i[r][c.id()].getCenterX(),endY:i[r][c.id()].getCenterY()})})),o.nodes.length>0&&(w.push(o),b.add(r))}}));var T=u.packComponents(w,t.randomize).shifts;if("draft"==t.quality)n.forEach((function(t,e){var r=t.xCoords.map((function(t){return t+T[e].dx})),n=t.yCoords.map((function(t){return t+T[e].dy}));t.xCoords=r,t.yCoords=n}));else{var _=0;b.forEach((function(t){Object.keys(i[t]).forEach((function(e){var r=i[t][e];r.setCenter(r.getCenterX()+T[_].dx,r.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);n.push(C)}"default"==t.quality||"proof"==t.quality?(i.push(c(t,n[0])),s.relocateComponent(h[0],i[0],t)):s.relocateComponent(h[0],n[0],t)}var S=o((function(e,r){if("default"==t.quality||"proof"==t.quality){"number"==typeof e&&(e=r);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 n.forEach((function(t){var r=t.nodeIndexes.get(e.id());null!=r&&(l={x:t.xCoords[r],y:t.yCoords[r]})})),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=s.calcParentsWithoutChildren(e,r),L=r.filter((function(t){return"none"==t.css("display")}));t.eles=r.not(L),r.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,r)=>{var n=r(548),i=r(140).layoutBase.Matrix,a=r(140).layoutBase.SVD,s=o((function(t){var e=t.cy,r=t.eles,s=r.nodes(),l=r.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=o((function(){for(var t=0,e=0,r=!1;e<C;){t=Math.floor(Math.random()*b),r=!1;for(var n=0;n<e;n++)if(f[n]==t){r=!0;break}r||(f[e]=t,e++)}}),"randomSampleCR"),A=o((function(t,e,r){for(var n=[],i=0,a=0,s=0,o=void 0,l=[],c=0,u=1,p=0;p<b;p++)l[p]=w;for(n[a]=t,l[t]=0;a>=i;){s=n[i++];for(var g=d[s],f=0;f<g.length;f++)l[o=h.get(g[f])]==w&&(l[o]=l[s]+1,n[++a]=o);y[s][e]=l[s]*E}if(r){for(var v=0;v<b;v++)y[v][e]<m[v]&&(m[v]=y[v][e]);for(var x=0;x<b;x++)m[x]>c&&(c=m[x],u=x)}return u}),"BFS"),L=o((function(t){var e=void 0;if(t){e=Math.floor(Math.random()*b);for(var r=0;r<b;r++)m[r]=w;for(var n=0;n<C;n++)f[n]=e,e=A(e,n,t)}else{S();for(var i=0;i<C;i++)A(f[i],i,t,!1)}for(var a=0;a<b;a++)for(var s=0;s<C;s++)y[a][s]*=y[a][s];for(var o=0;o<C;o++)v[o]=[];for(var l=0;l<C;l++)for(var c=0;c<C;c++)v[l][c]=y[f[c]][l]}),"allBFS"),N=o((function(){for(var t=a.svd(v),e=t.S,r=t.U,n=t.V,s=e[0]*e[0]*e[0],o=[],l=0;l<C;l++){o[l]=[];for(var c=0;c<C;c++)o[l][c]=0,l==c&&(o[l][c]=e[l]/(e[l]*e[l]+s/(e[l]*e[l])))}x=i.multMat(i.multMat(n,o),i.transpose(r))}),"sample"),I=o((function(){for(var t=void 0,e=void 0,r=[],n=[],a=[],s=[],o=0;o<b;o++)r[o]=Math.random(),n[o]=Math.random();r=i.normalize(r),n=i.normalize(n);for(var l=k,c=k,h=void 0;;){for(var u=0;u<b;u++)a[u]=r[u];if(r=i.multGamma(i.multL(i.multGamma(a),y,x)),t=i.dotProduct(a,r),r=i.normalize(r),l=i.dotProduct(a,r),(h=Math.abs(l/c))<=1+T&&h>=1)break;c=l}for(var d=0;d<b;d++)a[d]=r[d];for(c=k;;){for(var f=0;f<b;f++)s[f]=n[f];if(s=i.minusOp(s,i.multCons(a,i.dotProduct(a,s))),n=i.multGamma(i.multL(i.multGamma(s),y,x)),e=i.dotProduct(s,n),n=i.normalize(n),l=i.dotProduct(s,n),(h=Math.abs(l/c))<=1+T&&h>=1)break;c=l}for(var m=0;m<b;m++)s[m]=n[m];p=i.multCons(a,Math.sqrt(Math.abs(t))),g=i.multCons(s,Math.sqrt(Math.abs(e)))}),"powerIteration");n.connectComponents(e,r,n.getTopMostNodes(s),c),l.forEach((function(t){n.connectComponents(e,r,n.getTopMostNodes(t.descendants().intersection(r)),c)}));for(var R=0,M=0;M<s.length;M++)s[M].isParent()||h.set(s[M].id(),R++);var D=!0,O=!1,P=void 0;try{for(var B,$=c.keys()[Symbol.iterator]();!(D=(B=$.next()).done);D=!0){var F=B.value;h.set(F,R++)}}catch(t){O=!0,P=t}finally{try{!D&&$.return&&$.return()}finally{if(O)throw P}}for(var z=0;z<h.size;z++)d[z]=[];l.forEach((function(t){for(var e=t.children().intersection(r);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(r);var n=0,i=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach((function(t,e){t.connectedEdges().length<i&&(i=t.connectedEdges().length,n=e)})),u.set(t.id(),e.nodes(":childless")[n].id())})),s.forEach((function(t){var e=void 0;e=t.isParent()?h.get(u.get(t.id())):h.get(t.id()),t.neighborhood().nodes().forEach((function(n){r.intersection(t.edgesWith(n)).length>0&&(n.isParent()?d[e].push(u.get(n.id())):d[e].push(n.id()))}))}));var U=o((function(t){var r=h.get(t),n=void 0;c.get(t).forEach((function(i){n=e.getElementById(i).isParent()?u.get(i):i,d[r].push(n),d[h.get(n)].push(t)}))}),"_loop"),G=!0,q=!1,j=void 0;try{for(var W,Y=c.keys()[Symbol.iterator]();!(G=(W=Y.next()).done);G=!0){U(W.value)}}catch(t){q=!0,j=t}finally{try{!G&&Y.return&&Y.return()}finally{if(q)throw j}}var H=void 0;if((b=h.size)>2){C=b<t.sampleSize?b:t.sampleSize;for(var V=0;V<b;V++)y[V]=[];for(var X=0;X<C;X++)x[X]=[];return"draft"==t.quality||"all"==t.step?(L(_),N(),I(),H={nodeIndexes:h,xCoords:p,yCoords:g}):(h.forEach((function(t,r){p.push(e.getElementById(r).position("x")),g.push(e.getElementById(r).position("y"))})),H={nodeIndexes:h,xCoords:p,yCoords:g}),H}var K=h.keys(),Z=e.getElementById(K.next().value),Q=Z.position(),J=Z.outerWidth();if(p.push(Q.x),g.push(Q.y),2==b){var tt=e.getElementById(K.next().value).outerWidth();p.push(Q.x+J/2+tt/2+t.idealEdgeLength),g.push(Q.y)}return H={nodeIndexes:h,xCoords:p,yCoords:g}}),"spectralLayout");t.exports={spectralLayout:s}},579:(t,e,r)=>{var n=r(212),i=o((function(t){t&&t("layout","fcose",n)}),"register");"undefined"!=typeof cytoscape&&i(cytoscape),t.exports=i},140:e=>{e.exports=t}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={exports:{}};return e[t](a,a.exports,n),a.exports}return o(n,"__webpack_require__"),n(579)})()}))}}),SIt={L:"left",R:"right",T:"top",B:"bottom"},AIt={L:o((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:o((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:o((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:o((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")},LIt={L:o(((t,e)=>t-e+2),"L"),R:o(((t,e)=>t-2),"R"),T:o(((t,e)=>t-e+2),"T"),B:o(((t,e)=>t-2),"B")},NIt=o((function(t){return RIt(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),IIt=o((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),RIt=o((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),MIt=o((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),DIt=o((function(t,e){const r=RIt(t)&&MIt(e),n=MIt(t)&&RIt(e);return r||n}),"isArchitectureDirectionXY"),OIt=o((function(t){const e=t[0],r=t[1],n=RIt(e)&&MIt(r),i=MIt(e)&&RIt(r);return n||i}),"isArchitecturePairXY"),PIt=o((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),BIt=o((function(t,e){const r=`${t}${e}`;return PIt(r)?r:void 0}),"getArchitectureDirectionPair"),$It=o((function([t,e],r){const n=r[0],i=r[1];return RIt(n)?MIt(i)?[t+("L"===n?-1:1),e+("T"===i?1:-1)]:[t+("L"===n?-1:1),e]:RIt(i)?[t+("L"===i?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),FIt=o((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),zIt=o((function(t,e){return DIt(t,e)?"bend":RIt(t)?"horizontal":"vertical"}),"getArchitectureDirectionAlignment"),UIt=o((function(t){return"service"===t.type}),"isArchitectureService"),GIt=o((function(t){return"junction"===t.type}),"isArchitectureJunction"),qIt=o((t=>t.data()),"edgeData"),jIt=o((t=>t.data()),"nodeData"),WIt=Lt.architecture,YIt=new NX((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:WIt,dataStructures:void 0,elements:{}}))),HIt=o((()=>{YIt.reset(),qr()}),"clear"),VIt=o((function({id:t,icon:e,in:r,title:n,iconText:i}){if(void 0!==YIt.records.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${YIt.records.registeredIds[t]}`);if(void 0!==r){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===YIt.records.registeredIds[r])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===YIt.records.registeredIds[r])throw new Error(`The service [${t}]'s parent is not a group`)}YIt.records.registeredIds[t]="node",YIt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}}),"addService"),XIt=o((()=>Object.values(YIt.records.nodes).filter(UIt)),"getServices"),KIt=o((function({id:t,in:e}){YIt.records.registeredIds[t]="node",YIt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction"),ZIt=o((()=>Object.values(YIt.records.nodes).filter(GIt)),"getJunctions"),QIt=o((()=>Object.values(YIt.records.nodes)),"getNodes"),JIt=o((t=>YIt.records.nodes[t]),"getNode"),tRt=o((function({id:t,icon:e,in:r,title:n}){if(void 0!==YIt.records.registeredIds[t])throw new Error(`The group id [${t}] is already in use by another ${YIt.records.registeredIds[t]}`);if(void 0!==r){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===YIt.records.registeredIds[r])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===YIt.records.registeredIds[r])throw new Error(`The group [${t}]'s parent is not a group`)}YIt.records.registeredIds[t]="group",YIt.records.groups[t]={id:t,icon:e,title:n,in:r}}),"addGroup"),eRt=o((()=>Object.values(YIt.records.groups)),"getGroups"),rRt=o((function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!IIt(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!IIt(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(void 0===YIt.records.nodes[t]&&void 0===YIt.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===YIt.records.nodes[e]&&void 0===YIt.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=YIt.records.nodes[t].in,h=YIt.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:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:o,title:l};YIt.records.edges.push(u),YIt.records.nodes[t]&&YIt.records.nodes[e]&&(YIt.records.nodes[t].edges.push(YIt.records.edges[YIt.records.edges.length-1]),YIt.records.nodes[e].edges.push(YIt.records.edges[YIt.records.edges.length-1]))}),"addEdge"),nRt=o((()=>YIt.records.edges),"getEdges"),iRt=o((()=>{if(void 0===YIt.records.dataStructures){const t={},e=Object.entries(YIt.records.nodes).reduce(((e,[r,n])=>(e[r]=n.edges.reduce(((e,n)=>{const i=JIt(n.lhsId)?.in,a=JIt(n.rhsId)?.in;if(i&&a&&i!==a){const e=zIt(n.lhsDir,n.rhsDir);"bend"!==e&&(t[i]??={},t[i][a]=e,t[a]??={},t[a][i]=e)}if(n.lhsId===r){const t=BIt(n.lhsDir,n.rhsDir);t&&(e[t]=n.rhsId)}else{const t=BIt(n.rhsDir,n.lhsDir);t&&(e[t]=n.lhsId)}return e}),{}),e)),{}),r=Object.keys(e)[0],n={[r]:1},i=Object.keys(e).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{}),a=o((t=>{const r={[t]:[0,0]},a=[t];for(;a.length>0;){const t=a.shift();if(t){n[t]=1,delete i[t];const s=e[t],[o,l]=r[t];Object.entries(s).forEach((([t,e])=>{n[e]||(r[e]=$It([o,l],t),a.push(e))}))}}return r}),"BFS"),s=[a(r)];for(;Object.keys(i).length>0;)s.push(a(Object.keys(i)[0]));YIt.records.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return YIt.records.dataStructures}),"getDataStructures"),aRt=o(((t,e)=>{YIt.records.elements[t]=e}),"setElementForId"),sRt=o((t=>YIt.records.elements[t]),"getElementById"),oRt={clear:HIt,setDiagramTitle:Vr,getDiagramTitle:Xr,setAccTitle:jr,getAccTitle:Wr,setAccDescription:Yr,getAccDescription:Hr,addService:VIt,getServices:XIt,addJunction:KIt,getJunctions:ZIt,getNodes:QIt,getNode:JIt,addGroup:tRt,getGroups:eRt,addEdge:rRt,getEdges:nRt,setElementForId:aRt,getElementById:sRt,getDataStructures:iRt};function lRt(t){const e=Qr().architecture;return e?.[t]?e[t]:WIt[t]}o(lRt,"getConfigField");var cRt=o(((t,e)=>{IX(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"),hRt={parse:o((async t=>{const e=await Tet("architecture",t);y.debug(e),cRt(e,oRt)}),"parse")},uRt=o((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"),dRt=p(CIt(),1),pRt=o((t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`),"wrapIcon"),gRt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:pRt('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:pRt('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:pRt('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:pRt('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:pRt('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:By,blank:{body:pRt("")}}},fRt=o((async function(t,e){const r=lRt("padding"),n=lRt("iconSize"),i=n/2,a=n/6,s=a/2;await Promise.all(e.edges().map((async e=>{const{source:n,sourceDir:o,sourceArrow:l,sourceGroup:c,target:h,targetDir:u,targetArrow:d,targetGroup:p,label:g}=qIt(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=r+4;if(c&&(RIt(o)?f+="L"===o?-w:w:m+="T"===o?-w:w+18),p&&(RIt(u)?x+="L"===u?-w:w:b+="T"===u?-w:w+18),c||"junction"!==oRt.getNode(n)?.type||(RIt(o)?f+="L"===o?i:-i:m+="T"===o?i:-i),p||"junction"!==oRt.getNode(h)?.type||(RIt(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=RIt(o)?LIt[o](f,a):f-s,r=MIt(o)?LIt[o](m,a):m-s;e.insert("polygon").attr("points",AIt[o](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(d){const t=RIt(u)?LIt[u](x,a):x-s,r=MIt(u)?LIt[u](b,a):b-s;e.insert("polygon").attr("points",AIt[u](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(g){const t=DIt(o,u)?"XY":RIt(o)?"X":"Y";let r=0;r="X"===t?Math.abs(f-x):"Y"===t?Math.abs(m-b)/1.5:Math.abs(f-x)/2;const n=e.append("g");if(await v_(n,g,{useHtmlLabels:!1,width:r,classes:"architecture-service-label"},Qr()),n.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)n.attr("transform","translate("+y+", "+v+")");else if("Y"===t)n.attr("transform","translate("+y+", "+v+") rotate(-90)");else if("XY"===t){const t=BIt(o,u);if(t&&OIt(t)){const e=n.node().getBoundingClientRect(),[r,i]=FIt(t);n.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*r*i*45})`);const a=n.node().getBoundingClientRect();n.attr("transform",`\n translate(${y}, ${v-e.height/2})\n translate(${r*a.width/2}, ${i*a.height/2})\n rotate(${-1*r*i*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges"),mRt=o((async function(t,e){const r=.75*lRt("padding"),n=lRt("fontSize"),i=lRt("iconSize")/2;await Promise.all(e.nodes().map((async e=>{const a=jIt(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(`<g>${await Gy(a.icon,{height:r,width:r,fallbackPrefix:gRt.prefix})}</g>`),t.attr("transform","translate("+(u+i+1)+", "+(d+i+1)+")"),u+=r,d+=n/2-1-2}if(a.label){const t=h.append("g");await v_(t,a.label,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},Qr()),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"),yRt=o((async function(t,e,r){for(const n of r){const r=e.append("g"),i=lRt("iconSize");if(n.title){const t=r.append("g");await v_(t,n.title,{useHtmlLabels:!1,width:1.5*i,classes:"architecture-service-label"},Qr()),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=r.append("g");if(n.icon)a.html(`<g>${await Gy(n.icon,{height:i,width:i,fallbackPrefix:gRt.prefix})}</g>`);else if(n.iconText){a.html(`<g>${await Gy("blank",{height:i,width:i,fallbackPrefix:gRt.prefix})}</g>`);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(n.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-"+n.id).attr("d",`M0 ${i} v${-i} q0,-5 5,-5 h${i} q5,0 5,5 v${i} H0 Z`);r.attr("class","architecture-service");const{width:s,height:o}=r._groups[0][0].getBBox();n.width=s,n.height=o,t.setElementForId(n.id,r)}return 0}),"drawServices"),vRt=o((function(t,e,r){r.forEach((r=>{const n=e.append("g"),i=lRt("iconSize");n.append("g").append("rect").attr("id","node-"+r.id).attr("fill-opacity","0").attr("width",i).attr("height",i),n.attr("class","architecture-junction");const{width:a,height:s}=n._groups[0][0].getBBox();n.width=a,n.height=s,t.setElementForId(r.id,n)}))}),"drawJunctions");function xRt(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:lRt("iconSize"),height:lRt("iconSize")},classes:"node-service"})}))}function bRt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:lRt("iconSize"),height:lRt("iconSize")},classes:"node-junction"})}))}function wRt(t,e){e.nodes().map((e=>{const r=jIt(e);if("group"===r.type)return;r.x=e.position().x,r.y=e.position().y;t.getElementById(r.id).attr("transform","translate("+(r.x||0)+","+(r.y||0)+")")}))}function kRt(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 TRt(t,e){t.forEach((t=>{const{lhsId:r,rhsId:n,lhsInto:i,lhsGroup:a,rhsInto:s,lhsDir:o,rhsDir:l,rhsGroup:c,title:h}=t,u=DIt(t.lhsDir,t.rhsDir)?"segments":"straight",d={id:`${r}-${n}`,label:h,source:r,sourceDir:o,sourceArrow:i,sourceGroup:a,sourceEndpoint:"L"===o?"0 50%":"R"===o?"100% 50%":"T"===o?"50% 0":"50% 100%",target:n,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 _Rt(t,e,r){const n=o(((t,e)=>Object.entries(t).reduce(((t,[n,i])=>{let a=0;const s=Object.entries(i);if(1===s.length)return t[n]=s[0][1],t;for(let i=0;i<s.length-1;i++)for(let o=i+1;o<s.length;o++){const[l,c]=s[i],[h,u]=s[o],d=r[l]?.[h];if(d===e)t[n]??=[],t[n]=[...t[n],...c,...u];else if("default"===l||"default"===h)t[n]??=[],t[n]=[...t[n],...c,...u];else{t[`${n}-${a++}`]=c;t[`${n}-${a++}`]=u}}return t}),{})),"flattenAlignments"),i=e.map((e=>{const r={},i={};return Object.entries(e).forEach((([e,[n,a]])=>{const s=t.getNode(e)?.in??"default";r[a]??={},r[a][s]??=[],r[a][s].push(e),i[n]??={},i[n][s]??=[],i[n][s].push(e)})),{horiz:Object.values(n(r,"horizontal")).filter((t=>t.length>1)),vert:Object.values(n(i,"vertical")).filter((t=>t.length>1))}})),[a,s]=i.reduce((([t,e],{horiz:r,vert:n})=>[[...t,...r],[...e,...n]]),[[],[]]);return{horizontal:a,vertical:s}}function ERt(t){const e=[],r=o((t=>`${t[0]},${t[1]}`),"posToStr"),n=o((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const i=Object.fromEntries(Object.entries(t).map((([t,e])=>[r(e),t]))),a=[r([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=n(t);Object.entries(o).forEach((([t,n])=>{const o=r([c[0]+n[0],c[1]+n[1]]),h=i[o];h&&!s[o]&&(a.push(o),e.push({[SIt[t]]:h,[SIt[NIt(t)]]:l,gap:1.5*lRt("iconSize")}))}))}}}})),e}function CRt(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise((l=>{const c=Ga("body").append("div").attr("id","cy").attr("style","display:none"),h=HEt({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":`${lRt("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:`${lRt("padding")}px`}}]});c.remove(),kRt(r,h),xRt(t,h),bRt(e,h),TRt(n,h);const u=_Rt(i,a,s),d=ERt(a),p=h.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[e,r]=t.connectedNodes(),{parent:n}=jIt(e),{parent:i}=jIt(r);return n===i?1.5*lRt("iconSize"):.5*lRt("iconSize")},edgeElasticity(t){const[e,r]=t.connectedNodes(),{parent:n}=jIt(e),{parent:i}=jIt(r);return n===i?.45:.001},alignmentConstraint:u,relativePlacementConstraint:d});p.one("layoutstop",(()=>{function t(t,e,r,n){let i,a;const{x:s,y:o}=t,{x:l,y:c}=e;a=(n-o+(s-r)*(o-c)/(s-l))/Math.sqrt(1+Math.pow((o-c)/(s-l),2)),i=Math.sqrt(Math.pow(n-o,2)+Math.pow(r-s,2)-Math.pow(a,2));i/=Math.sqrt(Math.pow(l-s,2)+Math.pow(c-o,2));let h=(l-s)*(n-o)-(c-o)*(r-s);switch(!0){case h>=0:h=1;break;case h<0:h=-1}let u=(l-s)*(r-s)+(c-o)*(n-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}}o(t,"getSegmentWeights"),h.startBatch();for(const e of Object.values(h.edges()))if(e.data?.()){const{x:r,y:n}=e.source().position(),{x:i,y:a}=e.target().position();if(r!==i&&n!==a){const r=e.sourceEndpoint(),n=e.targetEndpoint(),{sourceDir:i}=qIt(e),[a,s]=MIt(i)?[r.x,n.y]:[n.x,r.y],{weights:o,distances:l}=t(r,n,a,s);e.style("segment-distances",l),e.style("segment-weights",o)}}h.endBatch(),p.run()})),p.run(),h.ready((t=>{y.info("Ready",t),l(h)}))}))}zy([{name:gRt.prefix,icons:gRt}]),HEt.use(dRt.default),o(xRt,"addServices"),o(bRt,"addJunctions"),o(wRt,"positionNodes"),o(kRt,"addGroups"),o(TRt,"addEdges"),o(_Rt,"getAlignments"),o(ERt,"getRelativeConstraints"),o(CRt,"layoutArchitecture");var SRt=o((async(t,e,r,n)=>{const i=n.db,a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),c=i.getDataStructures(),h=ag(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 yRt(i,d,a),vRt(i,d,s);const g=await CRt(a,s,o,l,i,c);await fRt(u,g),await mRt(p,g),wRt(i,g),Mr(void 0,h,lRt("padding"),lRt("useMaxWidth"))}),"draw"),ARt={parser:hRt,db:oRt,renderer:{draw:SRt},styles:uRt},LRt=Object.freeze({__proto__:null,diagram:ARt}),NRt=Object.freeze({__proto__:null,InfoModule:Uet,createInfoServices:Get}),IRt=Object.freeze({__proto__:null,PacketModule:jet,createPacketServices:Wet}),RRt=Object.freeze({__proto__:null,PieModule:Aet,createPieServices:Let}),MRt=Object.freeze({__proto__:null,ArchitectureModule:Ret,createArchitectureServices:Met}),DRt=Object.freeze({__proto__:null,GitGraphModule:Oet,createGitGraphServices:Pet}),ORt=Object.freeze({__proto__:null,RadarModule:$et,createRadarServices:Fet});return()=>HI}));