@haibun/web-playwright 1.64.0 → 1.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/BrowserFactory.js +4 -4
- package/build/BrowserFactory.js.map +1 -1
- package/build/PlaywrightEvents.js +1 -1
- package/build/PlaywrightEvents.js.map +1 -1
- package/build/cycles.js +3 -3
- package/build/cycles.js.map +1 -1
- package/build/monitor/artifactDisplays/HtmlArtifactDisplay.d.ts.map +1 -1
- package/build/monitor/artifactDisplays/HtmlArtifactDisplay.js +1 -5
- package/build/monitor/artifactDisplays/HtmlArtifactDisplay.js.map +1 -1
- package/build/monitor/artifactDisplays/SequenceDiagramGenerator.d.ts.map +1 -1
- package/build/monitor/artifactDisplays/SequenceDiagramGenerator.js +5 -5
- package/build/monitor/artifactDisplays/SequenceDiagramGenerator.js.map +1 -1
- package/build/monitor/messages.d.ts +2 -3
- package/build/monitor/messages.d.ts.map +1 -1
- package/build/monitor/messages.js +43 -33
- package/build/monitor/messages.js.map +1 -1
- package/build/web-playwright.js +2 -2
- package/build/web-playwright.js.map +1 -1
- package/package.json +3 -3
- package/web/monitor.html +20 -20
package/web/monitor.html
CHANGED
|
@@ -409,8 +409,8 @@
|
|
|
409
409
|
align-items: baseline;
|
|
410
410
|
}
|
|
411
411
|
</style>
|
|
412
|
-
<script type="module" crossorigin>var CY=Object.defineProperty;var AY=(t,e,r)=>e in t?CY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var xt=(t,e,r)=>AY(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Hc;(function(t){t.INIT="INIT",t.EXECUTION_START="EXECUTION_START",t.FEATURE_START="FEATURE_START",t.SCENARIO_START="SCENARIO_START",t.STEP_START="STEP_START",t.STEP_NEXT="STEP_NEXT",t.ACTION="ACTION",t.TRACE="TRACE",t.STEP_END="STEP_END",t.SCENARIO_END="SCENARIO_END",t.FEATURE_END="FEATURE_END",t.EXECUTION_END="EXECUTION_END",t.ON_FAILURE="ON_FAILURE"})(Hc||(Hc={}));function QN(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pm(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return t.length===0?!0:t.every(e=>typeof e!="object"||e===null);{const e=Object.keys(t);return e.length===0?!0:e.every(r=>typeof t[r]!="object"||t[r]===null)}}function Ev(t,e){return e==="html"?"<html>":typeof t=="string"?JSON.stringify(t):t===null?"null":String(t)}function o7(t){return Array.isArray(t)?`[${t.map(e=>Ev(e)).join(", ")}]`:typeof t=="object"&&t!==null?`{ ${Object.entries(t).map(([r,n])=>{let i=Ev(n,r);return r==="html"&&(i=QN(i)),`"${r}": ${i}`}).join(", ")} }`:String(t)}function JN(t){const e=document.createElement("span");if(e.className="simple-aggregate-inline",Array.isArray(t))e.appendChild(document.createTextNode("[")),t.forEach((r,n)=>{e.appendChild(kv(r)),n<t.length-1&&e.appendChild(document.createTextNode(", "))}),e.appendChild(document.createTextNode("]"));else if(typeof t=="object"&&t!==null){e.appendChild(document.createTextNode("{ "));const r=Object.keys(t);r.forEach((n,i)=>{const a=document.createElement("span");a.className="key inline-key",a.textContent=`"${n}": `,e.appendChild(a),e.appendChild(kv(t[n],n)),i<r.length-1&&e.appendChild(document.createTextNode(", "))}),e.appendChild(document.createTextNode(" }"))}return e}function b6(t){if(typeof t!="object"||t===null){const e=document.createElement("div");return e.className="json-root-primitive",e.appendChild(kv(t)),e.dataset.rawJson=JSON.stringify(t),e}if(pm(t)){const e=document.createElement("div");return e.className="json-root-simple-aggregate",e.appendChild(JN(t)),e.dataset.rawJson=JSON.stringify(t),e}else{const e=document.createElement("div");return e.className="json-root-complex",e.dataset.rawJson=JSON.stringify(t),Array.isArray(t)?t.forEach((n,i)=>{Sv(i,n,!0,e,0,void 0)}):Object.keys(t).forEach(n=>{Sv(n,t[n],!1,e,0,void 0)}),e}}function Sv(t,e,r,n,i=0,a){const s=typeof e!="object"||e===null;if(s){const o=document.createElement("div");o.className="json-line primitive-kv";let l=0;i===1?l=20:i>1&&(l=20+(i-1)*15),o.style.marginLeft=`${l}px`;const u=document.createElement("span");u.className=r?"key index":"key",u.textContent=r?`[${t}]: `:`${t}: `,o.appendChild(u);let h=!1;if(s&&(t==="in"&&typeof e=="string"||t==="named"||a==="named"||a==="namedWithVars")&&(h=!0),h){const d=document.createElement("textarea");d.classList.add("expanded-value-textarea"),d.value=String(e);let f="root";n.parentElement&&n.parentElement.tagName==="DETAILS"&&(f=_Y(n.parentElement));const p=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");d.id=`textarea-${f}-${p}`,d.rows=1;const g=v=>{let y=document.getElementById("autogrow-helper");y||(y=document.createElement("div"),y.id="autogrow-helper",y.style.position="absolute",y.style.left="-9999px",y.style.top="0",y.style.visibility="hidden",y.style.pointerEvents="none",document.body.appendChild(y));const b=window.getComputedStyle(v);y.style.font=b.font,y.style.letterSpacing=b.letterSpacing,y.style.paddingTop=b.paddingTop,y.style.paddingRight=b.paddingRight,y.style.paddingBottom=b.paddingBottom,y.style.paddingLeft=b.paddingLeft,y.style.borderTopWidth=b.borderTopWidth,y.style.borderRightWidth=b.borderRightWidth,y.style.borderBottomWidth=b.borderBottomWidth,y.style.borderLeftWidth=b.borderLeftWidth,y.style.borderStyle=b.borderStyle,y.style.boxSizing="border-box",y.style.lineHeight=b.lineHeight,y.style.whiteSpace="nowrap",y.style.width="auto",y.textContent=v.value||" ";let w=y.scrollWidth;w+=2,v.style.width=w+"px"},m=v=>{v.style.height="auto",v.style.height=v.scrollHeight+"px"};d.addEventListener("input",()=>m(d)),o.appendChild(d),o.classList.add("line-with-textarea"),n.appendChild(o),requestAnimationFrame(()=>{g(d)})}else o.appendChild(kv(e,t)),n.appendChild(o)}else if(!(t==="named"||t==="namedWithVars")&&pm(e)){const l=document.createElement("div");l.className="json-line simple-aggregate-kv";let u=0;i===1?u=20:i>1&&(u=20+(i-1)*15),l.style.marginLeft=`${u}px`;const h=document.createElement("span");h.className=r?"key index":"key",h.textContent=r?`[${t}]: `:`${t}: `,l.appendChild(h),l.appendChild(JN(e)),n.appendChild(l)}else{const l=document.createElement("details");l.className=(r?"json-array-item":"json-object-item")+" expandable";let u=0;i===1?u=20:i>1&&(u=20+(i-1)*15),l.style.marginLeft=`${u}px`,l.open=!1;const h=document.createElement("summary"),d=document.createElement("span"),f=document.createElement("span");f.className=r?"key index":"key",f.textContent=r?`[${String(t)}]: `:`${String(t)}: `,d.appendChild(f);const p=document.createElement("span");p.className="children-summary-inline";const g=[];Array.isArray(e)?e.forEach((v,y)=>{const b=String(y);typeof v!="object"||v===null?g.push(`{${b}: ${Ev(v,y)}}`):pm(v)?g.push(`{${b}: ${o7(v)}}`):g.push(`<span class="complex-child-marker">+${b}</span>`)}):Object.entries(e).forEach(([v,y])=>{if(typeof y!="object"||y===null){let w=Ev(y,v);v==="html"&&(w=QN(w)),g.push(`{${v}: ${w}}`)}else pm(y)?g.push(`{${v}: ${o7(y)}}`):g.push(`<span class="complex-child-marker">+${v}</span>`)}),p.innerHTML=g.join(", "),d.appendChild(p),h.appendChild(d),l.appendChild(h);const m=document.createElement("div");m.className="details-content",Array.isArray(e)?e.forEach((v,y)=>{Sv(y,v,!0,m,i+1,t)}):Object.entries(e).forEach(([v,y])=>{Sv(v,y,!1,m,i+1,t)}),l.appendChild(m),l.addEventListener("toggle",()=>{l.open?p.classList.add("hidden"):p.classList.remove("hidden")}),l.open?p.classList.add("hidden"):p.classList.remove("hidden"),n.appendChild(l)}}function _Y(t){var r,n,i;const e=[];for(;t&&t.parentElement&&!t.classList.contains("json-root-complex");){const a=t.querySelector(":scope > summary > span > .key");let s=((r=a==null?void 0:a.textContent)==null?void 0:r.replace(/: $/,""))||"item";t.classList.contains("json-array-item")&&(s=((i=(n=t.querySelector(":scope > summary > span > .key.index"))==null?void 0:n.textContent)==null?void 0:i.replace(/[[\]:]/g,""))||"index"),e.unshift(s),t=t.parentElement.closest("details, .json-root-complex")}return e.join("-")}function kv(t,e){const r=document.createElement("span");r.classList.add("value");let n,i=typeof t;return e==="html"?(n="<html>",i="html"):t===null?(i="null",n="<null>"):i==="string"?n=JSON.stringify(t):i==="undefined"?n="undefined":n=String(t),r.classList.add(`value-${i}`),r.textContent=n,r}class rf{constructor(e,r){xt(this,"element");if(this.element=document.createElement(e),r){const n=Array.isArray(r)?r:[r];this.element.classList.add(...n)}}append(e){this.element.appendChild(e instanceof rf?e.element:e)}addClass(e){this.element.classList.add(e)}setData(e,r){this.element.dataset[e]=r}setHtml(e){this.element.innerHTML=e}setText(e){this.element.textContent=e}}class jl{constructor(e){xt(this,"label");this.artifact=e,this.label=this.deriveLabel()}deriveLabel(){return this.artifact.artifactType}get artifactType(){return this.artifact.artifactType}}class LY extends jl{constructor(r){super(r);xt(this,"placementTarget","details")}render(r){const n=this.artifact;try{const i=b6(n.json);if(r.innerHTML="",i){const a=document.createElement("pre");a.classList.add("haibun-message-details-json"),a.appendChild(i),r.appendChild(a)}}catch(i){console.error("Error rendering JSON artifact:",i),r.innerHTML=`<p class="haibun-artifact-error">Error rendering JSON: ${i.message}</p>`}}}class RY extends jl{constructor(r){super(r);xt(this,"placementTarget","details");this.artifact=r}render(r){r.innerHTML="";const n=document.createElement("iframe");n.style.border="none",n.style.width="100%",n.style.height="80vh","html"in this.artifact&&typeof this.artifact.html=="string"?n.srcdoc=this.artifact.html:"path"in this.artifact&&typeof this.artifact.path=="string"?(console.warn(`HtmlArtifactDisplay received artifact with path: ${this.artifact.path}. This display expects direct HTML content.`),n.srcdoc='<p class="haibun-artifact-error">Error: Artifact is a path, but direct HTML content was expected.</p>'):n.srcdoc='<p class="haibun-artifact-error">Error: HTML content not available or in an unexpected format.</p>',r.appendChild(n)}}class NY extends jl{constructor(r){super(r);xt(this,"placementTarget","details");this.artifact=r}render(r){const n=document.createElement("img");n.alt="Screen capture artifact",n.src=this.artifact.path,r.replaceChildren(n)}}class DY extends jl{constructor(r){super(r);xt(this,"placementTarget");this.artifact=r,this.placementTarget=document.querySelector("#haibun-focus")?"haibun-focus":"details",this.placementTarget==="details"&&console.info("Cannot find #haibun-video container; video will be appended to details on toggle.")}render(r){const n=document.createElement("video");n.controls=!0,n.style.width="320px",n.src=this.artifact.path,r.replaceChildren(n)}}class IY extends jl{constructor(r){super(r);xt(this,"placementTarget","details");this.artifact=r}render(r){const n=this.artifact;r.innerHTML="";const i=document.createElement("audio");i.src=n.path,i.controls=!0,i.style.width="320px",r.appendChild(i)}}class MY extends jl{constructor(r){super(r);xt(this,"placementTarget","body");this.artifact=r}render(r){const n=document.createElement("span");n.id="haibun-video-start",n.dataset.start=`${this.artifact.start}`,r.replaceChildren(n)}}const OY="modulepreload",PY=function(t,e){return new URL(t,e).href},l7={},ur=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(r.map(h=>{if(h=PY(h,n),h in l7)return;l7[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const v=o[m];if(v.href===h&&(!d||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":OY,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,v)=>{g.addEventListener("load",m),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function nf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gm={exports:{}},BY=gm.exports,c7;function FY(){return c7||(c7=1,function(t,e){(function(r,n){t.exports=n()})(BY,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var N=["th","st","nd","rd"],M=_%100;return"["+_+(N[(M-20)%10]||N[M]||N[0])+"]"}},w=function(_,N,M){var O=String(_);return!O||O.length>=N?_:""+Array(N+1-O.length).join(M)+_},T={s:w,z:function(_){var N=-_.utcOffset(),M=Math.abs(N),O=Math.floor(M/60),D=M%60;return(N<=0?"+":"-")+w(O,2,"0")+":"+w(D,2,"0")},m:function _(N,M){if(N.date()<M.date())return-_(M,N);var O=12*(M.year()-N.year())+(M.month()-N.month()),D=N.clone().add(O,d),B=M-D<0,z=N.clone().add(O+(B?-1:1),d);return+(-(O+(M-D)/(B?D-z:z-D))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},E="en",k={};k[E]=b;var S="$isDayjsObject",L=function(_){return _ instanceof I||!(!_||!_[S])},A=function _(N,M,O){var D;if(!N)return E;if(typeof N=="string"){var B=N.toLowerCase();k[B]&&(D=B),M&&(k[B]=M,D=B);var z=N.split("-");if(!D&&z.length>1)return _(z[0])}else{var F=N.name;k[F]=N,D=F}return!O&&D&&(E=D),D||!O&&E},R=function(_,N){if(L(_))return _.clone();var M=typeof N=="object"?N:{};return M.date=_,M.args=arguments,new I(M)},C=T;C.l=A,C.i=L,C.w=function(_,N){return R(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var I=function(){function _(M){this.$L=A(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[S]=!0}var N=_.prototype;return N.parse=function(M){this.$d=function(O){var D=O.date,B=O.utc;if(D===null)return new Date(NaN);if(C.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var z=D.match(v);if(z){var F=z[2]-1||0,G=(z[7]||"0").substring(0,3);return B?new Date(Date.UTC(z[1],F,z[3]||1,z[4]||0,z[5]||0,z[6]||0,G)):new Date(z[1],F,z[3]||1,z[4]||0,z[5]||0,z[6]||0,G)}}return new Date(D)}(M),this.init()},N.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},N.$utils=function(){return C},N.isValid=function(){return this.$d.toString()!==m},N.isSame=function(M,O){var D=R(M);return this.startOf(O)<=D&&D<=this.endOf(O)},N.isAfter=function(M,O){return R(M)<this.startOf(O)},N.isBefore=function(M,O){return this.endOf(O)<R(M)},N.$g=function(M,O,D){return C.u(M)?this[O]:this.set(D,M)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(M,O){var D=this,B=!!C.u(O)||O,z=C.p(M),F=function(j,W){var X=C.w(D.$u?Date.UTC(D.$y,W,j):new Date(D.$y,W,j),D);return B?X:X.endOf(u)},G=function(j,W){return C.w(D.toDate()[j].apply(D.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(W)),D)},q=this.$W,Y=this.$M,ee=this.$D,Q="set"+(this.$u?"UTC":"");switch(z){case p:return B?F(1,0):F(31,11);case d:return B?F(1,Y):F(0,Y+1);case h:var oe=this.$locale().weekStart||0,pe=(q<oe?q+7:q)-oe;return F(B?ee-pe:ee+(6-pe),Y);case u:case g:return G(Q+"Hours",0);case l:return G(Q+"Minutes",1);case o:return G(Q+"Seconds",2);case s:return G(Q+"Milliseconds",3);default:return this.clone()}},N.endOf=function(M){return this.startOf(M,!1)},N.$set=function(M,O){var D,B=C.p(M),z="set"+(this.$u?"UTC":""),F=(D={},D[u]=z+"Date",D[g]=z+"Date",D[d]=z+"Month",D[p]=z+"FullYear",D[l]=z+"Hours",D[o]=z+"Minutes",D[s]=z+"Seconds",D[a]=z+"Milliseconds",D)[B],G=B===u?this.$D+(O-this.$W):O;if(B===d||B===p){var q=this.clone().set(g,1);q.$d[F](G),q.init(),this.$d=q.set(g,Math.min(this.$D,q.daysInMonth())).$d}else F&&this.$d[F](G);return this.init(),this},N.set=function(M,O){return this.clone().$set(M,O)},N.get=function(M){return this[C.p(M)]()},N.add=function(M,O){var D,B=this;M=Number(M);var z=C.p(O),F=function(Y){var ee=R(B);return C.w(ee.date(ee.date()+Math.round(Y*M)),B)};if(z===d)return this.set(d,this.$M+M);if(z===p)return this.set(p,this.$y+M);if(z===u)return F(1);if(z===h)return F(7);var G=(D={},D[o]=n,D[l]=i,D[s]=r,D)[z]||1,q=this.$d.getTime()+M*G;return C.w(q,this)},N.subtract=function(M,O){return this.add(-1*M,O)},N.format=function(M){var O=this,D=this.$locale();if(!this.isValid())return D.invalidDate||m;var B=M||"YYYY-MM-DDTHH:mm:ssZ",z=C.z(this),F=this.$H,G=this.$m,q=this.$M,Y=D.weekdays,ee=D.months,Q=D.meridiem,oe=function(W,X,H,K){return W&&(W[X]||W(O,B))||H[X].slice(0,K)},pe=function(W){return C.s(F%12||12,W,"0")},j=Q||function(W,X,H){var K=W<12?"AM":"PM";return H?K.toLowerCase():K};return B.replace(y,function(W,X){return X||function(H){switch(H){case"YY":return String(O.$y).slice(-2);case"YYYY":return C.s(O.$y,4,"0");case"M":return q+1;case"MM":return C.s(q+1,2,"0");case"MMM":return oe(D.monthsShort,q,ee,3);case"MMMM":return oe(ee,q);case"D":return O.$D;case"DD":return C.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return oe(D.weekdaysMin,O.$W,Y,2);case"ddd":return oe(D.weekdaysShort,O.$W,Y,3);case"dddd":return Y[O.$W];case"H":return String(F);case"HH":return C.s(F,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return j(F,G,!0);case"A":return j(F,G,!1);case"m":return String(G);case"mm":return C.s(G,2,"0");case"s":return String(O.$s);case"ss":return C.s(O.$s,2,"0");case"SSS":return C.s(O.$ms,3,"0");case"Z":return z}return null}(W)||z.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(M,O,D){var B,z=this,F=C.p(O),G=R(M),q=(G.utcOffset()-this.utcOffset())*n,Y=this-G,ee=function(){return C.m(z,G)};switch(F){case p:B=ee()/12;break;case d:B=ee();break;case f:B=ee()/3;break;case h:B=(Y-q)/6048e5;break;case u:B=(Y-q)/864e5;break;case l:B=Y/i;break;case o:B=Y/n;break;case s:B=Y/r;break;default:B=Y}return D?B:C.a(B)},N.daysInMonth=function(){return this.endOf(d).$D},N.$locale=function(){return k[this.$L]},N.locale=function(M,O){if(!M)return this.$L;var D=this.clone(),B=A(M,O,!0);return B&&(D.$L=B),D},N.clone=function(){return C.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},_}(),P=I.prototype;return R.prototype=P,[["$ms",a],["$s",s],["$m",o],["$H",l],["$W",u],["$M",d],["$y",p],["$D",g]].forEach(function(_){P[_[1]]=function(N){return this.$g(N,_[0],_[1])}}),R.extend=function(_,N){return _.$i||(_(N,I,R),_.$i=!0),R},R.locale=A,R.isDayjs=L,R.unix=function(_){return R(1e3*_)},R.en=k[E],R.Ls=k,R.p={},R})}(gm)),gm.exports}var $Y=FY();const bi=nf($Y),mm={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return mm.hue2rgb(a,i,t+1/3)*255;case"g":return mm.hue2rgb(a,i,t)*255;case"b":return mm.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(e<r?6:0))*60;case e:return((r-t)/o+2)*60;case r:return((t-e)/o+4)*60;default:return-1}}},zY={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},VY={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},jt={channel:mm,lang:zY,unit:VY},fl={};for(let t=0;t<=255;t++)fl[t]=jt.unit.dec2hex(t);const vi={ALL:0,RGB:1,HSL:2};let GY=class{constructor(){this.type=vi.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=vi.ALL}is(e){return this.type===e}};class UY{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new GY}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=vi.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=jt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=jt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=jt.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=jt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=jt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=jt.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(vi.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(vi.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(vi.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(vi.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(vi.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(vi.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const k2=new UY({r:0,g:0,b:0,a:0},"transparent"),mh={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(mh.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return k2.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}${fl[Math.round(i*255)]}`:`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}`}},Dc={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Dc.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return jt.channel.clamp.h(parseFloat(r)*.9);case"rad":return jt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return jt.channel.clamp.h(parseFloat(r)*360)}}return jt.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Dc.re);if(!r)return;const[,n,i,a,s,o]=r;return k2.set({h:Dc._hue2deg(n),s:jt.channel.clamp.s(parseFloat(i)),l:jt.channel.clamp.l(parseFloat(a)),a:s?jt.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%, ${i})`:`hsl(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%)`}},np={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=np.colors[t];if(e)return mh.parse(e)},stringify:t=>{const e=mh.stringify(t);for(const r in np.colors)if(np.colors[r]===e)return r}},n0={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(n0.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return k2.set({r:jt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:jt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:jt.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?jt.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)}, ${jt.lang.round(i)})`:`rgb(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)})`}},Ts={format:{keyword:np,hex:mh,rgb:n0,rgba:n0,hsl:Dc,hsla:Dc},parse:t=>{if(typeof t!="string")return t;const e=mh.parse(t)||n0.parse(t)||Dc.parse(t)||np.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(vi.HSL)||t.data.r===void 0?Dc.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?n0.stringify(t):mh.stringify(t)},eD=(t,e)=>{const r=Ts.parse(t);for(const n in e)r[n]=jt.channel.clamp[n](e[n]);return Ts.stringify(r)},Sl=(t,e,r=0,n=1)=>{if(typeof t!="number")return eD(t,{a:e});const i=k2.set({r:jt.channel.clamp.r(t),g:jt.channel.clamp.g(e),b:jt.channel.clamp.b(r),a:jt.channel.clamp.a(n)});return Ts.stringify(i)},w6=(t,e)=>jt.lang.round(Ts.parse(t)[e]),qY=t=>{const{r:e,g:r,b:n}=Ts.parse(t),i=.2126*jt.channel.toLinear(e)+.7152*jt.channel.toLinear(r)+.0722*jt.channel.toLinear(n);return jt.lang.round(i)},HY=t=>qY(t)>=.5,Kl=t=>!HY(t),tD=(t,e,r)=>{const n=Ts.parse(t),i=n[e],a=jt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Ts.stringify(n)},Ct=(t,e)=>tD(t,"l",e),Mt=(t,e)=>tD(t,"l",-e),De=(t,e)=>{const r=Ts.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return eD(t,n)},WY=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=Ts.parse(t),{r:o,g:l,b:u,a:h}=Ts.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+o*v,b=i*m+l*v,w=a*m+u*v,T=s*d+h*(1-d);return Sl(y,b,w,T)},yt=(t,e=100)=>{const r=Ts.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,WY(r,t,e)};/*! @license DOMPurify 3.2.6 | (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.6/LICENSE */const{entries:rD,setPrototypeOf:u7,isFrozen:YY,getPrototypeOf:XY,getOwnPropertyDescriptor:jY}=Object;let{freeze:Gi,seal:Za,create:nD}=Object,{apply:y3,construct:x3}=typeof Reflect<"u"&&Reflect;Gi||(Gi=function(e){return e});Za||(Za=function(e){return e});y3||(y3=function(e,r,n){return e.apply(r,n)});x3||(x3=function(e,r){return new e(...r)});const s1=Ui(Array.prototype.forEach),KY=Ui(Array.prototype.lastIndexOf),h7=Ui(Array.prototype.pop),Lf=Ui(Array.prototype.push),ZY=Ui(Array.prototype.splice),vm=Ui(String.prototype.toLowerCase),hb=Ui(String.prototype.toString),d7=Ui(String.prototype.match),Rf=Ui(String.prototype.replace),QY=Ui(String.prototype.indexOf),JY=Ui(String.prototype.trim),ls=Ui(Object.prototype.hasOwnProperty),Ri=Ui(RegExp.prototype.test),Nf=eX(TypeError);function Ui(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return y3(t,e,n)}}function eX(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return x3(t,r)}}function or(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vm;u7&&u7(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(YY(e)||(e[n]=a),i=a)}t[i]=!0}return t}function tX(t){for(let e=0;e<t.length;e++)ls(t,e)||(t[e]=null);return t}function wo(t){const e=nD(null);for(const[r,n]of rD(t))ls(t,r)&&(Array.isArray(n)?e[r]=tX(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=wo(n):e[r]=n);return e}function Df(t,e){for(;t!==null;){const n=jY(t,e);if(n){if(n.get)return Ui(n.get);if(typeof n.value=="function")return Ui(n.value)}t=XY(t)}function r(){return null}return r}const f7=Gi(["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"]),db=Gi(["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"]),fb=Gi(["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"]),rX=Gi(["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"]),pb=Gi(["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"]),nX=Gi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),p7=Gi(["#text"]),g7=Gi(["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"]),gb=Gi(["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"]),m7=Gi(["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"]),o1=Gi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),iX=Za(/\{\{[\w\W]*|[\w\W]*\}\}/gm),aX=Za(/<%[\w\W]*|[\w\W]*%>/gm),sX=Za(/\$\{[\w\W]*/gm),oX=Za(/^data-[\-\w.\u00B7-\uFFFF]+$/),lX=Za(/^aria-[\-\w]+$/),iD=Za(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cX=Za(/^(?:\w+script|data):/i),uX=Za(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aD=Za(/^html$/i),hX=Za(/^[a-z][.\w]*(-[.\w]+)+$/i);var v7=Object.freeze({__proto__:null,ARIA_ATTR:lX,ATTR_WHITESPACE:uX,CUSTOM_ELEMENT:hX,DATA_ATTR:oX,DOCTYPE_NAME:aD,ERB_EXPR:aX,IS_ALLOWED_URI:iD,IS_SCRIPT_OR_DATA:cX,MUSTACHE_EXPR:iX,TMPLIT_EXPR:sX});const If={element:1,text:3,progressingInstruction:7,comment:8,document:9},dX=function(){return typeof window>"u"?null:window},fX=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},y7=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dX();const e=pt=>sD(pt);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==If.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=t,g=l.prototype,m=Df(g,"cloneNode"),v=Df(g,"remove"),y=Df(g,"nextSibling"),b=Df(g,"childNodes"),w=Df(g,"parentNode");if(typeof s=="function"){const pt=r.createElement("template");pt.content&&pt.content.ownerDocument&&(r=pt.content.ownerDocument)}let T,E="";const{implementation:k,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:A}=r,{importNode:R}=n;let C=y7();e.isSupported=typeof rD=="function"&&typeof w=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:I,ERB_EXPR:P,TMPLIT_EXPR:_,DATA_ATTR:N,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:B}=v7;let{IS_ALLOWED_URI:z}=v7,F=null;const G=or({},[...f7,...db,...fb,...pb,...p7]);let q=null;const Y=or({},[...g7,...gb,...m7,...o1]);let ee=Object.seal(nD(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,oe=null,pe=!0,j=!0,W=!1,X=!0,H=!1,K=!0,ne=!1,Z=!1,be=!1,ce=!1,re=!1,Ne=!1,me=!0,Ve=!1;const Ue="user-content-";let Fe=!0,_e=!1,Oe={},Ce=null;const Le=or({},["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 ze=null;const ge=or({},["audio","video","img","source","image","track"]);let Me=null;const J=or({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",$="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml";let ae=se,fe=!1,he=null;const Te=or({},[ue,$,se],hb);let Se=or({},["mi","mo","mn","ms","mtext"]),Ee=or({},["annotation-xml"]);const Ge=or({},["title","style","font","a","script"]);let Je=null;const He=["application/xhtml+xml","text/html"],Xe="text/html";let Ke=null,$e=null;const je=r.createElement("form"),lt=function(ke){return ke instanceof RegExp||ke instanceof Function},st=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!($e&&$e===ke)){if((!ke||typeof ke!="object")&&(ke={}),ke=wo(ke),Je=He.indexOf(ke.PARSER_MEDIA_TYPE)===-1?Xe:ke.PARSER_MEDIA_TYPE,Ke=Je==="application/xhtml+xml"?hb:vm,F=ls(ke,"ALLOWED_TAGS")?or({},ke.ALLOWED_TAGS,Ke):G,q=ls(ke,"ALLOWED_ATTR")?or({},ke.ALLOWED_ATTR,Ke):Y,he=ls(ke,"ALLOWED_NAMESPACES")?or({},ke.ALLOWED_NAMESPACES,hb):Te,Me=ls(ke,"ADD_URI_SAFE_ATTR")?or(wo(J),ke.ADD_URI_SAFE_ATTR,Ke):J,ze=ls(ke,"ADD_DATA_URI_TAGS")?or(wo(ge),ke.ADD_DATA_URI_TAGS,Ke):ge,Ce=ls(ke,"FORBID_CONTENTS")?or({},ke.FORBID_CONTENTS,Ke):Le,Q=ls(ke,"FORBID_TAGS")?or({},ke.FORBID_TAGS,Ke):wo({}),oe=ls(ke,"FORBID_ATTR")?or({},ke.FORBID_ATTR,Ke):wo({}),Oe=ls(ke,"USE_PROFILES")?ke.USE_PROFILES:!1,pe=ke.ALLOW_ARIA_ATTR!==!1,j=ke.ALLOW_DATA_ATTR!==!1,W=ke.ALLOW_UNKNOWN_PROTOCOLS||!1,X=ke.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=ke.SAFE_FOR_TEMPLATES||!1,K=ke.SAFE_FOR_XML!==!1,ne=ke.WHOLE_DOCUMENT||!1,ce=ke.RETURN_DOM||!1,re=ke.RETURN_DOM_FRAGMENT||!1,Ne=ke.RETURN_TRUSTED_TYPE||!1,be=ke.FORCE_BODY||!1,me=ke.SANITIZE_DOM!==!1,Ve=ke.SANITIZE_NAMED_PROPS||!1,Fe=ke.KEEP_CONTENT!==!1,_e=ke.IN_PLACE||!1,z=ke.ALLOWED_URI_REGEXP||iD,ae=ke.NAMESPACE||se,Se=ke.MATHML_TEXT_INTEGRATION_POINTS||Se,Ee=ke.HTML_INTEGRATION_POINTS||Ee,ee=ke.CUSTOM_ELEMENT_HANDLING||{},ke.CUSTOM_ELEMENT_HANDLING&<(ke.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=ke.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ke.CUSTOM_ELEMENT_HANDLING&<(ke.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=ke.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ke.CUSTOM_ELEMENT_HANDLING&&typeof ke.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=ke.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(j=!1),re&&(ce=!0),Oe&&(F=or({},p7),q=[],Oe.html===!0&&(or(F,f7),or(q,g7)),Oe.svg===!0&&(or(F,db),or(q,gb),or(q,o1)),Oe.svgFilters===!0&&(or(F,fb),or(q,gb),or(q,o1)),Oe.mathMl===!0&&(or(F,pb),or(q,m7),or(q,o1))),ke.ADD_TAGS&&(F===G&&(F=wo(F)),or(F,ke.ADD_TAGS,Ke)),ke.ADD_ATTR&&(q===Y&&(q=wo(q)),or(q,ke.ADD_ATTR,Ke)),ke.ADD_URI_SAFE_ATTR&&or(Me,ke.ADD_URI_SAFE_ATTR,Ke),ke.FORBID_CONTENTS&&(Ce===Le&&(Ce=wo(Ce)),or(Ce,ke.FORBID_CONTENTS,Ke)),Fe&&(F["#text"]=!0),ne&&or(F,["html","head","body"]),F.table&&(or(F,["tbody"]),delete Q.tbody),ke.TRUSTED_TYPES_POLICY){if(typeof ke.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ke.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=ke.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=fX(p,i)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));Gi&&Gi(ke),$e=ke}},qe=or({},[...db,...fb,...rX]),Et=or({},[...pb,...nX]),Ye=function(ke){let Qe=w(ke);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:ae,tagName:"template"});const bt=vm(ke.tagName),tr=vm(Qe.tagName);return he[ke.namespaceURI]?ke.namespaceURI===$?Qe.namespaceURI===se?bt==="svg":Qe.namespaceURI===ue?bt==="svg"&&(tr==="annotation-xml"||Se[tr]):!!qe[bt]:ke.namespaceURI===ue?Qe.namespaceURI===se?bt==="math":Qe.namespaceURI===$?bt==="math"&&Ee[tr]:!!Et[bt]:ke.namespaceURI===se?Qe.namespaceURI===$&&!Ee[tr]||Qe.namespaceURI===ue&&!Se[tr]?!1:!Et[bt]&&(Ge[bt]||!qe[bt]):!!(Je==="application/xhtml+xml"&&he[ke.namespaceURI]):!1},Ze=function(ke){Lf(e.removed,{element:ke});try{w(ke).removeChild(ke)}catch{v(ke)}},ht=function(ke,Qe){try{Lf(e.removed,{attribute:Qe.getAttributeNode(ke),from:Qe})}catch{Lf(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(ke),ke==="is")if(ce||re)try{Ze(Qe)}catch{}else try{Qe.setAttribute(ke,"")}catch{}},ct=function(ke){let Qe=null,bt=null;if(be)ke="<remove></remove>"+ke;else{const Or=d7(ke,/^[\r\n\t ]+/);bt=Or&&Or[0]}Je==="application/xhtml+xml"&&ae===se&&(ke='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ke+"</body></html>");const tr=T?T.createHTML(ke):ke;if(ae===se)try{Qe=new f().parseFromString(tr,Je)}catch{}if(!Qe||!Qe.documentElement){Qe=k.createDocument(ae,"template",null);try{Qe.documentElement.innerHTML=fe?E:tr}catch{}}const Mr=Qe.body||Qe.documentElement;return ke&&bt&&Mr.insertBefore(r.createTextNode(bt),Mr.childNodes[0]||null),ae===se?A.call(Qe,ne?"html":"body")[0]:ne?Qe.documentElement:Mr},ut=function(ke){return S.call(ke.ownerDocument||ke,ke,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},mt=function(ke){return ke instanceof d&&(typeof ke.nodeName!="string"||typeof ke.textContent!="string"||typeof ke.removeChild!="function"||!(ke.attributes instanceof h)||typeof ke.removeAttribute!="function"||typeof ke.setAttribute!="function"||typeof ke.namespaceURI!="string"||typeof ke.insertBefore!="function"||typeof ke.hasChildNodes!="function")},sr=function(ke){return typeof o=="function"&&ke instanceof o};function Rt(pt,ke,Qe){s1(pt,bt=>{bt.call(e,ke,Qe,$e)})}const hr=function(ke){let Qe=null;if(Rt(C.beforeSanitizeElements,ke,null),mt(ke))return Ze(ke),!0;const bt=Ke(ke.nodeName);if(Rt(C.uponSanitizeElement,ke,{tagName:bt,allowedTags:F}),K&&ke.hasChildNodes()&&!sr(ke.firstElementChild)&&Ri(/<[/\w!]/g,ke.innerHTML)&&Ri(/<[/\w!]/g,ke.textContent)||ke.nodeType===If.progressingInstruction||K&&ke.nodeType===If.comment&&Ri(/<[/\w]/g,ke.data))return Ze(ke),!0;if(!F[bt]||Q[bt]){if(!Q[bt]&&er(bt)&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,bt)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(bt)))return!1;if(Fe&&!Ce[bt]){const tr=w(ke)||ke.parentNode,Mr=b(ke)||ke.childNodes;if(Mr&&tr){const Or=Mr.length;for(let Lr=Or-1;Lr>=0;--Lr){const Sn=m(Mr[Lr],!0);Sn.__removalCount=(ke.__removalCount||0)+1,tr.insertBefore(Sn,y(ke))}}}return Ze(ke),!0}return ke instanceof l&&!Ye(ke)||(bt==="noscript"||bt==="noembed"||bt==="noframes")&&Ri(/<\/no(script|embed|frames)/i,ke.innerHTML)?(Ze(ke),!0):(H&&ke.nodeType===If.text&&(Qe=ke.textContent,s1([I,P,_],tr=>{Qe=Rf(Qe,tr," ")}),ke.textContent!==Qe&&(Lf(e.removed,{element:ke.cloneNode()}),ke.textContent=Qe)),Rt(C.afterSanitizeElements,ke,null),!1)},rr=function(ke,Qe,bt){if(me&&(Qe==="id"||Qe==="name")&&(bt in r||bt in je))return!1;if(!(j&&!oe[Qe]&&Ri(N,Qe))){if(!(pe&&Ri(M,Qe))){if(!q[Qe]||oe[Qe]){if(!(er(ke)&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,ke)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(ke))&&(ee.attributeNameCheck instanceof RegExp&&Ri(ee.attributeNameCheck,Qe)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(Qe))||Qe==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,bt)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(bt))))return!1}else if(!Me[Qe]){if(!Ri(z,Rf(bt,D,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&ke!=="script"&&QY(bt,"data:")===0&&ze[ke])){if(!(W&&!Ri(O,Rf(bt,D,"")))){if(bt)return!1}}}}}}return!0},er=function(ke){return ke!=="annotation-xml"&&d7(ke,B)},Wt=function(ke){Rt(C.beforeSanitizeAttributes,ke,null);const{attributes:Qe}=ke;if(!Qe||mt(ke))return;const bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let tr=Qe.length;for(;tr--;){const Mr=Qe[tr],{name:Or,namespaceURI:Lr,value:Sn}=Mr,gi=Ke(Or),Li=Sn;let dr=Or==="value"?Li:JY(Li);if(bt.attrName=gi,bt.attrValue=dr,bt.keepAttr=!0,bt.forceKeepAttr=void 0,Rt(C.uponSanitizeAttribute,ke,bt),dr=bt.attrValue,Ve&&(gi==="id"||gi==="name")&&(ht(Or,ke),dr=Ue+dr),K&&Ri(/((--!?|])>)|<\/(style|title)/i,dr)){ht(Or,ke);continue}if(bt.forceKeepAttr)continue;if(!bt.keepAttr){ht(Or,ke);continue}if(!X&&Ri(/\/>/i,dr)){ht(Or,ke);continue}H&&s1([I,P,_],wt=>{dr=Rf(dr,wt," ")});const At=Ke(ke.nodeName);if(!rr(At,gi,dr)){ht(Or,ke);continue}if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Lr)switch(p.getAttributeType(At,gi)){case"TrustedHTML":{dr=T.createHTML(dr);break}case"TrustedScriptURL":{dr=T.createScriptURL(dr);break}}if(dr!==Li)try{Lr?ke.setAttributeNS(Lr,Or,dr):ke.setAttribute(Or,dr),mt(ke)?Ze(ke):h7(e.removed)}catch{ht(Or,ke)}}Rt(C.afterSanitizeAttributes,ke,null)},Xr=function pt(ke){let Qe=null;const bt=ut(ke);for(Rt(C.beforeSanitizeShadowDOM,ke,null);Qe=bt.nextNode();)Rt(C.uponSanitizeShadowNode,Qe,null),hr(Qe),Wt(Qe),Qe.content instanceof a&&pt(Qe.content);Rt(C.afterSanitizeShadowDOM,ke,null)};return e.sanitize=function(pt){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,bt=null,tr=null,Mr=null;if(fe=!pt,fe&&(pt="\x3C!-->"),typeof pt!="string"&&!sr(pt))if(typeof pt.toString=="function"){if(pt=pt.toString(),typeof pt!="string")throw Nf("dirty is not a string, aborting")}else throw Nf("toString is not a function");if(!e.isSupported)return pt;if(Z||st(ke),e.removed=[],typeof pt=="string"&&(_e=!1),_e){if(pt.nodeName){const Sn=Ke(pt.nodeName);if(!F[Sn]||Q[Sn])throw Nf("root node is forbidden and cannot be sanitized in-place")}}else if(pt instanceof o)Qe=ct("\x3C!---->"),bt=Qe.ownerDocument.importNode(pt,!0),bt.nodeType===If.element&&bt.nodeName==="BODY"||bt.nodeName==="HTML"?Qe=bt:Qe.appendChild(bt);else{if(!ce&&!H&&!ne&&pt.indexOf("<")===-1)return T&&Ne?T.createHTML(pt):pt;if(Qe=ct(pt),!Qe)return ce?null:Ne?E:""}Qe&&be&&Ze(Qe.firstChild);const Or=ut(_e?pt:Qe);for(;tr=Or.nextNode();)hr(tr),Wt(tr),tr.content instanceof a&&Xr(tr.content);if(_e)return pt;if(ce){if(re)for(Mr=L.call(Qe.ownerDocument);Qe.firstChild;)Mr.appendChild(Qe.firstChild);else Mr=Qe;return(q.shadowroot||q.shadowrootmode)&&(Mr=R.call(n,Mr,!0)),Mr}let Lr=ne?Qe.outerHTML:Qe.innerHTML;return ne&&F["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Ri(aD,Qe.ownerDocument.doctype.name)&&(Lr="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
|
|
413
|
-
`+Lr),H&&s1([I,P,_],Sn=>{Lr=Rf(Lr,Sn," ")}),T&&Ne?T.createHTML(Lr):Lr},e.setConfig=function(){let pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(pt),Z=!0},e.clearConfig=function(){$e=null,Z=!1},e.isValidAttribute=function(pt,ke,Qe){$e||st({});const
|
|
412
|
+
<script type="module" crossorigin>var CY=Object.defineProperty;var AY=(t,e,r)=>e in t?CY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var wt=(t,e,r)=>AY(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Hc;(function(t){t.INIT="INIT",t.EXECUTION_START="EXECUTION_START",t.FEATURE_START="FEATURE_START",t.SCENARIO_START="SCENARIO_START",t.STEP_START="STEP_START",t.STEP_NEXT="STEP_NEXT",t.ACTION="ACTION",t.TRACE="TRACE",t.STEP_END="STEP_END",t.SCENARIO_END="SCENARIO_END",t.FEATURE_END="FEATURE_END",t.EXECUTION_END="EXECUTION_END",t.ON_FAILURE="ON_FAILURE"})(Hc||(Hc={}));function QN(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pm(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return t.length===0?!0:t.every(e=>typeof e!="object"||e===null);{const e=Object.keys(t);return e.length===0?!0:e.every(r=>typeof t[r]!="object"||t[r]===null)}}function Ev(t,e){return e==="html"?"<html>":typeof t=="string"?JSON.stringify(t):t===null?"null":String(t)}function o7(t){return Array.isArray(t)?`[${t.map(e=>Ev(e)).join(", ")}]`:typeof t=="object"&&t!==null?`{ ${Object.entries(t).map(([r,n])=>{let i=Ev(n,r);return r==="html"&&(i=QN(i)),`"${r}": ${i}`}).join(", ")} }`:String(t)}function JN(t){const e=document.createElement("span");if(e.className="simple-aggregate-inline",Array.isArray(t))e.appendChild(document.createTextNode("[")),t.forEach((r,n)=>{e.appendChild(kv(r)),n<t.length-1&&e.appendChild(document.createTextNode(", "))}),e.appendChild(document.createTextNode("]"));else if(typeof t=="object"&&t!==null){e.appendChild(document.createTextNode("{ "));const r=Object.keys(t);r.forEach((n,i)=>{const a=document.createElement("span");a.className="key inline-key",a.textContent=`"${n}": `,e.appendChild(a),e.appendChild(kv(t[n],n)),i<r.length-1&&e.appendChild(document.createTextNode(", "))}),e.appendChild(document.createTextNode(" }"))}return e}function b6(t){if(typeof t!="object"||t===null){const e=document.createElement("div");return e.className="json-root-primitive",e.appendChild(kv(t)),e.dataset.rawJson=JSON.stringify(t),e}if(pm(t)){const e=document.createElement("div");return e.className="json-root-simple-aggregate",e.appendChild(JN(t)),e.dataset.rawJson=JSON.stringify(t),e}else{const e=document.createElement("div");return e.className="json-root-complex",e.dataset.rawJson=JSON.stringify(t),Array.isArray(t)?t.forEach((n,i)=>{Sv(i,n,!0,e,0,void 0)}):Object.keys(t).forEach(n=>{Sv(n,t[n],!1,e,0,void 0)}),e}}function Sv(t,e,r,n,i=0,a){const s=typeof e!="object"||e===null;if(s){const o=document.createElement("div");o.className="json-line primitive-kv";let l=0;i===1?l=20:i>1&&(l=20+(i-1)*15),o.style.marginLeft=`${l}px`;const u=document.createElement("span");u.className=r?"key index":"key",u.textContent=r?`[${t}]: `:`${t}: `,o.appendChild(u);let h=!1;if(s&&(t==="in"&&typeof e=="string"||t==="named"||a==="named"||a==="namedWithVars")&&(h=!0),h){const d=document.createElement("textarea");d.classList.add("expanded-value-textarea"),d.value=String(e);let f="root";n.parentElement&&n.parentElement.tagName==="DETAILS"&&(f=_Y(n.parentElement));const p=String(t).replace(/[^a-zA-Z0-9_-]/g,"_");d.id=`textarea-${f}-${p}`,d.rows=1;const g=v=>{let y=document.getElementById("autogrow-helper");y||(y=document.createElement("div"),y.id="autogrow-helper",y.style.position="absolute",y.style.left="-9999px",y.style.top="0",y.style.visibility="hidden",y.style.pointerEvents="none",document.body.appendChild(y));const b=window.getComputedStyle(v);y.style.font=b.font,y.style.letterSpacing=b.letterSpacing,y.style.paddingTop=b.paddingTop,y.style.paddingRight=b.paddingRight,y.style.paddingBottom=b.paddingBottom,y.style.paddingLeft=b.paddingLeft,y.style.borderTopWidth=b.borderTopWidth,y.style.borderRightWidth=b.borderRightWidth,y.style.borderBottomWidth=b.borderBottomWidth,y.style.borderLeftWidth=b.borderLeftWidth,y.style.borderStyle=b.borderStyle,y.style.boxSizing="border-box",y.style.lineHeight=b.lineHeight,y.style.whiteSpace="nowrap",y.style.width="auto",y.textContent=v.value||" ";let w=y.scrollWidth;w+=2,v.style.width=w+"px"},m=v=>{v.style.height="auto",v.style.height=v.scrollHeight+"px"};d.addEventListener("input",()=>m(d)),o.appendChild(d),o.classList.add("line-with-textarea"),n.appendChild(o),requestAnimationFrame(()=>{g(d)})}else o.appendChild(kv(e,t)),n.appendChild(o)}else if(!(t==="named"||t==="namedWithVars")&&pm(e)){const l=document.createElement("div");l.className="json-line simple-aggregate-kv";let u=0;i===1?u=20:i>1&&(u=20+(i-1)*15),l.style.marginLeft=`${u}px`;const h=document.createElement("span");h.className=r?"key index":"key",h.textContent=r?`[${t}]: `:`${t}: `,l.appendChild(h),l.appendChild(JN(e)),n.appendChild(l)}else{const l=document.createElement("details");l.className=(r?"json-array-item":"json-object-item")+" expandable";let u=0;i===1?u=20:i>1&&(u=20+(i-1)*15),l.style.marginLeft=`${u}px`,l.open=!1;const h=document.createElement("summary"),d=document.createElement("span"),f=document.createElement("span");f.className=r?"key index":"key",f.textContent=r?`[${String(t)}]: `:`${String(t)}: `,d.appendChild(f);const p=document.createElement("span");p.className="children-summary-inline";const g=[];Array.isArray(e)?e.forEach((v,y)=>{const b=String(y);typeof v!="object"||v===null?g.push(`{${b}: ${Ev(v,y)}}`):pm(v)?g.push(`{${b}: ${o7(v)}}`):g.push(`<span class="complex-child-marker">+${b}</span>`)}):Object.entries(e).forEach(([v,y])=>{if(typeof y!="object"||y===null){let w=Ev(y,v);v==="html"&&(w=QN(w)),g.push(`{${v}: ${w}}`)}else pm(y)?g.push(`{${v}: ${o7(y)}}`):g.push(`<span class="complex-child-marker">+${v}</span>`)}),p.innerHTML=g.join(", "),d.appendChild(p),h.appendChild(d),l.appendChild(h);const m=document.createElement("div");m.className="details-content",Array.isArray(e)?e.forEach((v,y)=>{Sv(y,v,!0,m,i+1,t)}):Object.entries(e).forEach(([v,y])=>{Sv(v,y,!1,m,i+1,t)}),l.appendChild(m),l.addEventListener("toggle",()=>{l.open?p.classList.add("hidden"):p.classList.remove("hidden")}),l.open?p.classList.add("hidden"):p.classList.remove("hidden"),n.appendChild(l)}}function _Y(t){var r,n,i;const e=[];for(;t&&t.parentElement&&!t.classList.contains("json-root-complex");){const a=t.querySelector(":scope > summary > span > .key");let s=((r=a==null?void 0:a.textContent)==null?void 0:r.replace(/: $/,""))||"item";t.classList.contains("json-array-item")&&(s=((i=(n=t.querySelector(":scope > summary > span > .key.index"))==null?void 0:n.textContent)==null?void 0:i.replace(/[[\]:]/g,""))||"index"),e.unshift(s),t=t.parentElement.closest("details, .json-root-complex")}return e.join("-")}function kv(t,e){const r=document.createElement("span");r.classList.add("value");let n,i=typeof t;return e==="html"?(n="<html>",i="html"):t===null?(i="null",n="<null>"):i==="string"?n=JSON.stringify(t):i==="undefined"?n="undefined":n=String(t),r.classList.add(`value-${i}`),r.textContent=n,r}class rf{constructor(e,r){wt(this,"element");if(this.element=document.createElement(e),r){const n=Array.isArray(r)?r:[r];this.element.classList.add(...n)}}append(e){this.element.appendChild(e instanceof rf?e.element:e)}addClass(e){this.element.classList.add(e)}setData(e,r){this.element.dataset[e]=r}setHtml(e){this.element.innerHTML=e}setText(e){this.element.textContent=e}}class jl{constructor(e){wt(this,"label");this.artifact=e,this.label=this.deriveLabel()}deriveLabel(){return this.artifact.artifactType}get artifactType(){return this.artifact.artifactType}}class LY extends jl{constructor(r){super(r);wt(this,"placementTarget","details")}render(r){const n=this.artifact;try{const i=b6(n.json);if(r.innerHTML="",i){const a=document.createElement("pre");a.classList.add("haibun-message-details-json"),a.appendChild(i),r.appendChild(a)}}catch(i){console.error("Error rendering JSON artifact:",i),r.innerHTML=`<p class="haibun-artifact-error">Error rendering JSON: ${i.message}</p>`}}}class RY extends jl{constructor(r){super(r);wt(this,"placementTarget","details");this.artifact=r}render(r){r.innerHTML="";const n=document.createElement("iframe");n.style.border="none",n.style.width="100%",n.style.height="80vh","html"in this.artifact&&typeof this.artifact.html=="string"?n.srcdoc=this.artifact.html:"path"in this.artifact&&typeof this.artifact.path=="string"?n.src=this.artifact.path:n.srcdoc='<p class="haibun-artifact-error">Error: HTML content not available or in an unexpected format.</p>',r.appendChild(n)}}class NY extends jl{constructor(r){super(r);wt(this,"placementTarget","details");this.artifact=r}render(r){const n=document.createElement("img");n.alt="Screen capture artifact",n.src=this.artifact.path,r.replaceChildren(n)}}class DY extends jl{constructor(r){super(r);wt(this,"placementTarget");this.artifact=r,this.placementTarget=document.querySelector("#haibun-focus")?"haibun-focus":"details",this.placementTarget==="details"&&console.info("Cannot find #haibun-video container; video will be appended to details on toggle.")}render(r){const n=document.createElement("video");n.controls=!0,n.style.width="320px",n.src=this.artifact.path,r.replaceChildren(n)}}class IY extends jl{constructor(r){super(r);wt(this,"placementTarget","details");this.artifact=r}render(r){const n=this.artifact;r.innerHTML="";const i=document.createElement("audio");i.src=n.path,i.controls=!0,i.style.width="320px",r.appendChild(i)}}class MY extends jl{constructor(r){super(r);wt(this,"placementTarget","body");this.artifact=r}render(r){const n=document.createElement("span");n.id="haibun-video-start",n.dataset.start=`${this.artifact.start}`,r.replaceChildren(n)}}const OY="modulepreload",PY=function(t,e){return new URL(t,e).href},l7={},ur=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(r.map(h=>{if(h=PY(h,n),h in l7)return;l7[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const v=o[m];if(v.href===h&&(!d||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":OY,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,v)=>{g.addEventListener("load",m),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function nf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gm={exports:{}},BY=gm.exports,c7;function FY(){return c7||(c7=1,function(t,e){(function(r,n){t.exports=n()})(BY,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var N=["th","st","nd","rd"],M=_%100;return"["+_+(N[(M-20)%10]||N[M]||N[0])+"]"}},w=function(_,N,M){var O=String(_);return!O||O.length>=N?_:""+Array(N+1-O.length).join(M)+_},T={s:w,z:function(_){var N=-_.utcOffset(),M=Math.abs(N),O=Math.floor(M/60),D=M%60;return(N<=0?"+":"-")+w(O,2,"0")+":"+w(D,2,"0")},m:function _(N,M){if(N.date()<M.date())return-_(M,N);var O=12*(M.year()-N.year())+(M.month()-N.month()),D=N.clone().add(O,d),B=M-D<0,z=N.clone().add(O+(B?-1:1),d);return+(-(O+(M-D)/(B?D-z:z-D))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},E="en",k={};k[E]=b;var S="$isDayjsObject",L=function(_){return _ instanceof I||!(!_||!_[S])},A=function _(N,M,O){var D;if(!N)return E;if(typeof N=="string"){var B=N.toLowerCase();k[B]&&(D=B),M&&(k[B]=M,D=B);var z=N.split("-");if(!D&&z.length>1)return _(z[0])}else{var F=N.name;k[F]=N,D=F}return!O&&D&&(E=D),D||!O&&E},R=function(_,N){if(L(_))return _.clone();var M=typeof N=="object"?N:{};return M.date=_,M.args=arguments,new I(M)},C=T;C.l=A,C.i=L,C.w=function(_,N){return R(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var I=function(){function _(M){this.$L=A(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[S]=!0}var N=_.prototype;return N.parse=function(M){this.$d=function(O){var D=O.date,B=O.utc;if(D===null)return new Date(NaN);if(C.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var z=D.match(v);if(z){var F=z[2]-1||0,G=(z[7]||"0").substring(0,3);return B?new Date(Date.UTC(z[1],F,z[3]||1,z[4]||0,z[5]||0,z[6]||0,G)):new Date(z[1],F,z[3]||1,z[4]||0,z[5]||0,z[6]||0,G)}}return new Date(D)}(M),this.init()},N.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},N.$utils=function(){return C},N.isValid=function(){return this.$d.toString()!==m},N.isSame=function(M,O){var D=R(M);return this.startOf(O)<=D&&D<=this.endOf(O)},N.isAfter=function(M,O){return R(M)<this.startOf(O)},N.isBefore=function(M,O){return this.endOf(O)<R(M)},N.$g=function(M,O,D){return C.u(M)?this[O]:this.set(D,M)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(M,O){var D=this,B=!!C.u(O)||O,z=C.p(M),F=function(j,W){var X=C.w(D.$u?Date.UTC(D.$y,W,j):new Date(D.$y,W,j),D);return B?X:X.endOf(u)},G=function(j,W){return C.w(D.toDate()[j].apply(D.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(W)),D)},q=this.$W,Y=this.$M,ee=this.$D,Q="set"+(this.$u?"UTC":"");switch(z){case p:return B?F(1,0):F(31,11);case d:return B?F(1,Y):F(0,Y+1);case h:var oe=this.$locale().weekStart||0,pe=(q<oe?q+7:q)-oe;return F(B?ee-pe:ee+(6-pe),Y);case u:case g:return G(Q+"Hours",0);case l:return G(Q+"Minutes",1);case o:return G(Q+"Seconds",2);case s:return G(Q+"Milliseconds",3);default:return this.clone()}},N.endOf=function(M){return this.startOf(M,!1)},N.$set=function(M,O){var D,B=C.p(M),z="set"+(this.$u?"UTC":""),F=(D={},D[u]=z+"Date",D[g]=z+"Date",D[d]=z+"Month",D[p]=z+"FullYear",D[l]=z+"Hours",D[o]=z+"Minutes",D[s]=z+"Seconds",D[a]=z+"Milliseconds",D)[B],G=B===u?this.$D+(O-this.$W):O;if(B===d||B===p){var q=this.clone().set(g,1);q.$d[F](G),q.init(),this.$d=q.set(g,Math.min(this.$D,q.daysInMonth())).$d}else F&&this.$d[F](G);return this.init(),this},N.set=function(M,O){return this.clone().$set(M,O)},N.get=function(M){return this[C.p(M)]()},N.add=function(M,O){var D,B=this;M=Number(M);var z=C.p(O),F=function(Y){var ee=R(B);return C.w(ee.date(ee.date()+Math.round(Y*M)),B)};if(z===d)return this.set(d,this.$M+M);if(z===p)return this.set(p,this.$y+M);if(z===u)return F(1);if(z===h)return F(7);var G=(D={},D[o]=n,D[l]=i,D[s]=r,D)[z]||1,q=this.$d.getTime()+M*G;return C.w(q,this)},N.subtract=function(M,O){return this.add(-1*M,O)},N.format=function(M){var O=this,D=this.$locale();if(!this.isValid())return D.invalidDate||m;var B=M||"YYYY-MM-DDTHH:mm:ssZ",z=C.z(this),F=this.$H,G=this.$m,q=this.$M,Y=D.weekdays,ee=D.months,Q=D.meridiem,oe=function(W,X,H,K){return W&&(W[X]||W(O,B))||H[X].slice(0,K)},pe=function(W){return C.s(F%12||12,W,"0")},j=Q||function(W,X,H){var K=W<12?"AM":"PM";return H?K.toLowerCase():K};return B.replace(y,function(W,X){return X||function(H){switch(H){case"YY":return String(O.$y).slice(-2);case"YYYY":return C.s(O.$y,4,"0");case"M":return q+1;case"MM":return C.s(q+1,2,"0");case"MMM":return oe(D.monthsShort,q,ee,3);case"MMMM":return oe(ee,q);case"D":return O.$D;case"DD":return C.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return oe(D.weekdaysMin,O.$W,Y,2);case"ddd":return oe(D.weekdaysShort,O.$W,Y,3);case"dddd":return Y[O.$W];case"H":return String(F);case"HH":return C.s(F,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return j(F,G,!0);case"A":return j(F,G,!1);case"m":return String(G);case"mm":return C.s(G,2,"0");case"s":return String(O.$s);case"ss":return C.s(O.$s,2,"0");case"SSS":return C.s(O.$ms,3,"0");case"Z":return z}return null}(W)||z.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(M,O,D){var B,z=this,F=C.p(O),G=R(M),q=(G.utcOffset()-this.utcOffset())*n,Y=this-G,ee=function(){return C.m(z,G)};switch(F){case p:B=ee()/12;break;case d:B=ee();break;case f:B=ee()/3;break;case h:B=(Y-q)/6048e5;break;case u:B=(Y-q)/864e5;break;case l:B=Y/i;break;case o:B=Y/n;break;case s:B=Y/r;break;default:B=Y}return D?B:C.a(B)},N.daysInMonth=function(){return this.endOf(d).$D},N.$locale=function(){return k[this.$L]},N.locale=function(M,O){if(!M)return this.$L;var D=this.clone(),B=A(M,O,!0);return B&&(D.$L=B),D},N.clone=function(){return C.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},_}(),P=I.prototype;return R.prototype=P,[["$ms",a],["$s",s],["$m",o],["$H",l],["$W",u],["$M",d],["$y",p],["$D",g]].forEach(function(_){P[_[1]]=function(N){return this.$g(N,_[0],_[1])}}),R.extend=function(_,N){return _.$i||(_(N,I,R),_.$i=!0),R},R.locale=A,R.isDayjs=L,R.unix=function(_){return R(1e3*_)},R.en=k[E],R.Ls=k,R.p={},R})}(gm)),gm.exports}var $Y=FY();const bi=nf($Y),mm={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return mm.hue2rgb(a,i,t+1/3)*255;case"g":return mm.hue2rgb(a,i,t)*255;case"b":return mm.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(e<r?6:0))*60;case e:return((r-t)/o+2)*60;case r:return((t-e)/o+4)*60;default:return-1}}},zY={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},VY={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},jt={channel:mm,lang:zY,unit:VY},fl={};for(let t=0;t<=255;t++)fl[t]=jt.unit.dec2hex(t);const vi={ALL:0,RGB:1,HSL:2};let GY=class{constructor(){this.type=vi.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=vi.ALL}is(e){return this.type===e}};class UY{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new GY}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=vi.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=jt.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=jt.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=jt.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=jt.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=jt.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=jt.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(vi.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(vi.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(vi.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(vi.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(vi.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(vi.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(vi.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(vi.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const k2=new UY({r:0,g:0,b:0,a:0},"transparent"),mh={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(mh.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return k2.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}${fl[Math.round(i*255)]}`:`#${fl[Math.round(e)]}${fl[Math.round(r)]}${fl[Math.round(n)]}`}},Dc={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Dc.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return jt.channel.clamp.h(parseFloat(r)*.9);case"rad":return jt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return jt.channel.clamp.h(parseFloat(r)*360)}}return jt.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Dc.re);if(!r)return;const[,n,i,a,s,o]=r;return k2.set({h:Dc._hue2deg(n),s:jt.channel.clamp.s(parseFloat(i)),l:jt.channel.clamp.l(parseFloat(a)),a:s?jt.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%, ${i})`:`hsl(${jt.lang.round(e)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%)`}},np={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=np.colors[t];if(e)return mh.parse(e)},stringify:t=>{const e=mh.stringify(t);for(const r in np.colors)if(np.colors[r]===e)return r}},n0={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(n0.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return k2.set({r:jt.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:jt.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:jt.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?jt.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)}, ${jt.lang.round(i)})`:`rgb(${jt.lang.round(e)}, ${jt.lang.round(r)}, ${jt.lang.round(n)})`}},Ts={format:{keyword:np,hex:mh,rgb:n0,rgba:n0,hsl:Dc,hsla:Dc},parse:t=>{if(typeof t!="string")return t;const e=mh.parse(t)||n0.parse(t)||Dc.parse(t)||np.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(vi.HSL)||t.data.r===void 0?Dc.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?n0.stringify(t):mh.stringify(t)},eD=(t,e)=>{const r=Ts.parse(t);for(const n in e)r[n]=jt.channel.clamp[n](e[n]);return Ts.stringify(r)},Sl=(t,e,r=0,n=1)=>{if(typeof t!="number")return eD(t,{a:e});const i=k2.set({r:jt.channel.clamp.r(t),g:jt.channel.clamp.g(e),b:jt.channel.clamp.b(r),a:jt.channel.clamp.a(n)});return Ts.stringify(i)},w6=(t,e)=>jt.lang.round(Ts.parse(t)[e]),qY=t=>{const{r:e,g:r,b:n}=Ts.parse(t),i=.2126*jt.channel.toLinear(e)+.7152*jt.channel.toLinear(r)+.0722*jt.channel.toLinear(n);return jt.lang.round(i)},HY=t=>qY(t)>=.5,Kl=t=>!HY(t),tD=(t,e,r)=>{const n=Ts.parse(t),i=n[e],a=jt.channel.clamp[e](i+r);return i!==a&&(n[e]=a),Ts.stringify(n)},Ct=(t,e)=>tD(t,"l",e),Mt=(t,e)=>tD(t,"l",-e),De=(t,e)=>{const r=Ts.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return eD(t,n)},WY=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=Ts.parse(t),{r:o,g:l,b:u,a:h}=Ts.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+o*v,b=i*m+l*v,w=a*m+u*v,T=s*d+h*(1-d);return Sl(y,b,w,T)},yt=(t,e=100)=>{const r=Ts.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,WY(r,t,e)};/*! @license DOMPurify 3.2.6 | (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.6/LICENSE */const{entries:rD,setPrototypeOf:u7,isFrozen:YY,getPrototypeOf:XY,getOwnPropertyDescriptor:jY}=Object;let{freeze:Gi,seal:Za,create:nD}=Object,{apply:y3,construct:x3}=typeof Reflect<"u"&&Reflect;Gi||(Gi=function(e){return e});Za||(Za=function(e){return e});y3||(y3=function(e,r,n){return e.apply(r,n)});x3||(x3=function(e,r){return new e(...r)});const s1=Ui(Array.prototype.forEach),KY=Ui(Array.prototype.lastIndexOf),h7=Ui(Array.prototype.pop),Lf=Ui(Array.prototype.push),ZY=Ui(Array.prototype.splice),vm=Ui(String.prototype.toLowerCase),hb=Ui(String.prototype.toString),d7=Ui(String.prototype.match),Rf=Ui(String.prototype.replace),QY=Ui(String.prototype.indexOf),JY=Ui(String.prototype.trim),ls=Ui(Object.prototype.hasOwnProperty),Ri=Ui(RegExp.prototype.test),Nf=eX(TypeError);function Ui(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return y3(t,e,n)}}function eX(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return x3(t,r)}}function or(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vm;u7&&u7(t,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(YY(e)||(e[n]=a),i=a)}t[i]=!0}return t}function tX(t){for(let e=0;e<t.length;e++)ls(t,e)||(t[e]=null);return t}function wo(t){const e=nD(null);for(const[r,n]of rD(t))ls(t,r)&&(Array.isArray(n)?e[r]=tX(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=wo(n):e[r]=n);return e}function Df(t,e){for(;t!==null;){const n=jY(t,e);if(n){if(n.get)return Ui(n.get);if(typeof n.value=="function")return Ui(n.value)}t=XY(t)}function r(){return null}return r}const f7=Gi(["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"]),db=Gi(["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"]),fb=Gi(["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"]),rX=Gi(["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"]),pb=Gi(["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"]),nX=Gi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),p7=Gi(["#text"]),g7=Gi(["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"]),gb=Gi(["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"]),m7=Gi(["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"]),o1=Gi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),iX=Za(/\{\{[\w\W]*|[\w\W]*\}\}/gm),aX=Za(/<%[\w\W]*|[\w\W]*%>/gm),sX=Za(/\$\{[\w\W]*/gm),oX=Za(/^data-[\-\w.\u00B7-\uFFFF]+$/),lX=Za(/^aria-[\-\w]+$/),iD=Za(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cX=Za(/^(?:\w+script|data):/i),uX=Za(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aD=Za(/^html$/i),hX=Za(/^[a-z][.\w]*(-[.\w]+)+$/i);var v7=Object.freeze({__proto__:null,ARIA_ATTR:lX,ATTR_WHITESPACE:uX,CUSTOM_ELEMENT:hX,DATA_ATTR:oX,DOCTYPE_NAME:aD,ERB_EXPR:aX,IS_ALLOWED_URI:iD,IS_SCRIPT_OR_DATA:cX,MUSTACHE_EXPR:iX,TMPLIT_EXPR:sX});const If={element:1,text:3,progressingInstruction:7,comment:8,document:9},dX=function(){return typeof window>"u"?null:window},fX=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},y7=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dX();const e=pt=>sD(pt);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==If.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:u,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=t,g=l.prototype,m=Df(g,"cloneNode"),v=Df(g,"remove"),y=Df(g,"nextSibling"),b=Df(g,"childNodes"),w=Df(g,"parentNode");if(typeof s=="function"){const pt=r.createElement("template");pt.content&&pt.content.ownerDocument&&(r=pt.content.ownerDocument)}let T,E="";const{implementation:k,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:A}=r,{importNode:R}=n;let C=y7();e.isSupported=typeof rD=="function"&&typeof w=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:I,ERB_EXPR:P,TMPLIT_EXPR:_,DATA_ATTR:N,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:B}=v7;let{IS_ALLOWED_URI:z}=v7,F=null;const G=or({},[...f7,...db,...fb,...pb,...p7]);let q=null;const Y=or({},[...g7,...gb,...m7,...o1]);let ee=Object.seal(nD(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,oe=null,pe=!0,j=!0,W=!1,X=!0,H=!1,K=!0,ne=!1,Z=!1,be=!1,ce=!1,re=!1,Ne=!1,me=!0,Ve=!1;const Ue="user-content-";let Fe=!0,_e=!1,Oe={},Ce=null;const Le=or({},["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 ze=null;const ge=or({},["audio","video","img","source","image","track"]);let Me=null;const J=or({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",$="http://www.w3.org/2000/svg",se="http://www.w3.org/1999/xhtml";let ae=se,fe=!1,he=null;const Te=or({},[ue,$,se],hb);let Se=or({},["mi","mo","mn","ms","mtext"]),Ee=or({},["annotation-xml"]);const Ge=or({},["title","style","font","a","script"]);let Je=null;const He=["application/xhtml+xml","text/html"],Xe="text/html";let Ke=null,$e=null;const je=r.createElement("form"),lt=function(ke){return ke instanceof RegExp||ke instanceof Function},st=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!($e&&$e===ke)){if((!ke||typeof ke!="object")&&(ke={}),ke=wo(ke),Je=He.indexOf(ke.PARSER_MEDIA_TYPE)===-1?Xe:ke.PARSER_MEDIA_TYPE,Ke=Je==="application/xhtml+xml"?hb:vm,F=ls(ke,"ALLOWED_TAGS")?or({},ke.ALLOWED_TAGS,Ke):G,q=ls(ke,"ALLOWED_ATTR")?or({},ke.ALLOWED_ATTR,Ke):Y,he=ls(ke,"ALLOWED_NAMESPACES")?or({},ke.ALLOWED_NAMESPACES,hb):Te,Me=ls(ke,"ADD_URI_SAFE_ATTR")?or(wo(J),ke.ADD_URI_SAFE_ATTR,Ke):J,ze=ls(ke,"ADD_DATA_URI_TAGS")?or(wo(ge),ke.ADD_DATA_URI_TAGS,Ke):ge,Ce=ls(ke,"FORBID_CONTENTS")?or({},ke.FORBID_CONTENTS,Ke):Le,Q=ls(ke,"FORBID_TAGS")?or({},ke.FORBID_TAGS,Ke):wo({}),oe=ls(ke,"FORBID_ATTR")?or({},ke.FORBID_ATTR,Ke):wo({}),Oe=ls(ke,"USE_PROFILES")?ke.USE_PROFILES:!1,pe=ke.ALLOW_ARIA_ATTR!==!1,j=ke.ALLOW_DATA_ATTR!==!1,W=ke.ALLOW_UNKNOWN_PROTOCOLS||!1,X=ke.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=ke.SAFE_FOR_TEMPLATES||!1,K=ke.SAFE_FOR_XML!==!1,ne=ke.WHOLE_DOCUMENT||!1,ce=ke.RETURN_DOM||!1,re=ke.RETURN_DOM_FRAGMENT||!1,Ne=ke.RETURN_TRUSTED_TYPE||!1,be=ke.FORCE_BODY||!1,me=ke.SANITIZE_DOM!==!1,Ve=ke.SANITIZE_NAMED_PROPS||!1,Fe=ke.KEEP_CONTENT!==!1,_e=ke.IN_PLACE||!1,z=ke.ALLOWED_URI_REGEXP||iD,ae=ke.NAMESPACE||se,Se=ke.MATHML_TEXT_INTEGRATION_POINTS||Se,Ee=ke.HTML_INTEGRATION_POINTS||Ee,ee=ke.CUSTOM_ELEMENT_HANDLING||{},ke.CUSTOM_ELEMENT_HANDLING&<(ke.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=ke.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ke.CUSTOM_ELEMENT_HANDLING&<(ke.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=ke.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ke.CUSTOM_ELEMENT_HANDLING&&typeof ke.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=ke.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(j=!1),re&&(ce=!0),Oe&&(F=or({},p7),q=[],Oe.html===!0&&(or(F,f7),or(q,g7)),Oe.svg===!0&&(or(F,db),or(q,gb),or(q,o1)),Oe.svgFilters===!0&&(or(F,fb),or(q,gb),or(q,o1)),Oe.mathMl===!0&&(or(F,pb),or(q,m7),or(q,o1))),ke.ADD_TAGS&&(F===G&&(F=wo(F)),or(F,ke.ADD_TAGS,Ke)),ke.ADD_ATTR&&(q===Y&&(q=wo(q)),or(q,ke.ADD_ATTR,Ke)),ke.ADD_URI_SAFE_ATTR&&or(Me,ke.ADD_URI_SAFE_ATTR,Ke),ke.FORBID_CONTENTS&&(Ce===Le&&(Ce=wo(Ce)),or(Ce,ke.FORBID_CONTENTS,Ke)),Fe&&(F["#text"]=!0),ne&&or(F,["html","head","body"]),F.table&&(or(F,["tbody"]),delete Q.tbody),ke.TRUSTED_TYPES_POLICY){if(typeof ke.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ke.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=ke.TRUSTED_TYPES_POLICY,E=T.createHTML("")}else T===void 0&&(T=fX(p,i)),T!==null&&typeof E=="string"&&(E=T.createHTML(""));Gi&&Gi(ke),$e=ke}},qe=or({},[...db,...fb,...rX]),Et=or({},[...pb,...nX]),Ye=function(ke){let Qe=w(ke);(!Qe||!Qe.tagName)&&(Qe={namespaceURI:ae,tagName:"template"});const xt=vm(ke.tagName),tr=vm(Qe.tagName);return he[ke.namespaceURI]?ke.namespaceURI===$?Qe.namespaceURI===se?xt==="svg":Qe.namespaceURI===ue?xt==="svg"&&(tr==="annotation-xml"||Se[tr]):!!qe[xt]:ke.namespaceURI===ue?Qe.namespaceURI===se?xt==="math":Qe.namespaceURI===$?xt==="math"&&Ee[tr]:!!Et[xt]:ke.namespaceURI===se?Qe.namespaceURI===$&&!Ee[tr]||Qe.namespaceURI===ue&&!Se[tr]?!1:!Et[xt]&&(Ge[xt]||!qe[xt]):!!(Je==="application/xhtml+xml"&&he[ke.namespaceURI]):!1},Ze=function(ke){Lf(e.removed,{element:ke});try{w(ke).removeChild(ke)}catch{v(ke)}},ht=function(ke,Qe){try{Lf(e.removed,{attribute:Qe.getAttributeNode(ke),from:Qe})}catch{Lf(e.removed,{attribute:null,from:Qe})}if(Qe.removeAttribute(ke),ke==="is")if(ce||re)try{Ze(Qe)}catch{}else try{Qe.setAttribute(ke,"")}catch{}},ct=function(ke){let Qe=null,xt=null;if(be)ke="<remove></remove>"+ke;else{const Or=d7(ke,/^[\r\n\t ]+/);xt=Or&&Or[0]}Je==="application/xhtml+xml"&&ae===se&&(ke='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ke+"</body></html>");const tr=T?T.createHTML(ke):ke;if(ae===se)try{Qe=new f().parseFromString(tr,Je)}catch{}if(!Qe||!Qe.documentElement){Qe=k.createDocument(ae,"template",null);try{Qe.documentElement.innerHTML=fe?E:tr}catch{}}const Mr=Qe.body||Qe.documentElement;return ke&&xt&&Mr.insertBefore(r.createTextNode(xt),Mr.childNodes[0]||null),ae===se?A.call(Qe,ne?"html":"body")[0]:ne?Qe.documentElement:Mr},ut=function(ke){return S.call(ke.ownerDocument||ke,ke,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},mt=function(ke){return ke instanceof d&&(typeof ke.nodeName!="string"||typeof ke.textContent!="string"||typeof ke.removeChild!="function"||!(ke.attributes instanceof h)||typeof ke.removeAttribute!="function"||typeof ke.setAttribute!="function"||typeof ke.namespaceURI!="string"||typeof ke.insertBefore!="function"||typeof ke.hasChildNodes!="function")},sr=function(ke){return typeof o=="function"&&ke instanceof o};function Rt(pt,ke,Qe){s1(pt,xt=>{xt.call(e,ke,Qe,$e)})}const hr=function(ke){let Qe=null;if(Rt(C.beforeSanitizeElements,ke,null),mt(ke))return Ze(ke),!0;const xt=Ke(ke.nodeName);if(Rt(C.uponSanitizeElement,ke,{tagName:xt,allowedTags:F}),K&&ke.hasChildNodes()&&!sr(ke.firstElementChild)&&Ri(/<[/\w!]/g,ke.innerHTML)&&Ri(/<[/\w!]/g,ke.textContent)||ke.nodeType===If.progressingInstruction||K&&ke.nodeType===If.comment&&Ri(/<[/\w]/g,ke.data))return Ze(ke),!0;if(!F[xt]||Q[xt]){if(!Q[xt]&&er(xt)&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,xt)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(xt)))return!1;if(Fe&&!Ce[xt]){const tr=w(ke)||ke.parentNode,Mr=b(ke)||ke.childNodes;if(Mr&&tr){const Or=Mr.length;for(let Lr=Or-1;Lr>=0;--Lr){const Sn=m(Mr[Lr],!0);Sn.__removalCount=(ke.__removalCount||0)+1,tr.insertBefore(Sn,y(ke))}}}return Ze(ke),!0}return ke instanceof l&&!Ye(ke)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Ri(/<\/no(script|embed|frames)/i,ke.innerHTML)?(Ze(ke),!0):(H&&ke.nodeType===If.text&&(Qe=ke.textContent,s1([I,P,_],tr=>{Qe=Rf(Qe,tr," ")}),ke.textContent!==Qe&&(Lf(e.removed,{element:ke.cloneNode()}),ke.textContent=Qe)),Rt(C.afterSanitizeElements,ke,null),!1)},rr=function(ke,Qe,xt){if(me&&(Qe==="id"||Qe==="name")&&(xt in r||xt in je))return!1;if(!(j&&!oe[Qe]&&Ri(N,Qe))){if(!(pe&&Ri(M,Qe))){if(!q[Qe]||oe[Qe]){if(!(er(ke)&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,ke)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(ke))&&(ee.attributeNameCheck instanceof RegExp&&Ri(ee.attributeNameCheck,Qe)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(Qe))||Qe==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Ri(ee.tagNameCheck,xt)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(xt))))return!1}else if(!Me[Qe]){if(!Ri(z,Rf(xt,D,""))){if(!((Qe==="src"||Qe==="xlink:href"||Qe==="href")&&ke!=="script"&&QY(xt,"data:")===0&&ze[ke])){if(!(W&&!Ri(O,Rf(xt,D,"")))){if(xt)return!1}}}}}}return!0},er=function(ke){return ke!=="annotation-xml"&&d7(ke,B)},Wt=function(ke){Rt(C.beforeSanitizeAttributes,ke,null);const{attributes:Qe}=ke;if(!Qe||mt(ke))return;const xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let tr=Qe.length;for(;tr--;){const Mr=Qe[tr],{name:Or,namespaceURI:Lr,value:Sn}=Mr,gi=Ke(Or),Li=Sn;let dr=Or==="value"?Li:JY(Li);if(xt.attrName=gi,xt.attrValue=dr,xt.keepAttr=!0,xt.forceKeepAttr=void 0,Rt(C.uponSanitizeAttribute,ke,xt),dr=xt.attrValue,Ve&&(gi==="id"||gi==="name")&&(ht(Or,ke),dr=Ue+dr),K&&Ri(/((--!?|])>)|<\/(style|title)/i,dr)){ht(Or,ke);continue}if(xt.forceKeepAttr)continue;if(!xt.keepAttr){ht(Or,ke);continue}if(!X&&Ri(/\/>/i,dr)){ht(Or,ke);continue}H&&s1([I,P,_],bt=>{dr=Rf(dr,bt," ")});const At=Ke(ke.nodeName);if(!rr(At,gi,dr)){ht(Or,ke);continue}if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Lr)switch(p.getAttributeType(At,gi)){case"TrustedHTML":{dr=T.createHTML(dr);break}case"TrustedScriptURL":{dr=T.createScriptURL(dr);break}}if(dr!==Li)try{Lr?ke.setAttributeNS(Lr,Or,dr):ke.setAttribute(Or,dr),mt(ke)?Ze(ke):h7(e.removed)}catch{ht(Or,ke)}}Rt(C.afterSanitizeAttributes,ke,null)},Xr=function pt(ke){let Qe=null;const xt=ut(ke);for(Rt(C.beforeSanitizeShadowDOM,ke,null);Qe=xt.nextNode();)Rt(C.uponSanitizeShadowNode,Qe,null),hr(Qe),Wt(Qe),Qe.content instanceof a&&pt(Qe.content);Rt(C.afterSanitizeShadowDOM,ke,null)};return e.sanitize=function(pt){let ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Qe=null,xt=null,tr=null,Mr=null;if(fe=!pt,fe&&(pt="\x3C!-->"),typeof pt!="string"&&!sr(pt))if(typeof pt.toString=="function"){if(pt=pt.toString(),typeof pt!="string")throw Nf("dirty is not a string, aborting")}else throw Nf("toString is not a function");if(!e.isSupported)return pt;if(Z||st(ke),e.removed=[],typeof pt=="string"&&(_e=!1),_e){if(pt.nodeName){const Sn=Ke(pt.nodeName);if(!F[Sn]||Q[Sn])throw Nf("root node is forbidden and cannot be sanitized in-place")}}else if(pt instanceof o)Qe=ct("\x3C!---->"),xt=Qe.ownerDocument.importNode(pt,!0),xt.nodeType===If.element&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?Qe=xt:Qe.appendChild(xt);else{if(!ce&&!H&&!ne&&pt.indexOf("<")===-1)return T&&Ne?T.createHTML(pt):pt;if(Qe=ct(pt),!Qe)return ce?null:Ne?E:""}Qe&&be&&Ze(Qe.firstChild);const Or=ut(_e?pt:Qe);for(;tr=Or.nextNode();)hr(tr),Wt(tr),tr.content instanceof a&&Xr(tr.content);if(_e)return pt;if(ce){if(re)for(Mr=L.call(Qe.ownerDocument);Qe.firstChild;)Mr.appendChild(Qe.firstChild);else Mr=Qe;return(q.shadowroot||q.shadowrootmode)&&(Mr=R.call(n,Mr,!0)),Mr}let Lr=ne?Qe.outerHTML:Qe.innerHTML;return ne&&F["!doctype"]&&Qe.ownerDocument&&Qe.ownerDocument.doctype&&Qe.ownerDocument.doctype.name&&Ri(aD,Qe.ownerDocument.doctype.name)&&(Lr="<!DOCTYPE "+Qe.ownerDocument.doctype.name+`>
|
|
413
|
+
`+Lr),H&&s1([I,P,_],Sn=>{Lr=Rf(Lr,Sn," ")}),T&&Ne?T.createHTML(Lr):Lr},e.setConfig=function(){let pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(pt),Z=!0},e.clearConfig=function(){$e=null,Z=!1},e.isValidAttribute=function(pt,ke,Qe){$e||st({});const xt=Ke(pt),tr=Ke(ke);return rr(xt,tr,Qe)},e.addHook=function(pt,ke){typeof ke=="function"&&Lf(C[pt],ke)},e.removeHook=function(pt,ke){if(ke!==void 0){const Qe=KY(C[pt],ke);return Qe===-1?void 0:ZY(C[pt],Qe,1)[0]}return h7(C[pt])},e.removeHooks=function(pt){C[pt]=[]},e.removeAllHooks=function(){C=y7()},e}var Td=sD(),oD=Object.defineProperty,x=(t,e)=>oD(t,"name",{value:e,configurable:!0}),C2=(t,e)=>{for(var r in e)oD(t,r,{get:e[r],enumerable:!0})},po={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ie={trace:x((...t)=>{},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},T6=x(function(t="fatal"){let e=po.fatal;typeof t=="string"?t.toLowerCase()in po&&(e=po[t]):typeof t=="number"&&(e=t),ie.trace=()=>{},ie.debug=()=>{},ie.info=()=>{},ie.warn=()=>{},ie.error=()=>{},ie.fatal=()=>{},e<=po.fatal&&(ie.fatal=console.error?console.error.bind(console,Oa("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Oa("FATAL"))),e<=po.error&&(ie.error=console.error?console.error.bind(console,Oa("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Oa("ERROR"))),e<=po.warn&&(ie.warn=console.warn?console.warn.bind(console,Oa("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Oa("WARN"))),e<=po.info&&(ie.info=console.info?console.info.bind(console,Oa("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Oa("INFO"))),e<=po.debug&&(ie.debug=console.debug?console.debug.bind(console,Oa("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Oa("DEBUG"))),e<=po.trace&&(ie.trace=console.debug?console.debug.bind(console,Oa("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Oa("TRACE")))},"setLogLevel"),Oa=x(t=>`%c${bi().format("ss.SSS")} : ${t} : `,"format"),lD=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,ip=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,pX=/\s*%%.*\n/gm,Nh,cD=(Nh=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(Nh,"UnknownDiagramError"),Nh),Ed={},E6=x(function(t,e){t=t.replace(lD,"").replace(ip,"").replace(pX,`
|
|
414
414
|
`);for(const[r,{detector:n}]of Object.entries(Ed))if(n(t,e))return r;throw new cD(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),uD=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)hD(e,r,n)},"registerLazyLoadedDiagrams"),hD=x((t,e,r)=>{Ed[t]&&ie.warn(`Detector with key ${t} already exists. Overwriting.`),Ed[t]={detector:e,loader:r},ie.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),gX=x(t=>Ed[t].loader,"getDiagramLoader"),b3=x((t,e,{depth:r=2,clobber:n=!1}={})=>{const i={depth:r,clobber:n};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>b3(t,a,i)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=b3(t[a],e[a],{depth:r-1,clobber:n})):(n||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),In=b3,A2="#ffffff",_2="#f2f2f2",Oi=x((t,e)=>e?De(t,{s:-40,l:10}):De(t,{s:-40,l:-10}),"mkBorder"),Dh,mX=(Dh=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w,T,E,k;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||De(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||De(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Oi(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Oi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Oi(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Oi(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||yt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||yt(this.tertiaryColor),this.lineColor=this.lineColor||yt(this.background),this.arrowheadColor=this.arrowheadColor||yt(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?Mt(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||Mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||yt(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||Ct(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||Mt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Mt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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||De(this.primaryColor,{h:30}),this.cScale4=this.cScale4||De(this.primaryColor,{h:60}),this.cScale5=this.cScale5||De(this.primaryColor,{h:90}),this.cScale6=this.cScale6||De(this.primaryColor,{h:120}),this.cScale7=this.cScale7||De(this.primaryColor,{h:150}),this.cScale8=this.cScale8||De(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||De(this.primaryColor,{h:270}),this.cScale10=this.cScale10||De(this.primaryColor,{h:300}),this.cScale11=this.cScale11||De(this.primaryColor,{h:330}),this.darkMode)for(let S=0;S<this.THEME_COLOR_LIMIT;S++)this["cScale"+S]=Mt(this["cScale"+S],75);else for(let S=0;S<this.THEME_COLOR_LIMIT;S++)this["cScale"+S]=Mt(this["cScale"+S],25);for(let S=0;S<this.THEME_COLOR_LIMIT;S++)this["cScaleInv"+S]=this["cScaleInv"+S]||yt(this["cScale"+S]);for(let S=0;S<this.THEME_COLOR_LIMIT;S++)this.darkMode?this["cScalePeer"+S]=this["cScalePeer"+S]||Ct(this["cScale"+S],10):this["cScalePeer"+S]=this["cScalePeer"+S]||Mt(this["cScale"+S],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let S=0;S<this.THEME_COLOR_LIMIT;S++)this["cScaleLabel"+S]=this["cScaleLabel"+S]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let S=0;S<5;S++)this["surface"+S]=this["surface"+S]||De(this.mainBkg,{h:180,s:-15,l:e*(5+S*3)}),this["surfacePeer"+S]=this["surfacePeer"+S]||De(this.mainBkg,{h:180,s:-15,l:e*(8+S*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||De(this.primaryColor,{h:64}),this.fillType3=this.fillType3||De(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||De(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||De(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||De(this.primaryColor,{h:128}),this.fillType7=this.fillType7||De(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||De(this.primaryColor,{l:-10}),this.pie5=this.pie5||De(this.secondaryColor,{l:-10}),this.pie6=this.pie6||De(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||De(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||De(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||De(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||De(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||De(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||De(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:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((n=this.radar)==null?void 0:n.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((a=this.radar)==null?void 0:a.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((o=this.radar)==null?void 0:o.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((u=this.radar)==null?void 0:u.graticuleOpacity)||.3,legendBoxSize:((h=this.radar)==null?void 0:h.legendBoxSize)||12,legendFontSize:((d=this.radar)==null?void 0:d.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||De(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||De(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||De(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||De(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||De(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||De(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Kl(this.quadrant1Fill)?Ct(this.quadrant1Fill):Mt(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:((f=this.xyChart)==null?void 0:f.backgroundColor)||this.background,titleColor:((p=this.xyChart)==null?void 0:p.titleColor)||this.primaryTextColor,xAxisTitleColor:((g=this.xyChart)==null?void 0:g.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((m=this.xyChart)==null?void 0:m.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((v=this.xyChart)==null?void 0:v.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((y=this.xyChart)==null?void 0:y.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((b=this.xyChart)==null?void 0:b.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((w=this.xyChart)==null?void 0:w.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((T=this.xyChart)==null?void 0:T.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((E=this.xyChart)==null?void 0:E.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((k=this.xyChart)==null?void 0:k.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?Mt(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||De(this.primaryColor,{h:-30}),this.git4=this.git4||De(this.primaryColor,{h:-60}),this.git5=this.git5||De(this.primaryColor,{h:-90}),this.git6=this.git6||De(this.primaryColor,{h:60}),this.git7=this.git7||De(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=Mt(this.git0,25),this.git1=Mt(this.git1,25),this.git2=Mt(this.git2,25),this.git3=Mt(this.git3,25),this.git4=Mt(this.git4,25),this.git5=Mt(this.git5,25),this.git6=Mt(this.git6,25),this.git7=Mt(this.git7,25)),this.gitInv0=this.gitInv0||yt(this.git0),this.gitInv1=this.gitInv1||yt(this.git1),this.gitInv2=this.gitInv2||yt(this.git2),this.gitInv3=this.gitInv3||yt(this.git3),this.gitInv4=this.gitInv4||yt(this.git4),this.gitInv5=this.gitInv5||yt(this.git5),this.gitInv6=this.gitInv6||yt(this.git6),this.gitInv7=this.gitInv7||yt(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||A2,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||_2}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Dh,"Theme"),Dh),vX=x(t=>{const e=new mX;return e.calculate(t),e},"getThemeVariables"),Ih,yX=(Ih=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Ct(this.primaryColor,16),this.tertiaryColor=De(this.primaryColor,{h:-160}),this.primaryBorderColor=yt(this.background),this.secondaryBorderColor=Oi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Oi(this.tertiaryColor,this.darkMode),this.primaryTextColor=yt(this.primaryColor),this.secondaryTextColor=yt(this.secondaryColor),this.tertiaryTextColor=yt(this.tertiaryColor),this.lineColor=yt(this.background),this.textColor=yt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Ct(yt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Sl(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=Mt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Mt(this.sectionBkgColor,10),this.taskBorderColor=Sl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Sl(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||Ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Mt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w,T,E;this.secondBkg=Ct(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=Ct(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=Ct(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=De(this.primaryColor,{h:64}),this.fillType3=De(this.secondaryColor,{h:64}),this.fillType4=De(this.primaryColor,{h:-64}),this.fillType5=De(this.secondaryColor,{h:-64}),this.fillType6=De(this.primaryColor,{h:128}),this.fillType7=De(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||De(this.primaryColor,{h:30}),this.cScale4=this.cScale4||De(this.primaryColor,{h:60}),this.cScale5=this.cScale5||De(this.primaryColor,{h:90}),this.cScale6=this.cScale6||De(this.primaryColor,{h:120}),this.cScale7=this.cScale7||De(this.primaryColor,{h:150}),this.cScale8=this.cScale8||De(this.primaryColor,{h:210}),this.cScale9=this.cScale9||De(this.primaryColor,{h:270}),this.cScale10=this.cScale10||De(this.primaryColor,{h:300}),this.cScale11=this.cScale11||De(this.primaryColor,{h:330});for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||yt(this["cScale"+k]);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScalePeer"+k]=this["cScalePeer"+k]||Ct(this["cScale"+k],10);for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||De(this.mainBkg,{h:30,s:-30,l:-(-10+k*4)}),this["surfacePeer"+k]=this["surfacePeer"+k]||De(this.mainBkg,{h:30,s:-30,l:-(-7+k*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["pie"+k]=this["cScale"+k];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||De(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||De(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||De(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||De(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||De(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||De(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Kl(this.quadrant1Fill)?Ct(this.quadrant1Fill):Mt(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:((e=this.xyChart)==null?void 0:e.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((l=this.xyChart)==null?void 0:l.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((u=this.xyChart)==null?void 0:u.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((d=this.xyChart)==null?void 0:d.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:((f=this.radar)==null?void 0:f.axisColor)||this.lineColor,axisStrokeWidth:((p=this.radar)==null?void 0:p.axisStrokeWidth)||2,axisLabelFontSize:((g=this.radar)==null?void 0:g.axisLabelFontSize)||12,curveOpacity:((m=this.radar)==null?void 0:m.curveOpacity)||.5,curveStrokeWidth:((v=this.radar)==null?void 0:v.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((b=this.radar)==null?void 0:b.graticuleStrokeWidth)||1,graticuleOpacity:((w=this.radar)==null?void 0:w.graticuleOpacity)||.3,legendBoxSize:((T=this.radar)==null?void 0:T.legendBoxSize)||12,legendFontSize:((E=this.radar)==null?void 0:E.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?Mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ct(this.secondaryColor,20),this.git1=Ct(this.pie2||this.secondaryColor,20),this.git2=Ct(this.pie3||this.tertiaryColor,20),this.git3=Ct(this.pie4||De(this.primaryColor,{h:-30}),20),this.git4=Ct(this.pie5||De(this.primaryColor,{h:-60}),20),this.git5=Ct(this.pie6||De(this.primaryColor,{h:-90}),10),this.git6=Ct(this.pie7||De(this.primaryColor,{h:60}),10),this.git7=Ct(this.pie8||De(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||yt(this.git0),this.gitInv1=this.gitInv1||yt(this.git1),this.gitInv2=this.gitInv2||yt(this.git2),this.gitInv3=this.gitInv3||yt(this.git3),this.gitInv4=this.gitInv4||yt(this.git4),this.gitInv5=this.gitInv5||yt(this.git5),this.gitInv6=this.gitInv6||yt(this.git6),this.gitInv7=this.gitInv7||yt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||yt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||yt(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||Ct(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ct(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ih,"Theme"),Ih),xX=x(t=>{const e=new yX;return e.calculate(t),e},"getThemeVariables"),Mh,bX=(Mh=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=De(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=De(this.primaryColor,{h:-160}),this.primaryBorderColor=Oi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Oi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Oi(this.tertiaryColor,this.darkMode),this.primaryTextColor=yt(this.primaryColor),this.secondaryTextColor=yt(this.secondaryColor),this.tertiaryTextColor=yt(this.tertiaryColor),this.lineColor=yt(this.background),this.textColor=yt(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=Sl(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(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w,T,E;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||De(this.primaryColor,{h:30}),this.cScale4=this.cScale4||De(this.primaryColor,{h:60}),this.cScale5=this.cScale5||De(this.primaryColor,{h:90}),this.cScale6=this.cScale6||De(this.primaryColor,{h:120}),this.cScale7=this.cScale7||De(this.primaryColor,{h:150}),this.cScale8=this.cScale8||De(this.primaryColor,{h:210}),this.cScale9=this.cScale9||De(this.primaryColor,{h:270}),this.cScale10=this.cScale10||De(this.primaryColor,{h:300}),this.cScale11=this.cScale11||De(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Mt(this.tertiaryColor,40);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScale"+k]=Mt(this["cScale"+k],10),this["cScalePeer"+k]=this["cScalePeer"+k]||Mt(this["cScale"+k],25);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||De(this["cScale"+k],{h:180});for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||De(this.mainBkg,{h:30,l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||De(this.mainBkg,{h:30,l:-(7+k*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||yt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||yt(this.labelTextColor);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||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=Ct(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||Ct(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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=De(this.primaryColor,{h:64}),this.fillType3=De(this.secondaryColor,{h:64}),this.fillType4=De(this.primaryColor,{h:-64}),this.fillType5=De(this.secondaryColor,{h:-64}),this.fillType6=De(this.primaryColor,{h:128}),this.fillType7=De(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||De(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||De(this.primaryColor,{l:-10}),this.pie5=this.pie5||De(this.secondaryColor,{l:-30}),this.pie6=this.pie6||De(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||De(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||De(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||De(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||De(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||De(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||De(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||De(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||De(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||De(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||De(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||De(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||De(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Kl(this.quadrant1Fill)?Ct(this.quadrant1Fill):Mt(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:((e=this.radar)==null?void 0:e.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((s=this.radar)==null?void 0:s.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((o=this.radar)==null?void 0:o.graticuleStrokeWidth)||1,graticuleOpacity:((l=this.radar)==null?void 0:l.graticuleOpacity)||.3,legendBoxSize:((u=this.radar)==null?void 0:u.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((d=this.xyChart)==null?void 0:d.backgroundColor)||this.background,titleColor:((f=this.xyChart)==null?void 0:f.titleColor)||this.primaryTextColor,xAxisTitleColor:((p=this.xyChart)==null?void 0:p.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((g=this.xyChart)==null?void 0:g.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((m=this.xyChart)==null?void 0:m.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((v=this.xyChart)==null?void 0:v.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((b=this.xyChart)==null?void 0:b.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((w=this.xyChart)==null?void 0:w.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((T=this.xyChart)==null?void 0:T.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((E=this.xyChart)==null?void 0:E.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||De(this.primaryColor,{h:-30}),this.git4=this.git4||De(this.primaryColor,{h:-60}),this.git5=this.git5||De(this.primaryColor,{h:-90}),this.git6=this.git6||De(this.primaryColor,{h:60}),this.git7=this.git7||De(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=Mt(this.git0,25),this.git1=Mt(this.git1,25),this.git2=Mt(this.git2,25),this.git3=Mt(this.git3,25),this.git4=Mt(this.git4,25),this.git5=Mt(this.git5,25),this.git6=Mt(this.git6,25),this.git7=Mt(this.git7,25)),this.gitInv0=this.gitInv0||Mt(yt(this.git0),25),this.gitInv1=this.gitInv1||yt(this.git1),this.gitInv2=this.gitInv2||yt(this.git2),this.gitInv3=this.gitInv3||yt(this.git3),this.gitInv4=this.gitInv4||yt(this.git4),this.gitInv5=this.gitInv5||yt(this.git5),this.gitInv6=this.gitInv6||yt(this.git6),this.gitInv7=this.gitInv7||yt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||yt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||yt(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||A2,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||_2}calculate(e){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Mh,"Theme"),Mh),L2=x(t=>{const e=new bX;return e.calculate(t),e},"getThemeVariables"),Oh,wX=(Oh=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Ct("#cde498",10),this.primaryBorderColor=Oi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Oi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Oi(this.tertiaryColor,this.darkMode),this.primaryTextColor=yt(this.primaryColor),this.secondaryTextColor=yt(this.secondaryColor),this.tertiaryTextColor=yt(this.primaryColor),this.lineColor=yt(this.background),this.textColor=yt(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(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w,T,E;this.actorBorder=Mt(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||De(this.primaryColor,{h:30}),this.cScale4=this.cScale4||De(this.primaryColor,{h:60}),this.cScale5=this.cScale5||De(this.primaryColor,{h:90}),this.cScale6=this.cScale6||De(this.primaryColor,{h:120}),this.cScale7=this.cScale7||De(this.primaryColor,{h:150}),this.cScale8=this.cScale8||De(this.primaryColor,{h:210}),this.cScale9=this.cScale9||De(this.primaryColor,{h:270}),this.cScale10=this.cScale10||De(this.primaryColor,{h:300}),this.cScale11=this.cScale11||De(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Mt(this.tertiaryColor,40);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScale"+k]=Mt(this["cScale"+k],10),this["cScalePeer"+k]=this["cScalePeer"+k]||Mt(this["cScale"+k],25);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||De(this["cScale"+k],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||De(this.mainBkg,{h:30,s:-30,l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||De(this.mainBkg,{h:30,s:-30,l:-(8+k*5)});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||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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=De(this.primaryColor,{h:64}),this.fillType3=De(this.secondaryColor,{h:64}),this.fillType4=De(this.primaryColor,{h:-64}),this.fillType5=De(this.secondaryColor,{h:-64}),this.fillType6=De(this.primaryColor,{h:128}),this.fillType7=De(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||De(this.primaryColor,{l:-30}),this.pie5=this.pie5||De(this.secondaryColor,{l:-30}),this.pie6=this.pie6||De(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||De(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||De(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||De(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||De(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||De(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||De(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||De(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||De(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||De(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||De(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||De(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||De(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Kl(this.quadrant1Fill)?Ct(this.quadrant1Fill):Mt(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:((e=this.radar)==null?void 0:e.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((i=this.radar)==null?void 0:i.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((s=this.radar)==null?void 0:s.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((o=this.radar)==null?void 0:o.graticuleStrokeWidth)||1,graticuleOpacity:((l=this.radar)==null?void 0:l.graticuleOpacity)||.3,legendBoxSize:((u=this.radar)==null?void 0:u.legendBoxSize)||12,legendFontSize:((h=this.radar)==null?void 0:h.legendFontSize)||12},this.xyChart={backgroundColor:((d=this.xyChart)==null?void 0:d.backgroundColor)||this.background,titleColor:((f=this.xyChart)==null?void 0:f.titleColor)||this.primaryTextColor,xAxisTitleColor:((p=this.xyChart)==null?void 0:p.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((g=this.xyChart)==null?void 0:g.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((m=this.xyChart)==null?void 0:m.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((v=this.xyChart)==null?void 0:v.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((y=this.xyChart)==null?void 0:y.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((b=this.xyChart)==null?void 0:b.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((w=this.xyChart)==null?void 0:w.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((T=this.xyChart)==null?void 0:T.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((E=this.xyChart)==null?void 0:E.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||De(this.primaryColor,{h:-30}),this.git4=this.git4||De(this.primaryColor,{h:-60}),this.git5=this.git5||De(this.primaryColor,{h:-90}),this.git6=this.git6||De(this.primaryColor,{h:60}),this.git7=this.git7||De(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=Mt(this.git0,25),this.git1=Mt(this.git1,25),this.git2=Mt(this.git2,25),this.git3=Mt(this.git3,25),this.git4=Mt(this.git4,25),this.git5=Mt(this.git5,25),this.git6=Mt(this.git6,25),this.git7=Mt(this.git7,25)),this.gitInv0=this.gitInv0||yt(this.git0),this.gitInv1=this.gitInv1||yt(this.git1),this.gitInv2=this.gitInv2||yt(this.git2),this.gitInv3=this.gitInv3||yt(this.git3),this.gitInv4=this.gitInv4||yt(this.git4),this.gitInv5=this.gitInv5||yt(this.git5),this.gitInv6=this.gitInv6||yt(this.git6),this.gitInv7=this.gitInv7||yt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||yt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||yt(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||A2,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||_2}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Oh,"Theme"),Oh),TX=x(t=>{const e=new wX;return e.calculate(t),e},"getThemeVariables"),Ph,EX=(Ph=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Ct(this.contrast,55),this.background="#ffffff",this.tertiaryColor=De(this.primaryColor,{h:-160}),this.primaryBorderColor=Oi(this.primaryColor,this.darkMode),this.secondaryBorderColor=Oi(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Oi(this.tertiaryColor,this.darkMode),this.primaryTextColor=yt(this.primaryColor),this.secondaryTextColor=yt(this.secondaryColor),this.tertiaryTextColor=yt(this.tertiaryColor),this.lineColor=yt(this.background),this.textColor=yt(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||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w,T,E;this.secondBkg=Ct(this.contrast,55),this.border2=this.contrast,this.actorBorder=Ct(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 k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||yt(this["cScale"+k]);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this.darkMode?this["cScalePeer"+k]=this["cScalePeer"+k]||Ct(this["cScale"+k],10):this["cScalePeer"+k]=this["cScalePeer"+k]||Mt(this["cScale"+k],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||De(this.mainBkg,{l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||De(this.mainBkg,{l:-(8+k*5)});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=Ct(this.contrast,30),this.sectionBkgColor2=Ct(this.contrast,30),this.taskBorderColor=Mt(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=Ct(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Mt(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=De(this.primaryColor,{h:64}),this.fillType3=De(this.secondaryColor,{h:64}),this.fillType4=De(this.primaryColor,{h:-64}),this.fillType5=De(this.secondaryColor,{h:-64}),this.fillType6=De(this.primaryColor,{h:128}),this.fillType7=De(this.secondaryColor,{h:128});for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["pie"+k]=this["cScale"+k];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||De(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||De(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||De(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||De(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||De(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||De(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Kl(this.quadrant1Fill)?Ct(this.quadrant1Fill):Mt(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:((e=this.xyChart)==null?void 0:e.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((i=this.xyChart)==null?void 0:i.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((a=this.xyChart)==null?void 0:a.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((s=this.xyChart)==null?void 0:s.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((o=this.xyChart)==null?void 0:o.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((l=this.xyChart)==null?void 0:l.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((u=this.xyChart)==null?void 0:u.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((h=this.xyChart)==null?void 0:h.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((d=this.xyChart)==null?void 0:d.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((f=this.radar)==null?void 0:f.axisColor)||this.lineColor,axisStrokeWidth:((p=this.radar)==null?void 0:p.axisStrokeWidth)||2,axisLabelFontSize:((g=this.radar)==null?void 0:g.axisLabelFontSize)||12,curveOpacity:((m=this.radar)==null?void 0:m.curveOpacity)||.5,curveStrokeWidth:((v=this.radar)==null?void 0:v.curveStrokeWidth)||2,graticuleColor:((y=this.radar)==null?void 0:y.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((b=this.radar)==null?void 0:b.graticuleStrokeWidth)||1,graticuleOpacity:((w=this.radar)==null?void 0:w.graticuleOpacity)||.3,legendBoxSize:((T=this.radar)==null?void 0:T.legendBoxSize)||12,legendFontSize:((E=this.radar)==null?void 0:E.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=Mt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||De(this.primaryColor,{h:-30}),this.git4=this.pie5||De(this.primaryColor,{h:-60}),this.git5=this.pie6||De(this.primaryColor,{h:-90}),this.git6=this.pie7||De(this.primaryColor,{h:60}),this.git7=this.pie8||De(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||yt(this.git0),this.gitInv1=this.gitInv1||yt(this.git1),this.gitInv2=this.gitInv2||yt(this.git2),this.gitInv3=this.gitInv3||yt(this.git3),this.gitInv4=this.gitInv4||yt(this.git4),this.gitInv5=this.gitInv5||yt(this.git5),this.gitInv6=this.gitInv6||yt(this.git6),this.gitInv7=this.gitInv7||yt(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||A2,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||_2}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ph,"Theme"),Ph),SX=x(t=>{const e=new EX;return e.calculate(t),e},"getThemeVariables"),Bo={base:{getThemeVariables:vX},dark:{getThemeVariables:xX},default:{getThemeVariables:L2},forest:{getThemeVariables:TX},neutral:{getThemeVariables:SX}},go={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},dD={...go,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF"},themeCSS:void 0,themeVariables:Bo.default.getThemeVariables(),sequence:{...go.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...go.gantt,tickInterval:void 0,useWidth:void 0},c4:{...go.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...go.pie,useWidth:984},xyChart:{...go.xyChart,useWidth:void 0},requirement:{...go.requirement,useWidth:void 0},packet:{...go.packet},radar:{...go.radar}},fD=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...fD(t[n],"")]:[...r,e+n],[]),"keyify"),kX=new Set(fD(dD,"")),fr=dD,Cv=x(t=>{if(ie.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Cv(e));return}for(const e of Object.keys(t)){if(ie.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!kX.has(e)||t[e]==null){ie.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){ie.debug("sanitizing object",e),Cv(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ie.debug("sanitizing css option",e),t[e]=CX(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}ie.debug("After sanitization",t)}},"sanitizeDirective"),CX=x(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"),Sd=Object.freeze(fr),Qi=In({},Sd),pD,kd=[],ap=In({},Sd),R2=x((t,e)=>{let r=In({},t),n={};for(const i of e)vD(i),n=In(n,i);if(r=In(r,n),n.theme&&n.theme in Bo){const i=In({},pD),a=In(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Bo&&(r.themeVariables=Bo[r.theme].getThemeVariables(a))}return ap=r,yD(ap),ap},"updateCurrentConfig"),AX=x(t=>(Qi=In({},Sd),Qi=In(Qi,t),t.theme&&Bo[t.theme]&&(Qi.themeVariables=Bo[t.theme].getThemeVariables(t.themeVariables)),R2(Qi,kd),Qi),"setSiteConfig"),_X=x(t=>{pD=In({},t)},"saveConfigFromInitialize"),LX=x(t=>(Qi=In(Qi,t),R2(Qi,kd),Qi),"updateSiteConfig"),gD=x(()=>In({},Qi),"getSiteConfig"),mD=x(t=>(yD(t),In(ap,t),Ir()),"setConfig"),Ir=x(()=>In({},ap),"getConfig"),vD=x(t=>{t&&(["secure",...Qi.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ie.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&vD(t[e])}))},"sanitize"),RX=x(t=>{var e;Cv(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),kd.push(t),R2(Qi,kd)},"addDirective"),Av=x((t=Qi)=>{kd=[],R2(t,kd)},"reset"),NX={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},x7={},DX=x(t=>{x7[t]||(ie.warn(NX[t]),x7[t]=!0)},"issueWarning"),yD=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&DX("LAZY_LOAD_DEPRECATED")},"checkConfig"),af=/<br\s*\/?>/gi,IX=x(t=>t?wD(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),MX=(()=>{let t=!1;return()=>{t||(xD(),t=!0)}})();function xD(){const t="data-temp-href-target";Td.addHook("beforeSanitizeAttributes",e=>{e instanceof Element&&e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Td.addHook("afterSanitizeAttributes",e=>{e instanceof Element&&e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(xD,"setupDompurifyHooks");var bD=x(t=>(MX(),Td.sanitize(t)),"removeScript"),b7=x((t,e)=>{var r;if(((r=e.flowchart)==null?void 0:r.htmlLabels)!==!1){const n=e.securityLevel;n==="antiscript"||n==="strict"?t=bD(t):n!=="loose"&&(t=wD(t),t=t.replace(/</g,"<").replace(/>/g,">"),t=t.replace(/=/g,"="),t=FX(t))}return t},"sanitizeMore"),Fr=x((t,e)=>t&&(e.dompurifyConfig?t=Td.sanitize(b7(t,e),e.dompurifyConfig).toString():t=Td.sanitize(b7(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),OX=x((t,e)=>typeof t=="string"?Fr(t,e):t.flat().map(r=>Fr(r,e)),"sanitizeTextOrArray"),PX=x(t=>af.test(t),"hasBreaks"),BX=x(t=>t.split(af),"splitBreaks"),FX=x(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),wD=x(t=>t.replace(af,"#br#"),"breakToPlaceholder"),$X=x(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"),Dr=x(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),zX=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),VX=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),pl=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n<e.length;n++){let i=e[n];if(i===","&&n>0&&n+1<e.length){const a=e[n-1],s=e[n+1];GX(a,s)&&(i=a+","+s,n++,r.pop())}r.push(UX(i))}return r.join("")},"parseGenericTypes"),w3=x((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),GX=x((t,e)=>{const r=w3(t,"~"),n=w3(e,"~");return r===1&&n===1},"shouldCombineSets"),UX=x(t=>{const e=w3(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),w7=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),T3=/\$\$(.*)\$\$/g,Si=x(t=>{var e;return(((e=t.match(T3))==null?void 0:e.length)??0)>0},"hasKatex"),ug=x(async(t,e)=>{t=await hg(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";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),hg=x(async(t,e)=>{if(!Si(t))return t;if(!(w7()||e.legacyMathML||e.forceLegacyMathML))return t.replace(T3,"MathML is unsupported in this environment.");const{default:r}=await ur(async()=>{const{default:i}=await Promise.resolve().then(()=>wde);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!w7()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(af).map(i=>Si(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(T3,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))},"renderKatex"),it={getRows:IX,sanitizeText:Fr,sanitizeTextOrArray:OX,hasBreaks:PX,splitBreaks:BX,lineBreakRegex:af,removeScript:bD,getUrl:$X,evaluate:Dr,getMax:zX,getMin:VX},qX=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),HX=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),ha=x(function(t,e,r,n){const i=HX(e,r,n);qX(t,i)},"configureSvgSize"),sf=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;ie.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;ie.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,ie.info(`Calculated bounds: ${o}x${l}`),ha(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),ym={},WX=x((t,e,r)=>{let n="";return t in ym&&ym[t]?n=ym[t](r):ie.warn(`No theme found for ${t}`),` & {
|
|
415
415
|
font-family: ${r.fontFamily};
|
|
416
416
|
font-size: ${r.fontSize};
|
|
@@ -527,7 +527,7 @@ js-yaml/dist/js-yaml.mjs:
|
|
|
527
527
|
`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ie.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=ip.exec(t))!==null;)if(a.index===ip.lastIndex&&ip.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return ie.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),Vie=x(function(t){return t.replace(ip,"")},"removeDirectives"),Gie=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function nE(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Fie[r]??e}x(nE,"interpolateToCurve");function jO(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?mu.sanitizeUrl(r):r}x(jO,"formatUrl");var Uie=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s<n;s++)if(a=a[r[s]],!a){ie.error(`Function name: ${t} not found in window`);return}a[i](...e)},"runFunc");function iE(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}x(iE,"distance");function KO(t){let e,r=0;t.forEach(i=>{r+=iE(i,e),e=i});const n=r/2;return aE(t,n)}x(KO,"traverseEdge");function ZO(t){return t.length===1?t[0]:KO(t)}x(ZO,"calcLabelPosition");var LC=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),aE=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=iE(i,r);if(a===0)return r;if(a<n)n-=a;else{const s=n/a;if(s<=0)return r;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:LC((1-s)*r.x+s*i.x,5),y:LC((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),qie=x((t,e,r)=>{ie.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=aE(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function QO(t,e,r){const n=structuredClone(r);ie.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=aE(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(QO,"calcTerminalLabelPosition");function sE(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(sE,"getStylesFromArray");var RC=0,JO=x(()=>(RC++,"id-"+Math.random().toString(36).substr(2,12)+"-"+RC),"generateId");function eP(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}x(eP,"makeRandomHex");var tP=x(t=>eP(t.length),"random"),Hie=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Wie=x(function(t,e){const r=e.text.replace(it.lineBreakRegex," "),[,n]=Zl(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),rP=lf((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),it.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=$i(`${s} `,r),u=$i(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Yie(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Yie=lf((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if($i(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function ay(t,e){return oE(t,e).height}x(ay,"calculateTextHeight");function $i(t,e){return oE(t,e).width}x($i,"calculateTextWidth");var oE=lf((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Zl(r),s=["sans-serif",n],o=t.split(it.lineBreakRegex),l=[],u=rt("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const v=Hie();v.text=m||YO;const y=Wie(h,v).style("font-size",a).style("font-weight",i).style("font-family",f),b=(y._groups||y)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),p=Math.round(b.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Fh,Xie=(Fh=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(Fh,"InitIDGenerator"),Fh),p1,jie=x(function(t){return p1=p1||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),p1.innerHTML=t,unescape(p1.textContent)},"entityDecode");function lE(t){return"str"in t}x(lE,"isDetailedError");var Kie=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Zl=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ts(t,e){return iy({},t,e)}x(ts,"cleanAndMerge");var Zt={assignWithDepth:In,wrapLabel:rP,calculateTextHeight:ay,calculateTextWidth:$i,calculateTextDimensions:oE,cleanAndMerge:ts,detectInit:zie,detectDirective:XO,isSubstringInArray:Gie,interpolateToCurve:nE,calcLabelPosition:ZO,calcCardinalityPosition:qie,calcTerminalLabelPosition:QO,formatUrl:jO,getStylesFromArray:sE,generateId:JO,random:tP,runFunc:Uie,entityDecode:jie,insertTitle:Kie,parseFontSize:Zl,InitIDGenerator:Xie},Zie=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),Zs=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),lp=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function zi(t){return t??null}x(zi,"handleUndefinedAttr");function cE(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Eu=cE();function nP(t){Eu=t}const cp={exec:()=>null};function Ar(t,e=""){let r=typeof t=="string"?t:t.source;const n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Bi.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}const Bi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Qie=/^(?:[ \t]*(?:\n|$))+/,Jie=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,eae=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tg=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tae=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uE=/(?:[*+-]|\d{1,9}[.)])/,iP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,aP=Ar(iP).replace(/bull/g,uE).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(),rae=Ar(iP).replace(/bull/g,uE).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(),hE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nae=/^[^\n]+/,dE=/(?!\s*\])(?:\\.|[^\[\]\\])+/,iae=Ar(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dE).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),aae=Ar(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,uE).getRegex(),W2="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",fE=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,sae=Ar("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fE).replace("tag",W2).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sP=Ar(hE).replace("hr",Tg).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",W2).getRegex(),oae=Ar(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sP).getRegex(),pE={blockquote:oae,code:Jie,def:iae,fences:eae,heading:tae,hr:Tg,html:sae,lheading:aP,list:aae,newline:Qie,paragraph:sP,table:cp,text:nae},NC=Ar("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tg).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",W2).getRegex(),lae={...pE,lheading:rae,table:NC,paragraph:Ar(hE).replace("hr",Tg).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",NC).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",W2).getRegex()},cae={...pE,html:Ar(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fE).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:cp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ar(hE).replace("hr",Tg).replace("heading",` *#{1,6} *[^
|
|
528
528
|
]`).replace("lheading",aP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uae=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hae=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oP=/^( {2,}|\\)\n(?!\s*$)/,dae=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Y2=/[\p{P}\p{S}]/u,gE=/[\s\p{P}\p{S}]/u,lP=/[^\s\p{P}\p{S}]/u,fae=Ar(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gE).getRegex(),cP=/(?!~)[\p{P}\p{S}]/u,pae=/(?!~)[\s\p{P}\p{S}]/u,gae=/(?:[^\s\p{P}\p{S}]|~)/u,mae=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,uP=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vae=Ar(uP,"u").replace(/punct/g,Y2).getRegex(),yae=Ar(uP,"u").replace(/punct/g,cP).getRegex(),hP="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xae=Ar(hP,"gu").replace(/notPunctSpace/g,lP).replace(/punctSpace/g,gE).replace(/punct/g,Y2).getRegex(),bae=Ar(hP,"gu").replace(/notPunctSpace/g,gae).replace(/punctSpace/g,pae).replace(/punct/g,cP).getRegex(),wae=Ar("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lP).replace(/punctSpace/g,gE).replace(/punct/g,Y2).getRegex(),Tae=Ar(/\\(punct)/,"gu").replace(/punct/g,Y2).getRegex(),Eae=Ar(/^<(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(),Sae=Ar(fE).replace("(?:-->|$)","-->").getRegex(),kae=Ar("^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",Sae).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sy=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cae=Ar(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sy).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dP=Ar(/^!?\[(label)\]\[(ref)\]/).replace("label",sy).replace("ref",dE).getRegex(),fP=Ar(/^!?\[(ref)\](?:\[\])?/).replace("ref",dE).getRegex(),Aae=Ar("reflink|nolink(?!\\()","g").replace("reflink",dP).replace("nolink",fP).getRegex(),mE={_backpedal:cp,anyPunctuation:Tae,autolink:Eae,blockSkip:mae,br:oP,code:hae,del:cp,emStrongLDelim:vae,emStrongRDelimAst:xae,emStrongRDelimUnd:wae,escape:uae,link:Cae,nolink:fP,punctuation:fae,reflink:dP,reflinkSearch:Aae,tag:kae,text:dae,url:cp},_ae={...mE,link:Ar(/^!?\[(label)\]\((.*?)\)/).replace("label",sy).getRegex(),reflink:Ar(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sy).getRegex()},iw={...mE,emStrongRDelimAst:bae,emStrongLDelim:yae,url:Ar(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Lae={...iw,br:Ar(oP).replace("{2,}","*").getRegex(),text:Ar(iw.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},g1={normal:pE,gfm:lae,pedantic:cae},zf={normal:mE,gfm:iw,breaks:Lae,pedantic:_ae},Rae={"&":"&","<":"<",">":">",'"':""","'":"'"},DC=t=>Rae[t];function Is(t,e){if(e){if(Bi.escapeTest.test(t))return t.replace(Bi.escapeReplace,DC)}else if(Bi.escapeTestNoEncode.test(t))return t.replace(Bi.escapeReplaceNoEncode,DC);return t}function IC(t){try{t=encodeURI(t).replace(Bi.percentDecode,"%")}catch{return null}return t}function MC(t,e){var a;const r=t.replace(Bi.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Bi.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Bi.slashPipe,"|");return n}function Vf(t,e,r){const n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function Nae(t,e){if(t.indexOf(e[1])===-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 r>0?-2:-1}function OC(t,e,r,n,i){const a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function Dae(t,e,r){const n=t.match(r.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
|
|
529
529
|
`).map(a=>{const s=a.match(r.other.beginningSpace);if(s===null)return a;const[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(`
|
|
530
|
-
`)}class oy{constructor(e){
|
|
530
|
+
`)}class oy{constructor(e){wt(this,"options");wt(this,"rules");wt(this,"lexer");this.options=e||Eu}space(e){const r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){const r=this.rules.block.code.exec(e);if(r){const n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Vf(n,`
|
|
531
531
|
`)}}}fences(e){const r=this.rules.block.fences.exec(e);if(r){const n=r[0],i=Dae(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){const r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){const i=Vf(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Vf(r[0],`
|
|
532
532
|
`)}}blockquote(e){const r=this.rules.block.blockquote.exec(e);if(r){let n=Vf(r[0],`
|
|
533
533
|
`).split(`
|
|
@@ -549,7 +549,7 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
549
549
|
`+p}!g&&!p.trim()&&(g=!0),h+=S+`
|
|
550
550
|
`,e=e.substring(S.length+1),f=L.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let v=null,y;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(y=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!v,checked:y,loose:!1,text:d,tokens:[]}),a.raw+=h}const l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;u<a.items.length;u++)if(this.lexer.state.top=!1,a.items[u].tokens=this.lexer.blockTokens(a.items[u].text,[]),!a.loose){const h=a.items[u].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u<a.items.length;u++)a.items[u].loose=!0;return a}}html(e){const r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){const r=this.rules.block.def.exec(e);if(r){const n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){var o;const r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const n=MC(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
551
551
|
`):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<n.length;l++)s.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:s.align[l]});for(const l of a)s.rows.push(MC(l,s.header.length).map((u,h)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){const r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){const r=this.rules.block.paragraph.exec(e);if(r){const n=r[1].charAt(r[1].length-1)===`
|
|
552
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){const r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){const r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){const r=this.rules.inline.link.exec(e);if(r){const n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const s=Vf(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Nae(r[2],"()");if(s===-2)return;if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),OC(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return OC(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...i[0]].length-1;let o,l,u=s,h=0;const d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*e.length+s);(i=d.exec(r))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){h+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+h);const f=[...i[0]][0].length,p=e.slice(0,s+i.index+f+l);if(Math.min(s,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){const r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){const r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){const r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const r=this.rules.inline.text.exec(e);if(r){const n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}}class Ha{constructor(e){
|
|
552
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){const r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){const r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){const r=this.rules.inline.link.exec(e);if(r){const n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const s=Vf(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Nae(r[2],"()");if(s===-2)return;if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),OC(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return OC(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...i[0]].length-1;let o,l,u=s,h=0;const d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*e.length+s);(i=d.exec(r))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){h+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+h);const f=[...i[0]][0].length,p=e.slice(0,s+i.index+f+l);if(Math.min(s,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){const r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){const r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){const r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const r=this.rules.inline.text.exec(e);if(r){const n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}}class Ha{constructor(e){wt(this,"tokens");wt(this,"options");wt(this,"state");wt(this,"tokenizer");wt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Eu,this.options.tokenizer=this.options.tokenizer||new oy,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 r={other:Bi,block:g1.normal,inline:zf.normal};this.options.pedantic?(r.block=g1.pedantic,r.inline=zf.pedantic):this.options.gfm&&(r.block=g1.gfm,this.options.breaks?r.inline=zf.breaks:r.inline=zf.gfm),this.tokenizer.rules=r}static get rules(){return{block:g1,inline:zf}}static lex(e,r){return new Ha(r).lex(e)}static lexInline(e,r){return new Ha(r).inlineTokens(e)}lex(e){e=e.replace(Bi.carriageReturn,`
|
|
553
553
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var i,a,s;for(this.options.pedantic&&(e=e.replace(Bi.tabCharGlobal," ").replace(Bi.spaceLine,""));e;){let o;if((a=(i=this.options.extensions)==null?void 0:i.block)!=null&&a.some(u=>(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=`
|
|
554
554
|
`:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
555
555
|
`+o.raw,u.text+=`
|
|
@@ -559,7 +559,7 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
559
559
|
`+o.raw,u.text+=`
|
|
560
560
|
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
561
561
|
`+o.raw,u.text+=`
|
|
562
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var o,l,u;let n=e,i=null;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)h.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,s="";for(;e;){a||(s=""),a=!1;let h;if((l=(o=this.options.extensions)==null?void 0:o.inline)!=null&&l.some(f=>(h=f.call({lexer:this},e,r))?(e=e.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(h.raw.length);const f=r.at(-1);h.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(e,n,s)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(e)){e=e.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(e))){e=e.substring(h.raw.length),r.push(h);continue}let d=e;if((u=this.options.extensions)!=null&&u.startInline){let f=1/0;const p=e.slice(1);let g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},p),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(d=e.substring(0,f+1))}if(h=this.tokenizer.inlineText(d)){e=e.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(s=h.raw.slice(-1)),a=!0;const f=r.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}}class ly{constructor(e){
|
|
562
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var o,l,u;let n=e,i=null;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)h.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,s="";for(;e;){a||(s=""),a=!1;let h;if((l=(o=this.options.extensions)==null?void 0:o.inline)!=null&&l.some(f=>(h=f.call({lexer:this},e,r))?(e=e.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(h.raw.length);const f=r.at(-1);h.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(e,n,s)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(e)){e=e.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(e))){e=e.substring(h.raw.length),r.push(h);continue}let d=e;if((u=this.options.extensions)!=null&&u.startInline){let f=1/0;const p=e.slice(1);let g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},p),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(d=e.substring(0,f+1))}if(h=this.tokenizer.inlineText(d)){e=e.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(s=h.raw.slice(-1)),a=!0;const f=r.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=h.raw,f.text+=h.text):r.push(h);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}}class ly{constructor(e){wt(this,"options");wt(this,"parser");this.options=e||Eu}space(e){return""}code({text:e,lang:r,escaped:n}){var s;const i=(s=(r||"").match(Bi.notSpaceStart))==null?void 0:s[0],a=e.replace(Bi.endingNewline,"")+`
|
|
563
563
|
`;return i?'<pre><code class="language-'+Is(i)+'">'+(n?a:Is(a,!0))+`</code></pre>
|
|
564
564
|
`:"<pre><code>"+(n?a:Is(a,!0))+`</code></pre>
|
|
565
565
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -577,8 +577,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
577
577
|
`}tablerow({text:e}){return`<tr>
|
|
578
578
|
${e}</tr>
|
|
579
579
|
`}tablecell(e){const r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
|
|
580
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Is(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){const i=this.parser.parseInline(n),a=IC(e);if(a===null)return i;e=a;let s='<a href="'+e+'"';return r&&(s+=' title="'+Is(r)+'"'),s+=">"+i+"</a>",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));const a=IC(e);if(a===null)return Is(n);e=a;let s=`<img src="${e}" alt="${n}"`;return r&&(s+=` title="${Is(r)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Is(e.text)}}class vE{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Wa{constructor(e){
|
|
581
|
-
`+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):n+=h;continue}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(e,r=this.renderer){var i,a;let n="";for(let s=0;s<e.length;s++){const o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){const u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=u||"";continue}}const l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}}class up{constructor(e){
|
|
580
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Is(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){const i=this.parser.parseInline(n),a=IC(e);if(a===null)return i;e=a;let s='<a href="'+e+'"';return r&&(s+=' title="'+Is(r)+'"'),s+=">"+i+"</a>",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));const a=IC(e);if(a===null)return Is(n);e=a;let s=`<img src="${e}" alt="${n}"`;return r&&(s+=` title="${Is(r)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Is(e.text)}}class vE{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Wa{constructor(e){wt(this,"options");wt(this,"renderer");wt(this,"textRenderer");this.options=e||Eu,this.options.renderer=this.options.renderer||new ly,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vE}static parse(e,r){return new Wa(r).parse(e)}static parseInline(e,r){return new Wa(r).parseInline(e)}parse(e,r=!0){var i,a;let n="";for(let s=0;s<e.length;s++){const o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){const u=o,h=this.options.extensions.renderers[u.type].call({parser:this},u);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){n+=h||"";continue}}const l=o;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let u=l,h=this.renderer.text(u);for(;s+1<e.length&&e[s+1].type==="text";)u=e[++s],h+=`
|
|
581
|
+
`+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):n+=h;continue}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(e,r=this.renderer){var i,a;let n="";for(let s=0;s<e.length;s++){const o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){const u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=u||"";continue}}const l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{const u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}}class up{constructor(e){wt(this,"options");wt(this,"block");this.options=e||Eu}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ha.lex:Ha.lexInline}provideParser(){return this.block?Wa.parse:Wa.parseInline}}wt(up,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Iae{constructor(...e){wt(this,"defaults",cE());wt(this,"options",this.setOptions);wt(this,"parse",this.parseMarkdown(!0));wt(this,"parseInline",this.parseMarkdown(!1));wt(this,"Parser",Wa);wt(this,"Renderer",ly);wt(this,"TextRenderer",vE);wt(this,"Lexer",Ha);wt(this,"Tokenizer",oy);wt(this,"Hooks",up);this.use(...e)}walkTokens(e,r){var i,a;let n=[];for(const s of e)switch(n=n.concat(r.call(this,s)),s.type){case"table":{const o=s;for(const l of o.header)n=n.concat(this.walkTokens(l.tokens,r));for(const l of o.rows)for(const u of l)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{const o=s;n=n.concat(this.walkTokens(o.items,r));break}default:{const o=s;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{const u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){const a=this.defaults.renderer||new ly(this.defaults);for(const s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){const a=this.defaults.tokenizer||new oy(this.defaults);for(const s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){const a=this.defaults.hooks||new up;for(const s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const o=s,l=n.hooks[o],u=a[o];up.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async)return Promise.resolve(l.call(a,h)).then(f=>u.call(a,f));const d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){const a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Ha.lex(e,r??this.defaults)}parser(e,r){return Wa.parse(e,r??this.defaults)}parseMarkdown(e){return(n,i)=>{const a={...i},s={...this.defaults,...a},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&a.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);const l=s.hooks?s.hooks.provideLexer():e?Ha.lex:Ha.lexInline,u=s.hooks?s.hooks.provideParser():e?Wa.parse:Wa.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(h=>l(h,s)).then(h=>s.hooks?s.hooks.processAllTokens(h):h).then(h=>s.walkTokens?Promise.all(this.walkTokens(h,s.walkTokens)).then(()=>h):h).then(h=>u(h,s)).then(h=>s.hooks?s.hooks.postprocess(h):h).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let h=l(n,s);s.hooks&&(h=s.hooks.processAllTokens(h)),s.walkTokens&&this.walkTokens(h,s.walkTokens);let d=u(h,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(h){return o(h)}}}onError(e,r){return n=>{if(n.message+=`
|
|
582
582
|
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Is(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}}const eu=new Iae;function Sr(t,e){return eu.parse(t,e)}Sr.options=Sr.setOptions=function(t){return eu.setOptions(t),Sr.defaults=eu.defaults,nP(Sr.defaults),Sr};Sr.getDefaults=cE;Sr.defaults=Eu;Sr.use=function(...t){return eu.use(...t),Sr.defaults=eu.defaults,nP(Sr.defaults),Sr};Sr.walkTokens=function(t,e){return eu.walkTokens(t,e)};Sr.parseInline=eu.parseInline;Sr.Parser=Wa;Sr.parser=Wa.parse;Sr.Renderer=ly;Sr.TextRenderer=vE;Sr.Lexer=Ha;Sr.lexer=Ha.lex;Sr.Tokenizer=oy;Sr.Hooks=up;Sr.parse=Sr;Sr.options;Sr.setOptions;Sr.use;Sr.walkTokens;Sr.parseInline;Wa.parse;Ha.lex;function pP(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from(typeof t=="string"?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(o,l){var u=l.match(/\n([\t ]+|(?!\s).)/g);return u?o.concat(u.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var a=new RegExp(`
|
|
583
583
|
[ ]{`+Math.min.apply(Math,i)+"}","g");n=n.map(function(o){return o.replace(a,`
|
|
584
584
|
`)})}n[0]=n[0].replace(/^\r?\n/,"");var s=n[0];return e.forEach(function(o,l){var u=s.match(/(?:^|\n)( *)$/),h=u?u[1]:"",d=o;typeof o=="string"&&o.includes(`
|
|
@@ -620,15 +620,15 @@ ${t.themeCSS}`),t.fontFamily!==void 0&&(r+=`
|
|
|
620
620
|
${Uce}
|
|
621
621
|
</iframe>`},"putIntoIFrame"),n8=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Oce);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function xw(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(xw,"sandboxedIframe");var Kce=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),Zce=x(async function(t,e,r){var I,P,_,N,M,O;rx();const n=_E(e);e=n.code;const i=Ir();ie.debug(i),e.length>((i==null?void 0:i.maxTextSize)??Nce)&&(e=Dce);const a="#"+t,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const B=rt(f?o:u).node();B&&"remove"in B&&B.remove()},"removeTempElements");let d=rt("body");const f=i.securityLevel===Ice,p=i.securityLevel===Mce,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const D=xw(rt(r),s);d=rt(D.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=rt(r);n8(d,t,l,`font-family: ${g}`,Pce)}else{if(Kce(document,t,l,s),f){const D=xw(rt("body"),s);d=rt(D.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=rt("body");n8(d,t,l)}let m,v;try{m=await yw.fromText(e,{title:n.title})}catch(D){if(i.suppressErrorRendering)throw h(),D;m=await yw.fromText("error"),v=D}const y=d.select(u).node(),b=m.type,w=y.firstChild,T=w.firstChild,E=(P=(I=m.renderer).getClasses)==null?void 0:P.call(I,e,m),k=Yce(i,b,E,a),S=document.createElement("style");S.innerHTML=k,w.insertBefore(S,T);try{await m.renderer.draw(e,t,dw.version,m)}catch(D){throw i.suppressErrorRendering?h():Vle.draw(e,t,dw.version),D}const L=d.select(`${u} svg`),A=(N=(_=m.db).getAccTitle)==null?void 0:N.call(_),R=(O=(M=m.db).getAccDescription)==null?void 0:O.call(M);qF(b,L,A,R),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",Bce);let C=d.select(u).node().innerHTML;if(ie.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),C=Xce(C,f,Dr(i.arrowMarkerAbsolute)),f){const D=d.select(u+" svg").node();C=jce(C,D)}else p||(C=Td.sanitize(C,{ADD_TAGS:qce,ADD_ATTR:Hce,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Cce(),v)throw v;return h(),{diagramType:b,svg:C,bindFunctions:m.db.bindFunctions}},"render");function GF(t={}){var n;const e=In({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),_X(e),e!=null&&e.theme&&e.theme in Bo?e.themeVariables=Bo[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Bo.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?AX(e):gD();T6(r.logLevel),rx()}x(GF,"initialize");var UF=x((t,e={})=>{const{code:r}=AE(t);return yw.fromText(r,e)},"getDiagramFromText");function qF(t,e,r,n){BF(e,t),FF(e,r,n,e.attr("id"))}x(qF,"addA11yInfo");var tu=Object.freeze({render:Zce,parse:VF,getDiagramFromText:UF,initialize:GF,getConfig:Ir,setConfig:mD,getSiteConfig:gD,updateSiteConfig:LX,reset:x(()=>{Av()},"reset"),globalReset:x(()=>{Av(Sd)},"globalReset"),defaultConfig:Sd});T6(Ir().logLevel);Av(Ir());var Qce=x((t,e,r)=>{ie.warn(t),lE(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"),HF=x(async function(t={querySelector:".mermaid"}){try{await Jce(t)}catch(e){if(lE(e)&&ie.error(e.str),ka.parseError&&ka.parseError(e),!t.suppressErrors)throw ie.error("Use the suppressErrors option to suppress these errors"),e}},"run"),Jce=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=tu.getConfig();ie.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");ie.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ie.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),tu.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new Zt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(ie.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=pP(Zt.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Zt.detectInit(s);h&&ie.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await jF(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){Qce(d,o,ka.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),WF=x(function(t){tu.initialize(t)},"initialize"),eue=x(async function(t,e,r){ie.warn("mermaid.init is deprecated. Please use run instead."),t&&WF(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await HF(n)},"init"),tue=x(async(t,{lazyLoad:e=!0}={})=>{rx(),uD(...t),e===!1&&await Sce()},"registerExternalDiagrams"),YF=x(function(){if(ka.startOnLoad){const{startOnLoad:t}=tu.getConfig();t&&ka.run().catch(e=>ie.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",YF,!1);var rue=x(function(t){ka.parseError=t},"setParseErrorHandler"),gy=[],Vb=!1,XF=x(async()=>{if(!Vb){for(Vb=!0;gy.length>0;){const t=gy.shift();if(t)try{await t()}catch(e){ie.error("Error executing queue",e)}}Vb=!1}},"executeQueue"),nue=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{tu.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;ie.error("Error parsing",o),(l=ka.parseError)==null||l.call(ka,o),s(o),n(o)})}),"performCall");gy.push(i),XF().catch(n)}),"parse"),jF=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{tu.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;ie.error("Error parsing",l),(u=ka.parseError)==null||u.call(ka,l),o(l),i(l)})}),"performCall");gy.push(a),XF().catch(i)}),"render"),ka={startOnLoad:!0,mermaidAPI:tu,parse:nue,render:jF,init:eue,run:HF,registerExternalDiagrams:tue,registerLayoutLoaders:rF,initialize:WF,parseError:void 0,contentLoaded:YF,setParseErrorHandler:rue,detectType:E6,registerIconPacks:cM},my=ka;/*! Check if previously processed *//*!
|
|
622
622
|
* Wait for document loaded before starting the execution
|
|
623
|
-
*/function i8(t){const e=t.startsWith("https://")?t.replace("https://",""):t;return e.length<32?e:e.substring(0,26)+"..."+e.substring(t.length-6)}const Hf=t=>{let e=t.replace(/"/g,"'");return e=e.replace(/;/g,"#59;"),e=e.replace(/\(/g,"#40;"),e=e.replace(/\)/g,"#41;"),e=e.replace(/,/g,"#44;"),e},iue={request:{method:["GET","POST","PUT","DELETE","PATCH"],accept:["application/json"]},response:{type:["application/json"]}};class aue{constructor(e,r){
|
|
624
|
-
`)}generateDiagramFromHistory(){if(this.resetDiagramState(),window.haibunCapturedMessages){const
|
|
623
|
+
*/function i8(t){const e=t.startsWith("https://")?t.replace("https://",""):t;return e.length<32?e:e.substring(0,26)+"..."+e.substring(t.length-6)}const Hf=t=>{let e=t.replace(/"/g,"'");return e=e.replace(/;/g,"#59;"),e=e.replace(/\(/g,"#40;"),e=e.replace(/\)/g,"#41;"),e=e.replace(/,/g,"#44;"),e},iue={request:{method:["GET","POST","PUT","DELETE","PATCH"],accept:["application/json"]},response:{type:["application/json"]}};class aue{constructor(e,r){wt(this,"needsUpdate",!0);wt(this,"diagramLines",["sequenceDiagram"]);wt(this,"pageNames",{});wt(this,"pageCounter",1);wt(this,"participantAdded",{});wt(this,"mermaidContainerId");wt(this,"parentElement");wt(this,"currentDiagramString","");this.mermaidContainerId=`mermaid-container-${e}`,this.parentElement=r,this.ensureMermaidContainer(),this.currentDiagramString=this.buildDiagramString()}ensureMermaidContainer(){let e=this.parentElement.querySelector(`#${this.mermaidContainerId}`);e||(e=document.createElement("div"),e.id=this.mermaidContainerId,e.className="mermaid",this.parentElement.appendChild(e))}addParticipant(e,r){if(!this.participantAdded[e]){let n=1;for(let i=this.diagramLines.length-1;i>=1;i--)if(this.diagramLines[i].startsWith("participant ")){n=i+1;break}this.diagramLines.splice(n,0,`participant ${e} as ${r}`),this.participantAdded[e]=!0}}resetDiagramState(){this.diagramLines=["sequenceDiagram"],this.pageNames={},this.pageCounter=1,this.participantAdded={}}buildDiagramString(){return this.diagramLines.length<=1?"sequenceDiagram":this.diagramLines.join(`
|
|
624
|
+
`)}generateDiagramFromHistory(){var r;if(this.resetDiagramState(),window.haibunCapturedMessages){const n=window.haibunCapturedMessages.filter(i=>{var a,s,o,l;return((o=(s=(a=i.messageContext)==null?void 0:a.artifacts)==null?void 0:s[0])==null?void 0:o.artifactType)==="json/http/trace"&&((l=i.messageContext.artifacts)==null?void 0:l[0]).httpEvent!=="route"});for(const i of n)if(i.messageContext&&((r=i.messageContext.artifacts)!=null&&r[0])){const a=i.messageContext.artifacts[0];a&&a.trace&&typeof a.trace=="object"&&this.processSingleEvent(a.trace,a.httpEvent)}}this.buildDiagramString()===this.currentDiagramString?this.needsUpdate=!1:this.needsUpdate=!0}processSingleEvent(e,r,n=iue){this.needsUpdate=!0;const{requestingPage:i,requestingURL:a,method:s,status:o,statusText:l,headers:u}=e;let h="UnknownServerAlias",d="UnknownServer";if(a)try{const g=new URL(a);d=g.hostname,g.hostname==="localhost"&&g.port&&(d=`${g.hostname}:${g.port}`),d?h=d.toLowerCase().replace(/[.:-]/g,""):(h="sourcealias",d="Source")}catch{h="invalidurlalias",d="InvalidURL"}if(this.addParticipant(h,d),sue(n,r,d,e))return;let f="UnknownPageAlias",p="UnknownPage";if(i){const g=this.pageNames[i];if(!g)f=i.toLowerCase().replace(/[.-]/g,""),p=i,f.trim()||(f=`Page${this.pageCounter}`),this.pageNames[i]=f,this.addParticipant(f,p),this.pageCounter++;else{f=g;const m=this.diagramLines.find(v=>v.startsWith(`participant ${f} as `));m?p=m.substring(m.indexOf(" as ")+4):p=f}}else f="ClientPage",p="Client Page",this.addParticipant(f,p);if(s&&a){const g=Hf(`${s} ${i8(a)}`);if(this.diagramLines.push(`${f}->>${h}: ${g}`),u){if(u.referer){const m=i8(Hf(`Referer: ${u.referer}`));this.diagramLines.push(`Note right of ${f}: ${m}`)}if(u.accept){const m=Hf(`Accept: ${u.accept}`);this.diagramLines.push(`Note right of ${f}: ${m}`)}if(u["content-type"]){const m=Hf(`Content-type: ${u["content-type"]}`);this.diagramLines.push(`Note right of ${f}: ${m}`)}}}if(o){const g=Hf(`${o} ${l||""}`);this.diagramLines.push(`${h}-->>${f}: ${g}`)}}getDiagram(){return this.buildDiagramString()}getNeedsUpdate(){return this.needsUpdate}setNeedsUpdate(e){this.needsUpdate=e}async update(){this.generateDiagramFromHistory();const e=this.parentElement.querySelector(`#${this.mermaidContainerId}`);if(!e){console.error("Mermaid container not found for ID:",this.mermaidContainerId);return}if(!this.needsUpdate&&e.querySelector("svg"))return;const r=this.getDiagram();try{my.initialize({maxTextSize:9e5,startOnLoad:!1}),e.innerHTML="";const n=`<pre class="mermaid">${r}</pre>`;e.insertAdjacentHTML("beforeend",n);const i=e.querySelector(".mermaid");i?(await my.run({nodes:[i]}),console.info("Mermaid diagram rendered."),this.currentDiagramString=r,this.needsUpdate=!1):(console.error("Mermaid pre element not found after insert."),e.innerHTML="<pre>Error: Could not find .mermaid element for rendering.</pre>")}catch(n){console.error(`Failed Mermaid diagram definition:
|
|
625
625
|
`,r),console.error("Error rendering Mermaid diagram:",n);const a=(typeof n=="object"&&n!==null&&"str"in n?n.str:null)||(n instanceof Error?n.message:String(n));e.innerHTML=`<pre>Error rendering Mermaid diagram:
|
|
626
626
|
|
|
627
627
|
${a}
|
|
628
628
|
|
|
629
629
|
--- Diagram Definition ---
|
|
630
|
-
${r}</pre>`,this.currentDiagramString=r,this.needsUpdate=!1}}}function sue(t,e,r,{requestingURL:n,headers:i}){if(!r||n==="about:blank")return!0;if(e==="request"){if(i&&i.accept){const a=i.accept;if(!t.request.accept.some(s=>a.includes(s)))return!0}}else if(e==="response"){if(i&&i["content-type"]){const a=i["content-type"];if(!t.response.type.some(s=>a.includes(s)))return!0}}else return console.warn(`Unknown HTTP event type: ${e}`),!0;return!1}class oue extends jl{constructor(r){super(r);
|
|
631
|
-
`)}async function hue(t,e=!0){const r=["graph TD"];KF(t).forEach(l=>{const u=String(l);r.push(` base_${vo(u)}(${hc(u)})`)});const i=new Set;for(const l of t)for(const u of l.featureSteps)for(const[h,d]of Object.entries(u.action.named||{}))/^e_\d+$/.test(h)&&i.add(d);i.size&&(r.push(" subgraph ENV [Environment Variables]"),i.forEach(l=>{r.push(` env_${vo(l)}([${hc(l)}])`)}),r.push(" end"));const{getBackgroundFeatures:a}=await ur(async()=>{const{getBackgroundFeatures:l}=await Promise.resolve().then(()=>cue);return{getBackgroundFeatures:l}},void 0,import.meta.url),s=a(t);s.size&&(r.push(" subgraph BACKGROUNDS [Backgrounds]"),s.forEach(l=>{r.push(` bg_${vo(l)}[${hc(l)}]`)}),r.push(" end"));const o=[];return t.forEach(l=>{const u=`f_${vo(l.path)}`;r.push(` subgraph ${u} [${hc(l.path)}]`);const h=`base_${vo(l.base)}`;o.push(` ${h} --> ${u}`);let d=0,f=null,p=null,g=!1;l.featureSteps.forEach((m,v)=>{const y=vo(m.action.actionName),b=`s_${y}_${v}`,w=f?" ":" ",T=!!f;if(m.action.actionName==="scenarioStart")f&&r.push(" end"),f=`sc_${++d}`,r.push(` subgraph ${f} [${hc(m.in)}]`),p=null;else if(r.push(`${w}${b}[${hc(m.in)}]`),p&&T===g&&r.push(`${w}${p} ==> ${b}`),p=b,m.path!==l.path&&(s.has(m.path)?r.push(`${w}${b} -.-> bg_${vo(m.path)}`):console.warn(`Background step patah "${m.path}" not found in backgrounds set.`)),e&&m.action.stepVariables&&m.action.actionName!=="scenarioStart"){const E=new Set;m.action.stepVariables.forEach((k,S)=>{const L=k.name;let A,R=!1,C;const I=["q","b","t","s","c","a","n"],_=`e_${S}`;if(m.action.named&&m.action.named[_]!==void 0)A=String(m.action.named[_]),R=!0,C=A;else for(const N of I){const M=`${N}_${S}`;if(m.action.named&&m.action.named[M]!==void 0){A=String(m.action.named[M]);break}}if(A!==void 0)if(R&&C)r.push(`${w}${b} -.-> env_${vo(C)}`);else{const N=`sv_${y}_${v}_${vo(L)}`;E.has(N)||(r.push(`${w}${N}([${hc(L+" = "+A)}])`),E.add(N)),r.push(`${w}${b} -.-> ${N}`)}})}g=T}),f&&r.push(" end"),r.push(" end")}),r.push(...o),r}my.initialize({maxTextSize:1e6,maxEdges:1e4});let due=0;class fue extends jl{constructor(r){super(r);
|
|
630
|
+
${r}</pre>`,this.currentDiagramString=r,this.needsUpdate=!1}}}function sue(t,e,r,{requestingURL:n,headers:i}){if(!r||n==="about:blank")return!0;if(e==="request"){if(i&&i.accept){const a=i.accept;if(!t.request.accept.some(s=>a.includes(s)))return!0}}else if(e==="response"){if(i&&i["content-type"]){const a=i["content-type"];if(!t.response.type.some(s=>a.includes(s)))return!0}}else return console.warn(`Unknown HTTP event type: ${e}`),!0;return!1}class oue extends jl{constructor(r){super(r);wt(this,"placementTarget");wt(this,"diagramGenerator");wt(this,"id");this.artifact=r,this.placementTarget=document.querySelector("#sequence-diagram")?"haibun-focus":"details"}deriveLabel(){return"⇄ Trace"}async render(r){r.innerHTML="";const n=document.createElement("pre");n.classList.add("haibun-message-details-json");const i=b6(this.artifact.trace);if(i&&n.appendChild(i),r.appendChild(n),this.diagramGenerator||(this.id=Math.random().toString(36).substring(2,15),this.diagramGenerator=new aue(this.id,r)),this.artifact.httpEvent!=="route"){const a=document.getElementById("sequence-diagram");if(a&&a.offsetParent!==null)try{await this.diagramGenerator.update()}catch(s){console.error("Error updating sequence diagram:",s);const o=document.createElement("p");o.className="haibun-artifact-error",o.textContent=`Error updating sequence diagram: ${s.message}`,r.appendChild(o)}}}}const vo=t=>t?t.replace(/\W/g,"_"):"empty_sanitized_string",hc=t=>t==null||t===""?'" "':`"${t.replace(/"/g,"#quot;")}"`;function KF(t){const e=new Set;return t.forEach(r=>{r.base&&typeof r.base=="string"&&r.base.trim()!==""&&e.add(r.base)}),e}function lue(t){const e=new Set;return t.forEach(r=>{(r.featureSteps??[]).forEach(i=>{i.path&&i.path!==r.path&&e.add(i.path)})}),e}const cue=Object.freeze(Object.defineProperty({__proto__:null,getBackgroundFeatures:lue,getBaseLocations:KF},Symbol.toStringTag,{value:"Module"}));async function uue(t,e=!0){return(await hue(t,e)).join(`
|
|
631
|
+
`)}async function hue(t,e=!0){const r=["graph TD"];KF(t).forEach(l=>{const u=String(l);r.push(` base_${vo(u)}(${hc(u)})`)});const i=new Set;for(const l of t)for(const u of l.featureSteps)for(const[h,d]of Object.entries(u.action.named||{}))/^e_\d+$/.test(h)&&i.add(d);i.size&&(r.push(" subgraph ENV [Environment Variables]"),i.forEach(l=>{r.push(` env_${vo(l)}([${hc(l)}])`)}),r.push(" end"));const{getBackgroundFeatures:a}=await ur(async()=>{const{getBackgroundFeatures:l}=await Promise.resolve().then(()=>cue);return{getBackgroundFeatures:l}},void 0,import.meta.url),s=a(t);s.size&&(r.push(" subgraph BACKGROUNDS [Backgrounds]"),s.forEach(l=>{r.push(` bg_${vo(l)}[${hc(l)}]`)}),r.push(" end"));const o=[];return t.forEach(l=>{const u=`f_${vo(l.path)}`;r.push(` subgraph ${u} [${hc(l.path)}]`);const h=`base_${vo(l.base)}`;o.push(` ${h} --> ${u}`);let d=0,f=null,p=null,g=!1;l.featureSteps.forEach((m,v)=>{const y=vo(m.action.actionName),b=`s_${y}_${v}`,w=f?" ":" ",T=!!f;if(m.action.actionName==="scenarioStart")f&&r.push(" end"),f=`sc_${++d}`,r.push(` subgraph ${f} [${hc(m.in)}]`),p=null;else if(r.push(`${w}${b}[${hc(m.in)}]`),p&&T===g&&r.push(`${w}${p} ==> ${b}`),p=b,m.path!==l.path&&(s.has(m.path)?r.push(`${w}${b} -.-> bg_${vo(m.path)}`):console.warn(`Background step patah "${m.path}" not found in backgrounds set.`)),e&&m.action.stepVariables&&m.action.actionName!=="scenarioStart"){const E=new Set;m.action.stepVariables.forEach((k,S)=>{const L=k.name;let A,R=!1,C;const I=["q","b","t","s","c","a","n"],_=`e_${S}`;if(m.action.named&&m.action.named[_]!==void 0)A=String(m.action.named[_]),R=!0,C=A;else for(const N of I){const M=`${N}_${S}`;if(m.action.named&&m.action.named[M]!==void 0){A=String(m.action.named[M]);break}}if(A!==void 0)if(R&&C)r.push(`${w}${b} -.-> env_${vo(C)}`);else{const N=`sv_${y}_${v}_${vo(L)}`;E.has(N)||(r.push(`${w}${N}([${hc(L+" = "+A)}])`),E.add(N)),r.push(`${w}${b} -.-> ${N}`)}})}g=T}),f&&r.push(" end"),r.push(" end")}),r.push(...o),r}my.initialize({maxTextSize:1e6,maxEdges:1e4});let due=0;class fue extends jl{constructor(r){super(r);wt(this,"placementTarget","details");this.artifact=r}async render(r){if(!this.artifact.resolvedFeatures||this.artifact.resolvedFeatures.length===0){r.innerHTML="<p>No resolved features to display.</p>";return}const n=await uue(this.artifact.resolvedFeatures,!1),i=`mermaid-graph-svg-${due++}-${Date.now()}`;r.innerHTML="";try{const{svg:a,bindFunctions:s}=await my.render(i,n);r.innerHTML=a,s&&s(r)}catch(a){console.error("Error rendering Mermaid graph:",a),r.innerHTML=`<p class="haibun-artifact-error">Error rendering graph: ${a.message}</p>`}}}class pue extends rf{constructor(r,n,i,a){super("div",["haibun-log-entry",`haibun-level-${r}`]);wt(this,"detailsSummary");wt(this,"messageContent");(a==null?void 0:a.incident)===Hc.STEP_START&&this.addClass("haibun-step-start"),this.setData("time",`${n}`),this.detailsSummary=new gue(r,n),this.messageContent=new mue(i,a),this.append(this.detailsSummary),this.append(this.messageContent)}}class gue extends rf{constructor(e,r){super("summary","haibun-log-details-summary");const n=xue(r);this.setHtml(`${e}<div class="time-small">${bue(n)}s</div>`)}}class mue extends rf{constructor(r,n){super("div","haibun-message-content");wt(this,"artifactDisplays",[]);wt(this,"artifactContainers",[]);if(n){const{incident:i,incidentDetails:a,artifacts:s}=n,o=wue(r,n);let l=Hc[i]||"Context";if(s&&s.length>0)for(const d of s){const f=yue(d);f&&(this.artifactDisplays.push(f),f.label!==f.artifactType?l=f.label:f.artifactType&&(l=f.artifactType))}const u=document.createElement("details");u.classList.add("haibun-context-details");const h=new vue(o,l);if(i===Hc.STEP_START){const d=document.createElement("div");d.className="haibun-loader",h.element.prepend(d)}if(u.appendChild(h.element),a){const d=document.createElement("div");d.classList.add("haibun-message-details-json"),d.appendChild(b6(a)),u.appendChild(d)}if(this.artifactDisplays.length>0)for(const[d,f]of this.artifactDisplays.entries()){const p=f.placementTarget;if(!p||p==="details"){const g=document.createElement("div");g.className=`haibun-artifact-container haibun-artifact-${f.artifactType.replace(/\//g,"-")}`,g.textContent="Artifact is rendering...",u.appendChild(g),this.artifactContainers.push(g);const m=async()=>{if(u.open)try{await f.render(g)}catch(v){console.error(`[LogMessageContent] Error rendering artifact ${f.label}:`,v),g.innerHTML=`<p class="haibun-artifact-error">Error loading artifact: ${v.message}</p>`}else g.innerHTML="Artifact is rendering..."};u.addEventListener("toggle",m)}else this.renderSpecialPlacementArtifact(f,p)}this.append(u)}else this.addClass("haibun-simple-message"),this.setText(r)}async renderSpecialPlacementArtifact(r,n){const i=async a=>{const s=document.createElement("div");s.className=`haibun-artifact-special-placement haibun-artifact-${r.artifactType.replace(/\//g,"-")}`,s.textContent="Artifact is rendering...";try{await r.render(s)}catch(o){console.error(`[LogMessageContent] Error rendering artifact ${r.label} for special placement ${n}:`,o),s.innerHTML=`<p class="haibun-artifact-error">Error loading artifact: ${o.message}</p>`}a(s)};if(n==="body")await i(a=>document.body.appendChild(a));else if(n==="haibun-focus"){const a=document.querySelector("#haibun-focus");a?await i(s=>{a.replaceChildren(s),a.style.display="flex"}):console.warn("[LogMessageContent] #haibun-focus container not found for artifact placement.")}}}class vue extends rf{constructor(r,n){super("summary","haibun-log-message-summary");wt(this,"labelSpan");this.labelSpan=document.createElement("span"),this.labelSpan.className="details-type",this.updateLabel(n),this.setText(r),this.append(this.labelSpan)}updateLabel(r){this.labelSpan.textContent=r.replace(/_/g," ")}}function yue(t){const{artifactType:e}=t;switch(e){case"html":return new RY(t);case"image":return new NY(t);case"speech":return new IY(t);case"video":return new DY(t);case"video/start":return new MY(t);case"json":return new LY(t);case"json/http/trace":return new oue(t);case"resolvedFeatures":return new fue(t);default:throw Error(`Unsupported artifact type "${t.artifactType}" for display from ${e}`)}}function xue(t){const e=parseInt(document.body.dataset.startTime||`${Date.now()}`,10);return t-e}function bue(t){return(t/1e3).toFixed(3).replace(".",":")}function wue(t,e){var r;return(e==null?void 0:e.incident)===Hc.STEP_END?`${t} ${(r=e.incidentDetails)==null?void 0:r.featureStep.in}`:t}let Dm=!1;function Tue(){const t=document.getElementById("haibun-debug-level-select"),e=["debug","log","info","error"],r=n=>{const i=e.indexOf(n);let a="";e.forEach((o,l)=>{l<i?a+=`div.haibun-log-entry.haibun-level-${o}:not(.disappeared) { display: none; }
|
|
632
632
|
`:a+=`div.haibun-log-entry.haibun-level-${o}:not(.disappeared) { display: flex; }
|
|
633
633
|
`});let s=document.getElementById("haibun-dynamic-styles");s||(s=document.createElement("style"),s.id="haibun-dynamic-styles",document.head.appendChild(s)),s.textContent=a};t&&(t.addEventListener("change",n=>{const i=n.target;r(i.value)}),r(t.value)),Eue()}function ZF(t){var l;if(Dm)return;const e=document.body.dataset.startTime,r=(l=document.getElementById("haibun-video-start"))==null?void 0:l.dataset.start;if(!e||!r)return;const n=parseInt(e,10),i=parseInt(r,10);if(isNaN(n)||isNaN(i))return;const a=n+i,s=t.currentTime*1e3;let o=null;document.querySelectorAll(".haibun-log-entry").forEach(u=>{u.classList.remove("haibun-stepper-played","haibun-stepper-notplayed","haibun-stepper-current");const h=u.dataset.time;if(!h)return;const d=parseInt(h,10);if(isNaN(d))return;d-a<=s?(u.classList.add("haibun-stepper-played"),(!o||d>parseInt(o.dataset.time||"0",10))&&(o=u)):u.classList.add("haibun-stepper-notplayed")}),o&&(o.classList.add("haibun-stepper-current"),setTimeout(()=>{o.scrollIntoView({behavior:"smooth",block:"center"})},0))}function a8(t){let e=t.currentTime;setInterval(()=>{t.currentTime!==e&&(e=t.currentTime,ZF(t))},100)}function Eue(){const t=document.getElementById("sequence-diagram"),e=document.getElementById("haibun-focus"),r=document.getElementById("haibun-log-display-area");r.addEventListener("click",u=>{var f;const h=u.target,d=Sue(h);if(d&&d.dataset.time){const p=e.querySelector("video");if(p){const g=document.body.dataset.startTime,m=(f=document.getElementById("haibun-video-start"))==null?void 0:f.dataset.start;if(!g||!m){console.warn("Monitor start time or video start offset not found. Cannot seek video.");return}const v=parseInt(g,10),y=parseInt(m,10);if(isNaN(v)||isNaN(y)){console.warn("Invalid monitor start time or video start offset.");return}const b=v+y,w=parseInt(d.dataset.time,10);if(isNaN(w)){console.warn("Clicked log entry missing or invalid data-time:",d);return}const E=(w-b)/1e3;isNaN(E)||(p.currentTime=Math.max(0,E))}}});let n;r.addEventListener("scroll",()=>{clearTimeout(n),n=window.setTimeout(()=>{Dm=!0},150)});const i=u=>{let h;const d=()=>{ZF(u)};u.addEventListener("seeked",()=>{Dm=!1,d()}),u.addEventListener("play",()=>{Dm=!1,h===void 0&&(d(),h=window.setInterval(d,50))});const f=()=>{h!==void 0&&(clearInterval(h),h=void 0,d())};u.addEventListener("pause",f),u.addEventListener("ended",f),d()};let a=e.querySelector("video");a&&(i(a),a8(a)),new MutationObserver(u=>{u.forEach(h=>{if(h.type==="childList"){const d=e.querySelector("video");d&&d!==a&&(console.info("New video detected, setting up handlers."),i(d),a8(d),a=d)}})}).observe(e,{childList:!0});const o=new MutationObserver(u=>{u.forEach(h=>{h.type==="childList"&&h.addedNodes.length>0&&h.target===t&&(console.info("Sequence diagram content detected."),o.disconnect())})});t&&o.observe(t,{childList:!0}),window.addEventListener("load",()=>{setTimeout(()=>{const u=document.querySelector(".haibun-log-entry.haibun-stepper-current");u&&u.scrollIntoView({behavior:"auto",block:"nearest"})},0)});function l(){const u=document.getElementById("haibun-log-display-area");if(!u)return;let h=u.querySelector(".haibun-log-entry.haibun-stepper-notplayed");if(!h){const d=u.querySelectorAll(".haibun-log-entry.haibun-stepper-played");d.length&&(h=d[d.length-1])}h&&h.scrollIntoView({behavior:"smooth",block:"center"})}r&&new MutationObserver(()=>{l()}).observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),window.addEventListener("DOMContentLoaded",()=>{const u=document.getElementById("haibun-prompt-controls-container"),h=document.getElementById("haibun-retry-button"),d=document.getElementById("haibun-fail-button"),f=document.getElementById("haibun-step-button"),p=document.getElementById("haibun-continue-button"),g=document.getElementById("haibun-prompt-message");window.showPromptControls=v=>{const{message:y,options:b}=JSON.parse(v);g.textContent=y,(b.includes("r")||b.includes("retry"))&&(h.disabled=!1),(b.includes("f")||b.includes("fail"))&&(d.disabled=!1),(b.includes("s")||b.includes("step"))&&(f.disabled=!1),(b.includes("c")||b.includes("continue"))&&(p.disabled=!1),u.classList.add("paused-program-glow"),u.style.display="flex"},window.hidePromptControls=()=>{u.style.display="none",u.classList.remove("paused-program-glow")},h.disabled=!0,d.disabled=!0,f.disabled=!0,p.disabled=!0,g.textContent="",window.hidePromptControls(),h.addEventListener("click",()=>{window.haibunResolvePrompt("retry")}),d.addEventListener("click",()=>{window.haibunResolvePrompt("fail")}),f.addEventListener("click",()=>{window.haibunResolvePrompt("step")}),p.addEventListener("click",()=>{window.haibunResolvePrompt("continue")});const m=document.querySelectorAll(".haibun-log-entry");m.length>0&&(document.querySelector(".haibun-stepper-current")||(m.forEach(v=>{v.classList.remove("haibun-stepper-current","haibun-stepper-played","haibun-stepper-notplayed"),v.classList.add("haibun-stepper-notplayed")}),m[0].classList.add("haibun-stepper-current")),setTimeout(()=>{m[0].scrollIntoView({behavior:"smooth",block:"center"})},0))})}function Sue(t){let e=t;for(;e&&!e.classList.contains("haibun-log-entry");)e=e.parentElement;return e}window.haibunCapturedMessages=window.haibunCapturedMessages||[];console.info("monitor.ts: window.haibunCapturedMessages initialized.");window.receiveLogData=t=>{window.haibunCapturedMessages.push(t),QF(t)};function QF(t){const{level:e,message:r,messageContext:n,timestamp:i}=t,a=document.getElementById("haibun-log-display-area"),o=new pue(e,i,r,n).element;if(a.appendChild(o),(n==null?void 0:n.incident)===Hc.STEP_END){const l=a.querySelectorAll(".haibun-step-start:not(.disappeared)");l.length>0?l[l.length-1].classList.add("disappeared"):console.warn("Received STEP_END but found no active STEP_START log entry to hide.")}a.scrollTop=a.scrollHeight}function kue(){document.getElementById("haibun-log-display-area")&&(console.info(`Rendering ${window.haibunCapturedMessages.length} log entries...`),window.haibunCapturedMessages.forEach(QF))}document.addEventListener("DOMContentLoaded",()=>{document.body.dataset.startTime||(document.body.dataset.startTime=`${Date.now()}`),kue(),Tue(),console.info("Initial logs rendered.")});class ba{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new ba(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class Ka{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new Ka(r,ba.range(this,e))}}class at{constructor(e,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15<o.length?h=o.slice(a,a+15)+"…":h=o.slice(a),n+=u+l+h}var d=new Error(n);return d.name="ParseError",d.__proto__=at.prototype,d.position=i,i!=null&&a!=null&&(d.length=a-i),d.rawMessage=e,d}}at.prototype.__proto__=Error.prototype;var Cue=function(e,r){return e.indexOf(r)!==-1},Aue=function(e,r){return e===void 0?r:e},_ue=/([A-Z])/g,Lue=function(e){return e.replace(_ue,"-$1").toLowerCase()},Rue={"&":"&",">":">","<":"<",'"':""","'":"'"},Nue=/[&><"']/g;function Due(t){return String(t).replace(Nue,e=>Rue[e])}var JF=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},Iue=function(e){var r=JF(e);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},Mue=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Oue=function(e){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},$t={contains:Cue,deflt:Aue,escape:Due,hyphenate:Lue,getBaseElem:JF,isCharacterBox:Iue,protocolFromUrl:Oue},hp={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:t=>"#"+t},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:(t,e)=>(e.push(t),e)},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:t=>Math.max(0,t),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:t=>Math.max(0,t),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:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Pue(t){if(t.default)return t.default;var e=t.type,r=Array.isArray(e)?e[0]:e;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class LE{constructor(e){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,e=e||{};for(var r in hp)if(hp.hasOwnProperty(r)){var n=hp[r];this[r]=e[r]!==void 0?n.processor?n.processor(e[r]):e[r]:Pue(n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new at("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var r=$t.protocolFromUrl(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class cl{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return $s[Bue[this.id]]}sub(){return $s[Fue[this.id]]}fracNum(){return $s[$ue[this.id]]}fracDen(){return $s[zue[this.id]]}cramp(){return $s[Vue[this.id]]}text(){return $s[Gue[this.id]]}isTight(){return this.size>=2}}var RE=0,vy=1,Th=2,$o=3,Fp=4,Ya=5,$d=6,Fi=7,$s=[new cl(RE,0,!1),new cl(vy,0,!0),new cl(Th,1,!1),new cl($o,1,!0),new cl(Fp,2,!1),new cl(Ya,2,!0),new cl($d,3,!1),new cl(Fi,3,!0)],Bue=[Fp,Ya,Fp,Ya,$d,Fi,$d,Fi],Fue=[Ya,Ya,Ya,Ya,Fi,Fi,Fi,Fi],$ue=[Th,$o,Fp,Ya,$d,Fi,$d,Fi],zue=[$o,$o,Ya,Ya,Fi,Fi,Fi,Fi],Vue=[vy,vy,$o,$o,Ya,Ya,Fi,Fi],Gue=[RE,vy,Th,$o,Th,$o,Th,$o],Gt={DISPLAY:$s[RE],TEXT:$s[Th],SCRIPT:$s[Fp],SCRIPTSCRIPT:$s[$d]},bw=[{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 Uue(t){for(var e=0;e<bw.length;e++)for(var r=bw[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}var Im=[];bw.forEach(t=>t.blocks.forEach(e=>Im.push(...e)));function e$(t){for(var e=0;e<Im.length;e+=2)if(t>=Im[e]&&t<=Im[e+1])return!0;return!1}var Uu=80,que=function(e,r){return"M95,"+(622+e+r)+`
|
|
634
634
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
@@ -910,12 +910,12 @@ Expecting `+Ye.join(", ")+", got '"+(this.terminals_[Xe]||Xe)+"'":Ze="Parse erro
|
|
|
910
910
|
|
|
911
911
|
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
912
912
|
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
913
|
-
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ie.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e,/.*</.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"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){const i=this.lookUpDomId(e);if(we().securityLevel!=="loose"||r===void 0)return;let a=[];if(typeof n=="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o<a.length;o++){let l=a[o].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),a[o]=l}}a.length===0&&a.push(e);const s=this.vertices.get(e);s&&(s.haveCallback=!0,this.funs.push(()=>{const o=document.querySelector(`[id="${i}"]`);o!==null&&o.addEventListener("click",()=>{Zt.runFunc(r,...a)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Zt.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=rt(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=rt("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),rt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=rt(a.currentTarget);if(s.attr("title")===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(r.html().replace(/<br\/>/g,"<br/>")),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),rt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=we(),Vn()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const s=x(h=>{const d={boolean:{},number:{},string:{}},f=[];let p;return{nodeList:h.filter(function(m){const v=typeof m;return m.stmt&&m.stmt==="dir"?(p=m.value,!1):m.trim()===""?!1:v in d?d[v].hasOwnProperty(m)?!1:d[v][m]=!0:f.includes(m)?!1:f.push(m)}),dir:p}},"uniq"),{nodeList:o,dir:l}=s(r.flat());if(this.version==="gen-1")for(let h=0;h<o.length;h++)o[h]=this.lookUpDomId(o[h]);i=i??"subGraph"+this.subCount,a=a||"",a=this.sanitizeText(a),this.subCount=this.subCount+1;const u={id:i,nodes:o,title:a.trim(),classes:[],dir:l,labelType:n.type};return ie.info("Adding",u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(i,u),i}getPosForId(e){for(const[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){const n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i<n.length;){const s=this.getPosForId(n[i]);if(s>=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a<n;++a)r[a]===e&&++i;return i}destructEndLink(e){const r=e.trim();let n=r.slice(0,-1),i="arrow_open";switch(r.slice(-1)){case"x":i="arrow_cross",r.startsWith("x")&&(i="double_"+i,n=n.slice(1));break;case">":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=we(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:lp(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return TD.flowchart}},x(Vh,"FlowDB"),Vh),qme=x(function(t,e){return e.db.getClasses()},"getClasses"),Hme=x(async function(t,e,r,n){var p;ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=we();let o;i==="sandbox"&&(o=rt("#i"+e));const l=i==="sandbox"?o.nodes()[0].contentDocument:document;ie.debug("Before getData: ");const u=n.db.getData();ie.debug("Data: ",u);const h=Ig(e,i),d=n.db.getDirection();u.type=n.type,u.layoutAlgorithm=J2(s),u.layoutAlgorithm==="dagre"&&s==="elk"&&ie.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."),u.direction=d,u.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,u.rankSpacing=(a==null?void 0:a.rankSpacing)||50,u.markers=["point","circle","cross"],u.diagramId=e,ie.debug("REF1:",u),await kg(u,h);const f=((p=u.config.flowchart)==null?void 0:p.diagramPadding)??8;Zt.insertTitle(h,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Mg(h,f,"flowchart",(a==null?void 0:a.useMaxWidth)||!1);for(const g of u.nodes){const m=rt(`#${e} [id="${g.id}"]`);if(!m||!g.link)continue;const v=l.createElementNS("http://www.w3.org/2000/svg","a");v.setAttributeNS("http://www.w3.org/2000/svg","class",g.cssClasses),v.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),i==="sandbox"?v.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):g.linkTarget&&v.setAttributeNS("http://www.w3.org/2000/svg","target",g.linkTarget);const y=m.insert(function(){return v},":first-child"),b=m.select(".label-container");b&&y.append(function(){return b.node()});const w=m.select(".label");w&&y.append(function(){return w.node()})}},"draw"),Wme={getClasses:qme,draw:Hme},Mw=function(){var t=x(function(dr,At,wt,ot){for(wt=wt||{},ot=dr.length;ot--;wt[dr[ot]]=At);return wt},"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],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,49],m=[1,48],v=[1,29],y=[1,30],b=[1,31],w=[1,32],T=[1,33],E=[1,44],k=[1,46],S=[1,42],L=[1,47],A=[1,43],R=[1,50],C=[1,45],I=[1,51],P=[1,52],_=[1,34],N=[1,35],M=[1,36],O=[1,37],D=[1,57],B=[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],z=[1,61],F=[1,60],G=[1,62],q=[8,9,11,75,77,78],Y=[1,78],ee=[1,91],Q=[1,96],oe=[1,95],pe=[1,92],j=[1,88],W=[1,94],X=[1,90],H=[1,97],K=[1,93],ne=[1,98],Z=[1,89],be=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],re=[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],Ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],me=[44,60,89,102,105,106,109,111,114,115,116],Ve=[1,121],Ue=[1,122],Fe=[1,124],_e=[1,123],Oe=[44,60,62,74,89,102,105,106,109,111,114,115,116],Ce=[1,133],Le=[1,147],ze=[1,148],ge=[1,149],Me=[1,150],J=[1,135],ue=[1,137],$=[1,141],se=[1,142],ae=[1,143],fe=[1,144],he=[1,145],Te=[1,146],Se=[1,151],Ee=[1,152],Ge=[1,131],Je=[1,132],He=[1,139],Xe=[1,134],Ke=[1,138],$e=[1,136],je=[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],lt=[1,154],st=[1,156],qe=[8,9,11],Et=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ye=[1,176],Ze=[1,172],ht=[1,173],ct=[1,177],ut=[1,174],mt=[1,175],sr=[77,116,119],Rt=[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],hr=[10,106],rr=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],er=[1,247],Wt=[1,245],Xr=[1,249],pt=[1,243],ke=[1,244],Qe=[1,246],bt=[1,248],tr=[1,250],Mr=[1,268],Or=[8,9,11,106],Lr=[8,9,10,11,60,84,105,106,109,110,111,112],Sn={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$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:x(function(At,wt,ot,We,ar,de,ss){var ve=de.length-1;switch(ar){case 2:this.$=[];break;case 3:(!Array.isArray(de[ve])||de[ve].length>0)&&de[ve-1].push(de[ve]),this.$=de[ve-1];break;case 4:case 183:this.$=de[ve];break;case 11:We.setDirection("TB"),this.$="TB";break;case 12:We.setDirection(de[ve-1]),this.$=de[ve-1];break;case 27:this.$=de[ve-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=We.addSubGraph(de[ve-6],de[ve-1],de[ve-4]);break;case 34:this.$=We.addSubGraph(de[ve-3],de[ve-1],de[ve-3]);break;case 35:this.$=We.addSubGraph(void 0,de[ve-1],void 0);break;case 37:this.$=de[ve].trim(),We.setAccTitle(this.$);break;case 38:case 39:this.$=de[ve].trim(),We.setAccDescription(this.$);break;case 43:this.$=de[ve-1]+de[ve];break;case 44:this.$=de[ve];break;case 45:We.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),We.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 46:We.addLink(de[ve-2].stmt,de[ve],de[ve-1]),this.$={stmt:de[ve],nodes:de[ve].concat(de[ve-2].nodes)};break;case 47:We.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 48:this.$={stmt:de[ve-1],nodes:de[ve-1]};break;case 49:We.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),this.$={stmt:de[ve-1],nodes:de[ve-1],shapeData:de[ve]};break;case 50:this.$={stmt:de[ve],nodes:de[ve]};break;case 51:this.$=[de[ve]];break;case 52:We.addVertex(de[ve-5][de[ve-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve-4]),this.$=de[ve-5].concat(de[ve]);break;case 53:this.$=de[ve-4].concat(de[ve]);break;case 54:this.$=de[ve];break;case 55:this.$=de[ve-2],We.setClass(de[ve-2],de[ve]);break;case 56:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"square");break;case 57:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"doublecircle");break;case 58:this.$=de[ve-5],We.addVertex(de[ve-5],de[ve-2],"circle");break;case 59:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"ellipse");break;case 60:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"stadium");break;case 61:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"subroutine");break;case 62:this.$=de[ve-7],We.addVertex(de[ve-7],de[ve-1],"rect",void 0,void 0,void 0,Object.fromEntries([[de[ve-5],de[ve-3]]]));break;case 63:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"cylinder");break;case 64:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"round");break;case 65:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"diamond");break;case 66:this.$=de[ve-5],We.addVertex(de[ve-5],de[ve-2],"hexagon");break;case 67:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"odd");break;case 68:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"trapezoid");break;case 69:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"inv_trapezoid");break;case 70:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"lean_right");break;case 71:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"lean_left");break;case 72:this.$=de[ve],We.addVertex(de[ve]);break;case 73:de[ve-1].text=de[ve],this.$=de[ve-1];break;case 74:case 75:de[ve-2].text=de[ve-1],this.$=de[ve-2];break;case 76:this.$=de[ve];break;case 77:var sn=We.destructLink(de[ve],de[ve-2]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,text:de[ve-1]};break;case 78:var sn=We.destructLink(de[ve],de[ve-2]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,text:de[ve-1],id:de[ve-3]};break;case 79:this.$={text:de[ve],type:"text"};break;case 80:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 81:this.$={text:de[ve],type:"string"};break;case 82:this.$={text:de[ve],type:"markdown"};break;case 83:var sn=We.destructLink(de[ve]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length};break;case 84:var sn=We.destructLink(de[ve]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,id:de[ve-1]};break;case 85:this.$=de[ve-1];break;case 86:this.$={text:de[ve],type:"text"};break;case 87:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 88:this.$={text:de[ve],type:"string"};break;case 89:case 104:this.$={text:de[ve],type:"markdown"};break;case 101:this.$={text:de[ve],type:"text"};break;case 102:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 103:this.$={text:de[ve],type:"text"};break;case 105:this.$=de[ve-4],We.addClass(de[ve-2],de[ve]);break;case 106:this.$=de[ve-4],We.setClass(de[ve-2],de[ve]);break;case 107:case 115:this.$=de[ve-1],We.setClickEvent(de[ve-1],de[ve]);break;case 108:case 116:this.$=de[ve-3],We.setClickEvent(de[ve-3],de[ve-2]),We.setTooltip(de[ve-3],de[ve]);break;case 109:this.$=de[ve-2],We.setClickEvent(de[ve-2],de[ve-1],de[ve]);break;case 110:this.$=de[ve-4],We.setClickEvent(de[ve-4],de[ve-3],de[ve-2]),We.setTooltip(de[ve-4],de[ve]);break;case 111:this.$=de[ve-2],We.setLink(de[ve-2],de[ve]);break;case 112:this.$=de[ve-4],We.setLink(de[ve-4],de[ve-2]),We.setTooltip(de[ve-4],de[ve]);break;case 113:this.$=de[ve-4],We.setLink(de[ve-4],de[ve-2],de[ve]);break;case 114:this.$=de[ve-6],We.setLink(de[ve-6],de[ve-4],de[ve]),We.setTooltip(de[ve-6],de[ve-2]);break;case 117:this.$=de[ve-1],We.setLink(de[ve-1],de[ve]);break;case 118:this.$=de[ve-3],We.setLink(de[ve-3],de[ve-2]),We.setTooltip(de[ve-3],de[ve]);break;case 119:this.$=de[ve-3],We.setLink(de[ve-3],de[ve-2],de[ve]);break;case 120:this.$=de[ve-5],We.setLink(de[ve-5],de[ve-4],de[ve]),We.setTooltip(de[ve-5],de[ve-2]);break;case 121:this.$=de[ve-4],We.addVertex(de[ve-2],void 0,void 0,de[ve]);break;case 122:this.$=de[ve-4],We.updateLink([de[ve-2]],de[ve]);break;case 123:this.$=de[ve-4],We.updateLink(de[ve-2],de[ve]);break;case 124:this.$=de[ve-8],We.updateLinkInterpolate([de[ve-6]],de[ve-2]),We.updateLink([de[ve-6]],de[ve]);break;case 125:this.$=de[ve-8],We.updateLinkInterpolate(de[ve-6],de[ve-2]),We.updateLink(de[ve-6],de[ve]);break;case 126:this.$=de[ve-6],We.updateLinkInterpolate([de[ve-4]],de[ve]);break;case 127:this.$=de[ve-6],We.updateLinkInterpolate(de[ve-4],de[ve]);break;case 128:case 130:this.$=[de[ve]];break;case 129:case 131:de[ve-2].push(de[ve]),this.$=de[ve-2];break;case 133:this.$=de[ve-1]+de[ve];break;case 181:this.$=de[ve];break;case 182:this.$=de[ve-1]+""+de[ve];break;case 184:this.$=de[ve-1]+""+de[ve];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:D,15:53,18:56},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:z,9:F,11:G,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:z,9:F,11:G,21:67},{8:z,9:F,11:G,21:68},{8:z,9:F,11:G,21:69},{8:z,9:F,11:G,21:70},{8:z,9:F,11:G,21:71},{8:z,9:F,10:[1,72],11:G,21:73},t(B,[2,36]),{35:[1,74]},{37:[1,75]},t(B,[2,39]),t(q,[2,50],{18:76,39:77,10:D,40:Y}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:ee,44:Q,60:oe,80:[1,86],89:pe,95:[1,83],97:[1,84],101:85,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(be,[2,51]),t(be,[2,54],{46:[1,99]}),t(ce,[2,72],{113:112,29:[1,100],44:g,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:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),t(re,[2,181]),t(re,[2,142]),t(re,[2,143]),t(re,[2,144]),t(re,[2,145]),t(re,[2,146]),t(re,[2,147]),t(re,[2,148]),t(re,[2,149]),t(re,[2,150]),t(re,[2,151]),t(re,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,113]},t(Ne,[2,26],{18:114,10:D}),t(B,[2,27]),{42:115,43:38,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(me,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:Ve,81:Ue,116:Fe,119:_e},{75:[1,125],77:[1,126]},t(Oe,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:Ce,12:Le,14:ze,27:ge,28:127,32:Me,44:J,60:ue,75:$,80:[1,129],81:[1,130],83:140,84:se,85:ae,86:fe,87:he,88:Te,89:Se,90:Ee,91:128,105:Ge,109:Je,111:He,114:Xe,115:Ke,116:$e},t(je,a,{5:153}),t(B,[2,37]),t(B,[2,38]),t(q,[2,48],{44:lt}),t(q,[2,49],{18:155,10:D,40:st}),t(be,[2,44]),{44:g,47:157,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{102:[1,158],103:159,105:[1,160]},{44:g,47:161,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{44:g,47:162,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(qe,[2,115],{120:167,10:[1,166],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,117],{10:[1,168]}),t(Et,[2,183]),t(Et,[2,170]),t(Et,[2,171]),t(Et,[2,172]),t(Et,[2,173]),t(Et,[2,174]),t(Et,[2,175]),t(Et,[2,176]),t(Et,[2,177]),t(Et,[2,178]),t(Et,[2,179]),t(Et,[2,180]),{44:g,47:169,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{30:170,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:178,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:180,50:[1,179],67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:181,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:182,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:183,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{109:[1,184]},{30:185,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:186,65:[1,187],67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:188,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:189,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:190,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(re,[2,182]),t(i,[2,20]),t(Ne,[2,25]),t(q,[2,46],{39:191,18:192,10:D,40:Y}),t(me,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{77:[1,196],79:197,116:Fe,119:_e},t(sr,[2,79]),t(sr,[2,81]),t(sr,[2,82]),t(sr,[2,168]),t(sr,[2,169]),{76:198,79:120,80:Ve,81:Ue,116:Fe,119:_e},t(Oe,[2,84]),{8:z,9:F,10:Ce,11:G,12:Le,14:ze,21:200,27:ge,29:[1,199],32:Me,44:J,60:ue,75:$,83:140,84:se,85:ae,86:fe,87:he,88:Te,89:Se,90:Ee,91:201,105:Ge,109:Je,111:He,114:Xe,115:Ke,116:$e},t(Rt,[2,101]),t(Rt,[2,103]),t(Rt,[2,104]),t(Rt,[2,157]),t(Rt,[2,158]),t(Rt,[2,159]),t(Rt,[2,160]),t(Rt,[2,161]),t(Rt,[2,162]),t(Rt,[2,163]),t(Rt,[2,164]),t(Rt,[2,165]),t(Rt,[2,166]),t(Rt,[2,167]),t(Rt,[2,90]),t(Rt,[2,91]),t(Rt,[2,92]),t(Rt,[2,93]),t(Rt,[2,94]),t(Rt,[2,95]),t(Rt,[2,96]),t(Rt,[2,97]),t(Rt,[2,98]),t(Rt,[2,99]),t(Rt,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,202],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},{10:D,18:203},{44:[1,204]},t(be,[2,43]),{10:[1,205],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{10:[1,206]},{10:[1,207],106:[1,208]},t(hr,[2,128]),{10:[1,209],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{10:[1,210],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{80:[1,211]},t(qe,[2,109],{10:[1,212]}),t(qe,[2,111],{10:[1,213]}),{80:[1,214]},t(Et,[2,184]),{80:[1,215],98:[1,216]},t(be,[2,55],{113:112,44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),{31:[1,217],67:Ye,82:218,116:ct,117:ut,118:mt},t(rr,[2,86]),t(rr,[2,88]),t(rr,[2,89]),t(rr,[2,153]),t(rr,[2,154]),t(rr,[2,155]),t(rr,[2,156]),{49:[1,219],67:Ye,82:218,116:ct,117:ut,118:mt},{30:220,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{51:[1,221],67:Ye,82:218,116:ct,117:ut,118:mt},{53:[1,222],67:Ye,82:218,116:ct,117:ut,118:mt},{55:[1,223],67:Ye,82:218,116:ct,117:ut,118:mt},{57:[1,224],67:Ye,82:218,116:ct,117:ut,118:mt},{60:[1,225]},{64:[1,226],67:Ye,82:218,116:ct,117:ut,118:mt},{66:[1,227],67:Ye,82:218,116:ct,117:ut,118:mt},{30:228,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{31:[1,229],67:Ye,82:218,116:ct,117:ut,118:mt},{67:Ye,69:[1,230],71:[1,231],82:218,116:ct,117:ut,118:mt},{67:Ye,69:[1,233],71:[1,232],82:218,116:ct,117:ut,118:mt},t(q,[2,45],{18:155,10:D,40:st}),t(q,[2,47],{44:lt}),t(me,[2,75]),t(me,[2,74]),{62:[1,234],67:Ye,82:218,116:ct,117:ut,118:mt},t(me,[2,77]),t(sr,[2,80]),{77:[1,235],79:197,116:Fe,119:_e},{30:236,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(je,a,{5:237}),t(Rt,[2,102]),t(B,[2,35]),{43:238,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{10:D,18:239},{10:er,60:Wt,84:Xr,92:240,105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},{10:er,60:Wt,84:Xr,92:251,104:[1,252],105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},{10:er,60:Wt,84:Xr,92:253,104:[1,254],105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},{105:[1,255]},{10:er,60:Wt,84:Xr,92:256,105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},{44:g,47:257,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(qe,[2,116]),t(qe,[2,118],{10:[1,261]}),t(qe,[2,119]),t(ce,[2,56]),t(rr,[2,87]),t(ce,[2,57]),{51:[1,262],67:Ye,82:218,116:ct,117:ut,118:mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,263]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,264],67:Ye,82:218,116:ct,117:ut,118:mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(me,[2,78]),{31:[1,265],67:Ye,82:218,116:ct,117:ut,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,266],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},t(be,[2,53]),{43:267,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,121],{106:Mr}),t(Or,[2,130],{108:269,10:er,60:Wt,84:Xr,105:pt,109:ke,110:Qe,111:bt,112:tr}),t(Lr,[2,132]),t(Lr,[2,134]),t(Lr,[2,135]),t(Lr,[2,136]),t(Lr,[2,137]),t(Lr,[2,138]),t(Lr,[2,139]),t(Lr,[2,140]),t(Lr,[2,141]),t(qe,[2,122],{106:Mr}),{10:[1,270]},t(qe,[2,123],{106:Mr}),{10:[1,271]},t(hr,[2,129]),t(qe,[2,105],{106:Mr}),t(qe,[2,106],{113:112,44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),t(qe,[2,110]),t(qe,[2,112],{10:[1,272]}),t(qe,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:z,9:F,11:G,21:277},t(B,[2,34]),t(be,[2,52]),{10:er,60:Wt,84:Xr,105:pt,107:278,108:242,109:ke,110:Qe,111:bt,112:tr},t(Lr,[2,133]),{14:ee,44:Q,60:oe,89:pe,101:279,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},{14:ee,44:Q,60:oe,89:pe,101:280,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},{98:[1,281]},t(qe,[2,120]),t(ce,[2,58]),{30:282,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(ce,[2,66]),t(je,a,{5:283}),t(Or,[2,131],{108:269,10:er,60:Wt,84:Xr,105:pt,109:ke,110:Qe,111:bt,112:tr}),t(qe,[2,126],{120:167,10:[1,284],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,127],{120:167,10:[1,285],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,114]),{31:[1,286],67:Ye,82:218,116:ct,117:ut,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,287],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},{10:er,60:Wt,84:Xr,92:288,105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},{10:er,60:Wt,84:Xr,92:289,105:pt,107:241,108:242,109:ke,110:Qe,111:bt,112:tr},t(ce,[2,62]),t(B,[2,33]),t(qe,[2,124],{106:Mr}),t(qe,[2,125],{106:Mr})],defaultActions:{},parseError:x(function(At,wt){if(wt.recoverable)this.trace(At);else{var ot=new Error(At);throw ot.hash=wt,ot}},"parseError"),parse:x(function(At){var wt=this,ot=[0],We=[],ar=[null],de=[],ss=this.table,ve="",sn=0,n7=0,TY=2,i7=1,EY=de.slice.call(arguments,1),Hn=Object.create(this.lexer),oc={yy:{}};for(var ob in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ob)&&(oc.yy[ob]=this.yy[ob]);Hn.setInput(At,oc.yy),oc.yy.lexer=Hn,oc.yy.parser=this,typeof Hn.yylloc>"u"&&(Hn.yylloc={});var lb=Hn.yylloc;de.push(lb);var SY=Hn.options&&Hn.options.ranges;typeof oc.yy.parseError=="function"?this.parseError=oc.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kY(ya){ot.length=ot.length-2*ya,ar.length=ar.length-ya,de.length=de.length-ya}x(kY,"popStack");function a7(){var ya;return ya=We.pop()||Hn.lex()||i7,typeof ya!="number"&&(ya instanceof Array&&(We=ya,ya=We.pop()),ya=wt.symbols_[ya]||ya),ya}x(a7,"lex");for(var ji,lc,Ma,cb,zu={},i1,fo,s7,a1;;){if(lc=ot[ot.length-1],this.defaultActions[lc]?Ma=this.defaultActions[lc]:((ji===null||typeof ji>"u")&&(ji=a7()),Ma=ss[lc]&&ss[lc][ji]),typeof Ma>"u"||!Ma.length||!Ma[0]){var ub="";a1=[];for(i1 in ss[lc])this.terminals_[i1]&&i1>TY&&a1.push("'"+this.terminals_[i1]+"'");Hn.showPosition?ub="Parse error on line "+(sn+1)+`:
|
|
913
|
+
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;ie.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e,/.*</.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"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){const i=this.lookUpDomId(e);if(we().securityLevel!=="loose"||r===void 0)return;let a=[];if(typeof n=="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o<a.length;o++){let l=a[o].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),a[o]=l}}a.length===0&&a.push(e);const s=this.vertices.get(e);s&&(s.haveCallback=!0,this.funs.push(()=>{const o=document.querySelector(`[id="${i}"]`);o!==null&&o.addEventListener("click",()=>{Zt.runFunc(r,...a)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=Zt.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=rt(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=rt("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),rt(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=rt(a.currentTarget);if(s.attr("title")===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(r.html().replace(/<br\/>/g,"<br/>")),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),rt(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=we(),Vn()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const s=x(h=>{const d={boolean:{},number:{},string:{}},f=[];let p;return{nodeList:h.filter(function(m){const v=typeof m;return m.stmt&&m.stmt==="dir"?(p=m.value,!1):m.trim()===""?!1:v in d?d[v].hasOwnProperty(m)?!1:d[v][m]=!0:f.includes(m)?!1:f.push(m)}),dir:p}},"uniq"),{nodeList:o,dir:l}=s(r.flat());if(this.version==="gen-1")for(let h=0;h<o.length;h++)o[h]=this.lookUpDomId(o[h]);i=i??"subGraph"+this.subCount,a=a||"",a=this.sanitizeText(a),this.subCount=this.subCount+1;const u={id:i,nodes:o,title:a.trim(),classes:[],dir:l,labelType:n.type};return ie.info("Adding",u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(i,u),i}getPosForId(e){for(const[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){const n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i<n.length;){const s=this.getPosForId(n[i]);if(s>=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a<n;++a)r[a]===e&&++i;return i}destructEndLink(e){const r=e.trim();let n=r.slice(0,-1),i="arrow_open";switch(r.slice(-1)){case"x":i="arrow_cross",r.startsWith("x")&&(i="double_"+i,n=n.slice(1));break;case">":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=we(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:lp(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return TD.flowchart}},x(Vh,"FlowDB"),Vh),qme=x(function(t,e){return e.db.getClasses()},"getClasses"),Hme=x(async function(t,e,r,n){var p;ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,flowchart:a,layout:s}=we();let o;i==="sandbox"&&(o=rt("#i"+e));const l=i==="sandbox"?o.nodes()[0].contentDocument:document;ie.debug("Before getData: ");const u=n.db.getData();ie.debug("Data: ",u);const h=Ig(e,i),d=n.db.getDirection();u.type=n.type,u.layoutAlgorithm=J2(s),u.layoutAlgorithm==="dagre"&&s==="elk"&&ie.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."),u.direction=d,u.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,u.rankSpacing=(a==null?void 0:a.rankSpacing)||50,u.markers=["point","circle","cross"],u.diagramId=e,ie.debug("REF1:",u),await kg(u,h);const f=((p=u.config.flowchart)==null?void 0:p.diagramPadding)??8;Zt.insertTitle(h,"flowchartTitleText",(a==null?void 0:a.titleTopMargin)||0,n.db.getDiagramTitle()),Mg(h,f,"flowchart",(a==null?void 0:a.useMaxWidth)||!1);for(const g of u.nodes){const m=rt(`#${e} [id="${g.id}"]`);if(!m||!g.link)continue;const v=l.createElementNS("http://www.w3.org/2000/svg","a");v.setAttributeNS("http://www.w3.org/2000/svg","class",g.cssClasses),v.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),i==="sandbox"?v.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):g.linkTarget&&v.setAttributeNS("http://www.w3.org/2000/svg","target",g.linkTarget);const y=m.insert(function(){return v},":first-child"),b=m.select(".label-container");b&&y.append(function(){return b.node()});const w=m.select(".label");w&&y.append(function(){return w.node()})}},"draw"),Wme={getClasses:qme,draw:Hme},Mw=function(){var t=x(function(dr,At,bt,ot){for(bt=bt||{},ot=dr.length;ot--;bt[dr[ot]]=At);return bt},"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],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,49],m=[1,48],v=[1,29],y=[1,30],b=[1,31],w=[1,32],T=[1,33],E=[1,44],k=[1,46],S=[1,42],L=[1,47],A=[1,43],R=[1,50],C=[1,45],I=[1,51],P=[1,52],_=[1,34],N=[1,35],M=[1,36],O=[1,37],D=[1,57],B=[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],z=[1,61],F=[1,60],G=[1,62],q=[8,9,11,75,77,78],Y=[1,78],ee=[1,91],Q=[1,96],oe=[1,95],pe=[1,92],j=[1,88],W=[1,94],X=[1,90],H=[1,97],K=[1,93],ne=[1,98],Z=[1,89],be=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],re=[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],Ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],me=[44,60,89,102,105,106,109,111,114,115,116],Ve=[1,121],Ue=[1,122],Fe=[1,124],_e=[1,123],Oe=[44,60,62,74,89,102,105,106,109,111,114,115,116],Ce=[1,133],Le=[1,147],ze=[1,148],ge=[1,149],Me=[1,150],J=[1,135],ue=[1,137],$=[1,141],se=[1,142],ae=[1,143],fe=[1,144],he=[1,145],Te=[1,146],Se=[1,151],Ee=[1,152],Ge=[1,131],Je=[1,132],He=[1,139],Xe=[1,134],Ke=[1,138],$e=[1,136],je=[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],lt=[1,154],st=[1,156],qe=[8,9,11],Et=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Ye=[1,176],Ze=[1,172],ht=[1,173],ct=[1,177],ut=[1,174],mt=[1,175],sr=[77,116,119],Rt=[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],hr=[10,106],rr=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],er=[1,247],Wt=[1,245],Xr=[1,249],pt=[1,243],ke=[1,244],Qe=[1,246],xt=[1,248],tr=[1,250],Mr=[1,268],Or=[8,9,11,106],Lr=[8,9,10,11,60,84,105,106,109,110,111,112],Sn={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,$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:x(function(At,bt,ot,We,ar,de,ss){var ve=de.length-1;switch(ar){case 2:this.$=[];break;case 3:(!Array.isArray(de[ve])||de[ve].length>0)&&de[ve-1].push(de[ve]),this.$=de[ve-1];break;case 4:case 183:this.$=de[ve];break;case 11:We.setDirection("TB"),this.$="TB";break;case 12:We.setDirection(de[ve-1]),this.$=de[ve-1];break;case 27:this.$=de[ve-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=We.addSubGraph(de[ve-6],de[ve-1],de[ve-4]);break;case 34:this.$=We.addSubGraph(de[ve-3],de[ve-1],de[ve-3]);break;case 35:this.$=We.addSubGraph(void 0,de[ve-1],void 0);break;case 37:this.$=de[ve].trim(),We.setAccTitle(this.$);break;case 38:case 39:this.$=de[ve].trim(),We.setAccDescription(this.$);break;case 43:this.$=de[ve-1]+de[ve];break;case 44:this.$=de[ve];break;case 45:We.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),We.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 46:We.addLink(de[ve-2].stmt,de[ve],de[ve-1]),this.$={stmt:de[ve],nodes:de[ve].concat(de[ve-2].nodes)};break;case 47:We.addLink(de[ve-3].stmt,de[ve-1],de[ve-2]),this.$={stmt:de[ve-1],nodes:de[ve-1].concat(de[ve-3].nodes)};break;case 48:this.$={stmt:de[ve-1],nodes:de[ve-1]};break;case 49:We.addVertex(de[ve-1][de[ve-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve]),this.$={stmt:de[ve-1],nodes:de[ve-1],shapeData:de[ve]};break;case 50:this.$={stmt:de[ve],nodes:de[ve]};break;case 51:this.$=[de[ve]];break;case 52:We.addVertex(de[ve-5][de[ve-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,de[ve-4]),this.$=de[ve-5].concat(de[ve]);break;case 53:this.$=de[ve-4].concat(de[ve]);break;case 54:this.$=de[ve];break;case 55:this.$=de[ve-2],We.setClass(de[ve-2],de[ve]);break;case 56:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"square");break;case 57:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"doublecircle");break;case 58:this.$=de[ve-5],We.addVertex(de[ve-5],de[ve-2],"circle");break;case 59:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"ellipse");break;case 60:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"stadium");break;case 61:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"subroutine");break;case 62:this.$=de[ve-7],We.addVertex(de[ve-7],de[ve-1],"rect",void 0,void 0,void 0,Object.fromEntries([[de[ve-5],de[ve-3]]]));break;case 63:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"cylinder");break;case 64:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"round");break;case 65:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"diamond");break;case 66:this.$=de[ve-5],We.addVertex(de[ve-5],de[ve-2],"hexagon");break;case 67:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"odd");break;case 68:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"trapezoid");break;case 69:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"inv_trapezoid");break;case 70:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"lean_right");break;case 71:this.$=de[ve-3],We.addVertex(de[ve-3],de[ve-1],"lean_left");break;case 72:this.$=de[ve],We.addVertex(de[ve]);break;case 73:de[ve-1].text=de[ve],this.$=de[ve-1];break;case 74:case 75:de[ve-2].text=de[ve-1],this.$=de[ve-2];break;case 76:this.$=de[ve];break;case 77:var sn=We.destructLink(de[ve],de[ve-2]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,text:de[ve-1]};break;case 78:var sn=We.destructLink(de[ve],de[ve-2]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,text:de[ve-1],id:de[ve-3]};break;case 79:this.$={text:de[ve],type:"text"};break;case 80:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 81:this.$={text:de[ve],type:"string"};break;case 82:this.$={text:de[ve],type:"markdown"};break;case 83:var sn=We.destructLink(de[ve]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length};break;case 84:var sn=We.destructLink(de[ve]);this.$={type:sn.type,stroke:sn.stroke,length:sn.length,id:de[ve-1]};break;case 85:this.$=de[ve-1];break;case 86:this.$={text:de[ve],type:"text"};break;case 87:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 88:this.$={text:de[ve],type:"string"};break;case 89:case 104:this.$={text:de[ve],type:"markdown"};break;case 101:this.$={text:de[ve],type:"text"};break;case 102:this.$={text:de[ve-1].text+""+de[ve],type:de[ve-1].type};break;case 103:this.$={text:de[ve],type:"text"};break;case 105:this.$=de[ve-4],We.addClass(de[ve-2],de[ve]);break;case 106:this.$=de[ve-4],We.setClass(de[ve-2],de[ve]);break;case 107:case 115:this.$=de[ve-1],We.setClickEvent(de[ve-1],de[ve]);break;case 108:case 116:this.$=de[ve-3],We.setClickEvent(de[ve-3],de[ve-2]),We.setTooltip(de[ve-3],de[ve]);break;case 109:this.$=de[ve-2],We.setClickEvent(de[ve-2],de[ve-1],de[ve]);break;case 110:this.$=de[ve-4],We.setClickEvent(de[ve-4],de[ve-3],de[ve-2]),We.setTooltip(de[ve-4],de[ve]);break;case 111:this.$=de[ve-2],We.setLink(de[ve-2],de[ve]);break;case 112:this.$=de[ve-4],We.setLink(de[ve-4],de[ve-2]),We.setTooltip(de[ve-4],de[ve]);break;case 113:this.$=de[ve-4],We.setLink(de[ve-4],de[ve-2],de[ve]);break;case 114:this.$=de[ve-6],We.setLink(de[ve-6],de[ve-4],de[ve]),We.setTooltip(de[ve-6],de[ve-2]);break;case 117:this.$=de[ve-1],We.setLink(de[ve-1],de[ve]);break;case 118:this.$=de[ve-3],We.setLink(de[ve-3],de[ve-2]),We.setTooltip(de[ve-3],de[ve]);break;case 119:this.$=de[ve-3],We.setLink(de[ve-3],de[ve-2],de[ve]);break;case 120:this.$=de[ve-5],We.setLink(de[ve-5],de[ve-4],de[ve]),We.setTooltip(de[ve-5],de[ve-2]);break;case 121:this.$=de[ve-4],We.addVertex(de[ve-2],void 0,void 0,de[ve]);break;case 122:this.$=de[ve-4],We.updateLink([de[ve-2]],de[ve]);break;case 123:this.$=de[ve-4],We.updateLink(de[ve-2],de[ve]);break;case 124:this.$=de[ve-8],We.updateLinkInterpolate([de[ve-6]],de[ve-2]),We.updateLink([de[ve-6]],de[ve]);break;case 125:this.$=de[ve-8],We.updateLinkInterpolate(de[ve-6],de[ve-2]),We.updateLink(de[ve-6],de[ve]);break;case 126:this.$=de[ve-6],We.updateLinkInterpolate([de[ve-4]],de[ve]);break;case 127:this.$=de[ve-6],We.updateLinkInterpolate(de[ve-4],de[ve]);break;case 128:case 130:this.$=[de[ve]];break;case 129:case 131:de[ve-2].push(de[ve]),this.$=de[ve-2];break;case 133:this.$=de[ve-1]+de[ve];break;case 181:this.$=de[ve];break;case 182:this.$=de[ve-1]+""+de[ve];break;case 184:this.$=de[ve-1]+""+de[ve];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,54],9:[1,55],10:D,15:53,18:56},t(B,[2,3]),t(B,[2,4]),t(B,[2,5]),t(B,[2,6]),t(B,[2,7]),t(B,[2,8]),{8:z,9:F,11:G,21:58,41:59,72:63,75:[1,64],77:[1,66],78:[1,65]},{8:z,9:F,11:G,21:67},{8:z,9:F,11:G,21:68},{8:z,9:F,11:G,21:69},{8:z,9:F,11:G,21:70},{8:z,9:F,11:G,21:71},{8:z,9:F,10:[1,72],11:G,21:73},t(B,[2,36]),{35:[1,74]},{37:[1,75]},t(B,[2,39]),t(q,[2,50],{18:76,39:77,10:D,40:Y}),{10:[1,79]},{10:[1,80]},{10:[1,81]},{10:[1,82]},{14:ee,44:Q,60:oe,80:[1,86],89:pe,95:[1,83],97:[1,84],101:85,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(be,[2,51]),t(be,[2,54],{46:[1,99]}),t(ce,[2,72],{113:112,29:[1,100],44:g,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:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),t(re,[2,181]),t(re,[2,142]),t(re,[2,143]),t(re,[2,144]),t(re,[2,145]),t(re,[2,146]),t(re,[2,147]),t(re,[2,148]),t(re,[2,149]),t(re,[2,150]),t(re,[2,151]),t(re,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,113]},t(Ne,[2,26],{18:114,10:D}),t(B,[2,27]),{42:115,43:38,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(B,[2,40]),t(B,[2,41]),t(B,[2,42]),t(me,[2,76],{73:116,62:[1,118],74:[1,117]}),{76:119,79:120,80:Ve,81:Ue,116:Fe,119:_e},{75:[1,125],77:[1,126]},t(Oe,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:Ce,12:Le,14:ze,27:ge,28:127,32:Me,44:J,60:ue,75:$,80:[1,129],81:[1,130],83:140,84:se,85:ae,86:fe,87:he,88:Te,89:Se,90:Ee,91:128,105:Ge,109:Je,111:He,114:Xe,115:Ke,116:$e},t(je,a,{5:153}),t(B,[2,37]),t(B,[2,38]),t(q,[2,48],{44:lt}),t(q,[2,49],{18:155,10:D,40:st}),t(be,[2,44]),{44:g,47:157,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{102:[1,158],103:159,105:[1,160]},{44:g,47:161,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{44:g,47:162,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,107],{10:[1,163],96:[1,164]}),{80:[1,165]},t(qe,[2,115],{120:167,10:[1,166],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,117],{10:[1,168]}),t(Et,[2,183]),t(Et,[2,170]),t(Et,[2,171]),t(Et,[2,172]),t(Et,[2,173]),t(Et,[2,174]),t(Et,[2,175]),t(Et,[2,176]),t(Et,[2,177]),t(Et,[2,178]),t(Et,[2,179]),t(Et,[2,180]),{44:g,47:169,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{30:170,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:178,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:180,50:[1,179],67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:181,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:182,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:183,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{109:[1,184]},{30:185,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:186,65:[1,187],67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:188,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:189,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{30:190,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(re,[2,182]),t(i,[2,20]),t(Ne,[2,25]),t(q,[2,46],{39:191,18:192,10:D,40:Y}),t(me,[2,73],{10:[1,193]}),{10:[1,194]},{30:195,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{77:[1,196],79:197,116:Fe,119:_e},t(sr,[2,79]),t(sr,[2,81]),t(sr,[2,82]),t(sr,[2,168]),t(sr,[2,169]),{76:198,79:120,80:Ve,81:Ue,116:Fe,119:_e},t(Oe,[2,84]),{8:z,9:F,10:Ce,11:G,12:Le,14:ze,21:200,27:ge,29:[1,199],32:Me,44:J,60:ue,75:$,83:140,84:se,85:ae,86:fe,87:he,88:Te,89:Se,90:Ee,91:201,105:Ge,109:Je,111:He,114:Xe,115:Ke,116:$e},t(Rt,[2,101]),t(Rt,[2,103]),t(Rt,[2,104]),t(Rt,[2,157]),t(Rt,[2,158]),t(Rt,[2,159]),t(Rt,[2,160]),t(Rt,[2,161]),t(Rt,[2,162]),t(Rt,[2,163]),t(Rt,[2,164]),t(Rt,[2,165]),t(Rt,[2,166]),t(Rt,[2,167]),t(Rt,[2,90]),t(Rt,[2,91]),t(Rt,[2,92]),t(Rt,[2,93]),t(Rt,[2,94]),t(Rt,[2,95]),t(Rt,[2,96]),t(Rt,[2,97]),t(Rt,[2,98]),t(Rt,[2,99]),t(Rt,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,202],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},{10:D,18:203},{44:[1,204]},t(be,[2,43]),{10:[1,205],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{10:[1,206]},{10:[1,207],106:[1,208]},t(hr,[2,128]),{10:[1,209],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{10:[1,210],44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:112,114:C,115:I,116:P},{80:[1,211]},t(qe,[2,109],{10:[1,212]}),t(qe,[2,111],{10:[1,213]}),{80:[1,214]},t(Et,[2,184]),{80:[1,215],98:[1,216]},t(be,[2,55],{113:112,44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),{31:[1,217],67:Ye,82:218,116:ct,117:ut,118:mt},t(rr,[2,86]),t(rr,[2,88]),t(rr,[2,89]),t(rr,[2,153]),t(rr,[2,154]),t(rr,[2,155]),t(rr,[2,156]),{49:[1,219],67:Ye,82:218,116:ct,117:ut,118:mt},{30:220,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{51:[1,221],67:Ye,82:218,116:ct,117:ut,118:mt},{53:[1,222],67:Ye,82:218,116:ct,117:ut,118:mt},{55:[1,223],67:Ye,82:218,116:ct,117:ut,118:mt},{57:[1,224],67:Ye,82:218,116:ct,117:ut,118:mt},{60:[1,225]},{64:[1,226],67:Ye,82:218,116:ct,117:ut,118:mt},{66:[1,227],67:Ye,82:218,116:ct,117:ut,118:mt},{30:228,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},{31:[1,229],67:Ye,82:218,116:ct,117:ut,118:mt},{67:Ye,69:[1,230],71:[1,231],82:218,116:ct,117:ut,118:mt},{67:Ye,69:[1,233],71:[1,232],82:218,116:ct,117:ut,118:mt},t(q,[2,45],{18:155,10:D,40:st}),t(q,[2,47],{44:lt}),t(me,[2,75]),t(me,[2,74]),{62:[1,234],67:Ye,82:218,116:ct,117:ut,118:mt},t(me,[2,77]),t(sr,[2,80]),{77:[1,235],79:197,116:Fe,119:_e},{30:236,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(je,a,{5:237}),t(Rt,[2,102]),t(B,[2,35]),{43:238,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},{10:D,18:239},{10:er,60:Wt,84:Xr,92:240,105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},{10:er,60:Wt,84:Xr,92:251,104:[1,252],105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},{10:er,60:Wt,84:Xr,92:253,104:[1,254],105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},{105:[1,255]},{10:er,60:Wt,84:Xr,92:256,105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},{44:g,47:257,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,108]),{80:[1,258]},{80:[1,259],98:[1,260]},t(qe,[2,116]),t(qe,[2,118],{10:[1,261]}),t(qe,[2,119]),t(ce,[2,56]),t(rr,[2,87]),t(ce,[2,57]),{51:[1,262],67:Ye,82:218,116:ct,117:ut,118:mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,263]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,264],67:Ye,82:218,116:ct,117:ut,118:mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(me,[2,78]),{31:[1,265],67:Ye,82:218,116:ct,117:ut,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,266],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},t(be,[2,53]),{43:267,44:g,45:39,47:40,60:m,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P},t(qe,[2,121],{106:Mr}),t(Or,[2,130],{108:269,10:er,60:Wt,84:Xr,105:pt,109:ke,110:Qe,111:xt,112:tr}),t(Lr,[2,132]),t(Lr,[2,134]),t(Lr,[2,135]),t(Lr,[2,136]),t(Lr,[2,137]),t(Lr,[2,138]),t(Lr,[2,139]),t(Lr,[2,140]),t(Lr,[2,141]),t(qe,[2,122],{106:Mr}),{10:[1,270]},t(qe,[2,123],{106:Mr}),{10:[1,271]},t(hr,[2,129]),t(qe,[2,105],{106:Mr}),t(qe,[2,106],{113:112,44:g,60:m,89:E,102:k,105:S,106:L,109:A,111:R,114:C,115:I,116:P}),t(qe,[2,110]),t(qe,[2,112],{10:[1,272]}),t(qe,[2,113]),{98:[1,273]},{51:[1,274]},{62:[1,275]},{66:[1,276]},{8:z,9:F,11:G,21:277},t(B,[2,34]),t(be,[2,52]),{10:er,60:Wt,84:Xr,105:pt,107:278,108:242,109:ke,110:Qe,111:xt,112:tr},t(Lr,[2,133]),{14:ee,44:Q,60:oe,89:pe,101:279,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},{14:ee,44:Q,60:oe,89:pe,101:280,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z,120:87},{98:[1,281]},t(qe,[2,120]),t(ce,[2,58]),{30:282,67:Ye,80:Ze,81:ht,82:171,116:ct,117:ut,118:mt},t(ce,[2,66]),t(je,a,{5:283}),t(Or,[2,131],{108:269,10:er,60:Wt,84:Xr,105:pt,109:ke,110:Qe,111:xt,112:tr}),t(qe,[2,126],{120:167,10:[1,284],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,127],{120:167,10:[1,285],14:ee,44:Q,60:oe,89:pe,105:j,106:W,109:X,111:H,114:K,115:ne,116:Z}),t(qe,[2,114]),{31:[1,286],67:Ye,82:218,116:ct,117:ut,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,287],33:24,34:d,36:f,38:p,42:28,43:38,44:g,45:39,47:40,60:m,84:v,85:y,86:b,87:w,88:T,89:E,102:k,105:S,106:L,109:A,111:R,113:41,114:C,115:I,116:P,121:_,122:N,123:M,124:O},{10:er,60:Wt,84:Xr,92:288,105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},{10:er,60:Wt,84:Xr,92:289,105:pt,107:241,108:242,109:ke,110:Qe,111:xt,112:tr},t(ce,[2,62]),t(B,[2,33]),t(qe,[2,124],{106:Mr}),t(qe,[2,125],{106:Mr})],defaultActions:{},parseError:x(function(At,bt){if(bt.recoverable)this.trace(At);else{var ot=new Error(At);throw ot.hash=bt,ot}},"parseError"),parse:x(function(At){var bt=this,ot=[0],We=[],ar=[null],de=[],ss=this.table,ve="",sn=0,n7=0,TY=2,i7=1,EY=de.slice.call(arguments,1),Hn=Object.create(this.lexer),oc={yy:{}};for(var ob in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ob)&&(oc.yy[ob]=this.yy[ob]);Hn.setInput(At,oc.yy),oc.yy.lexer=Hn,oc.yy.parser=this,typeof Hn.yylloc>"u"&&(Hn.yylloc={});var lb=Hn.yylloc;de.push(lb);var SY=Hn.options&&Hn.options.ranges;typeof oc.yy.parseError=="function"?this.parseError=oc.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kY(ya){ot.length=ot.length-2*ya,ar.length=ar.length-ya,de.length=de.length-ya}x(kY,"popStack");function a7(){var ya;return ya=We.pop()||Hn.lex()||i7,typeof ya!="number"&&(ya instanceof Array&&(We=ya,ya=We.pop()),ya=bt.symbols_[ya]||ya),ya}x(a7,"lex");for(var ji,lc,Ma,cb,zu={},i1,fo,s7,a1;;){if(lc=ot[ot.length-1],this.defaultActions[lc]?Ma=this.defaultActions[lc]:((ji===null||typeof ji>"u")&&(ji=a7()),Ma=ss[lc]&&ss[lc][ji]),typeof Ma>"u"||!Ma.length||!Ma[0]){var ub="";a1=[];for(i1 in ss[lc])this.terminals_[i1]&&i1>TY&&a1.push("'"+this.terminals_[i1]+"'");Hn.showPosition?ub="Parse error on line "+(sn+1)+`:
|
|
914
914
|
`+Hn.showPosition()+`
|
|
915
|
-
Expecting `+a1.join(", ")+", got '"+(this.terminals_[ji]||ji)+"'":ub="Parse error on line "+(sn+1)+": Unexpected "+(ji==i7?"end of input":"'"+(this.terminals_[ji]||ji)+"'"),this.parseError(ub,{text:Hn.match,token:this.terminals_[ji]||ji,line:Hn.yylineno,loc:lb,expected:a1})}if(Ma[0]instanceof Array&&Ma.length>1)throw new Error("Parse Error: multiple actions possible at state: "+lc+", token: "+ji);switch(Ma[0]){case 1:ot.push(ji),ar.push(Hn.yytext),de.push(Hn.yylloc),ot.push(Ma[1]),ji=null,n7=Hn.yyleng,ve=Hn.yytext,sn=Hn.yylineno,lb=Hn.yylloc;break;case 2:if(fo=this.productions_[Ma[1]][1],zu.$=ar[ar.length-fo],zu._$={first_line:de[de.length-(fo||1)].first_line,last_line:de[de.length-1].last_line,first_column:de[de.length-(fo||1)].first_column,last_column:de[de.length-1].last_column},SY&&(zu._$.range=[de[de.length-(fo||1)].range[0],de[de.length-1].range[1]]),cb=this.performAction.apply(zu,[ve,n7,sn,oc.yy,Ma[1],ar,de].concat(EY)),typeof cb<"u")return cb;fo&&(ot=ot.slice(0,-1*fo*2),ar=ar.slice(0,-1*fo),de=de.slice(0,-1*fo)),ot.push(this.productions_[Ma[1]][0]),ar.push(zu.$),de.push(zu._$),s7=ss[ot[ot.length-2]][ot[ot.length-1]],ot.push(s7);break;case 3:return!0}}return!0},"parse")},gi=function(){var dr={EOF:1,parseError:x(function(
|
|
916
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(At){this.unput(this.match.slice(At))},"less"),pastInput:x(function(){var At=this.matched.substr(0,this.matched.length-this.match.length);return(At.length>20?"...":"")+At.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var At=this.match;return At.length<20&&(At+=this._input.substr(0,20-At.length)),(At.substr(0,20)+(At.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var At=this.pastInput(),
|
|
917
|
-
`+
|
|
918
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var wt=this.next();return wt||this.lex()},"lex"),begin:x(function(wt){this.conditionStack.push(wt)},"begin"),popState:x(function(){var wt=this.conditionStack.length-1;return wt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(wt){return wt=this.conditionStack.length-1-Math.abs(wt||0),wt>=0?this.conditionStack[wt]:"INITIAL"},"topState"),pushState:x(function(wt){this.begin(wt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(wt,ot,We,ar){switch(We){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),ot.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const de=/\n\s*/g;return ot.yytext=ot.yytext.replace(de,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return wt.lex.firstGraph()&&this.begin("dir"),12;case 36:return wt.lex.firstGraph()&&this.begin("dir"),12;case 37:return wt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:return 119;case 71:return this.popState(),77;case 72:return this.pushState("thickEdgeText"),75;case 73:return 119;case 74:return this.popState(),77;case 75:return this.pushState("dottedEdgeText"),75;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;case 79: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 101:return 115;case 102:return 111;case 103:return 44;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 115:return"TEXT";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 dr}();Sn.lexer=gi;function Li(){this.yy={}}return x(Li,"Parser"),Li.prototype=Sn,Sn.Parser=Li,new Li}();Mw.parser=Mw;var rV=Mw,nV=Object.assign({},rV);nV.parse=t=>{const e=t.replace(/}\s*\n/g,`}
|
|
915
|
+
Expecting `+a1.join(", ")+", got '"+(this.terminals_[ji]||ji)+"'":ub="Parse error on line "+(sn+1)+": Unexpected "+(ji==i7?"end of input":"'"+(this.terminals_[ji]||ji)+"'"),this.parseError(ub,{text:Hn.match,token:this.terminals_[ji]||ji,line:Hn.yylineno,loc:lb,expected:a1})}if(Ma[0]instanceof Array&&Ma.length>1)throw new Error("Parse Error: multiple actions possible at state: "+lc+", token: "+ji);switch(Ma[0]){case 1:ot.push(ji),ar.push(Hn.yytext),de.push(Hn.yylloc),ot.push(Ma[1]),ji=null,n7=Hn.yyleng,ve=Hn.yytext,sn=Hn.yylineno,lb=Hn.yylloc;break;case 2:if(fo=this.productions_[Ma[1]][1],zu.$=ar[ar.length-fo],zu._$={first_line:de[de.length-(fo||1)].first_line,last_line:de[de.length-1].last_line,first_column:de[de.length-(fo||1)].first_column,last_column:de[de.length-1].last_column},SY&&(zu._$.range=[de[de.length-(fo||1)].range[0],de[de.length-1].range[1]]),cb=this.performAction.apply(zu,[ve,n7,sn,oc.yy,Ma[1],ar,de].concat(EY)),typeof cb<"u")return cb;fo&&(ot=ot.slice(0,-1*fo*2),ar=ar.slice(0,-1*fo),de=de.slice(0,-1*fo)),ot.push(this.productions_[Ma[1]][0]),ar.push(zu.$),de.push(zu._$),s7=ss[ot[ot.length-2]][ot[ot.length-1]],ot.push(s7);break;case 3:return!0}}return!0},"parse")},gi=function(){var dr={EOF:1,parseError:x(function(bt,ot){if(this.yy.parser)this.yy.parser.parseError(bt,ot);else throw new Error(bt)},"parseError"),setInput:x(function(At,bt){return this.yy=bt||this.yy||{},this._input=At,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var At=this._input[0];this.yytext+=At,this.yyleng++,this.offset++,this.match+=At,this.matched+=At;var bt=At.match(/(?:\r\n?|\n).*/g);return bt?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),At},"input"),unput:x(function(At){var bt=At.length,ot=At.split(/(?:\r\n?|\n)/g);this._input=At+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-bt),this.offset-=bt;var We=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),ot.length-1&&(this.yylineno-=ot.length-1);var ar=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:ot?(ot.length===We.length?this.yylloc.first_column:0)+We[We.length-ot.length].length-ot[0].length:this.yylloc.first_column-bt},this.options.ranges&&(this.yylloc.range=[ar[0],ar[0]+this.yyleng-bt]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
916
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(At){this.unput(this.match.slice(At))},"less"),pastInput:x(function(){var At=this.matched.substr(0,this.matched.length-this.match.length);return(At.length>20?"...":"")+At.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var At=this.match;return At.length<20&&(At+=this._input.substr(0,20-At.length)),(At.substr(0,20)+(At.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var At=this.pastInput(),bt=new Array(At.length+1).join("-");return At+this.upcomingInput()+`
|
|
917
|
+
`+bt+"^"},"showPosition"),test_match:x(function(At,bt){var ot,We,ar;if(this.options.backtrack_lexer&&(ar={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&&(ar.yylloc.range=this.yylloc.range.slice(0))),We=At[0].match(/(?:\r\n?|\n).*/g),We&&(this.yylineno+=We.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:We?We[We.length-1].length-We[We.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+At[0].length},this.yytext+=At[0],this.match+=At[0],this.matches=At,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(At[0].length),this.matched+=At[0],ot=this.performAction.call(this,this.yy,this,bt,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ot)return ot;if(this._backtrack){for(var de in ar)this[de]=ar[de];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var At,bt,ot,We;this._more||(this.yytext="",this.match="");for(var ar=this._currentRules(),de=0;de<ar.length;de++)if(ot=this._input.match(this.rules[ar[de]]),ot&&(!bt||ot[0].length>bt[0].length)){if(bt=ot,We=de,this.options.backtrack_lexer){if(At=this.test_match(ot,ar[de]),At!==!1)return At;if(this._backtrack){bt=!1;continue}else return!1}else if(!this.options.flex)break}return bt?(At=this.test_match(bt,ar[We]),At!==!1?At:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
918
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var bt=this.next();return bt||this.lex()},"lex"),begin:x(function(bt){this.conditionStack.push(bt)},"begin"),popState:x(function(){var bt=this.conditionStack.length-1;return bt>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(bt){return bt=this.conditionStack.length-1-Math.abs(bt||0),bt>=0?this.conditionStack[bt]:"INITIAL"},"topState"),pushState:x(function(bt){this.begin(bt)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(bt,ot,We,ar){switch(We){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),ot.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const de=/\n\s*/g;return ot.yytext=ot.yytext.replace(de,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return bt.lex.firstGraph()&&this.begin("dir"),12;case 36:return bt.lex.firstGraph()&&this.begin("dir"),12;case 37:return bt.lex.firstGraph()&&this.begin("dir"),12;case 38:return 27;case 39:return 32;case 40:return 98;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return this.popState(),13;case 45:return this.popState(),14;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return 121;case 56:return 122;case 57:return 123;case 58:return 124;case 59:return 78;case 60:return 105;case 61:return 111;case 62:return 46;case 63:return 60;case 64:return 44;case 65:return 8;case 66:return 106;case 67:return 115;case 68:return this.popState(),77;case 69:return this.pushState("edgeText"),75;case 70:return 119;case 71:return this.popState(),77;case 72:return this.pushState("thickEdgeText"),75;case 73:return 119;case 74:return this.popState(),77;case 75:return this.pushState("dottedEdgeText"),75;case 76:return 119;case 77:return 77;case 78:return this.popState(),53;case 79: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 101:return 115;case 102:return 111;case 103:return 44;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 115:return"TEXT";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 dr}();Sn.lexer=gi;function Li(){this.yy={}}return x(Li,"Parser"),Li.prototype=Sn,Sn.Parser=Li,new Li}();Mw.parser=Mw;var rV=Mw,nV=Object.assign({},rV);nV.parse=t=>{const e=t.replace(/}\s*\n/g,`}
|
|
919
919
|
`);return rV.parse(e)};var Yme=nV,Xme=x((t,e)=>{const r=w6,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Sl(n,i,a,e)},"fade"),jme=x(t=>`.label {
|
|
920
920
|
font-family: ${t.fontFamily};
|
|
921
921
|
color: ${t.nodeTextColor||t.textColor};
|
|
@@ -1237,7 +1237,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis
|
|
|
1237
1237
|
For Further details.`,n}function Pxe(t){if(t instanceof qi)return"SUBRULE";if(t instanceof ci)return"OPTION";if(t instanceof va)return"OR";if(t instanceof Na)return"AT_LEAST_ONE";if(t instanceof Da)return"AT_LEAST_ONE_SEP";if(t instanceof ma)return"MANY_SEP";if(t instanceof ln)return"MANY";if(t instanceof Yr)return"CONSUME";throw Error("non exhaustive match")}function Bxe(t,e,r){const n=Ca(e.configs.elements,a=>a.state.transitions),i=zpe(n.filter(a=>a instanceof OS).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function Fxe(t,e){return t.edges[e.tokenTypeIdx]}function $xe(t,e,r){const n=new Zw,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Vg){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],h=zxe(u,e);h!==void 0&&n.add({state:h,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Zw;for(const s of n.elements)Vy(s,a)}if(i.length>0&&!qxe(a))for(const s of i)a.add(s);return a}function zxe(t,e){if(t instanceof OS&&$V(e,t.tokenType))return t.target}function Vxe(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function fG(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function XA(t,e,r,n){return n=pG(t,n),e.edges[r.tokenTypeIdx]=n,n}function pG(t,e){if(e===zy)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function Gxe(t){const e=new Zw,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};Vy(a,e)}return e}function Vy(t,e){const r=t.state;if(r.type===Vg){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Vy(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=Uxe(t,a);s!==void 0&&Vy(s,e)}}function Uxe(t,e){if(e instanceof oG)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof PS){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function qxe(t){for(const e of t.elements)if(e.state.type===Vg)return!0;return!1}function Hxe(t){for(const e of t.elements)if(e.state.type!==Vg)return!1;return!0}function Wxe(t){if(Hxe(t))return!0;const e=Yxe(t.elements);return Xxe(e)&&!jxe(e)}function Yxe(t){const e=new Map;for(const r of t){const n=hG(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function Xxe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function jxe(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var jA;(function(t){function e(r){return typeof r=="string"}t.is=e})(jA||(jA={}));var Qw;(function(t){function e(r){return typeof r=="string"}t.is=e})(Qw||(Qw={}));var KA;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(KA||(KA={}));var Gy;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Gy||(Gy={}));var Tr;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Gy.MAX_VALUE),i===Number.MAX_VALUE&&(i=Gy.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return Be.objectLiteral(i)&&Be.uinteger(i.line)&&Be.uinteger(i.character)}t.is=r})(Tr||(Tr={}));var pr;(function(t){function e(n,i,a,s){if(Be.uinteger(n)&&Be.uinteger(i)&&Be.uinteger(a)&&Be.uinteger(s))return{start:Tr.create(n,i),end:Tr.create(a,s)};if(Tr.is(n)&&Tr.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return Be.objectLiteral(i)&&Tr.is(i.start)&&Tr.is(i.end)}t.is=r})(pr||(pr={}));var Uy;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return Be.objectLiteral(i)&&pr.is(i.range)&&(Be.string(i.uri)||Be.undefined(i.uri))}t.is=r})(Uy||(Uy={}));var ZA;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return Be.objectLiteral(i)&&pr.is(i.targetRange)&&Be.string(i.targetUri)&&pr.is(i.targetSelectionRange)&&(pr.is(i.originSelectionRange)||Be.undefined(i.originSelectionRange))}t.is=r})(ZA||(ZA={}));var Jw;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&Be.numberRange(i.red,0,1)&&Be.numberRange(i.green,0,1)&&Be.numberRange(i.blue,0,1)&&Be.numberRange(i.alpha,0,1)}t.is=r})(Jw||(Jw={}));var QA;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&pr.is(i.range)&&Jw.is(i.color)}t.is=r})(QA||(QA={}));var JA;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&Be.string(i.label)&&(Be.undefined(i.textEdit)||Hd.is(i))&&(Be.undefined(i.additionalTextEdits)||Be.typedArray(i.additionalTextEdits,Hd.is))}t.is=r})(JA||(JA={}));var e_;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(e_||(e_={}));var t_;(function(t){function e(n,i,a,s,o,l){const u={startLine:n,endLine:i};return Be.defined(a)&&(u.startCharacter=a),Be.defined(s)&&(u.endCharacter=s),Be.defined(o)&&(u.kind=o),Be.defined(l)&&(u.collapsedText=l),u}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&Be.uinteger(i.startLine)&&Be.uinteger(i.startLine)&&(Be.undefined(i.startCharacter)||Be.uinteger(i.startCharacter))&&(Be.undefined(i.endCharacter)||Be.uinteger(i.endCharacter))&&(Be.undefined(i.kind)||Be.string(i.kind))}t.is=r})(t_||(t_={}));var eT;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Uy.is(i.location)&&Be.string(i.message)}t.is=r})(eT||(eT={}));var r_;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(r_||(r_={}));var n_;(function(t){t.Unnecessary=1,t.Deprecated=2})(n_||(n_={}));var i_;(function(t){function e(r){const n=r;return Be.objectLiteral(n)&&Be.string(n.href)}t.is=e})(i_||(i_={}));var qy;(function(t){function e(n,i,a,s,o,l){let u={range:n,message:i};return Be.defined(a)&&(u.severity=a),Be.defined(s)&&(u.code=s),Be.defined(o)&&(u.source=o),Be.defined(l)&&(u.relatedInformation=l),u}t.create=e;function r(n){var i;let a=n;return Be.defined(a)&&pr.is(a.range)&&Be.string(a.message)&&(Be.number(a.severity)||Be.undefined(a.severity))&&(Be.integer(a.code)||Be.string(a.code)||Be.undefined(a.code))&&(Be.undefined(a.codeDescription)||Be.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(Be.string(a.source)||Be.undefined(a.source))&&(Be.undefined(a.relatedInformation)||Be.typedArray(a.relatedInformation,eT.is))}t.is=r})(qy||(qy={}));var qd;(function(t){function e(n,i,...a){let s={title:n,command:i};return Be.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.string(i.title)&&Be.string(i.command)}t.is=r})(qd||(qd={}));var Hd;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return Be.objectLiteral(s)&&Be.string(s.newText)&&pr.is(s.range)}t.is=i})(Hd||(Hd={}));var tT;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&Be.string(i.label)&&(Be.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(Be.string(i.description)||i.description===void 0)}t.is=r})(tT||(tT={}));var Wd;(function(t){function e(r){const n=r;return Be.string(n)}t.is=e})(Wd||(Wd={}));var a_;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return Hd.is(s)&&(tT.is(s.annotationId)||Wd.is(s.annotationId))}t.is=i})(a_||(a_={}));var rT;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return Be.defined(i)&&oT.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(rT||(rT={}));var nT;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&Be.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||Be.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Be.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wd.is(i.annotationId))}t.is=r})(nT||(nT={}));var iT;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&Be.string(i.oldUri)&&Be.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||Be.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Be.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Wd.is(i.annotationId))}t.is=r})(iT||(iT={}));var aT;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&Be.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||Be.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||Be.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Wd.is(i.annotationId))}t.is=r})(aT||(aT={}));var sT;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>Be.string(i.kind)?nT.is(i)||iT.is(i)||aT.is(i):rT.is(i)))}t.is=e})(sT||(sT={}));var s_;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.string(i.uri)}t.is=r})(s_||(s_={}));var o_;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.string(i.uri)&&Be.integer(i.version)}t.is=r})(o_||(o_={}));var oT;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.string(i.uri)&&(i.version===null||Be.integer(i.version))}t.is=r})(oT||(oT={}));var l_;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.string(i.uri)&&Be.string(i.languageId)&&Be.integer(i.version)&&Be.string(i.text)}t.is=r})(l_||(l_={}));var lT;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(lT||(lT={}));var Hp;(function(t){function e(r){const n=r;return Be.objectLiteral(r)&&lT.is(n.kind)&&Be.string(n.value)}t.is=e})(Hp||(Hp={}));var c_;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(c_||(c_={}));var u_;(function(t){t.PlainText=1,t.Snippet=2})(u_||(u_={}));var h_;(function(t){t.Deprecated=1})(h_||(h_={}));var d_;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&Be.string(i.newText)&&pr.is(i.insert)&&pr.is(i.replace)}t.is=r})(d_||(d_={}));var f_;(function(t){t.asIs=1,t.adjustIndentation=2})(f_||(f_={}));var p_;(function(t){function e(r){const n=r;return n&&(Be.string(n.detail)||n.detail===void 0)&&(Be.string(n.description)||n.description===void 0)}t.is=e})(p_||(p_={}));var g_;(function(t){function e(r){return{label:r}}t.create=e})(g_||(g_={}));var m_;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(m_||(m_={}));var Hy;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return Be.string(i)||Be.objectLiteral(i)&&Be.string(i.language)&&Be.string(i.value)}t.is=r})(Hy||(Hy={}));var v_;(function(t){function e(r){let n=r;return!!n&&Be.objectLiteral(n)&&(Hp.is(n.contents)||Hy.is(n.contents)||Be.typedArray(n.contents,Hy.is))&&(r.range===void 0||pr.is(r.range))}t.is=e})(v_||(v_={}));var y_;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(y_||(y_={}));var x_;(function(t){function e(r,n,...i){let a={label:r};return Be.defined(n)&&(a.documentation=n),Be.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(x_||(x_={}));var b_;(function(t){t.Text=1,t.Read=2,t.Write=3})(b_||(b_={}));var w_;(function(t){function e(r,n){let i={range:r};return Be.number(n)&&(i.kind=n),i}t.create=e})(w_||(w_={}));var T_;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(T_||(T_={}));var E_;(function(t){t.Deprecated=1})(E_||(E_={}));var S_;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(S_||(S_={}));var k_;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(k_||(k_={}));var C_;(function(t){function e(n,i,a,s,o,l){let u={name:n,detail:i,kind:a,range:s,selectionRange:o};return l!==void 0&&(u.children=l),u}t.create=e;function r(n){let i=n;return i&&Be.string(i.name)&&Be.number(i.kind)&&pr.is(i.range)&&pr.is(i.selectionRange)&&(i.detail===void 0||Be.string(i.detail))&&(i.deprecated===void 0||Be.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(C_||(C_={}));var A_;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(A_||(A_={}));var Wy;(function(t){t.Invoked=1,t.Automatic=2})(Wy||(Wy={}));var __;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.typedArray(i.diagnostics,qy.is)&&(i.only===void 0||Be.typedArray(i.only,Be.string))&&(i.triggerKind===void 0||i.triggerKind===Wy.Invoked||i.triggerKind===Wy.Automatic)}t.is=r})(__||(__={}));var L_;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):qd.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&Be.string(i.title)&&(i.diagnostics===void 0||Be.typedArray(i.diagnostics,qy.is))&&(i.kind===void 0||Be.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||qd.is(i.command))&&(i.isPreferred===void 0||Be.boolean(i.isPreferred))&&(i.edit===void 0||sT.is(i.edit))}t.is=r})(L_||(L_={}));var R_;(function(t){function e(n,i){let a={range:n};return Be.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return Be.defined(i)&&pr.is(i.range)&&(Be.undefined(i.command)||qd.is(i.command))}t.is=r})(R_||(R_={}));var N_;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return Be.defined(i)&&Be.uinteger(i.tabSize)&&Be.boolean(i.insertSpaces)}t.is=r})(N_||(N_={}));var D_;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return Be.defined(i)&&pr.is(i.range)&&(Be.undefined(i.target)||Be.string(i.target))}t.is=r})(D_||(D_={}));var I_;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return Be.objectLiteral(i)&&pr.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(I_||(I_={}));var M_;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(M_||(M_={}));var O_;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(O_||(O_={}));var P_;(function(t){function e(r){const n=r;return Be.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(P_||(P_={}));var B_;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&Be.string(i.text)}t.is=r})(B_||(B_={}));var F_;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&Be.boolean(i.caseSensitiveLookup)&&(Be.string(i.variableName)||i.variableName===void 0)}t.is=r})(F_||(F_={}));var $_;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&pr.is(i.range)&&(Be.string(i.expression)||i.expression===void 0)}t.is=r})($_||($_={}));var z_;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return Be.defined(i)&&pr.is(n.stoppedLocation)}t.is=r})(z_||(z_={}));var cT;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(cT||(cT={}));var uT;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&(i.tooltip===void 0||Be.string(i.tooltip)||Hp.is(i.tooltip))&&(i.location===void 0||Uy.is(i.location))&&(i.command===void 0||qd.is(i.command))}t.is=r})(uT||(uT={}));var V_;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return Be.objectLiteral(i)&&Tr.is(i.position)&&(Be.string(i.label)||Be.typedArray(i.label,uT.is))&&(i.kind===void 0||cT.is(i.kind))&&i.textEdits===void 0||Be.typedArray(i.textEdits,Hd.is)&&(i.tooltip===void 0||Be.string(i.tooltip)||Hp.is(i.tooltip))&&(i.paddingLeft===void 0||Be.boolean(i.paddingLeft))&&(i.paddingRight===void 0||Be.boolean(i.paddingRight))}t.is=r})(V_||(V_={}));var G_;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(G_||(G_={}));var U_;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(U_||(U_={}));var q_;(function(t){function e(r){return{items:r}}t.create=e})(q_||(q_={}));var H_;(function(t){t.Invoked=0,t.Automatic=1})(H_||(H_={}));var W_;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(W_||(W_={}));var Y_;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(Y_||(Y_={}));var X_;(function(t){function e(r){const n=r;return Be.objectLiteral(n)&&Qw.is(n.uri)&&Be.string(n.name)}t.is=e})(X_||(X_={}));var j_;(function(t){function e(a,s,o,l){return new Kxe(a,s,o,l)}t.create=e;function r(a){let s=a;return!!(Be.defined(s)&&Be.string(s.uri)&&(Be.undefined(s.languageId)||Be.string(s.languageId))&&Be.uinteger(s.lineCount)&&Be.func(s.getText)&&Be.func(s.positionAt)&&Be.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),l=i(s,(h,d)=>{let f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f}),u=o.length;for(let h=l.length-1;h>=0;h--){let d=l[h],f=a.offsetAt(d.range.start),p=a.offsetAt(d.range.end);if(p<=u)o=o.substring(0,f)+d.newText+o.substring(p,o.length);else throw new Error("Overlapping edit");u=f}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,l=a.slice(0,o),u=a.slice(o);i(l,s),i(u,s);let h=0,d=0,f=0;for(;h<l.length&&d<u.length;)s(l[h],u[d])<=0?a[f++]=l[h++]:a[f++]=u[d++];for(;h<l.length;)a[f++]=l[h++];for(;d<u.length;)a[f++]=u[d++];return a}})(j_||(j_={}));let Kxe=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){this._content=e.text,this._version=r,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],r=this._content,n=!0;for(let i=0;i<r.length;i++){n&&(e.push(i),n=!1);let a=r.charAt(i);n=a==="\r"||a===`
|
|
1238
1238
|
`,a==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
|
1239
1239
|
`&&i++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Tr.create(0,e);for(;n<i;){let s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}let a=n-1;return Tr.create(a,e-r[a])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1<r.length?r[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)}get lineCount(){return this.getLineOffsets().length}};var Be;(function(t){const e=Object.prototype.toString;function r(p){return typeof p<"u"}t.defined=r;function n(p){return typeof p>"u"}t.undefined=n;function i(p){return p===!0||p===!1}t.boolean=i;function a(p){return e.call(p)==="[object String]"}t.string=a;function s(p){return e.call(p)==="[object Number]"}t.number=s;function o(p,g,m){return e.call(p)==="[object Number]"&&g<=p&&p<=m}t.numberRange=o;function l(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=l;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function h(p){return e.call(p)==="[object Function]"}t.func=h;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,g){return Array.isArray(p)&&p.every(g)}t.typedArray=f})(Be||(Be={}));class Zxe{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new mG(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new $S;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new hT(e.startOffset,e.image.length,Fw(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new hT(a.startOffset,a.image.length,Fw(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}}class gG{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;const n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class hT extends gG{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class $S extends gG{constructor(){super(...arguments),this.content=new zS(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:Tr.create(0,0),end:Tr.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class zS extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,zS.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}}class mG extends $S{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const dT=Symbol("Datatype");function E4(t){return t.$type===dT}const K_="",vG=t=>t.endsWith(K_)?t:t+K_;class yG{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";this.wrapper=new rbe(r,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Qxe extends yG{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Zxe,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(vG(e.name),this.startImplementation(n,r).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(EV(e))return dT;{const r=kS(e);return r??e.name}}}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{const i=!this.isRecording()&&e!==void 0;if(i){const s={$type:e};this.stack.push(s),e===dT&&(s.value="")}let a;try{a=r(n)}catch{a=void 0}return a===void 0&&i&&(a=this.construct()),a}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,isCrossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=au(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(E4(u)){let h=i.image;au(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,r,a);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,i,s)}performSubruleAssignment(e,r,n){const{assignment:i,isCrossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(E4(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return Dve(e),this.nodeBuilder.construct(e),this.stack.pop(),E4(e)?this.converter.convert(e.value,e.$cstNode):(Ive(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const r=bx(e,iu);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?wS(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Jxe{buildMismatchTokenMessage(e){return hh.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return hh.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return hh.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return hh.buildEarlyExitMessage(e)}}class xG extends Jxe{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class ebe extends yG{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(vG(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const tbe={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new xG};class rbe extends cxe{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},tbe),{lookaheadStrategy:n?new IS({maxLookahead:r.maxLookahead}):new Rxe({logging:r.skipValidations?()=>{}:void 0})}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}}function bG(t,e,r){return nbe({parser:e,tokens:r,ruleNames:new Map},t),e}function nbe(t,e){const r=yV(e,!1),n=oi(e.rules).filter(as).filter(i=>r.has(i));for(const i of n){const a=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,lu(a,i.definition))}}function lu(t,e,r=!1){let n;if(au(e))n=ube(t,e);else if(xx(e))n=ibe(t,e);else if(iu(e))n=lu(t,e.terminal);else if(wS(e))n=wG(t,e);else if(su(e))n=abe(t,e);else if(dV(e))n=obe(t,e);else if(fV(e))n=lbe(t,e);else if(TS(e))n=cbe(t,e);else if(Sve(e)){const i=t.consume++;n=()=>t.parser.consume(i,$l,e)}else throw new lV(e.$cstNode,`Unexpected element type: ${e.$type}`);return TG(t,r?void 0:Yy(e),n,e.cardinality)}function ibe(t,e){const r=CS(e);return()=>t.parser.action(r,e)}function abe(t,e){const r=e.rule.ref;if(as(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?sbe(r,e.arguments):()=>({});return s=>t.parser.subrule(n,EG(t,r),i,e,a(s))}else if(_u(r)){const n=t.consume++,i=fT(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Og();else throw new lV(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function sbe(t,e){const r=e.map(n=>Lo(n.value));return n=>{const i={};for(let a=0;a<r.length;a++){const s=t.parameters[a],o=r[a];i[s.name]=o(n)}return i}}function Lo(t){if(yve(t)){const e=Lo(t.left),r=Lo(t.right);return n=>e(n)||r(n)}else if(vve(t)){const e=Lo(t.left),r=Lo(t.right);return n=>e(n)&&r(n)}else if(xve(t)){const e=Lo(t.value);return r=>!e(r)}else if(bve(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(mve(t)){const e=!!t.true;return()=>e}Og()}function obe(t,e){if(e.elements.length===1)return lu(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:lu(t,i,!0)},s=Yy(i);s&&(a.GATE=Lo(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function lbe(t,e){if(e.elements.length===1)return lu(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:lu(t,o,!0)},u=Yy(o);u&&(l.GATE=Lo(u)),r.push(l)}const n=t.or++,i=(o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},a=o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:()=>!0},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),s=TG(t,Yy(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function cbe(t,e){const r=e.elements.map(n=>lu(t,n));return n=>r.forEach(i=>i(n))}function Yy(t){if(TS(t))return t.guardCondition}function wG(t,e,r=e.terminal){if(r)if(su(r)&&as(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return a=>t.parser.subrule(i,EG(t,n),!1,e,a)}else if(su(r)&&_u(r.rule.ref)){const n=t.consume++,i=fT(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(au(r)){const n=t.consume++,i=fT(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=wV(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+CS(e.type.ref));return wG(t,e,i)}}function ube(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 TG(t,e,r,n){const i=e&&Lo(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:HA(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:HA(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else Og()}function EG(t,e){const r=hbe(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function hbe(t,e){if(as(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!as(n);)(TS(n)||dV(n)||fV(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 fT(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function dbe(t){const e=t.Grammar,r=t.parser.Lexer,n=new ebe(t);return bG(e,n,r.definition),n.finalize(),n}function fbe(t){const e=pbe(t);return e.finalize(),e}function pbe(t){const e=t.Grammar,r=t.parser.Lexer,n=new Qxe(t);return bG(e,n,r.definition)}class SG{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=oi(yV(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{const o=s.PATTERN;typeof o=="object"&&o&&"test"in o&&zw(o)?a.unshift(s):a.push(s)}),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(_u).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=AS(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=zw(r)?ia.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(as).flatMap(i=>Pg(i).filter(au)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Gve(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&Uve("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class kG{convert(e,r){let n=r.grammarSource;if(wS(n)&&(n=Yve(n)),su(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return So.convertInt(r);case"STRING":return So.convertString(r);case"ID":return So.convertID(r)}switch((i=eye(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return So.convertNumber(r);case"boolean":return So.convertBoolean(r);case"bigint":return So.convertBigint(r);case"date":return So.convertDate(r);default:return r}}}var So;(function(t){function e(u){let h="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);h+=r(p)}else h+=f}return h}t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
1240
|
-
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function a(u){return BigInt(u)}t.convertBigint=a;function s(u){return new Date(u)}t.convertDate=s;function o(u){return Number(u)}t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}t.convertBoolean=l})(So||(So={}));var gc={},q1={},Z_;function CG(){if(Z_)return q1;Z_=1,Object.defineProperty(q1,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n}(e||(e={})),q1.default=e,q1}var ri={},Q_;function gbe(){if(Q_)return ri;Q_=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.stringArray=ri.array=ri.func=ri.error=ri.number=ri.string=ri.boolean=void 0;function t(o){return o===!0||o===!1}ri.boolean=t;function e(o){return typeof o=="string"||o instanceof String}ri.string=e;function r(o){return typeof o=="number"||o instanceof Number}ri.number=r;function n(o){return o instanceof Error}ri.error=n;function i(o){return typeof o=="function"}ri.func=i;function a(o){return Array.isArray(o)}ri.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return ri.stringArray=s,ri}var mc={},J_;function AG(){if(J_)return mc;J_=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.Emitter=mc.Event=void 0;const t=CG();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(mc.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let l=0,u=this._callbacks.length;l<u;l++)if(this._callbacks[l]===a)if(this._contexts[l]===s){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let u=0,h=o.length;u<h;u++)try{s.push(o[u].apply(l[u],a))}catch(d){(0,t.default)().console.error(d)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),l.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return mc.Emitter=n,n._noop=function(){},mc}var e9;function mbe(){if(e9)return gc;e9=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.CancellationTokenSource=gc.CancellationToken=void 0;const t=CG(),e=gbe(),r=AG();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function l(u){const h=u;return h&&(h===o.None||h===o.Cancelled||e.boolean(h.isCancellationRequested)&&!!h.onCancellationRequested)}o.is=l})(n||(gc.CancellationToken=n={}));const i=Object.freeze(function(o,l){const u=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){u.dispose()}}});class a{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?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return gc.CancellationTokenSource=s,gc}var rn=mbe();function vbe(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Um=0,ybe=10;function xbe(){return Um=performance.now(),new rn.CancellationTokenSource}const Xy=Symbol("OperationCancelled");function Rx(t){return t===Xy}async function Sa(t){if(t===rn.CancellationToken.None)return;const e=performance.now();if(e-Um>=ybe&&(Um=e,await vbe(),Um=performance.now()),t.isCancellationRequested)throw Xy}class VS{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Wp{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Wp.isIncremental(n)){const i=LG(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=t9(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;f<p;f++)u[f+o+1]=h[f];else h.length<1e4?u.splice(o+1,l-o,...h):this._lineOffsets=u=u.slice(0,o+1).concat(h,u.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let f=o+1+h.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(Wp.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=t9(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&_G(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var pT;(function(t){function e(i,a,s,o){return new Wp(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Wp)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=gT(a.map(bbe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(pT||(pT={}));function gT(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);gT(n,e),gT(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function t9(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);_G(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function _G(t){return t===13||t===10}function LG(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 bbe(t){const e=LG(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var RG;(()=>{var t={470:i=>{function a(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function s(l,u){for(var h,d="",f=0,p=-1,g=0,m=0;m<=l.length;++m){if(m<l.length)h=l.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(p===m-1||g===1))if(p!==m-1&&g===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var v=d.lastIndexOf("/");if(v!==d.length-1){v===-1?(d="",f=0):f=(d=d.slice(0,v)).length-1-d.lastIndexOf("/"),p=m,g=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=m,g=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+l.slice(p+1,m):d=l.slice(p+1,m),f=m-p-1;p=m,g=0}else h===46&&g!==-1?++g:g=-1}return d}var o={resolve:function(){for(var l,u="",h=!1,d=arguments.length-1;d>=-1&&!h;d--){var f;d>=0?f=arguments[d]:(l===void 0&&(l=process.cwd()),f=l),a(f),f.length!==0&&(u=f+"/"+u,h=f.charCodeAt(0)===47)}return u=s(u,!h),h?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(l){if(a(l),l.length===0)return".";var u=l.charCodeAt(0)===47,h=l.charCodeAt(l.length-1)===47;return(l=s(l,!u)).length!==0||u||(l="."),l.length>0&&h&&(l+="/"),u?"/"+l:l},isAbsolute:function(l){return a(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,u=0;u<arguments.length;++u){var h=arguments[u];a(h),h.length>0&&(l===void 0?l=h:l+="/"+h)}return l===void 0?".":o.normalize(l)},relative:function(l,u){if(a(l),a(u),l===u||(l=o.resolve(l))===(u=o.resolve(u)))return"";for(var h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var d=l.length,f=d-h,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var g=u.length-p,m=f<g?f:g,v=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(u.charCodeAt(p+y)===47)return u.slice(p+y+1);if(y===0)return u.slice(p+y)}else f>m&&(l.charCodeAt(h+y)===47?v=y:y===0&&(v=0));break}var b=l.charCodeAt(h+y);if(b!==u.charCodeAt(p+y))break;b===47&&(v=y)}var w="";for(y=h+v+1;y<=d;++y)y!==d&&l.charCodeAt(y)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+u.slice(p+v):(p+=v,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(l){return l},dirname:function(l){if(a(l),l.length===0)return".";for(var u=l.charCodeAt(0),h=u===47,d=-1,f=!0,p=l.length-1;p>=1;--p)if((u=l.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?h?"/":".":h&&d===1?"//":l.slice(0,d)},basename:function(l,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');a(l);var h,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=l.length){if(u.length===l.length&&u===l)return"";var g=u.length-1,m=-1;for(h=l.length-1;h>=0;--h){var v=l.charCodeAt(h);if(v===47){if(!p){d=h+1;break}}else m===-1&&(p=!1,m=h+1),g>=0&&(v===u.charCodeAt(g)?--g==-1&&(f=h):(g=-1,f=m))}return d===f?f=m:f===-1&&(f=l.length),l.slice(d,f)}for(h=l.length-1;h>=0;--h)if(l.charCodeAt(h)===47){if(!p){d=h+1;break}}else f===-1&&(p=!1,f=h+1);return f===-1?"":l.slice(d,f)},extname:function(l){a(l);for(var u=-1,h=0,d=-1,f=!0,p=0,g=l.length-1;g>=0;--g){var m=l.charCodeAt(g);if(m!==47)d===-1&&(f=!1,d=g+1),m===46?u===-1?u=g:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){h=g+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===h+1?"":l.slice(u,d)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(u,h){var d=h.dir||h.root,f=h.base||(h.name||"")+(h.ext||"");return d?d===h.root?d+f:d+"/"+f:f}(0,l)},parse:function(l){a(l);var u={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return u;var h,d=l.charCodeAt(0),f=d===47;f?(u.root="/",h=1):h=0;for(var p=-1,g=0,m=-1,v=!0,y=l.length-1,b=0;y>=h;--y)if((d=l.charCodeAt(y))!==47)m===-1&&(v=!1,m=y+1),d===46?p===-1?p=y:b!==1&&(b=1):p!==-1&&(b=-1);else if(!v){g=y+1;break}return p===-1||m===-1||b===0||b===1&&p===m-1&&p===g+1?m!==-1&&(u.base=u.name=g===0&&f?l.slice(1,m):l.slice(g,m)):(g===0&&f?(u.name=l.slice(1,p),u.base=l.slice(1,m)):(u.name=l.slice(g,p),u.base=l.slice(g,m)),u.ext=l.slice(p,m)),g>0?u.dir=l.slice(0,g-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>f,Utils:()=>R}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(C,I){if(!C.scheme&&I)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!a.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!s.test(C.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{constructor(I,P,_,N,M,O=!1){xt(this,"scheme");xt(this,"authority");xt(this,"path");xt(this,"query");xt(this,"fragment");typeof I=="object"?(this.scheme=I.scheme||u,this.authority=I.authority||u,this.path=I.path||u,this.query=I.query||u,this.fragment=I.fragment||u):(this.scheme=function(D,B){return D||B?D:"file"}(I,O),this.authority=P||u,this.path=function(D,B){switch(D){case"https":case"http":case"file":B?B[0]!==h&&(B=h+B):B=h}return B}(this.scheme,_||u),this.query=N||u,this.fragment=M||u,l(this,O))}static isUri(I){return I instanceof f||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"}get fsPath(){return b(this)}with(I){if(!I)return this;let{scheme:P,authority:_,path:N,query:M,fragment:O}=I;return P===void 0?P=this.scheme:P===null&&(P=u),_===void 0?_=this.authority:_===null&&(_=u),N===void 0?N=this.path:N===null&&(N=u),M===void 0?M=this.query:M===null&&(M=u),O===void 0?O=this.fragment:O===null&&(O=u),P===this.scheme&&_===this.authority&&N===this.path&&M===this.query&&O===this.fragment?this:new g(P,_,N,M,O)}static parse(I,P=!1){const _=d.exec(I);return _?new g(_[2]||u,k(_[4]||u),k(_[5]||u),k(_[7]||u),k(_[9]||u),P):new g(u,u,u,u,u)}static file(I){let P=u;if(i&&(I=I.replace(/\\/g,h)),I[0]===h&&I[1]===h){const _=I.indexOf(h,2);_===-1?(P=I.substring(2),I=h):(P=I.substring(2,_),I=I.substring(_)||h)}return new g("file",P,I,u,u)}static from(I){const P=new g(I.scheme,I.authority,I.path,I.query,I.fragment);return l(P,!0),P}toString(I=!1){return w(this,I)}toJSON(){return this}static revive(I){if(I){if(I instanceof f)return I;{const P=new g(I);return P._formatted=I.external,P._fsPath=I._sep===p?I.fsPath:null,P}}return I}}const p=i?1:void 0;class g extends f{constructor(){super(...arguments);xt(this,"_formatted",null);xt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this)),this._fsPath}toString(P=!1){return P?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){const P={$mid:1};return this._fsPath&&(P.fsPath=this._fsPath,P._sep=p),this._formatted&&(P.external=this._formatted),this.path&&(P.path=this.path),this.scheme&&(P.scheme=this.scheme),this.authority&&(P.authority=this.authority),this.query&&(P.query=this.query),this.fragment&&(P.fragment=this.fragment),P}}const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(C,I,P){let _,N=-1;for(let M=0;M<C.length;M++){const O=C.charCodeAt(M);if(O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||I&&O===47||P&&O===91||P&&O===93||P&&O===58)N!==-1&&(_+=encodeURIComponent(C.substring(N,M)),N=-1),_!==void 0&&(_+=C.charAt(M));else{_===void 0&&(_=C.substr(0,M));const D=m[O];D!==void 0?(N!==-1&&(_+=encodeURIComponent(C.substring(N,M)),N=-1),_+=D):N===-1&&(N=M)}}return N!==-1&&(_+=encodeURIComponent(C.substring(N))),_!==void 0?_:C}function y(C){let I;for(let P=0;P<C.length;P++){const _=C.charCodeAt(P);_===35||_===63?(I===void 0&&(I=C.substr(0,P)),I+=m[_]):I!==void 0&&(I+=C[P])}return I!==void 0?I:C}function b(C,I){let P;return P=C.authority&&C.path.length>1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(P=P.replace(/\//g,"\\")),P}function w(C,I){const P=I?y:v;let _="",{scheme:N,authority:M,path:O,query:D,fragment:B}=C;if(N&&(_+=N,_+=":"),(M||N==="file")&&(_+=h,_+=h),M){let z=M.indexOf("@");if(z!==-1){const F=M.substr(0,z);M=M.substr(z+1),z=F.lastIndexOf(":"),z===-1?_+=P(F,!1,!1):(_+=P(F.substr(0,z),!1,!1),_+=":",_+=P(F.substr(z+1),!1,!0)),_+="@"}M=M.toLowerCase(),z=M.lastIndexOf(":"),z===-1?_+=P(M,!1,!0):(_+=P(M.substr(0,z),!1,!0),_+=M.substr(z))}if(O){if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){const z=O.charCodeAt(1);z>=65&&z<=90&&(O=`/${String.fromCharCode(z+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){const z=O.charCodeAt(0);z>=65&&z<=90&&(O=`${String.fromCharCode(z+32)}:${O.substr(2)}`)}_+=P(O,!0,!1)}return D&&(_+="?",_+=P(D,!1,!1)),B&&(_+="#",_+=I?B:v(B,!1,!1)),_}function T(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+T(C.substr(3)):C}}const E=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function k(C){return C.match(E)?C.replace(E,I=>T(I)):C}var S=r(470);const L=S.posix||S,A="/";var R;(function(C){C.joinPath=function(I,...P){return I.with({path:L.join(I.path,...P)})},C.resolvePath=function(I,...P){let _=I.path,N=!1;_[0]!==A&&(_=A+_,N=!0);let M=L.resolve(_,...P);return N&&M[0]===A&&!I.authority&&(M=M.substring(1)),I.with({path:M})},C.dirname=function(I){if(I.path.length===0||I.path===A)return I;let P=L.dirname(I.path);return P.length===1&&P.charCodeAt(0)===46&&(P=""),I.with({path:P})},C.basename=function(I){return L.basename(I.path)},C.extname=function(I){return L.extname(I.path)}})(R||(R={}))})(),RG=n})();const{URI:cu,Utils:jf}=RG;var Vl;(function(t){t.basename=jf.basename,t.dirname=jf.dirname,t.extname=jf.extname,t.joinPath=jf.joinPath,t.resolvePath=jf.resolvePath;function e(i,a){return(i==null?void 0:i.toString())===(a==null?void 0:a.toString())}t.equals=e;function r(i,a){const s=typeof i=="string"?i:i.path,o=typeof a=="string"?a:a.path,l=s.split("/").filter(p=>p.length>0),u=o.split("/").filter(p=>p.length>0);let h=0;for(;h<l.length&&l[h]===u[h];h++);const d="../".repeat(l.length-h),f=u.slice(h).join("/");return d+f}t.relative=r;function n(i){return cu.parse(i.toString()).toString()}t.normalize=n})(Vl||(Vl={}));var Kr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Kr||(Kr={}));class wbe{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=rn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??cu.parse(e.uri),rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Kr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Kr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;const a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{const l=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:l})}return a!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=Kr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=pT.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Tbe{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return oi(this.documentMap.values())}addDocument(e){const r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){const r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=Kr.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=Kr.Changed,this.documentMap.delete(r)),n}}const S4=Symbol("ref_resolving");class Ebe{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=rn.CancellationToken.None){for(const n of Eh(e.parseResult.value))await Sa(r),gV(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;const i=e.reference;if(i._ref===void 0){i._ref=S4;try{const a=this.getCandidate(e);if(Pm(a))i._ref=a;else if(i._nodeDescription=a,this.langiumDocuments().hasDocument(a.documentUri)){const s=this.loadAstNode(a);i._ref=s??this.createLinkingError(e,a)}else i._ref=void 0}catch(a){console.error(`An error occurred while resolving reference to '${i.$refText}':`,a);const s=(n=a.message)!==null&&n!==void 0?n:String(a);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${s}`})}r.references.push(i)}}unlink(e){for(const r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){const n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,get ref(){var o;if(Ti(this._ref))return this._ref;if(sve(this._nodeDescription)){const l=a.loadAstNode(this._nodeDescription);this._ref=l??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=S4;const l=$w(e).$document,u=a.getLinkedNode({reference:s,container:e,property:r});if(u.error&&l&&l.state<Kr.ComputedScopes)return this._ref=void 0;this._ref=(o=u.node)!==null&&o!==void 0?o:u.error,this._nodeDescription=u.descr,l==null||l.references.push(this)}else if(this._ref===S4)throw new Error(`Cyclic reference resolution detected: ${a.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return Ti(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Pm(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){var r;try{const n=this.getCandidate(e);if(Pm(n))return{error:n};const i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=$w(e.container).$document;n&&n.state<Kr.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}}function Sbe(t){return typeof t.name=="string"}class kbe{getName(e){if(Sbe(e))return e.name}getNameNode(e){return bV(e.$cstNode,"name")}}class Cbe{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const r=Qve(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Hs(i))return i.ref;if(Array.isArray(i)){for(const a of i)if(Hs(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||cve(e,i)))return n}}}findDeclarationNode(e){const r=this.findDeclaration(e);if(r!=null&&r.$cstNode){const n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){const n=[];if(r.includeDeclaration){const a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Vl.equals(a.sourceUri,r.documentUri))),n.push(...i),oi(n)}getReferenceToSelf(e){const r=this.nameProvider.getNameNode(e);if(r){const n=Bl(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Ry(r),local:!0}}}}class jy{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Pw.sum(oi(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return oi(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return oi(this.map.keys())}values(){return oi(this.map.values()).flat()}entriesGroupedByKey(){return oi(this.map.entries())}}class r9{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class Abe{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=rn.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=ES,i=rn.CancellationToken.None){const a=[];this.exportNode(e,a,r);for(const s of n(e))await Sa(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=rn.CancellationToken.None){const n=e.parseResult.value,i=new jy;for(const a of Pg(n))await Sa(r),this.processNode(a,e,i);return i}processNode(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class n9{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}}class _be{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1;for(const a of e){const s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=oi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class NG{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Lbe extends NG{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Rbe extends NG{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class Nbe extends Lbe{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class Dbe{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Nbe(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Bl(e.container).precomputedScopes;if(i){let s=e.container;do{const o=i.get(s);o.length>0&&r.push(oi(o).filter(l=>this.reflection.isSubtype(l.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new n9(oi(e),r,n)}createScopeForNodes(e,r,n){const i=oi(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new n9(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new _be(this.indexManager.allElements(e)))}}function Ibe(t){return typeof t.$comment=="string"}function i9(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Mbe{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Bl(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h,d;if(!this.ignoreProperties.has(e))if(Hs(r)){const f=r.ref,p=n?r.$refText:void 0;if(f){const g=Bl(f);let m="";this.currentDocument&&this.currentDocument!==g&&(o?m=o(g.uri,r):m=g.uri.toString());const v=this.astNodeLocator.getAstNodePath(f);return{$ref:`${m}#${v}`,$refText:p}}else return{$error:(u=(l=r.error)===null||l===void 0?void 0:l.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(Ti(r)){let f;if(a&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&(f!=null&&f.$textRegion)&&(f.$textRegion.documentURI=(h=this.currentDocument)===null||h===void 0?void 0:h.uri.toString())),i&&!e&&(f??(f=Object.assign({},r)),f.$sourceText=(d=r.$cstNode)===null||d===void 0?void 0:d.text),s){f??(f=Object.assign({},r));const p=this.commentProvider.getComment(r);p&&(f.$comment=p.replace(/\r/g,""))}return f??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=jve(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h<u.length;h++){const d=u[h];i9(d)?u[h]=this.reviveReference(e,l,r,d,n):Ti(d)&&this.linkNode(d,r,n,e,l,h)}else i9(u)?e[l]=this.reviveReference(e,l,r,u,n):Ti(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error;if(i.$ref){const l=this.getRefNode(n,i.$ref,a.uriConverter);if(Ti(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??"",ref:l};o=l}if(o){const l={$refText:s??""};return l.error={container:e,property:r,message:o,reference:l},l}else return}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):cu.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):cu.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class Obe{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const a=Vl.extname(e),s=this.fileExtensionMap.get(a);if(!s)throw i?new Error(`The service registry contains no services for the extension '${a}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${a}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function U0(t){return{code:t}}var Ky;(function(t){t.all=["fast","slow","built-in"]})(Ky||(Ky={}));class Pbe{constructor(e){this.entries=new jy,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else Og()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Rx(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=oi(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class Bbe{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=rn.CancellationToken.None){const i=e.parseResult,a=[];if(await Sa(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Rx(s))throw s;console.error("An error occurred during validation:",s)}return await Sa(n),a}processLexingErrors(e,r,n){var i,a,s;const o=[...e.lexerErrors,...(a=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&a!==void 0?a:[]];for(const l of o){const u=(s=l.severity)!==null&&s!==void 0?s:"error",h={severity:k4(u),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:$be(u),source:this.getSource()};r.push(h)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Fw(i.token);if(a){const s={severity:k4("error"),range:a,message:i.message,data:U0(fs.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.container,property:a.property,index:a.index,data:{code:fs.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=rn.CancellationToken.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=rn.CancellationToken.None){var a;const s=this.validationRegistry.checksBefore;for(const o of s)await Sa(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}async validateAstNodes(e,r,n,i=rn.CancellationToken.None){await Promise.all(Eh(e).map(async a=>{await Sa(i);const s=this.validationRegistry.getChecks(a.$type,r.categories);for(const o of s)await o(a,n,i)}))}async validateAstAfter(e,r,n,i=rn.CancellationToken.None){var a;const s=this.validationRegistry.checksAfter;for(const o of s)await Sa(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}toDiagnostic(e,r,n){return{message:r,range:Fbe(n),severity:k4(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Fbe(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=bV(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Kve(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function k4(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 $be(t){switch(t){case"error":return U0(fs.LexingError);case"warning":return U0(fs.LexingWarning);case"info":return U0(fs.LexingInfo);case"hint":return U0(fs.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var fs;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(fs||(fs={}));class zbe{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Bl(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>{var l;return s??(s=Ry((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Ry(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class Vbe{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=rn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Eh(i))await Sa(r),gV(a).filter(s=>!Pm(s)).forEach(s=>{const o=this.createDescription(s);o&&n.push(o)});return n}createDescription(e){const r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;const i=Bl(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:Ry(n),local:Vl.equals(r.documentUri,i)}}}class Gbe{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}}var Ube=AG();class qbe{constructor(e){this._ready=new VS,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Ube.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{const n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var pp;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(pp||(pp={}));class Hbe{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new jy,this.documentPhaseListeners=new jy,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Kr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=rn.CancellationToken.None){var i,a;for(const s of e){const o=s.uri.toString();if(s.state===Kr.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=Kr.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(o);else if(typeof r.validation=="object"){const l=this.buildState.get(o),u=(i=l==null?void 0:l.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((a=r.validation.categories)!==null&&a!==void 0?a:Ky.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:d})},result:l.result}),s.state=Kr.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=Kr.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=rn.CancellationToken.None){this.currentState=Kr.Changed;for(const s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);l.state=Kr.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(s.toString())}const i=oi(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,Kr.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await Sa(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>{var o;return s.state<Kr.Linked||!(!((o=this.buildState.get(s.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),pp.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Kr.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,Kr.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,Kr.ComputedScopes,n,async a=>{const s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,Kr.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,Kr.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,Kr.Validated,n,a=>this.validate(a,n));for(const a of e){const s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){const a=e.filter(o=>o.state<r);for(const o of a)await Sa(n),await i(o),o.state=r,await this.notifyDocumentPhase(o,r,n);const s=e.filter(o=>o.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),pp.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),pp.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=rn.CancellationToken.None),i){const a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Xy):new Promise((a,s)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const u=this.langiumDocuments.getDocument(i);a(u==null?void 0:u.uri)}else a(void 0)}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Xy)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await s(e,n)}catch(o){if(!Rx(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Sa(n),await s(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;const a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o=typeof s=="object"?s:void 0,l=await a.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});const h=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:Ky.all;u.result.validationChecks?u.result.validationChecks.push(...h):u.result.validationChecks=[...h]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}class Wbe{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Rbe,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Bl(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Vl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),oi(i)}allElements(e,r){let n=oi(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var a;return((a=this.symbolIndex.get(e))!==null&&a!==void 0?a:[]).filter(o=>this.astReflection.isSubtype(o.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class Ybe{constructor(e){this.initialBuildOptions={},this._ready=new VS,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=rn.CancellationToken.None){const n=await this.performStartup(e);await Sa(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return cu.parse(e.uri)}async traverseFolder(e,r,n,i){const a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){const o=await this.langiumDocuments.getOrCreateDocument(s.uri);i(o)}}}))}includeEntry(e,r,n){const i=Vl.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){const a=Vl.extname(r.uri);return n.includes(a)}return!1}}class Xbe{buildUnexpectedCharactersMessage(e,r,n,i,a){return qw.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return qw.buildUnableToPopLexerModeMessage(e)}}const jbe={mode:"full"};class Kbe{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=a9(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ia(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=jbe){var n,i,a;const s=this.chevrotainLexer.tokenize(e);return{tokens:s.tokens,errors:s.errors,hidden:(n=s.groups.hidden)!==null&&n!==void 0?n:[],report:(a=(i=this.tokenBuilder).flushLexingReport)===null||a===void 0?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(a9(e))return e;const r=DG(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function Zbe(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function DG(t){return t&&"modes"in t&&"defaultMode"in t}function a9(t){return!Zbe(t)&&!DG(t)}function Qbe(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Tr.create(0,0));const a=IG(t),s=GS(n),o=t4e({lines:a,position:i,options:s});return s4e({index:0,tokens:o,position:i})}function Jbe(t,e){const r=GS(e),n=IG(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function IG(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Bve)}const s9=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,e4e=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function t4e(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=o===0,u=o===t.lines.length-1;let h=t.lines[o],d=0;if(l&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(h);p&&(d=p.index+p[0].length)}else{const p=(r=t.options.line)===null||r===void 0?void 0:r.exec(h);p&&(d=p.index+p[0].length)}if(u){const p=(n=t.options.end)===null||n===void 0?void 0:n.exec(h);p&&(h=h.substring(0,p.index))}if(h=h.substring(0,a4e(h)),mT(h,d)>=h.length){if(i.length>0){const p=Tr.create(a,s);i.push({type:"break",content:"",range:pr.create(p,p)})}}else{s9.lastIndex=d;const p=s9.exec(h);if(p){const g=p[0],m=p[1],v=Tr.create(a,s+d),y=Tr.create(a,s+d+g.length);i.push({type:"tag",content:m,range:pr.create(v,y)}),d+=g.length,d=mT(h,d)}if(d<h.length){const g=h.substring(d),m=Array.from(g.matchAll(e4e));i.push(...r4e(m,g,a,s+d))}}a++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function r4e(t,e,r,n){const i=[];if(t.length===0){const a=Tr.create(r,n),s=Tr.create(r,n+e.length);i.push({type:"text",content:e,range:pr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:pr.create(Tr.create(r,a+n),Tr.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:pr.create(Tr.create(r,a+n),Tr.create(r,a+n+s.length))})}return i}const n4e=/\S/,i4e=/\s*$/;function mT(t,e){const r=t.substring(e).match(n4e);return r?e+r.index:t.length}function a4e(t){const e=t.match(i4e);if(e&&typeof e.index=="number")return e.index}function s4e(t){var e,r,n,i;const a=Tr.create(t.position.line,t.position.character);if(t.tokens.length===0)return new o9([],pr.create(a,a));const s=[];for(;t.index<t.tokens.length;){const u=o4e(t,s[s.length-1]);u&&s.push(u)}const o=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:a,l=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:a;return new o9(s,pr.create(o,l))}function o4e(t,e){const r=t.tokens[t.index];if(r.type==="tag")return OG(t,!1);if(r.type==="text"||r.type==="inline-tag")return MG(t);l4e(r,e),t.index++}function l4e(t,e){if(e){const r=new BG("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function MG(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(c4e(t)),n=e,e=t.tokens[t.index];return new vT(i,pr.create(r.range.start,n.range.end))}function c4e(t){return t.tokens[t.index].type==="inline-tag"?OG(t,!0):PG(t)}function OG(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=PG(t);return new A4(n,new vT([a],a.range),e,pr.create(r.range.start,a.range.end))}else{const a=MG(t);return new A4(n,a,e,pr.create(r.range.start,a.range.end))}else{const a=r.range;return new A4(n,new vT([],a),e,a)}}function PG(t){const e=t.tokens[t.index++];return new BG(e.content,e.range)}function GS(t){if(!t)return GS({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:C4(e,!0),end:C4(r,!1),line:C4(n,!0)}}function C4(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Tx(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class o9{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=l9(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=l9(r)+i}return r.trim()}}class A4{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
1240
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function n(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=n;function i(u){return parseInt(u)}t.convertInt=i;function a(u){return BigInt(u)}t.convertBigint=a;function s(u){return new Date(u)}t.convertDate=s;function o(u){return Number(u)}t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}t.convertBoolean=l})(So||(So={}));var gc={},q1={},Z_;function CG(){if(Z_)return q1;Z_=1,Object.defineProperty(q1,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n}(e||(e={})),q1.default=e,q1}var ri={},Q_;function gbe(){if(Q_)return ri;Q_=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.stringArray=ri.array=ri.func=ri.error=ri.number=ri.string=ri.boolean=void 0;function t(o){return o===!0||o===!1}ri.boolean=t;function e(o){return typeof o=="string"||o instanceof String}ri.string=e;function r(o){return typeof o=="number"||o instanceof Number}ri.number=r;function n(o){return o instanceof Error}ri.error=n;function i(o){return typeof o=="function"}ri.func=i;function a(o){return Array.isArray(o)}ri.array=a;function s(o){return a(o)&&o.every(l=>e(l))}return ri.stringArray=s,ri}var mc={},J_;function AG(){if(J_)return mc;J_=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.Emitter=mc.Event=void 0;const t=CG();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(mc.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let l=0,u=this._callbacks.length;l<u;l++)if(this._callbacks[l]===a)if(this._contexts[l]===s){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let u=0,h=o.length;u<h;u++)try{s.push(o[u].apply(l[u],a))}catch(d){(0,t.default)().console.error(d)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),l.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return mc.Emitter=n,n._noop=function(){},mc}var e9;function mbe(){if(e9)return gc;e9=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.CancellationTokenSource=gc.CancellationToken=void 0;const t=CG(),e=gbe(),r=AG();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function l(u){const h=u;return h&&(h===o.None||h===o.Cancelled||e.boolean(h.isCancellationRequested)&&!!h.onCancellationRequested)}o.is=l})(n||(gc.CancellationToken=n={}));const i=Object.freeze(function(o,l){const u=(0,t.default)().timer.setTimeout(o.bind(l),0);return{dispose(){u.dispose()}}});class a{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?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return gc.CancellationTokenSource=s,gc}var rn=mbe();function vbe(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Um=0,ybe=10;function xbe(){return Um=performance.now(),new rn.CancellationTokenSource}const Xy=Symbol("OperationCancelled");function Rx(t){return t===Xy}async function Sa(t){if(t===rn.CancellationToken.None)return;const e=performance.now();if(e-Um>=ybe&&(Um=e,await vbe(),Um=performance.now()),t.isCancellationRequested)throw Xy}class VS{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Wp{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Wp.isIncremental(n)){const i=LG(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=t9(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;f<p;f++)u[f+o+1]=h[f];else h.length<1e4?u.splice(o+1,l-o,...h):this._lineOffsets=u=u.slice(0,o+1).concat(h,u.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let f=o+1+h.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(Wp.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=t9(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&_G(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var pT;(function(t){function e(i,a,s,o){return new Wp(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Wp)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=gT(a.map(bbe),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}t.applyEdits=n})(pT||(pT={}));function gT(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);gT(n,e),gT(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function t9(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);_G(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function _G(t){return t===13||t===10}function LG(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 bbe(t){const e=LG(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var RG;(()=>{var t={470:i=>{function a(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function s(l,u){for(var h,d="",f=0,p=-1,g=0,m=0;m<=l.length;++m){if(m<l.length)h=l.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(p===m-1||g===1))if(p!==m-1&&g===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var v=d.lastIndexOf("/");if(v!==d.length-1){v===-1?(d="",f=0):f=(d=d.slice(0,v)).length-1-d.lastIndexOf("/"),p=m,g=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=m,g=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+l.slice(p+1,m):d=l.slice(p+1,m),f=m-p-1;p=m,g=0}else h===46&&g!==-1?++g:g=-1}return d}var o={resolve:function(){for(var l,u="",h=!1,d=arguments.length-1;d>=-1&&!h;d--){var f;d>=0?f=arguments[d]:(l===void 0&&(l=process.cwd()),f=l),a(f),f.length!==0&&(u=f+"/"+u,h=f.charCodeAt(0)===47)}return u=s(u,!h),h?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(l){if(a(l),l.length===0)return".";var u=l.charCodeAt(0)===47,h=l.charCodeAt(l.length-1)===47;return(l=s(l,!u)).length!==0||u||(l="."),l.length>0&&h&&(l+="/"),u?"/"+l:l},isAbsolute:function(l){return a(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,u=0;u<arguments.length;++u){var h=arguments[u];a(h),h.length>0&&(l===void 0?l=h:l+="/"+h)}return l===void 0?".":o.normalize(l)},relative:function(l,u){if(a(l),a(u),l===u||(l=o.resolve(l))===(u=o.resolve(u)))return"";for(var h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var d=l.length,f=d-h,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var g=u.length-p,m=f<g?f:g,v=-1,y=0;y<=m;++y){if(y===m){if(g>m){if(u.charCodeAt(p+y)===47)return u.slice(p+y+1);if(y===0)return u.slice(p+y)}else f>m&&(l.charCodeAt(h+y)===47?v=y:y===0&&(v=0));break}var b=l.charCodeAt(h+y);if(b!==u.charCodeAt(p+y))break;b===47&&(v=y)}var w="";for(y=h+v+1;y<=d;++y)y!==d&&l.charCodeAt(y)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+u.slice(p+v):(p+=v,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(l){return l},dirname:function(l){if(a(l),l.length===0)return".";for(var u=l.charCodeAt(0),h=u===47,d=-1,f=!0,p=l.length-1;p>=1;--p)if((u=l.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?h?"/":".":h&&d===1?"//":l.slice(0,d)},basename:function(l,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');a(l);var h,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=l.length){if(u.length===l.length&&u===l)return"";var g=u.length-1,m=-1;for(h=l.length-1;h>=0;--h){var v=l.charCodeAt(h);if(v===47){if(!p){d=h+1;break}}else m===-1&&(p=!1,m=h+1),g>=0&&(v===u.charCodeAt(g)?--g==-1&&(f=h):(g=-1,f=m))}return d===f?f=m:f===-1&&(f=l.length),l.slice(d,f)}for(h=l.length-1;h>=0;--h)if(l.charCodeAt(h)===47){if(!p){d=h+1;break}}else f===-1&&(p=!1,f=h+1);return f===-1?"":l.slice(d,f)},extname:function(l){a(l);for(var u=-1,h=0,d=-1,f=!0,p=0,g=l.length-1;g>=0;--g){var m=l.charCodeAt(g);if(m!==47)d===-1&&(f=!1,d=g+1),m===46?u===-1?u=g:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){h=g+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===h+1?"":l.slice(u,d)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(u,h){var d=h.dir||h.root,f=h.base||(h.name||"")+(h.ext||"");return d?d===h.root?d+f:d+"/"+f:f}(0,l)},parse:function(l){a(l);var u={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return u;var h,d=l.charCodeAt(0),f=d===47;f?(u.root="/",h=1):h=0;for(var p=-1,g=0,m=-1,v=!0,y=l.length-1,b=0;y>=h;--y)if((d=l.charCodeAt(y))!==47)m===-1&&(v=!1,m=y+1),d===46?p===-1?p=y:b!==1&&(b=1):p!==-1&&(b=-1);else if(!v){g=y+1;break}return p===-1||m===-1||b===0||b===1&&p===m-1&&p===g+1?m!==-1&&(u.base=u.name=g===0&&f?l.slice(1,m):l.slice(g,m)):(g===0&&f?(u.name=l.slice(1,p),u.base=l.slice(1,m)):(u.name=l.slice(g,p),u.base=l.slice(g,m)),u.ext=l.slice(p,m)),g>0?u.dir=l.slice(0,g-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>f,Utils:()=>R}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(C,I){if(!C.scheme&&I)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!a.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!s.test(C.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{constructor(I,P,_,N,M,O=!1){wt(this,"scheme");wt(this,"authority");wt(this,"path");wt(this,"query");wt(this,"fragment");typeof I=="object"?(this.scheme=I.scheme||u,this.authority=I.authority||u,this.path=I.path||u,this.query=I.query||u,this.fragment=I.fragment||u):(this.scheme=function(D,B){return D||B?D:"file"}(I,O),this.authority=P||u,this.path=function(D,B){switch(D){case"https":case"http":case"file":B?B[0]!==h&&(B=h+B):B=h}return B}(this.scheme,_||u),this.query=N||u,this.fragment=M||u,l(this,O))}static isUri(I){return I instanceof f||!!I&&typeof I.authority=="string"&&typeof I.fragment=="string"&&typeof I.path=="string"&&typeof I.query=="string"&&typeof I.scheme=="string"&&typeof I.fsPath=="string"&&typeof I.with=="function"&&typeof I.toString=="function"}get fsPath(){return b(this)}with(I){if(!I)return this;let{scheme:P,authority:_,path:N,query:M,fragment:O}=I;return P===void 0?P=this.scheme:P===null&&(P=u),_===void 0?_=this.authority:_===null&&(_=u),N===void 0?N=this.path:N===null&&(N=u),M===void 0?M=this.query:M===null&&(M=u),O===void 0?O=this.fragment:O===null&&(O=u),P===this.scheme&&_===this.authority&&N===this.path&&M===this.query&&O===this.fragment?this:new g(P,_,N,M,O)}static parse(I,P=!1){const _=d.exec(I);return _?new g(_[2]||u,k(_[4]||u),k(_[5]||u),k(_[7]||u),k(_[9]||u),P):new g(u,u,u,u,u)}static file(I){let P=u;if(i&&(I=I.replace(/\\/g,h)),I[0]===h&&I[1]===h){const _=I.indexOf(h,2);_===-1?(P=I.substring(2),I=h):(P=I.substring(2,_),I=I.substring(_)||h)}return new g("file",P,I,u,u)}static from(I){const P=new g(I.scheme,I.authority,I.path,I.query,I.fragment);return l(P,!0),P}toString(I=!1){return w(this,I)}toJSON(){return this}static revive(I){if(I){if(I instanceof f)return I;{const P=new g(I);return P._formatted=I.external,P._fsPath=I._sep===p?I.fsPath:null,P}}return I}}const p=i?1:void 0;class g extends f{constructor(){super(...arguments);wt(this,"_formatted",null);wt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this)),this._fsPath}toString(P=!1){return P?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){const P={$mid:1};return this._fsPath&&(P.fsPath=this._fsPath,P._sep=p),this._formatted&&(P.external=this._formatted),this.path&&(P.path=this.path),this.scheme&&(P.scheme=this.scheme),this.authority&&(P.authority=this.authority),this.query&&(P.query=this.query),this.fragment&&(P.fragment=this.fragment),P}}const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function v(C,I,P){let _,N=-1;for(let M=0;M<C.length;M++){const O=C.charCodeAt(M);if(O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||I&&O===47||P&&O===91||P&&O===93||P&&O===58)N!==-1&&(_+=encodeURIComponent(C.substring(N,M)),N=-1),_!==void 0&&(_+=C.charAt(M));else{_===void 0&&(_=C.substr(0,M));const D=m[O];D!==void 0?(N!==-1&&(_+=encodeURIComponent(C.substring(N,M)),N=-1),_+=D):N===-1&&(N=M)}}return N!==-1&&(_+=encodeURIComponent(C.substring(N))),_!==void 0?_:C}function y(C){let I;for(let P=0;P<C.length;P++){const _=C.charCodeAt(P);_===35||_===63?(I===void 0&&(I=C.substr(0,P)),I+=m[_]):I!==void 0&&(I+=C[P])}return I!==void 0?I:C}function b(C,I){let P;return P=C.authority&&C.path.length>1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(P=P.replace(/\//g,"\\")),P}function w(C,I){const P=I?y:v;let _="",{scheme:N,authority:M,path:O,query:D,fragment:B}=C;if(N&&(_+=N,_+=":"),(M||N==="file")&&(_+=h,_+=h),M){let z=M.indexOf("@");if(z!==-1){const F=M.substr(0,z);M=M.substr(z+1),z=F.lastIndexOf(":"),z===-1?_+=P(F,!1,!1):(_+=P(F.substr(0,z),!1,!1),_+=":",_+=P(F.substr(z+1),!1,!0)),_+="@"}M=M.toLowerCase(),z=M.lastIndexOf(":"),z===-1?_+=P(M,!1,!0):(_+=P(M.substr(0,z),!1,!0),_+=M.substr(z))}if(O){if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){const z=O.charCodeAt(1);z>=65&&z<=90&&(O=`/${String.fromCharCode(z+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){const z=O.charCodeAt(0);z>=65&&z<=90&&(O=`${String.fromCharCode(z+32)}:${O.substr(2)}`)}_+=P(O,!0,!1)}return D&&(_+="?",_+=P(D,!1,!1)),B&&(_+="#",_+=I?B:v(B,!1,!1)),_}function T(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+T(C.substr(3)):C}}const E=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function k(C){return C.match(E)?C.replace(E,I=>T(I)):C}var S=r(470);const L=S.posix||S,A="/";var R;(function(C){C.joinPath=function(I,...P){return I.with({path:L.join(I.path,...P)})},C.resolvePath=function(I,...P){let _=I.path,N=!1;_[0]!==A&&(_=A+_,N=!0);let M=L.resolve(_,...P);return N&&M[0]===A&&!I.authority&&(M=M.substring(1)),I.with({path:M})},C.dirname=function(I){if(I.path.length===0||I.path===A)return I;let P=L.dirname(I.path);return P.length===1&&P.charCodeAt(0)===46&&(P=""),I.with({path:P})},C.basename=function(I){return L.basename(I.path)},C.extname=function(I){return L.extname(I.path)}})(R||(R={}))})(),RG=n})();const{URI:cu,Utils:jf}=RG;var Vl;(function(t){t.basename=jf.basename,t.dirname=jf.dirname,t.extname=jf.extname,t.joinPath=jf.joinPath,t.resolvePath=jf.resolvePath;function e(i,a){return(i==null?void 0:i.toString())===(a==null?void 0:a.toString())}t.equals=e;function r(i,a){const s=typeof i=="string"?i:i.path,o=typeof a=="string"?a:a.path,l=s.split("/").filter(p=>p.length>0),u=o.split("/").filter(p=>p.length>0);let h=0;for(;h<l.length&&l[h]===u[h];h++);const d="../".repeat(l.length-h),f=u.slice(h).join("/");return d+f}t.relative=r;function n(i){return cu.parse(i.toString()).toString()}t.normalize=n})(Vl||(Vl={}));var Kr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Kr||(Kr={}));class wbe{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=rn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??cu.parse(e.uri),rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return rn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Kr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Kr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;const a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{const l=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:l})}return a!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=Kr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=pT.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Tbe{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return oi(this.documentMap.values())}addDocument(e){const r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){const r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=Kr.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=Kr.Changed,this.documentMap.delete(r)),n}}const S4=Symbol("ref_resolving");class Ebe{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=rn.CancellationToken.None){for(const n of Eh(e.parseResult.value))await Sa(r),gV(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;const i=e.reference;if(i._ref===void 0){i._ref=S4;try{const a=this.getCandidate(e);if(Pm(a))i._ref=a;else if(i._nodeDescription=a,this.langiumDocuments().hasDocument(a.documentUri)){const s=this.loadAstNode(a);i._ref=s??this.createLinkingError(e,a)}else i._ref=void 0}catch(a){console.error(`An error occurred while resolving reference to '${i.$refText}':`,a);const s=(n=a.message)!==null&&n!==void 0?n:String(a);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${s}`})}r.references.push(i)}}unlink(e){for(const r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){const n=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return n??this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,get ref(){var o;if(Ti(this._ref))return this._ref;if(sve(this._nodeDescription)){const l=a.loadAstNode(this._nodeDescription);this._ref=l??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=S4;const l=$w(e).$document,u=a.getLinkedNode({reference:s,container:e,property:r});if(u.error&&l&&l.state<Kr.ComputedScopes)return this._ref=void 0;this._ref=(o=u.node)!==null&&o!==void 0?o:u.error,this._nodeDescription=u.descr,l==null||l.references.push(this)}else if(this._ref===S4)throw new Error(`Cyclic reference resolution detected: ${a.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return Ti(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Pm(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){var r;try{const n=this.getCandidate(e);if(Pm(n))return{error:n};const i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=$w(e.container).$document;n&&n.state<Kr.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}}function Sbe(t){return typeof t.name=="string"}class kbe{getName(e){if(Sbe(e))return e.name}getNameNode(e){return bV(e.$cstNode,"name")}}class Cbe{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const r=Qve(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Hs(i))return i.ref;if(Array.isArray(i)){for(const a of i)if(Hs(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||cve(e,i)))return n}}}findDeclarationNode(e){const r=this.findDeclaration(e);if(r!=null&&r.$cstNode){const n=this.nameProvider.getNameNode(r);return n??r.$cstNode}}findReferences(e,r){const n=[];if(r.includeDeclaration){const a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Vl.equals(a.sourceUri,r.documentUri))),n.push(...i),oi(n)}getReferenceToSelf(e){const r=this.nameProvider.getNameNode(e);if(r){const n=Bl(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:Ry(r),local:!0}}}}class jy{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Pw.sum(oi(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return oi(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return oi(this.map.keys())}values(){return oi(this.map.values()).flat()}entriesGroupedByKey(){return oi(this.map.entries())}}class r9{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class Abe{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=rn.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=ES,i=rn.CancellationToken.None){const a=[];this.exportNode(e,a,r);for(const s of n(e))await Sa(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=rn.CancellationToken.None){const n=e.parseResult.value,i=new jy;for(const a of Pg(n))await Sa(r),this.processNode(a,e,i);return i}processNode(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class n9{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}}class _be{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1;for(const a of e){const s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=oi(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class NG{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Lbe extends NG{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Rbe extends NG{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class Nbe extends Lbe{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class Dbe{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Nbe(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Bl(e.container).precomputedScopes;if(i){let s=e.container;do{const o=i.get(s);o.length>0&&r.push(oi(o).filter(l=>this.reflection.isSubtype(l.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new n9(oi(e),r,n)}createScopeForNodes(e,r,n){const i=oi(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new n9(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new _be(this.indexManager.allElements(e)))}}function Ibe(t){return typeof t.$comment=="string"}function i9(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class Mbe{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=(o,l)=>this.replacer(o,l,n),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=Bl(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h,d;if(!this.ignoreProperties.has(e))if(Hs(r)){const f=r.ref,p=n?r.$refText:void 0;if(f){const g=Bl(f);let m="";this.currentDocument&&this.currentDocument!==g&&(o?m=o(g.uri,r):m=g.uri.toString());const v=this.astNodeLocator.getAstNodePath(f);return{$ref:`${m}#${v}`,$refText:p}}else return{$error:(u=(l=r.error)===null||l===void 0?void 0:l.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(Ti(r)){let f;if(a&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&(f!=null&&f.$textRegion)&&(f.$textRegion.documentURI=(h=this.currentDocument)===null||h===void 0?void 0:h.uri.toString())),i&&!e&&(f??(f=Object.assign({},r)),f.$sourceText=(d=r.$cstNode)===null||d===void 0?void 0:d.text),s){f??(f=Object.assign({},r));const p=this.commentProvider.getComment(r);p&&(f.$comment=p.replace(/\r/g,""))}return f??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=jve(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h<u.length;h++){const d=u[h];i9(d)?u[h]=this.reviveReference(e,l,r,d,n):Ti(d)&&this.linkNode(d,r,n,e,l,h)}else i9(u)?e[l]=this.reviveReference(e,l,r,u,n):Ti(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error;if(i.$ref){const l=this.getRefNode(n,i.$ref,a.uriConverter);if(Ti(l))return s||(s=this.nameProvider.getName(l)),{$refText:s??"",ref:l};o=l}if(o){const l={$refText:s??""};return l.error={container:e,property:r,message:o,reference:l},l}else return}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):cu.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):cu.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}}class Obe{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const a=Vl.extname(e),s=this.fileExtensionMap.get(a);if(!s)throw i?new Error(`The service registry contains no services for the extension '${a}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${a}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function U0(t){return{code:t}}var Ky;(function(t){t.all=["fast","slow","built-in"]})(Ky||(Ky={}));class Pbe{constructor(e){this.entries=new jy,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else Og()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Rx(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=oi(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class Bbe{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=rn.CancellationToken.None){const i=e.parseResult,a=[];if(await Sa(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===fs.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Rx(s))throw s;console.error("An error occurred during validation:",s)}return await Sa(n),a}processLexingErrors(e,r,n){var i,a,s;const o=[...e.lexerErrors,...(a=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&a!==void 0?a:[]];for(const l of o){const u=(s=l.severity)!==null&&s!==void 0?s:"error",h={severity:k4(u),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:$be(u),source:this.getSource()};r.push(h)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=Fw(i.token);if(a){const s={severity:k4("error"),range:a,message:i.message,data:U0(fs.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.container,property:a.property,index:a.index,data:{code:fs.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=rn.CancellationToken.None){const i=[],a=(s,o,l)=>{i.push(this.toDiagnostic(s,o,l))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=rn.CancellationToken.None){var a;const s=this.validationRegistry.checksBefore;for(const o of s)await Sa(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}async validateAstNodes(e,r,n,i=rn.CancellationToken.None){await Promise.all(Eh(e).map(async a=>{await Sa(i);const s=this.validationRegistry.getChecks(a.$type,r.categories);for(const o of s)await o(a,n,i)}))}async validateAstAfter(e,r,n,i=rn.CancellationToken.None){var a;const s=this.validationRegistry.checksAfter;for(const o of s)await Sa(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}toDiagnostic(e,r,n){return{message:r,range:Fbe(n),severity:k4(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Fbe(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=bV(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Kve(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function k4(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 $be(t){switch(t){case"error":return U0(fs.LexingError);case"warning":return U0(fs.LexingWarning);case"info":return U0(fs.LexingInfo);case"hint":return U0(fs.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var fs;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(fs||(fs={}));class zbe{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Bl(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>{var l;return s??(s=Ry((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:Ry(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class Vbe{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=rn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Eh(i))await Sa(r),gV(a).filter(s=>!Pm(s)).forEach(s=>{const o=this.createDescription(s);o&&n.push(o)});return n}createDescription(e){const r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;const i=Bl(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:Ry(n),local:Vl.equals(r.documentUri,i)}}}class Gbe{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}}var Ube=AG();class qbe{constructor(e){this._ready=new VS,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Ube.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{const n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var pp;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(pp||(pp={}));class Hbe{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new jy,this.documentPhaseListeners=new jy,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Kr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=rn.CancellationToken.None){var i,a;for(const s of e){const o=s.uri.toString();if(s.state===Kr.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=Kr.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(o);else if(typeof r.validation=="object"){const l=this.buildState.get(o),u=(i=l==null?void 0:l.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((a=r.validation.categories)!==null&&a!==void 0?a:Ky.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:d})},result:l.result}),s.state=Kr.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=Kr.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=rn.CancellationToken.None){this.currentState=Kr.Changed;for(const s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);l.state=Kr.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(s.toString())}const i=oi(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,Kr.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await Sa(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>{var o;return s.state<Kr.Linked||!(!((o=this.buildState.get(s.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),pp.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Kr.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,Kr.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,Kr.ComputedScopes,n,async a=>{const s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,Kr.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,Kr.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,Kr.Validated,n,a=>this.validate(a,n));for(const a of e){const s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){const a=e.filter(o=>o.state<r);for(const o of a)await Sa(n),await i(o),o.state=r,await this.notifyDocumentPhase(o,r,n);const s=e.filter(o=>o.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),pp.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),pp.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=rn.CancellationToken.None),i){const a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Xy):new Promise((a,s)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const u=this.langiumDocuments.getDocument(i);a(u==null?void 0:u.uri)}else a(void 0)}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Xy)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await s(e,n)}catch(o){if(!Rx(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await Sa(n),await s(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;const a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o=typeof s=="object"?s:void 0,l=await a.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const u=this.buildState.get(e.uri.toString());if(u){(n=u.result)!==null&&n!==void 0||(u.result={});const h=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:Ky.all;u.result.validationChecks?u.result.validationChecks.push(...h):u.result.validationChecks=[...h]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}class Wbe{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Rbe,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Bl(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Vl.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),oi(i)}allElements(e,r){let n=oi(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var a;return((a=this.symbolIndex.get(e))!==null&&a!==void 0?a:[]).filter(o=>this.astReflection.isSubtype(o.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=rn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class Ybe{constructor(e){this.initialBuildOptions={},this._ready=new VS,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=rn.CancellationToken.None){const n=await this.performStartup(e);await Sa(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return cu.parse(e.uri)}async traverseFolder(e,r,n,i){const a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){const o=await this.langiumDocuments.getOrCreateDocument(s.uri);i(o)}}}))}includeEntry(e,r,n){const i=Vl.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){const a=Vl.extname(r.uri);return n.includes(a)}return!1}}class Xbe{buildUnexpectedCharactersMessage(e,r,n,i,a){return qw.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return qw.buildUnableToPopLexerModeMessage(e)}}const jbe={mode:"full"};class Kbe{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=a9(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new ia(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=jbe){var n,i,a;const s=this.chevrotainLexer.tokenize(e);return{tokens:s.tokens,errors:s.errors,hidden:(n=s.groups.hidden)!==null&&n!==void 0?n:[],report:(a=(i=this.tokenBuilder).flushLexingReport)===null||a===void 0?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(a9(e))return e;const r=DG(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function Zbe(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function DG(t){return t&&"modes"in t&&"defaultMode"in t}function a9(t){return!Zbe(t)&&!DG(t)}function Qbe(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=Tr.create(0,0));const a=IG(t),s=GS(n),o=t4e({lines:a,position:i,options:s});return s4e({index:0,tokens:o,position:i})}function Jbe(t,e){const r=GS(e),n=IG(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function IG(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Bve)}const s9=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,e4e=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function t4e(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=o===0,u=o===t.lines.length-1;let h=t.lines[o],d=0;if(l&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(h);p&&(d=p.index+p[0].length)}else{const p=(r=t.options.line)===null||r===void 0?void 0:r.exec(h);p&&(d=p.index+p[0].length)}if(u){const p=(n=t.options.end)===null||n===void 0?void 0:n.exec(h);p&&(h=h.substring(0,p.index))}if(h=h.substring(0,a4e(h)),mT(h,d)>=h.length){if(i.length>0){const p=Tr.create(a,s);i.push({type:"break",content:"",range:pr.create(p,p)})}}else{s9.lastIndex=d;const p=s9.exec(h);if(p){const g=p[0],m=p[1],v=Tr.create(a,s+d),y=Tr.create(a,s+d+g.length);i.push({type:"tag",content:m,range:pr.create(v,y)}),d+=g.length,d=mT(h,d)}if(d<h.length){const g=h.substring(d),m=Array.from(g.matchAll(e4e));i.push(...r4e(m,g,a,s+d))}}a++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function r4e(t,e,r,n){const i=[];if(t.length===0){const a=Tr.create(r,n),s=Tr.create(r,n+e.length);i.push({type:"text",content:e,range:pr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:pr.create(Tr.create(r,a+n),Tr.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:pr.create(Tr.create(r,a+h+n),Tr.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:pr.create(Tr.create(r,a+n),Tr.create(r,a+n+s.length))})}return i}const n4e=/\S/,i4e=/\s*$/;function mT(t,e){const r=t.substring(e).match(n4e);return r?e+r.index:t.length}function a4e(t){const e=t.match(i4e);if(e&&typeof e.index=="number")return e.index}function s4e(t){var e,r,n,i;const a=Tr.create(t.position.line,t.position.character);if(t.tokens.length===0)return new o9([],pr.create(a,a));const s=[];for(;t.index<t.tokens.length;){const u=o4e(t,s[s.length-1]);u&&s.push(u)}const o=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:a,l=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:a;return new o9(s,pr.create(o,l))}function o4e(t,e){const r=t.tokens[t.index];if(r.type==="tag")return OG(t,!1);if(r.type==="text"||r.type==="inline-tag")return MG(t);l4e(r,e),t.index++}function l4e(t,e){if(e){const r=new BG("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function MG(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(c4e(t)),n=e,e=t.tokens[t.index];return new vT(i,pr.create(r.range.start,n.range.end))}function c4e(t){return t.tokens[t.index].type==="inline-tag"?OG(t,!0):PG(t)}function OG(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=PG(t);return new A4(n,new vT([a],a.range),e,pr.create(r.range.start,a.range.end))}else{const a=MG(t);return new A4(n,a,e,pr.create(r.range.start,a.range.end))}else{const a=r.range;return new A4(n,new vT([],a),e,a)}}function PG(t){const e=t.tokens[t.index++];return new BG(e.content,e.range)}function GS(t){if(!t)return GS({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:C4(e,!0),end:C4(r,!1),line:C4(n,!0)}}function C4(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Tx(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class o9{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=l9(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=l9(r)+i}return r.trim()}}class A4{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
1241
1241
|
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r,n;return(n=(r=e==null?void 0:e.renderTag)===null||r===void 0?void 0:r.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=u4e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
|
|
1242
1242
|
${r}`),this.inline?`{${i}}`:i}}function u4e(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const a=e.indexOf(" ");let s=e;if(a>0){const l=mT(e,a);s=e.substring(l),e=e.substring(0,a)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:h4e(e,s)}}function h4e(t,e){try{return cu.parse(t,!0),`[${e}](${t})`}catch{return t}}class vT{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
|
|
1243
1243
|
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
|
|
@@ -1962,7 +1962,7 @@ g.classGroup line {
|
|
|
1962
1962
|
Expecting `+Le.join(", ")+", got '"+(this.terminals_[Ne]||Ne)+"'":ze="Parse error on line "+(oe+1)+": Unexpected "+(Ne==W?"end of input":"'"+(this.terminals_[Ne]||Ne)+"'"),this.parseError(ze,{text:H.match,token:this.terminals_[Ne]||Ne,line:H.yylineno,loc:Z,expected:Le})}if(Ve[0]instanceof Array&&Ve.length>1)throw new Error("Parse Error: multiple actions possible at state: "+me+", token: "+Ne);switch(Ve[0]){case 1:F.push(Ne),q.push(H.yytext),Y.push(H.yylloc),F.push(Ve[1]),Ne=null,pe=H.yyleng,Q=H.yytext,oe=H.yylineno,Z=H.yylloc;break;case 2:if(Oe=this.productions_[Ve[1]][1],Fe.$=q[q.length-Oe],Fe._$={first_line:Y[Y.length-(Oe||1)].first_line,last_line:Y[Y.length-1].last_line,first_column:Y[Y.length-(Oe||1)].first_column,last_column:Y[Y.length-1].last_column},be&&(Fe._$.range=[Y[Y.length-(Oe||1)].range[0],Y[Y.length-1].range[1]]),Ue=this.performAction.apply(Fe,[Q,pe,oe,K.yy,Ve[1],q,Y].concat(X)),typeof Ue<"u")return Ue;Oe&&(F=F.slice(0,-1*Oe*2),q=q.slice(0,-1*Oe),Y=Y.slice(0,-1*Oe)),F.push(this.productions_[Ve[1]][0]),q.push(Fe.$),Y.push(Fe._$),Ce=ee[F[F.length-2]][F[F.length-1]],F.push(Ce);break;case 3:return!0}}return!0},"parse")},M=function(){var D={EOF:1,parseError:x(function(z,F){if(this.yy.parser)this.yy.parser.parseError(z,F);else throw new Error(z)},"parseError"),setInput:x(function(B,z){return this.yy=z||this.yy||{},this._input=B,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var B=this._input[0];this.yytext+=B,this.yyleng++,this.offset++,this.match+=B,this.matched+=B;var z=B.match(/(?:\r\n?|\n).*/g);return z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),B},"input"),unput:x(function(B){var z=B.length,F=B.split(/(?:\r\n?|\n)/g);this._input=B+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-z),this.offset-=z;var G=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),F.length-1&&(this.yylineno-=F.length-1);var q=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:F?(F.length===G.length?this.yylloc.first_column:0)+G[G.length-F.length].length-F[0].length:this.yylloc.first_column-z},this.options.ranges&&(this.yylloc.range=[q[0],q[0]+this.yyleng-z]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
1963
1963
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(B){this.unput(this.match.slice(B))},"less"),pastInput:x(function(){var B=this.matched.substr(0,this.matched.length-this.match.length);return(B.length>20?"...":"")+B.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var B=this.match;return B.length<20&&(B+=this._input.substr(0,20-B.length)),(B.substr(0,20)+(B.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var B=this.pastInput(),z=new Array(B.length+1).join("-");return B+this.upcomingInput()+`
|
|
1964
1964
|
`+z+"^"},"showPosition"),test_match:x(function(B,z){var F,G,q;if(this.options.backtrack_lexer&&(q={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&&(q.yylloc.range=this.yylloc.range.slice(0))),G=B[0].match(/(?:\r\n?|\n).*/g),G&&(this.yylineno+=G.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:G?G[G.length-1].length-G[G.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+B[0].length},this.yytext+=B[0],this.match+=B[0],this.matches=B,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(B[0].length),this.matched+=B[0],F=this.performAction.call(this,this.yy,this,z,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var Y in q)this[Y]=q[Y];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var B,z,F,G;this._more||(this.yytext="",this.match="");for(var q=this._currentRules(),Y=0;Y<q.length;Y++)if(F=this._input.match(this.rules[q[Y]]),F&&(!z||F[0].length>z[0].length)){if(z=F,G=Y,this.options.backtrack_lexer){if(B=this.test_match(F,q[Y]),B!==!1)return B;if(this._backtrack){z=!1;continue}else return!1}else if(!this.options.flex)break}return z?(B=this.test_match(z,q[G]),B!==!1?B:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
1965
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var z=this.next();return z||this.lex()},"lex"),begin:x(function(z){this.conditionStack.push(z)},"begin"),popState:x(function(){var z=this.conditionStack.length-1;return z>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(z){return z=this.conditionStack.length-1-Math.abs(z||0),z>=0?this.conditionStack[z]:"INITIAL"},"topState"),pushState:x(function(z){this.begin(z)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(z,F,G,q){switch(G){case 0:return 41;case 1:return 48;case 2:return 49;case 3:return 50;case 4:return 51;case 5:break;case 6:break;case 7:return 5;case 8:break;case 9:break;case 10:break;case 11:break;case 12:return this.pushState("SCALE"),17;case 13:return 18;case 14: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 20:this.popState();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 32:return this.pushState("SCALE"),17;case 33:return 18;case 34:this.popState();break;case 35:this.pushState("STATE");break;case 36:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 37:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 38:return this.popState(),F.yytext=F.yytext.slice(0,-10).trim(),27;case 39:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),F.yytext=F.yytext.slice(0,-10).trim(),27;case 42:return 48;case 43:return 49;case 44:return 50;case 45:return 51;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:return this.popState(),"ID";case 49:this.popState();break;case 50:return"STATE_DESCR";case 51:return 19;case 52:this.popState();break;case 53:return this.popState(),this.pushState("struct"),20;case 54:break;case 55:return this.popState(),21;case 56:break;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 62:break;case 63:return"NOTE_TEXT";case 64:return this.popState(),"ID";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),F.yytext=F.yytext.substr(2).trim(),31;case 67:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return F.yytext=F.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 77:return 5;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 D}();N.lexer=M;function O(){this.yy={}}return x(O,"Parser"),O.prototype=N,N.Parser=O,new O}();MT.parser=MT;var lq=MT,r6e="TB",cq="TB",I9="dir",rv="state",OT="relation",n6e="classDef",i6e="style",a6e="applyClass",gp="default",uq="divider",hq="fill:none",dq="fill: #333",fq="c",pq="text",gq="normal",B4="rect",F4="rectWithTitle",s6e="stateStart",o6e="stateEnd",M9="divider",O9="roundedWithTitle",l6e="note",c6e="noteGroup",Hg="statediagram",u6e="state",h6e=`${Hg}-${u6e}`,mq="transition",d6e="note",f6e="note-edge",p6e=`${mq} ${f6e}`,g6e=`${Hg}-${d6e}`,m6e="cluster",v6e=`${Hg}-${m6e}`,y6e="cluster-alt",x6e=`${Hg}-${y6e}`,vq="parent",yq="note",b6e="state",fk="----",w6e=`${fk}${yq}`,P9=`${fk}${vq}`,xq=x((t,e=cq)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),T6e=x(function(t,e){return e.db.getClasses()},"getClasses"),E6e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=we();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Ig(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["barb"],o.diagramId=e,await kg(o,l);const u=8;Zt.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Mg(l,u,Hg,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),S6e={getClasses:T6e,draw:E6e,getDir:xq},nv=new Map,vl=0;function iv(t="",e=0,r="",n=fk){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${b6e}-${t}${i}-${e}`}x(iv,"stateDomId");var k6e=x((t,e,r,n,i,a,s,o)=>{ie.trace("items",e),e.forEach(l=>{switch(l.stmt){case rv:Z0(t,l,r,n,i,a,s,o);break;case gp:Z0(t,l,r,n,i,a,s,o);break;case OT:{Z0(t,l.state1,r,n,i,a,s,o),Z0(t,l.state2,r,n,i,a,s,o);const u={id:"edge"+vl,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:hq,labelStyle:"",label:it.sanitizeText(l.description,we()),arrowheadStyle:dq,labelpos:fq,labelType:pq,thickness:gq,classes:mq,look:s};i.push(u),vl++}break}})},"setupDoc"),B9=x((t,e=cq)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function K0(t,e,r){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{if(r.get(i)){const a=r.get(i);e.cssCompiledStyles=[...e.cssCompiledStyles,...a.styles]}}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(K0,"insertOrUpdateNode");function bq(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(bq,"getClassesFromDbInfo");function wq(t){return(t==null?void 0:t.styles)??[]}x(wq,"getStylesFromDbInfo");var Z0=x((t,e,r,n,i,a,s,o)=>{var f,p;const l=e.id,u=r.get(l),h=bq(u),d=wq(u);if(ie.info("dataFetcher parsedItem",e,u,d),l!=="root"){let g=B4;e.start===!0?g=s6e:e.start===!1&&(g=o6e),e.type!==gp&&(g=e.type),nv.get(l)||nv.set(l,{id:l,shape:g,description:it.sanitizeText(l,we()),cssClasses:`${h} ${h6e}`,cssStyles:d});const m=nv.get(l);e.description&&(Array.isArray(m.description)?(m.shape=F4,m.description.push(e.description)):((f=m.description)==null?void 0:f.length)>0?(m.shape=F4,m.description===l?m.description=[e.description]:m.description=[m.description,e.description]):(m.shape=B4,m.description=e.description),m.description=it.sanitizeTextOrArray(m.description,we())),((p=m.description)==null?void 0:p.length)===1&&m.shape===F4&&(m.type==="group"?m.shape=O9:m.shape=B4),!m.type&&e.doc&&(ie.info("Setting cluster for XCX",l,B9(e)),m.type="group",m.isGroup=!0,m.dir=B9(e),m.shape=e.type===uq?M9:O9,m.cssClasses=`${m.cssClasses} ${v6e} ${a?x6e:""}`);const v={labelStyle:"",shape:m.shape,label:m.description,cssClasses:m.cssClasses,cssCompiledStyles:[],cssStyles:m.cssStyles,id:l,dir:m.dir,domId:iv(l,vl),type:m.type,isGroup:m.type==="group",padding:8,rx:10,ry:10,look:s};if(v.shape===M9&&(v.label=""),t&&t.id!=="root"&&(ie.trace("Setting node ",l," to be child of its parent ",t.id),v.parentId=t.id),v.centerLabel=!0,e.note){const y={labelStyle:"",shape:l6e,label:e.note.text,cssClasses:g6e,cssStyles:[],cssCompilesStyles:[],id:l+w6e+"-"+vl,domId:iv(l,vl,yq),type:m.type,isGroup:m.type==="group",padding:we().flowchart.padding,look:s,position:e.note.position},b=l+P9,w={labelStyle:"",shape:c6e,label:e.note.text,cssClasses:m.cssClasses,cssStyles:[],id:l+P9,domId:iv(l,vl,vq),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};vl++,w.id=b,y.parentId=b,K0(n,w,o),K0(n,y,o),K0(n,v,o);let T=l,E=y.id;e.note.position==="left of"&&(T=y.id,E=l),i.push({id:T+"-"+E,start:T,end:E,arrowhead:"none",arrowTypeEnd:"",style:hq,labelStyle:"",classes:p6e,arrowheadStyle:dq,labelpos:fq,labelType:pq,thickness:gq,look:s})}else K0(n,v,o)}e.doc&&(ie.trace("Adding nodes children "),k6e(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),C6e=x(()=>{nv.clear(),vl=0},"reset"),PT="[*]",F9="start",$9=PT,z9="end",V9="color",G9="fill",A6e="bgFill",_6e=",";function BT(){return new Map}x(BT,"newClassesList");var U9=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Z1=x(t=>JSON.parse(JSON.stringify(t)),"clone"),Vc,Ac=(Vc=class{constructor(e){xt(this,"version");xt(this,"nodes",[]);xt(this,"edges",[]);xt(this,"rootDoc",[]);xt(this,"classes",BT());xt(this,"documents",{root:U9()});xt(this,"currentDocument",this.documents.root);xt(this,"startEndCount",0);xt(this,"dividerCnt",0);xt(this,"getAccTitle",Kn);xt(this,"setAccTitle",Bn);xt(this,"getAccDescription",Qn);xt(this,"setAccDescription",Zn);xt(this,"setDiagramTitle",di);xt(this,"getDiagramTitle",Gn);this.clear(),this.version=e,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}setRootDoc(e){ie.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(e,r,n){if(r.stmt===OT)this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);else if(r.stmt===rv&&(r.id==="[*]"?(r.id=n?e.id+"_start":e.id+"_end",r.start=n):r.id=r.id.trim()),r.doc){const i=[];let a=[],s;for(s=0;s<r.doc.length;s++)if(r.doc[s].type===uq){const o=Z1(r.doc[s]);o.doc=Z1(a),i.push(o),a=[]}else a.push(r.doc[s]);if(i.length>0&&a.length>0){const o={stmt:rv,id:JO(),type:"divider",doc:Z1(a)};i.push(Z1(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(e){let r;e.doc?r=e.doc:r=e,ie.info(r),this.clear(!0),ie.info("Extract initial document:",r),r.forEach(s=>{switch(ie.warn("Statement",s.stmt),s.stmt){case rv:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles);break;case OT:this.addRelation(s.state1,s.state2,s.description);break;case n6e:this.addStyleClass(s.id.trim(),s.classes);break;case i6e:{const o=s.id.trim().split(","),l=s.styleClass.split(",");o.forEach(u=>{let h=this.getState(u);if(h===void 0){const d=u.trim();this.addState(d),h=this.getState(d)}h.styles=l.map(d=>{var f;return(f=d.replace(/;/g,""))==null?void 0:f.trim()})})}break;case a6e:this.setCssClass(s.id.trim(),s.styleClass);break}});const n=this.getStates(),a=we().look;C6e(),Z0(void 0,this.getRootDocV2(),n,this.nodes,this.edges,!0,a,this.classes),this.nodes.forEach(s=>{if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+s.id+"]");s.label=s.label[0]}})}addState(e,r=gp,n=null,i=null,a=null,s=null,o=null,l=null){const u=e==null?void 0:e.trim();if(this.currentDocument.states.has(u)?(this.currentDocument.states.get(u).doc||(this.currentDocument.states.get(u).doc=n),this.currentDocument.states.get(u).type||(this.currentDocument.states.get(u).type=r)):(ie.info("Adding state ",u,i),this.currentDocument.states.set(u,{id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]})),i&&(ie.info("Setting state description",u,i),typeof i=="string"&&this.addDescription(u,i.trim()),typeof i=="object"&&i.forEach(h=>this.addDescription(u,h.trim()))),a){const h=this.currentDocument.states.get(u);h.note=a,h.note.text=it.sanitizeText(h.note.text,we())}s&&(ie.info("Setting state classes",u,s),(typeof s=="string"?[s]:s).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ie.info("Setting state styles",u,o),(typeof o=="string"?[o]:o).forEach(d=>this.setStyle(u,d.trim()))),l&&(ie.info("Setting state styles",u,o),(typeof l=="string"?[l]:l).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:U9()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=BT(),e||Vn()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ie.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(e=""){let r=e;return e===PT&&(this.startEndCount++,r=`${F9}${this.startEndCount}`),r}startTypeIfNeeded(e="",r=gp){return e===PT?F9:r}endIdIfNeeded(e=""){let r=e;return e===$9&&(this.startEndCount++,r=`${z9}${this.startEndCount}`),r}endTypeIfNeeded(e="",r=gp){return e===$9?z9:r}addRelationObjs(e,r,n){let i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:it.sanitizeText(n,we())})}addRelation(e,r,n){if(typeof e=="object")this.addRelationObjs(e,r,n);else{const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,title:it.sanitizeText(n,we())})}}addDescription(e,r){const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;n.descriptions.push(it.sanitizeText(i,we()))}cleanupLabel(e){return e.substring(0,1)===":"?e.substr(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r!=null&&r.split(_6e).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(V9).exec(i)){const o=a.replace(G9,A6e).replace(V9,G9);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{let i=this.getState(n);if(i===void 0){const a=n.trim();this.addState(a),i=this.getState(a)}i.classes.push(r)})}setStyle(e,r){const n=this.getState(e);n!==void 0&&n.styles.push(r)}setTextStyle(e,r){const n=this.getState(e);n!==void 0&&n.textStyles.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===I9)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??r6e}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:I9,value:e})}trimColon(e){return e&&e[0]===":"?e.substr(1).trim():e.trim()}getData(){const e=we();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:xq(this.getRootDocV2())}}getConfig(){return we().state}},x(Vc,"StateDB"),xt(Vc,"relationType",{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}),Vc),L6e=x(t=>`
|
|
1965
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var z=this.next();return z||this.lex()},"lex"),begin:x(function(z){this.conditionStack.push(z)},"begin"),popState:x(function(){var z=this.conditionStack.length-1;return z>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(z){return z=this.conditionStack.length-1-Math.abs(z||0),z>=0?this.conditionStack[z]:"INITIAL"},"topState"),pushState:x(function(z){this.begin(z)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(z,F,G,q){switch(G){case 0:return 41;case 1:return 48;case 2:return 49;case 3:return 50;case 4:return 51;case 5:break;case 6:break;case 7:return 5;case 8:break;case 9:break;case 10:break;case 11:break;case 12:return this.pushState("SCALE"),17;case 13:return 18;case 14: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 20:this.popState();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 32:return this.pushState("SCALE"),17;case 33:return 18;case 34:this.popState();break;case 35:this.pushState("STATE");break;case 36:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 37:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 38:return this.popState(),F.yytext=F.yytext.slice(0,-10).trim(),27;case 39:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),F.yytext=F.yytext.slice(0,-10).trim(),27;case 42:return 48;case 43:return 49;case 44:return 50;case 45:return 51;case 46:this.pushState("STATE_STRING");break;case 47:return this.pushState("STATE_ID"),"AS";case 48:return this.popState(),"ID";case 49:this.popState();break;case 50:return"STATE_DESCR";case 51:return 19;case 52:this.popState();break;case 53:return this.popState(),this.pushState("struct"),20;case 54:break;case 55:return this.popState(),21;case 56:break;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 62:break;case 63:return"NOTE_TEXT";case 64:return this.popState(),"ID";case 65:return this.popState(),this.pushState("NOTE_TEXT"),24;case 66:return this.popState(),F.yytext=F.yytext.substr(2).trim(),31;case 67:return this.popState(),F.yytext=F.yytext.slice(0,-8).trim(),31;case 68:return 6;case 69:return 6;case 70:return 16;case 71:return 54;case 72:return 24;case 73:return F.yytext=F.yytext.trim(),14;case 74:return 15;case 75:return 28;case 76:return 55;case 77:return 5;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 D}();N.lexer=M;function O(){this.yy={}}return x(O,"Parser"),O.prototype=N,N.Parser=O,new O}();MT.parser=MT;var lq=MT,r6e="TB",cq="TB",I9="dir",rv="state",OT="relation",n6e="classDef",i6e="style",a6e="applyClass",gp="default",uq="divider",hq="fill:none",dq="fill: #333",fq="c",pq="text",gq="normal",B4="rect",F4="rectWithTitle",s6e="stateStart",o6e="stateEnd",M9="divider",O9="roundedWithTitle",l6e="note",c6e="noteGroup",Hg="statediagram",u6e="state",h6e=`${Hg}-${u6e}`,mq="transition",d6e="note",f6e="note-edge",p6e=`${mq} ${f6e}`,g6e=`${Hg}-${d6e}`,m6e="cluster",v6e=`${Hg}-${m6e}`,y6e="cluster-alt",x6e=`${Hg}-${y6e}`,vq="parent",yq="note",b6e="state",fk="----",w6e=`${fk}${yq}`,P9=`${fk}${vq}`,xq=x((t,e=cq)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),T6e=x(function(t,e){return e.db.getClasses()},"getClasses"),E6e=x(async function(t,e,r,n){ie.info("REF0:"),ie.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=we();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Ig(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["barb"],o.diagramId=e,await kg(o,l);const u=8;Zt.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),Mg(l,u,Hg,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),S6e={getClasses:T6e,draw:E6e,getDir:xq},nv=new Map,vl=0;function iv(t="",e=0,r="",n=fk){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${b6e}-${t}${i}-${e}`}x(iv,"stateDomId");var k6e=x((t,e,r,n,i,a,s,o)=>{ie.trace("items",e),e.forEach(l=>{switch(l.stmt){case rv:Z0(t,l,r,n,i,a,s,o);break;case gp:Z0(t,l,r,n,i,a,s,o);break;case OT:{Z0(t,l.state1,r,n,i,a,s,o),Z0(t,l.state2,r,n,i,a,s,o);const u={id:"edge"+vl,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:hq,labelStyle:"",label:it.sanitizeText(l.description,we()),arrowheadStyle:dq,labelpos:fq,labelType:pq,thickness:gq,classes:mq,look:s};i.push(u),vl++}break}})},"setupDoc"),B9=x((t,e=cq)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function K0(t,e,r){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{if(r.get(i)){const a=r.get(i);e.cssCompiledStyles=[...e.cssCompiledStyles,...a.styles]}}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(K0,"insertOrUpdateNode");function bq(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(bq,"getClassesFromDbInfo");function wq(t){return(t==null?void 0:t.styles)??[]}x(wq,"getStylesFromDbInfo");var Z0=x((t,e,r,n,i,a,s,o)=>{var f,p;const l=e.id,u=r.get(l),h=bq(u),d=wq(u);if(ie.info("dataFetcher parsedItem",e,u,d),l!=="root"){let g=B4;e.start===!0?g=s6e:e.start===!1&&(g=o6e),e.type!==gp&&(g=e.type),nv.get(l)||nv.set(l,{id:l,shape:g,description:it.sanitizeText(l,we()),cssClasses:`${h} ${h6e}`,cssStyles:d});const m=nv.get(l);e.description&&(Array.isArray(m.description)?(m.shape=F4,m.description.push(e.description)):((f=m.description)==null?void 0:f.length)>0?(m.shape=F4,m.description===l?m.description=[e.description]:m.description=[m.description,e.description]):(m.shape=B4,m.description=e.description),m.description=it.sanitizeTextOrArray(m.description,we())),((p=m.description)==null?void 0:p.length)===1&&m.shape===F4&&(m.type==="group"?m.shape=O9:m.shape=B4),!m.type&&e.doc&&(ie.info("Setting cluster for XCX",l,B9(e)),m.type="group",m.isGroup=!0,m.dir=B9(e),m.shape=e.type===uq?M9:O9,m.cssClasses=`${m.cssClasses} ${v6e} ${a?x6e:""}`);const v={labelStyle:"",shape:m.shape,label:m.description,cssClasses:m.cssClasses,cssCompiledStyles:[],cssStyles:m.cssStyles,id:l,dir:m.dir,domId:iv(l,vl),type:m.type,isGroup:m.type==="group",padding:8,rx:10,ry:10,look:s};if(v.shape===M9&&(v.label=""),t&&t.id!=="root"&&(ie.trace("Setting node ",l," to be child of its parent ",t.id),v.parentId=t.id),v.centerLabel=!0,e.note){const y={labelStyle:"",shape:l6e,label:e.note.text,cssClasses:g6e,cssStyles:[],cssCompilesStyles:[],id:l+w6e+"-"+vl,domId:iv(l,vl,yq),type:m.type,isGroup:m.type==="group",padding:we().flowchart.padding,look:s,position:e.note.position},b=l+P9,w={labelStyle:"",shape:c6e,label:e.note.text,cssClasses:m.cssClasses,cssStyles:[],id:l+P9,domId:iv(l,vl,vq),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};vl++,w.id=b,y.parentId=b,K0(n,w,o),K0(n,y,o),K0(n,v,o);let T=l,E=y.id;e.note.position==="left of"&&(T=y.id,E=l),i.push({id:T+"-"+E,start:T,end:E,arrowhead:"none",arrowTypeEnd:"",style:hq,labelStyle:"",classes:p6e,arrowheadStyle:dq,labelpos:fq,labelType:pq,thickness:gq,look:s})}else K0(n,v,o)}e.doc&&(ie.trace("Adding nodes children "),k6e(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),C6e=x(()=>{nv.clear(),vl=0},"reset"),PT="[*]",F9="start",$9=PT,z9="end",V9="color",G9="fill",A6e="bgFill",_6e=",";function BT(){return new Map}x(BT,"newClassesList");var U9=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Z1=x(t=>JSON.parse(JSON.stringify(t)),"clone"),Vc,Ac=(Vc=class{constructor(e){wt(this,"version");wt(this,"nodes",[]);wt(this,"edges",[]);wt(this,"rootDoc",[]);wt(this,"classes",BT());wt(this,"documents",{root:U9()});wt(this,"currentDocument",this.documents.root);wt(this,"startEndCount",0);wt(this,"dividerCnt",0);wt(this,"getAccTitle",Kn);wt(this,"setAccTitle",Bn);wt(this,"getAccDescription",Qn);wt(this,"setAccDescription",Zn);wt(this,"setDiagramTitle",di);wt(this,"getDiagramTitle",Gn);this.clear(),this.version=e,this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}setRootDoc(e){ie.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}getRootDoc(){return this.rootDoc}docTranslator(e,r,n){if(r.stmt===OT)this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);else if(r.stmt===rv&&(r.id==="[*]"?(r.id=n?e.id+"_start":e.id+"_end",r.start=n):r.id=r.id.trim()),r.doc){const i=[];let a=[],s;for(s=0;s<r.doc.length;s++)if(r.doc[s].type===uq){const o=Z1(r.doc[s]);o.doc=Z1(a),i.push(o),a=[]}else a.push(r.doc[s]);if(i.length>0&&a.length>0){const o={stmt:rv,id:JO(),type:"divider",doc:Z1(a)};i.push(Z1(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}}getRootDocV2(){return this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},!0),{id:"root",doc:this.rootDoc}}extract(e){let r;e.doc?r=e.doc:r=e,ie.info(r),this.clear(!0),ie.info("Extract initial document:",r),r.forEach(s=>{switch(ie.warn("Statement",s.stmt),s.stmt){case rv:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles);break;case OT:this.addRelation(s.state1,s.state2,s.description);break;case n6e:this.addStyleClass(s.id.trim(),s.classes);break;case i6e:{const o=s.id.trim().split(","),l=s.styleClass.split(",");o.forEach(u=>{let h=this.getState(u);if(h===void 0){const d=u.trim();this.addState(d),h=this.getState(d)}h.styles=l.map(d=>{var f;return(f=d.replace(/;/g,""))==null?void 0:f.trim()})})}break;case a6e:this.setCssClass(s.id.trim(),s.styleClass);break}});const n=this.getStates(),a=we().look;C6e(),Z0(void 0,this.getRootDocV2(),n,this.nodes,this.edges,!0,a,this.classes),this.nodes.forEach(s=>{if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error("Group nodes can only have label. Remove the additional description for node ["+s.id+"]");s.label=s.label[0]}})}addState(e,r=gp,n=null,i=null,a=null,s=null,o=null,l=null){const u=e==null?void 0:e.trim();if(this.currentDocument.states.has(u)?(this.currentDocument.states.get(u).doc||(this.currentDocument.states.get(u).doc=n),this.currentDocument.states.get(u).type||(this.currentDocument.states.get(u).type=r)):(ie.info("Adding state ",u,i),this.currentDocument.states.set(u,{id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]})),i&&(ie.info("Setting state description",u,i),typeof i=="string"&&this.addDescription(u,i.trim()),typeof i=="object"&&i.forEach(h=>this.addDescription(u,h.trim()))),a){const h=this.currentDocument.states.get(u);h.note=a,h.note.text=it.sanitizeText(h.note.text,we())}s&&(ie.info("Setting state classes",u,s),(typeof s=="string"?[s]:s).forEach(d=>this.setCssClass(u,d.trim()))),o&&(ie.info("Setting state styles",u,o),(typeof o=="string"?[o]:o).forEach(d=>this.setStyle(u,d.trim()))),l&&(ie.info("Setting state styles",u,o),(typeof l=="string"?[l]:l).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:U9()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=BT(),e||Vn()}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ie.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(e=""){let r=e;return e===PT&&(this.startEndCount++,r=`${F9}${this.startEndCount}`),r}startTypeIfNeeded(e="",r=gp){return e===PT?F9:r}endIdIfNeeded(e=""){let r=e;return e===$9&&(this.startEndCount++,r=`${z9}${this.startEndCount}`),r}endTypeIfNeeded(e="",r=gp){return e===$9?z9:r}addRelationObjs(e,r,n){let i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:it.sanitizeText(n,we())})}addRelation(e,r,n){if(typeof e=="object")this.addRelationObjs(e,r,n);else{const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,title:it.sanitizeText(n,we())})}}addDescription(e,r){const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;n.descriptions.push(it.sanitizeText(i,we()))}cleanupLabel(e){return e.substring(0,1)===":"?e.substr(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r!=null&&r.split(_6e).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(V9).exec(i)){const o=a.replace(G9,A6e).replace(V9,G9);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setCssClass(e,r){e.split(",").forEach(n=>{let i=this.getState(n);if(i===void 0){const a=n.trim();this.addState(a),i=this.getState(a)}i.classes.push(r)})}setStyle(e,r){const n=this.getState(e);n!==void 0&&n.styles.push(r)}setTextStyle(e,r){const n=this.getState(e);n!==void 0&&n.textStyles.push(r)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===I9)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??r6e}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:I9,value:e})}trimColon(e){return e&&e[0]===":"?e.substr(1).trim():e.trim()}getData(){const e=we();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:xq(this.getRootDocV2())}}getConfig(){return we().state}},x(Vc,"StateDB"),wt(Vc,"relationType",{AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}),Vc),L6e=x(t=>`
|
|
1966
1966
|
defs #statediagram-barbEnd {
|
|
1967
1967
|
fill: ${t.transitionColor};
|
|
1968
1968
|
stroke: ${t.transitionColor};
|
|
@@ -2389,7 +2389,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
2389
2389
|
*/var OH=function(e,r){this.recycle(e,r)};function Qf(){return!1}function am(){return!0}OH.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Qf,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?am:Qf):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=am;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=am;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=am,this.stopPropagation()},isDefaultPrevented:Qf,isPropagationStopped:Qf,isImmediatePropagationStopped:Qf};var PH=/^([^.]+)(\.(?:[^.]+))?$/,HCe=".*",BH={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},zR=Object.keys(BH),WCe={};function jx(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:WCe,e=arguments.length>1?arguments[1]:void 0,r=0;r<zR.length;r++){var n=zR[r];this[n]=t[n]||BH[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Yl=jx.prototype,FH=function(e,r,n,i,a,s,o){an(i)&&(a=i,i=null),o&&(s==null?s=o:s=Ut({},s,o));for(var l=$r(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var h=l[u];if(!Gl(h)){var d=h.match(PH);if(d){var f=d[1],p=d[2]?d[2]:null,g=r(e,h,f,p,i,a,s);if(g===!1)break}}}},VR=function(e,r){return e.addEventFields(e.context,r),new OH(r.type,r)},YCe=function(e,r,n){if(rSe(n)){r(e,n);return}else if(vr(n)){r(e,VR(e,n));return}for(var i=$r(n)?n:n.split(/\s+/),a=0;a<i.length;a++){var s=i[a];if(!Gl(s)){var o=s.match(PH);if(o){var l=o[1],u=o[2]?o[2]:null,h=VR(e,{type:l,namespace:u,target:e.context});r(e,h)}}}};Yl.on=Yl.addListener=function(t,e,r,n,i){return FH(this,function(a,s,o,l,u,h,d){an(h)&&a.listeners.push({event:s,callback:h,type:o,namespace:l,qualifier:u,conf:d})},t,e,r,n,i),this};Yl.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};Yl.removeListener=Yl.off=function(t,e,r,n){var i=this;this.emitting!==0&&(this.listeners=OSe(this.listeners));for(var a=this.listeners,s=function(u){var h=a[u];FH(i,function(d,f,p,g,m,v){if((h.type===p||t==="*")&&(!g&&h.namespace!==".*"||h.namespace===g)&&(!m||d.qualifierCompare(h.qualifier,m))&&(!v||h.callback===v))return a.splice(u,1),!1},t,e,r,n)},o=a.length-1;o>=0;o--)s(o);return this};Yl.removeAllListeners=function(){return this.removeListener("*")};Yl.emit=Yl.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,$r(e)||(e=[e]),YCe(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===HCe)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&BSe(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<i;l++)o();a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,e)},t),this.emitting--,this};var XCe={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Yg(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},sm=function(e){return Ft(e)?new Hl(e):e},$H={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new jx(XCe,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var i=sm(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n)}return this},removeListener:function(e,r,n){for(var i=sm(r),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(e,i,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var i=sm(r),a=0;a<this.length;a++){var s=this[a];s.emitter().one(e,i,n)}return this},once:function(e,r,n){for(var i=sm(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var i=this[n];i.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Er.eventAliasesOn($H);var zH={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):r.push(i)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Ft(e)||Aa(e))return new Hl(e).filter(this);if(an(e)){for(var n=this.spawn(),i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){Ft(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var i=this[n],a=e.has(i);a||r.push(i)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ft(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),i=this,a=e,s=this.length<e.length,o=s?i:a,l=s?a:i,u=0;u<o.length;u++){var h=o[u];l.has(h)&&n.push(h)}return n},xor:function(e){var r=this._private.cy;Ft(e)&&(e=r.$(e));var n=this.spawn(),i=this,a=e,s=function(l,u){for(var h=0;h<l.length;h++){var d=l[h],f=d._private.data.id,p=u.hasElementWithId(f);p||n.push(d)}};return s(i,a),s(a,i),n},diff:function(e){var r=this._private.cy;Ft(e)&&(e=r.$(e));var n=this.spawn(),i=this.spawn(),a=this.spawn(),s=this,o=e,l=function(h,d,f){for(var p=0;p<h.length;p++){var g=h[p],m=g._private.data.id,v=d.hasElementWithId(m);v?a.merge(g):f.push(g)}};return l(s,o,n),l(o,s,i),{left:n,right:i,both:a}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ft(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=this.spawnSelf(),a=0;a<e.length;a++){var s=e[a],o=!this.has(s);o&&i.push(s)}return i},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ft(e)){var i=e;e=n.mutableElements().filter(i)}for(var a=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!a.has(l);if(u){var h=this.length++;this[h]=o,a.set(l,{ele:o,index:h})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),i=this._private,a=i.map;this[e]=void 0,a.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ft(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);n.push(o)}return n},reduce:function(e,r){for(var n=r,i=this,a=0;a<i.length;a++)n=e(n,i[a],a,i);return n},max:function(e,r){for(var n=-1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l>n&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l<n&&(n=l,i=o)}return{value:n,ele:i}}},xr=zH;xr.u=xr["|"]=xr["+"]=xr.union=xr.or=xr.add;xr["\\"]=xr["!"]=xr["-"]=xr.difference=xr.relativeComplement=xr.subtract=xr.not;xr.n=xr["&"]=xr["."]=xr.and=xr.intersection=xr.intersect;xr["^"]=xr["(+)"]=xr["(-)"]=xr.symmetricDifference=xr.symdiff=xr.xor;xr.fnFilter=xr.filterFn=xr.stdFilter=xr.filter;xr.complement=xr.abscomp=xr.absoluteComplement;var jCe={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},VH=function(e,r){var n=e.cy(),i=n.hasCompoundNodes();function a(h){var d=h.pstyle("z-compound-depth");return d.value==="auto"?i?h.zDepth():0:d.value==="bottom"?-1:d.value==="top"?Sk:0}var s=a(e)-a(r);if(s!==0)return s;function o(h){var d=h.pstyle("z-index-compare");return d.value==="auto"&&h.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},d2={forEach:function(e,r){if(an(e))for(var n=this.length,i=0;i<n;i++){var a=this[i],s=r?e.apply(r,[a,i,this]):e(a,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],i=this.length;r==null&&(r=i),e==null&&(e=0),e<0&&(e=i+e),r<0&&(r=i+r);for(var a=e;a>=0&&a<r&&a<i;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!an(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(VH)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var i=r.data.parent?e.parents().size():0;return e.isParent()?i:Sk-1}else{var a=r.source,s=r.target,o=a.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};d2.each=d2.forEach;var KCe=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":zn(Symbol))!=e&&zn(Symbol.iterator)!=e;r&&(d2[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return Vq({next:function(){return a<s?i.value=n[a++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};KCe();var ZCe=fi({nodeDimensionsIncludeLabels:!1}),cv={layoutDimensions:function(e){e=ZCe(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var i=this.nodes().filter(function(E){return!E.isParent()}),a=this.cy(),s=r.eles,o=function(k){return k.id()},l=Qd(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(k,S,L){var A={x:S.x1+S.w/2,y:S.y1+S.h/2},R={x:(L.x-A.x)*k,y:(L.y-A.y)*k};return{x:A.x+R.x,y:A.y+R.y}},h=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!h)return null;for(var k=ua(),S=0;S<i.length;S++){var L=i[S],A=l(L,S);pke(k,A.x,A.y)}return k},f=d(),p=Qd(function(E,k){var S=l(E,k);if(h){var L=Math.abs(r.spacingFactor);S=u(L,f,S)}return r.transform!=null&&(S=r.transform(E,S)),S},o);if(r.animate){for(var g=0;g<i.length;g++){var m=i[g],v=p(m,g),y=r.animateFilter==null||r.animateFilter(m,g);if(y){var b=m.animation({position:v,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else m.position(v)}if(r.fit){var w=a.animation({fit:{boundingBox:s.boundingBoxAt(p),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var T=a.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(T)}e.animations.forEach(function(E){return E.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Sf.all(e.animations.map(function(E){return E.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(p),r.fit&&a.fit(r.eles,r.padding),r.zoom!=null&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Ut({},e,{eles:this}))}};cv.createLayout=cv.makeLayout=cv.layout;function GH(t,e,r){var n=r._private,i=n.styleCache=n.styleCache||[],a;return(a=i[t])!=null||(a=i[t]=e(r)),a}function Kx(t,e){return t=hu(t),function(n){return GH(t,e,n)}}function Zx(t,e){t=hu(t);var r=function(i){return e.call(i)};return function(){var i=this[0];if(i)return GH(t,r,i)}}var ui={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),i=r.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(a){return a._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(i){r(i),i.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var i=r.hasCompoundNodes(),a=this;e=!!(e||e===void 0),i&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return e?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(vr(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(Ft(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s<a.length;s++){var o=a[s];i.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var u=a[l];i.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,a=n.pstyle("opacity").value;if(!r)return a;var s=i.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;a=u*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function a3(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var i=0;i<n.length;i++){var a=n[i];if(!e(a))return!1}return!0}function Pk(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var a=this[0],s=i.hasCompoundNodes();if(a){var o=a._private;if(!e(a))return!1;if(a.isNode())return!s||a3(a,n);var l=o.source,u=o.target;return r(l)&&(!s||a3(l,r))&&(l===u||r(u)&&(!s||a3(u,r)))}}}var kf=Kx("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});ui.takesUpSpace=Zx("takesUpSpace",Pk({ok:kf}));var QCe=Kx("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&kf(t)}),JCe=Kx("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&kf(t)});ui.interactive=Zx("interactive",Pk({ok:QCe,parentOk:JCe,edgeOkViaNode:kf}));ui.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var e8e=Kx("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&kf(t)}),t8e=kf;ui.visible=Zx("visible",Pk({ok:e8e,edgeOkViaNode:t8e}));ui.hidden=function(){var t=this[0];if(t)return!t.visible()};ui.isBundledBezier=Zx("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});ui.bypass=ui.css=ui.style;ui.renderedCss=ui.renderedStyle;ui.removeBypass=ui.removeCss=ui.removeStyle;ui.pstyle=ui.parsedStyle;var _l={};function GR(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],i=e[1];this.on(t.event,n,i)}else if(e.length===1&&an(e[0])){var a=e[0];this.on(t.event,a)}else if(e.length===0||e.length===1&&$r(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],h=l._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[t.field]=t.value,h&&r.push(l))}var f=this.spawn(r);f.updateStyle(),f.emit(t.event),s&&f.emit(s)}return this}}function Cf(t){_l[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},_l[t.on]=GR({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),_l[t.off]=GR({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Cf({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Cf({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Cf({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Cf({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});_l.deselect=_l.unselect;_l.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Cf({field:"active",on:"activate",off:"unactivate"});Cf({field:"pannable",on:"panify",off:"unpanify"});_l.inactive=function(){var t=this[0];if(t)return!t._private.active};var ki={},UR=function(e){return function(n){for(var i=this,a=[],s=0;s<i.length;s++){var o=i[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),h=0;h<u.length;h++){var d=u[h],f=d.source(),p=d.target();if(e.noIncomingEdges&&p===o&&f!==o||e.noOutgoingEdges&&f===o&&p!==o){l=!0;break}}l||a.push(o)}}return this.spawn(a,!0).filter(n)}},qR=function(e){return function(r){for(var n=this,i=[],a=0;a<n.length;a++){var s=n[a];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],h=u.source(),d=u.target();e.outgoing&&h===s?(i.push(u),i.push(d)):e.incoming&&d===s&&(i.push(u),i.push(h))}}return this.spawn(i,!0).filter(r)}},HR=function(e){return function(r){for(var n=this,i=[],a={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],h=u.id();a[h]||(a[h]=!0,i.push(u),o=!0)}if(!o)break;n=s}return this.spawn(i,!0).filter(r)}};ki.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Ut(ki,{roots:UR({noIncomingEdges:!0}),leaves:UR({noOutgoingEdges:!0}),outgoers:ja(qR({outgoing:!0}),"outgoers"),successors:HR({outgoing:!0}),incomers:ja(qR({incoming:!0}),"incomers"),predecessors:HR({})});Ut(ki,{neighborhood:ja(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(),u=o.target(),h=i===l?u:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ki.neighbourhood=ki.neighborhood;ki.closedNeighbourhood=ki.closedNeighborhood;ki.openNeighbourhood=ki.openNeighborhood;Ut(ki,{source:ja(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:ja(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:WR({attr:"source"}),targets:WR({attr:"target"})});function WR(t){return function(r){for(var n=[],i=0;i<this.length;i++){var a=this[i],s=a._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}Ut(ki,{edgesWith:ja(YR(),"edgesWith"),edgesTo:ja(YR({thisIsSrc:!0}),"edgesTo")});function YR(t){return function(r){var n=[],i=this._private.cy,a=t||{};Ft(r)&&(r=i.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],h=u._private.data,d=this.hasElementWithId(h.source)&&r.hasElementWithId(h.target),f=r.hasElementWithId(h.source)&&this.hasElementWithId(h.target),p=d||f;p&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!d||a.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}Ut(ki,{connectedEdges:ja(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];if(i.isNode())for(var a=i._private.edges,s=0;s<a.length;s++){var o=a[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:ja(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:ja(XR(),"parallelEdges"),codirectedEdges:ja(XR({codirected:!0}),"codirectedEdges")});function XR(t){var e={codirected:!1};return t=Ut({},e,t),function(n){for(var i=[],a=this.edges(),s=t,o=0;o<a.length;o++)for(var l=a[o],u=l._private,h=u.source,d=h._private.data.id,f=u.data.target,p=h._private.edges,g=0;g<p.length;g++){var m=p[g],v=m._private.data,y=v.target,b=v.source,w=y===f&&b===d,T=d===y&&f===b;(s.codirected&&w||!s.codirected&&(w||T))&&i.push(m)}return this.spawn(i,!0).filter(n)}}Ut(ki,{components:function(e){var r=this,n=r.cy(),i=n.collection(),a=e==null?r.nodes():e.nodes(),s=[];e!=null&&a.empty()&&(a=e.sources());var o=function(h,d){i.merge(h),a.unmerge(h),d.merge(h)};if(a.empty())return r.spawn();var l=function(){var h=n.collection();s.push(h);var d=a[0];o(d,h),r.bfs({directed:!1,roots:d,visit:function(p){return o(p,h)}}),h.forEach(function(f){f.connectedEdges().forEach(function(p){r.has(p)&&h.has(p.source())&&h.has(p.target())&&h.merge(p)})})};do l();while(a.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ki.componentsOf=ki.components;var hi=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){nn("A collection must have a reference to the core");return}var a=new Oo,s=!1;if(!r)r=[];else if(r.length>0&&vr(r[0])&&!Yg(r[0])){s=!0;for(var o=[],l=new Ef,u=0,h=r.length;u<h;u++){var d=r[u];d.data==null&&(d.data={});var f=d.data;if(f.id==null)f.id=iH();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var p=new Vx(e,d,!1);o.push(p),l.add(f.id)}r=o}this.length=0;for(var g=0,m=r.length;g<m;g++){var v=r[g][0];if(v!=null){var y=v._private.data.id;(!n||!a.has(y))&&(n&&a.set(y,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new Oo,T=this.eles,E=0;E<T.length;E++){var k=T[E];w.set(k.id(),{index:E,ele:k})}}},n&&(this._private.map=a),s&&!i&&this.restore()},qr=Vx.prototype=hi.prototype=Object.create(Array.prototype);qr.instanceString=function(){return"collection"};qr.spawn=function(t,e){return new hi(this.cy(),t,e)};qr.spawnSelf=function(){return this.spawn(this)};qr.cy=function(){return this._private.cy};qr.renderer=function(){return this._private.cy.renderer()};qr.element=function(){return this[0]};qr.collection=function(){return qq(this)?this:new hi(this._private.cy,[this])};qr.unique=function(){return new hi(this._private.cy,this,!0)};qr.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};qr.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new hi(e)};qr.$id=qr.getElementById;qr.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};qr.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};qr.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};qr.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(vr(t)){if(r.startBatch(),t.data){e.data(t.data);var i=n.data;if(e.isEdge()){var a=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=i.source&&(s.source=""+o,a=!0),l!=null&&l!=i.target&&(s.target=""+l,a=!0),a&&(e=e.move(s))}else{var u="parent"in t.data,h=t.data.parent;u&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var d=function(m,v,y){var b=t[m];b!=null&&b!==n[m]&&(b?e[v]():e[y]())};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"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var f={data:Ys(n.data),position:Ys(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};f.classes="";var p=0;return n.classes.forEach(function(g){return f.classes+=p++===0?g:" "+g}),f}}};qr.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};qr.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],i=n.json(),a=new Vx(t,i,!1);e.push(a)}return new hi(t,e)};qr.copy=qr.clone;qr.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l<u;l++){var h=r[l];e&&!h.removed()||(h.isNode()?a.push(h):s.push(h))}o=a.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var p=o[d],g=p._private,m=g.data;if(p.clearTraversalCache(),!(!e&&!g.removed)){if(m.id===void 0)m.id=iH();else if(gt(m.id))m.id=""+m.id;else if(Gl(m.id)||!Ft(m.id)){nn("Can not create element with invalid string ID `"+m.id+"`"),f();continue}else if(n.hasElementWithId(m.id)){nn("Can not create second element with ID `"+m.id+"`"),f();continue}}var v=m.id;if(p.isNode()){var y=g.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(p.isEdge()){for(var b=p,w=["source","target"],T=w.length,E=!1,k=0;k<T;k++){var S=w[k],L=m[S];gt(L)&&(L=m[S]=""+m[S]),L==null||L===""?(nn("Can not create edge `"+v+"` with unspecified "+S),E=!0):n.hasElementWithId(L)||(nn("Can not create edge `"+v+"` with nonexistant "+S+" `"+L+"`"),E=!0)}if(E){f();continue}var A=n.getElementById(m.source),R=n.getElementById(m.target);A.same(R)?A._private.edges.push(b):(A._private.edges.push(b),R._private.edges.push(b)),b._private.source=A,b._private.target=R}g.map=new Oo,g.map.set(v,{ele:p,index:0}),g.removed=!1,e&&n.addToPool(p)}for(var C=0;C<a.length;C++){var I=a[C],P=I._private.data;gt(P.parent)&&(P.parent=""+P.parent);var _=P.parent,N=_!=null;if(N||I._private.parent){var M=I._private.parent?n.collection().merge(I._private.parent):n.getElementById(_);if(M.empty())P.parent=void 0;else if(M[0].removed())Cr("Node added with missing parent, reference to parent removed"),P.parent=void 0,I._private.parent=null;else{for(var O=!1,D=M;!D.empty();){if(I.same(D)){O=!0,P.parent=void 0;break}D=D.parent()}O||(M[0]._private.children.push(I),I._private.parent=M[0],i.hasCompoundNodes=!0)}}}if(o.length>0){for(var B=o.length===r.length?r:new hi(n,o),z=0;z<B.length;z++){var F=B[z];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}var G;i.hasCompoundNodes?G=n.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()):G=B,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?B.emitAndNotify("add"):e&&B.emit("add")}return r};qr.removed=function(){var t=this[0];return t&&t._private.removed};qr.inside=function(){var t=this[0];return t&&!t._private.removed};qr.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(_){for(var N=_._private.edges,M=0;M<N.length;M++)l(N[M])}function o(_){for(var N=_._private.children,M=0;M<N.length;M++)l(N[M])}function l(_){var N=i[_.id()];e&&_.removed()||N||(i[_.id()]=!0,_.isNode()?(n.push(_),s(_),o(_)):n.unshift(_))}for(var u=0,h=r.length;u<h;u++){var d=r[u];l(d)}function f(_,N){var M=_._private.edges;Ul(M,N),_.clearTraversalCache()}function p(_){_.clearTraversalCache()}var g=[];g.ids={};function m(_,N){N=N[0],_=_[0];var M=_._private.children,O=_.id();Ul(M,N),N._private.parent=null,g.ids[O]||(g.ids[O]=!0,g.push(_))}r.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var v=0;v<n.length;v++){var y=n[v];if(y.isEdge()){var b=y.source()[0],w=y.target()[0];f(b,y),f(w,y);for(var T=y.parallelEdges(),E=0;E<T.length;E++){var k=T[E];p(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var S=y.parent();S.length!==0&&m(S,y)}e&&(y._private.removed=!0)}var L=a._private.elements;a._private.hasCompoundNodes=!1;for(var A=0;A<L.length;A++){var R=L[A];if(R.isParent()){a._private.hasCompoundNodes=!0;break}}var C=new hi(this.cy(),n);C.size()>0&&(t?C.emitAndNotify("remove"):e&&C.emit("remove"));for(var I=0;I<g.length;I++){var P=g[I];(!e||!P.removed())&&P.updateStyle()}return C};qr.move=function(t){var e=this._private.cy,r=this,n=!1,i=!1,a=function(g){return g==null?g:""+g};if(t.source!==void 0||t.target!==void 0){var s=a(t.source),o=a(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(n,i),r.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],m=g._private.data;g.isEdge()&&(l&&(m.source=s),u&&(m.target=o))}r.restore(n,i)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var h=a(t.parent),d=h===null||e.hasElementWithId(h);if(d){var f=h===null?void 0:h;e.batch(function(){var p=r.remove(n,i);p.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var m=r[g],v=m._private.data;m.isNode()&&(v.parent=f)}p.restore(n,i)}),r.emitAndNotify("move")}}return this};[gH,dCe,lv,Al,tf,_Ce,Xx,qCe,$H,zH,jCe,d2,cv,ui,_l,ki].forEach(function(t){Ut(qr,t)});var r8e={add:function(e){var r,n=this;if(Aa(e)){var i=e;if(i._private.cy===n)r=i.restore();else{for(var a=[],s=0;s<i.length;s++){var o=i[s];a.push(o.json())}r=new hi(n,a)}}else if($r(e)){var l=e;r=new hi(n,l)}else if(vr(e)&&($r(e.nodes)||$r(e.edges))){for(var u=e,h=[],d=["nodes","edges"],f=0,p=d.length;f<p;f++){var g=d[f],m=u[g];if($r(m))for(var v=0,y=m.length;v<y;v++){var b=Ut({group:g},m[v]);h.push(b)}}r=new hi(n,h)}else{var w=e;r=new Vx(n,w).collection()}return r},remove:function(e){if(!Aa(e)){if(Ft(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function n8e(t,e,r,n){var i=4,a=.001,s=1e-7,o=10,l=11,u=1/(l-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||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 f=h?new Float32Array(l):new Array(l);function p(R,C){return 1-3*C+3*R}function g(R,C){return 3*C-6*R}function m(R){return 3*R}function v(R,C,I){return((p(C,I)*R+g(C,I))*R+m(C))*R}function y(R,C,I){return 3*p(C,I)*R*R+2*g(C,I)*R+m(C)}function b(R,C){for(var I=0;I<i;++I){var P=y(C,t,r);if(P===0)return C;var _=v(C,t,r)-R;C-=_/P}return C}function w(){for(var R=0;R<l;++R)f[R]=v(R*u,t,r)}function T(R,C,I){var P,_,N=0;do _=C+(I-C)/2,P=v(_,t,r)-R,P>0?I=_:C=_;while(Math.abs(P)>s&&++N<o);return _}function E(R){for(var C=0,I=1,P=l-1;I!==P&&f[I]<=R;++I)C+=u;--I;var _=(R-f[I])/(f[I+1]-f[I]),N=C+_*u,M=y(N,t,r);return M>=a?b(R,N):M===0?N:T(R,C,C+u)}var k=!1;function S(){k=!0,(t!==e||r!==n)&&w()}var L=function(C){return k||S(),t===e&&r===n?C:C===0?0:C===1?1:v(E(C),e,n)};L.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return L.toString=function(){return A},L}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var i8e=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}}(),Vr=function(e,r,n,i){var a=n8e(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},uv={linear:function(e,r,n){return e+(r-e)*n},ease:Vr(.25,.1,.25,1),"ease-in":Vr(.42,0,1,1),"ease-out":Vr(0,0,.58,1),"ease-in-out":Vr(.42,0,.58,1),"ease-in-sine":Vr(.47,0,.745,.715),"ease-out-sine":Vr(.39,.575,.565,1),"ease-in-out-sine":Vr(.445,.05,.55,.95),"ease-in-quad":Vr(.55,.085,.68,.53),"ease-out-quad":Vr(.25,.46,.45,.94),"ease-in-out-quad":Vr(.455,.03,.515,.955),"ease-in-cubic":Vr(.55,.055,.675,.19),"ease-out-cubic":Vr(.215,.61,.355,1),"ease-in-out-cubic":Vr(.645,.045,.355,1),"ease-in-quart":Vr(.895,.03,.685,.22),"ease-out-quart":Vr(.165,.84,.44,1),"ease-in-out-quart":Vr(.77,0,.175,1),"ease-in-quint":Vr(.755,.05,.855,.06),"ease-out-quint":Vr(.23,1,.32,1),"ease-in-out-quint":Vr(.86,0,.07,1),"ease-in-expo":Vr(.95,.05,.795,.035),"ease-out-expo":Vr(.19,1,.22,1),"ease-in-out-expo":Vr(1,0,0,1),"ease-in-circ":Vr(.6,.04,.98,.335),"ease-out-circ":Vr(.075,.82,.165,1),"ease-in-out-circ":Vr(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return uv.linear;var i=i8e(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":Vr};function jR(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function KR(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Yu(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=KR(t,i),o=KR(e,i);if(gt(s)&>(o))return jR(a,s,o,r,n);if($r(s)&&$r(o)){for(var l=[],u=0;u<o.length;u++){var h=s[u],d=o[u];if(h!=null&&d!=null){var f=jR(a,h,d,r,n);l.push(f)}else l.push(d)}return l}}function a8e(t,e,r,n){var i=!n,a=t._private,s=e._private,o=s.easing,l=s.startTime,u=n?t:t.cy(),h=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=uv.linear;else{var d;if(Ft(o)){var f=h.parse("transition-timing-function",o);d=f.value}else d=o;var p,g;Ft(d)?(p=d,g=[]):(p=d[1],g=d.slice(2).map(function(B){return+B})),g.length>0?(p==="spring"&&g.push(s.duration),s.easingImpl=uv[p].apply(null,g)):s.easingImpl=uv[p]}var m=s.easingImpl,v;if(s.duration===0?v=1:v=(r-l)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&i&&!t.locked()){var w={};Jf(y.x,b.x)&&(w.x=Yu(y.x,b.x,v,m)),Jf(y.y,b.y)&&(w.y=Yu(y.y,b.y,v,m)),t.position(w)}var T=s.startPan,E=s.pan,k=a.pan,S=E!=null&&n;S&&(Jf(T.x,E.x)&&(k.x=Yu(T.x,E.x,v,m)),Jf(T.y,E.y)&&(k.y=Yu(T.y,E.y,v,m)),t.emit("pan"));var L=s.startZoom,A=s.zoom,R=A!=null&&n;R&&(Jf(L,A)&&(a.zoom=rg(a.minZoom,Yu(L,A,v,m),a.maxZoom)),t.emit("zoom")),(S||R)&&t.emit("viewport");var C=s.style;if(C&&C.length>0&&i){for(var I=0;I<C.length;I++){var P=C[I],_=P.name,N=P,M=s.startStyle[_],O=h.properties[M.name],D=Yu(M,N,v,m,O);h.overrideBypass(t,_,D)}t.emit("style")}}return s.progress=v,v}function Jf(t,e){return t==null||e==null?!1:gt(t)&>(e)?!0:!!(t&&e)}function s8e(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function ZR(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var v=g.shift();v&&p.push(v)}for(var y=function(k){for(var S=k.length-1;S>=0;S--){var L=k[S];L()}k.splice(0,k.length)},b=p.length-1;b>=0;b--){var w=p[b],T=w._private;if(T.stopped){p.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||s8e(h,w,t),a8e(h,w,t,d),T.applying&&(T.applying=!1),y(T.frames),T.step!=null&&T.step(t),w.completed()&&(p.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s<r.length;s++){var o=r[s],l=i(o);a=a||l}var u=i(e,!0);(a||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var o8e={animate:Er.animate(),animation:Er.animation(),animated:Er.animated(),clearQueue:Er.clearQueue(),delay:Er.delay(),delayAnimation:Er.delayAnimation(),stop:Er.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&o2(function(a){ZR(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){ZR(s,e)},n.beforeRenderPriorities.animations):r()}},l8e={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&Yg(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},om=function(e){return Ft(e)?new Hl(e):e},UH={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new jx(l8e,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,om(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,om(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,om(r),n),this},once:function(e,r,n){return this.emitter().one(e,om(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Er.eventAliasesOn(UH);var jT={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};jT.jpeg=jT.jpg;var hv={layout:function(e){var r=this;if(e==null){nn("Layout options must be specified to make a layout");return}if(e.name==null){nn("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){nn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Ft(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(Ut({},e,{cy:r,eles:a}));return s}};hv.createLayout=hv.makeLayout=hv.layout;var c8e={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],s=e[a],o=r.getElementById(a);o.data(s)}})}},u8e=fi({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:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),KT={renderTo:function(e,r,n,i){var a=this._private.renderer;return a.renderTo(e,r,n,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){nn("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Cr("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 i=u8e(e);i.cy=r,r._private.renderer=new n(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};KT.invalidateDimensions=KT.resize;var dv={collection:function(e,r){return Ft(e)?this.$(e):Aa(e)?e.collection():$r(e)?(r||(r={}),new hi(this,e,r.unique,r.removed)):new hi(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};dv.elements=dv.filter=dv.$;var ei={},mp="t",h8e="f";ei.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a<t.length;a++){var s=t[a],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};ei.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 u=r[l],h=t[l]===mp,d=e[l]===mp,f=h!==d,p=u.mappedProperties.length>0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m<g.length;m++){for(var v=g[m],y=v.name,b=!1,w=l+1;w<r.length;w++){var T=r[w],E=e[w]===mp;if(E&&(b=T.properties[v.name]!=null,b))break}!o[y]&&!b&&(o[y]=!0,s.push(y))}}}return n[i]=s,s};ei.getContextMeta=function(t){for(var e=this,r="",n,i=t._private.styleCxtKey||"",a=0;a<e.length;a++){var s=e[a],o=s.selector&&s.selector.matches(t);o?r+=mp:r+=h8e}return n=e.getPropertiesDiff(i,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};ei.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},a=0;a<r.length;a++){var s=r[a],o=e[a]===mp;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];i[u.name]=u}}return n[e]=i,i};ei.applyContextStyle=function(t,e,r){for(var n=this,i=t.diffPropNames,a={},s=n.types,o=0;o<i.length;o++){var l=i[o],u=e[l],h=r.pstyle(l);if(!u)if(h)h.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(h!==u){if(u.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===u.value){var d=h.mapping,f=d.fnValue=u.value(r);if(f===d.prevFnValue)continue}var p=a[l]={prev:h};n.applyParsedProperty(r,u),p.next=r.pstyle(l),p.next&&p.next.bypass&&(p.next=p.next.bypassed)}}return{diffProps:a}};ei.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,i=r.propertyGroupKeys,a=function(H,K,ne){return r.getPropertiesHash(H,K,ne)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<i.length;u++){var h=i[u];e.styleKeys[h]=[Rc,ih]}for(var d=function(H,K){return e.styleKeys[K][0]=Jp(H,e.styleKeys[K][0])},f=function(H,K){return e.styleKeys[K][1]=eg(H,e.styleKeys[K][1])},p=function(H,K){d(H,K),f(H,K)},g=function(H,K){for(var ne=0;ne<H.length;ne++){var Z=H.charCodeAt(ne);d(Z,K),f(Z,K)}},m=2e9,v=function(H){return-128<H&&H<128&&Math.floor(H)!==H?m-(H*1024|0):H},y=0;y<n.length;y++){var b=n[y],w=l[b];if(w!=null){var T=this.properties[b],E=T.type,k=T.groupKey,S=void 0;T.hashOverride!=null?S=T.hashOverride(t,w):w.pfValue!=null&&(S=w.pfValue);var L=T.enums==null?w.value:null,A=S!=null,R=L!=null,C=A||R,I=w.units;if(E.number&&C&&!E.multiple){var P=A?S:L;p(v(P),k),!A&&I!=null&&g(I,k)}else g(w.strValue,k)}}for(var _=[Rc,ih],N=0;N<i.length;N++){var M=i[N],O=e.styleKeys[M];_[0]=Jp(O[0],_[0]),_[1]=eg(O[1],_[1])}e.styleKey=RSe(_[0],_[1]);var D=e.styleKeys;e.labelDimsKey=hl(D.labelDimensions);var B=a(t,["label"],D.labelDimensions);if(e.labelKey=hl(B),e.labelStyleKey=hl(J1(D.commonLabel,B)),!o){var z=a(t,["source-label"],D.labelDimensions);e.sourceLabelKey=hl(z),e.sourceLabelStyleKey=hl(J1(D.commonLabel,z));var F=a(t,["target-label"],D.labelDimensions);e.targetLabelKey=hl(F),e.targetLabelStyleKey=hl(J1(D.commonLabel,F))}if(o){var G=e.styleKeys,q=G.nodeBody,Y=G.nodeBorder,ee=G.nodeOutline,Q=G.backgroundImage,oe=G.compound,pe=G.pie,j=G.stripe,W=[q,Y,ee,Q,oe,pe,j].filter(function(X){return X!=null}).reduce(J1,[Rc,ih]);e.nodeKey=hl(W),e.hasPie=pe!=null&&pe[0]!==Rc&&pe[1]!==ih,e.hasStripe=j!=null&&j[0]!==Rc&&j[1]!==ih}return s!==e.styleKey};ei.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,e.hasStripe=null};ei.applyParsedProperty=function(t,e){var r=this,n=e,i=t._private.style,a,s=r.types,o=r.properties[n.name].type,l=n.bypass,u=i[n.name],h=u&&u.bypass,d=t._private,f="mapping",p=function(q){return q==null?null:q.pfValue!=null?q.pfValue:q.value},g=function(){var q=p(u),Y=p(n);r.checkTriggers(t,n.name,q,Y)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return i[n.name]=void 0,g(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,g(),!0):!1:(g(),!0);if(n.deleteBypass)return u?u.bypass?(i[n.name]=u.bypassed,g(),!0):!1:(g(),!0);var m=function(){Cr("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var v=n.field.split("."),y=d.data,b=0;b<v.length&&y;b++){var w=v[b];y=y[w]}if(y==null)return m(),!1;var T;if(gt(y)){var E=n.fieldMax-n.fieldMin;E===0?T=0:T=(y-n.fieldMin)/E}else return Cr("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var k=n.valueMin[0],S=n.valueMax[0],L=n.valueMin[1],A=n.valueMax[1],R=n.valueMin[2],C=n.valueMax[2],I=n.valueMin[3]==null?1:n.valueMin[3],P=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(k+(S-k)*T),Math.round(L+(A-L)*T),Math.round(R+(C-R)*T),Math.round(I+(P-I)*T)];a={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(o.number){var N=n.valueMin+(n.valueMax-n.valueMin)*T;a=this.parse(n.name,N,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var M=n.field.split("."),O=d.data,D=0;D<M.length&&O;D++){var B=M[D];O=O[B]}if(O!=null&&(a=this.parse(n.name,O,n.bypass,f)),!a)return m(),!1;a.mapping=n,n=a;break}case s.fn:{var z=n.value,F=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=F,F==null)return Cr("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,F,n.bypass,f),!a)return Cr("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;a.mapping=Ys(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};ei.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)n._private.style={};else for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];l!=null&&(l.bypass?l.bypassed=null:i[o]=null)}}};ei.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};ei.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,u=0;u<i.length;u++){var h=i[u],d=t.pstyle(h),f=e[h];if(f){var p=f.prev,g=p,m=f.next!=null?f.next:d,v=!1,y=void 0,b=1e-6;g&&(gt(g.pfValue)&>(m.pfValue)?(v=m.pfValue-g.pfValue,y=g.pfValue+b*v):gt(g.value)&>(m.value)?(v=m.value-g.value,y=g.value+b*v):$r(g.value)&&$r(m.value)&&(v=g.value[0]!==m.value[0]||g.value[1]!==m.value[1]||g.value[2]!==m.value[2],y=g.strValue),v&&(o[h]=m.strValue,this.applyBypass(t,h,y),l=!0))}}if(!l)return;n.transitioning=!0,new Sf(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).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)};ei.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};ei.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};ei.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};ei.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};ei.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};ei.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var e1={};e1.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<i.properties.length;o++){var l=i.properties[o],u=l.name,h=this.parse(u,r,!0);h&&a.push(h)}}else if(Ft(e)){var d=this.parse(e,r,!0);d&&a.push(d)}else if(vr(e)){var f=e;n=r;for(var p=Object.keys(f),g=0;g<p.length;g++){var m=p[g],v=f[m];if(v===void 0&&(v=f[$x(m)]),v!==void 0){var y=this.parse(m,v,!0);y&&a.push(y)}}}else return!1;if(a.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var T=t[w],E={},k=void 0,S=0;S<a.length;S++){var L=a[S];if(n){var A=T.pstyle(L.name);k=E[L.name]={prev:A}}b=this.applyParsedProperty(T,Ys(L))||b,n&&(k.next=T.pstyle(L.name))}b&&this.updateStyleHints(T),n&&this.updateTransitions(T,E,s)}return b};e1.overrideBypass=function(t,e,r){e=Tk(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,u=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(i,e,r):(a.value=r,a.pfValue!=null&&(a.pfValue=r),o?a.strValue="rgb("+r.join(",")+")":l?a.strValue=r.join(" "):a.strValue=""+r,this.updateStyleHints(i)),this.checkTriggers(i,e,u,r)}};e1.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};e1.removeBypasses=function(t,e,r){for(var n=!0,i=0;i<t.length;i++){for(var a=t[i],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],h=a.pstyle(u.name);if(!(!h||!h.bypass)){var d="",f=this.parse(l,d,!0),p=s[u.name]={prev:h};this.applyParsedProperty(a,f),p.next=a.pstyle(u.name)}}this.updateStyleHints(a),r&&this.updateTransitions(a,s,n)}};var Bk={};Bk.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};Bk.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)};var eo={};eo.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};eo.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},i=0;i<r.properties.length;i++){var a=r.properties[i],s=r.getStylePropertyValue(t,a.name,e);s!=null&&(n[a.name]=s,n[$x(a.name)]=s)}return n}};eo.getIndexedStyle=function(t,e,r,n){var i=t.pstyle(e)[r][n];return i??t.cy().style().getDefaultProperty(e)[r][0]};eo.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var i=n.properties[e];i.alias&&(i=i.pointsTo);var a=i.type,s=t.pstyle(i.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&a.number&&o!=null&>(o)){var h=t.cy().zoom(),d=function(v){return v*h},f=function(v,y){return d(v)+y},p=$r(o),g=p?l.every(function(m){return m!=null}):l!=null;return g?p?o.map(function(m,v){return f(m,l[v])}).join(" "):f(o,l):p?o.map(function(m){return Ft(m)?m:""+d(m)}).join(" "):""+d(o)}else if(u!=null)return u}return null}};eo.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n],a=i.name,s=t.pstyle(a);s!==void 0&&(vr(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(r[a]=s)}return r};eo.getPropsList=function(t){var e=this,r=[],n=t,i=e.properties;if(n)for(var a=Object.keys(n),s=0;s<a.length;s++){var o=a[s],l=n[o],u=i[o]||i[Tk(o)],h=this.parse(u.name,l);h&&r.push(h)}return r};eo.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),i,a,s,o,l,u;for(l=0;l<e.length;l++)if(i=e[l],a=t.pstyle(i,!1),a!=null)if(a.pfValue!=null)n[0]=Jp(o,n[0]),n[1]=eg(o,n[1]);else for(s=a.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=Jp(o,n[0]),n[1]=eg(o,n[1]);return n};eo.getPropertiesHash=eo.getNonDefaultPropertiesHash;var Qx={};Qx.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],u=a[l];e.css(l,u)}}return e};Qx.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Qx.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};var Fk={};Fk.appendFromString=function(t){var e=this,r=this,n=""+t,i,a,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>i.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Cr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new Hl(d);if(f.invalid){Cr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var v=a.match(/^\s*$/);if(v)break;var y=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Cr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=y[0];var b=y[1],w=y[2],T=e.properties[b];if(!T){Cr("Skipping property: Invalid property name in: "+s),l();continue}var E=r.parse(b,w);if(!E){Cr("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:w}),l()}if(g){o();break}r.selector(d);for(var k=0;k<m.length;k++){var S=m[k];r.css(S.name,S.val)}o()}return r};Fk.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var yn={};(function(){var t=On,e=lSe,r=uSe,n=hSe,i=dSe,a=function(X){return"^"+X+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(X){var H=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+i;return"^"+X+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+H+")\\s*\\,\\s*("+H+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];yn.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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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:function(X,H){switch(X.length){case 2:return H[0]!=="deg"&&H[0]!=="rad"&&H[1]!=="deg"&&H[1]!=="rad";case 1:return Ft(X[0])||H[0]==="deg"||H[0]==="rad";default:return!1}}},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:function(X){var H=X.length;return H===1||H===2||H===4}}};var l={zeroNonZero:function(X,H){return(X==null||H==null)&&X!==H||X==0&&H!=0?!0:X!=0&&H==0},any:function(X,H){return X!=H},emptyNonEmpty:function(X,H){var K=Gl(X),ne=Gl(H);return K&&!ne||!K&&ne}},u=yn.types,h=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],p=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],g=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],m=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],v=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(X,H,K){return X===H?!1:K.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],y=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],T=function(X,H){return H.value==="label"?-X.poolIndex():H.pfValue},E=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],k=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],L=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],A=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],R=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(X,H){return X===H?!1:X==="bezier"||H==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],C=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],I=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],P=[];yn.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent}),P.push({name:"pie-hole",type:u.sizeMaybePercent}),P.push({name:"pie-start-angle",type:u.angle});for(var _=1;_<=yn.pieBackgroundN;_++)P.push({name:"pie-"+_+"-background-color",type:u.color}),P.push({name:"pie-"+_+"-background-size",type:u.percent}),P.push({name:"pie-"+_+"-background-opacity",type:u.zeroOneNumber});var N=[];yn.stripeBackgroundN=16,N.push({name:"stripe-size",type:u.sizeMaybePercent}),N.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var M=1;M<=yn.stripeBackgroundN;M++)N.push({name:"stripe-"+M+"-background-color",type:u.color}),N.push({name:"stripe-"+M+"-background-size",type:u.percent}),N.push({name:"stripe-"+M+"-background-opacity",type:u.zeroOneNumber});var O=[],D=yn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(W){D.forEach(function(X){var H=X+"-"+W.name,K=W.type,ne=W.triggersBounds;O.push({name:H,type:K,triggersBounds:ne})})},{});var B=yn.properties=[].concat(m,w,v,y,b,C,g,p,h,d,f,E,k,S,L,P,N,A,R,O,I),z=yn.propertyGroups={behavior:m,transition:w,visibility:v,overlay:y,underlay:b,ghost:C,commonLabel:g,labelDimensions:p,mainLabel:h,sourceLabel:d,targetLabel:f,nodeBody:E,nodeBorder:k,nodeOutline:S,backgroundImage:L,pie:P,stripe:N,compound:A,edgeLine:R,edgeArrow:O,core:I},F=yn.propertyGroupNames={},G=yn.propertyGroupKeys=Object.keys(z);G.forEach(function(W){F[W]=z[W].map(function(X){return X.name}),z[W].forEach(function(X){return X.groupKey=W})});var q=yn.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"}];yn.propertyNames=B.map(function(W){return W.name});for(var Y=0;Y<B.length;Y++){var ee=B[Y];B[ee.name]=ee}for(var Q=0;Q<q.length;Q++){var oe=q[Q],pe=B[oe.pointsTo],j={name:oe.name,alias:!0,pointsTo:pe};B.push(j),B[oe.name]=j}})();yn.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};yn.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Ut({"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","box-select-labels":"no","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=yn.pieBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=yn.stripeBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"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(l,u){return yn.arrowPrefixes.forEach(function(h){var d=h+"-"+u.name,f=u.value;l[d]=f}),l},{})),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};yn.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 Jx={};Jx.parse=function(t,e,r,n){var i=this;if(an(e))return i.parseImplWarn(t,e,r,n);var a=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,l=tH(t,o,s,a),u=i.propCache=i.propCache||[],h;return(h=u[l])||(h=u[l]=i.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(h=Ys(h),h&&(h.value=Ys(h.value))),h};Jx.parseImplWarn=function(t,e,r,n){var i=this.parseImpl(t,e,r,n);return!i&&e!=null&&Cr("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&Cr("The style value of `label` is deprecated for `"+i.name+"`"),i};Jx.parseImpl=function(t,e,r,n){var i=this;t=Tk(t);var a=i.properties[t],s=e,o=i.types;if(!a||e===void 0)return null;a.alias&&(a=a.pointsTo,t=a.name);var l=Ft(e);l&&(e=e.trim());var u=a.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(an(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var h,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Cr("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var v=g.value,y=m.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var w;if(l?w=e.split(/\s+/):$r(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var T=[],E=[],k=[],S="",L=!1,A=0;A<w.length;A++){var R=i.parse(t,w[A],r,"multiple");L=L||Ft(R.value),T.push(R.value),k.push(R.pfValue!=null?R.pfValue:R.value),E.push(R.units),S+=(A>0?" ":"")+R.strValue}return u.validate&&!u.validate(T,E)?null:u.singleEnum&&L?T.length===1&&Ft(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:k,strValue:S,bypass:r,units:E}}var C=function(){for(var j=0;j<u.enums.length;j++){var W=u.enums[j];if(W===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var I,P="px";if(u.units&&(I=u.units),u.implicitUnits&&(P=u.implicitUnits),!u.unitless)if(l){var _="px|em"+(u.allowPercent?"|\\%":"");I&&(_=I);var N=e.match("^("+On+")("+_+")?$");N&&(e=N[1],I=N[2]||P)}else(!I||u.implicitUnits)&&(I=P);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,C();if(u.integer&&!tSe(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var M={name:t,value:e,strValue:""+e+(I||""),units:I,bypass:r};return u.unitless||I!=="px"&&I!=="em"?M.pfValue=e:M.pfValue=I==="px"||!I?e:this.getEmSizeInPixels()*e,(I==="ms"||I==="s")&&(M.pfValue=I==="ms"?e:1e3*e),(I==="deg"||I==="rad")&&(M.pfValue=I==="rad"?e:lke(e)),I==="%"&&(M.pfValue=e/100),M}else if(u.propList){var O=[],D=""+e;if(D!=="none"){for(var B=D.split(/\s*,\s*|\s+/),z=0;z<B.length;z++){var F=B[z].trim();i.properties[F]?O.push(F):Cr("`"+F+"` is not a valid property name")}if(O.length===0)return null}return{name:t,value:O,strValue:O.length===0?"none":O.join(" "),bypass:r}}else if(u.color){var G=Xq(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var q=C();if(q)return q}for(var Y=u.regexes?u.regexes:[u.regex],ee=0;ee<Y.length;ee++){var Q=new RegExp(Y[ee]),oe=Q.exec(e);if(oe)return{name:t,value:u.singleRegexMatchValue?oe[1]:oe,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?C():null};var jn=function(e){if(!(this instanceof jn))return new jn(e);if(!wk(e)){nn("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ci=jn.prototype;Ci.instanceString=function(){return"style"};Ci.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(i){var a=i[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};Ci.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Ci.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};Ci.selector=function(t){var e=t==="core"?null:new Hl(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};Ci.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var i=t.properties[n],a=r[i.name];a===void 0&&(a=r[$x(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Ci.style=Ci.css;Ci.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.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[n].mappedProperties.push(r);var i=!this[n].selector;i&&(this._private.coreStyle[r.name]=r)}return this};Ci.append=function(t){return Hq(t)?t.appendToStyle(this):$r(t)?this.appendFromJson(t):Ft(t)&&this.appendFromString(t),this};jn.fromJson=function(t,e){var r=new jn(t);return r.fromJson(e),r};jn.fromString=function(t,e){return new jn(t).fromString(e)};[ei,e1,Bk,eo,Qx,Fk,yn,Jx].forEach(function(t){Ut(Ci,t)});jn.types=Ci.types;jn.properties=Ci.properties;jn.propertyGroups=Ci.propertyGroups;jn.propertyGroupNames=Ci.propertyGroupNames;jn.propertyGroupKeys=Ci.propertyGroupKeys;var d8e={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return Hq(e)?r.style=e.generateStyle(this):$r(e)?r.style=jn.fromJson(this,e):Ft(e)?r.style=jn.fromString(this,e):r.style=jn(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},f8e="single",pu={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=f8e),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,i,a,s,o;switch(e.length){case 0:return r;case 1:if(Ft(e[0]))return n=e[0],r[n];if(vr(e[0])){if(!this._private.panningEnabled)return this;a=e[0],s=a.x,o=a.y,gt(s)&&(r.x=s),gt(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],i=e[1],(n==="x"||n==="y")&>(i)&&(r[n]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,i=this._private.pan,a,s,o,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:vr(e)&&(o=n[0],l=o.x,u=o.y,gt(l)&&(i.x+=l),gt(u)&&(i.y+=u),this.emit("pan viewport"));break;case 2:a=e,s=r,(a==="x"||a==="y")&>(s)&&(i[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(gt(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ft(e)){var i=e;e=this.$(i)}else if(iSe(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Aa(e)||(e=this.mutableElements());if(!(Aa(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=gt(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var i=e;e=i.min,r=i.max}return gt(e)&>(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):gt(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:gt(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),gt(e)?s=e:vr(e)&&(s=e.level,e.position!=null?a=Gx(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!gt(s)||s===i||a!=null&&(!gt(a.x)||!gt(a.y)))return null;if(a!=null){var l=n,u=i,h=s,d={x:-h/u*(a.x-l.x)+a.x,y:-h/u*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:h,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,i=!0,a=[],s=!1,o=!1;if(!e)return this;if(gt(e.zoom)||(n=!1),vr(e.pan)||(i=!1),!n&&!i)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;gt(u.x)&&(r.pan.x=u.x,o=!1),gt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ft(e)){var n=e;e=this.mutableElements().filter(n)}else Aa(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};pu.centre=pu.center;pu.autolockNodes=pu.autolock;pu.autoungrabifyNodes=pu.autoungrabify;var sg={data:Er.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Er.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Er.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Er.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sg.attr=sg.data;sg.removeAttr=sg.removeData;var og=function(e){var r=this;e=Ut({},e);var n=e.container;n&&!s2(n)&&s2(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=_n!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Ut({name:s?"grid":"null"},o.layout),o.renderer=Ut({name:s?"canvas":"null"},o.renderer);var l=function(g,m,v){return m!==void 0?m:v!==void 0?v:g},u=this._private={container:n,ready:!1,options:o,elements:new hi(this),listeners:[],aniEles:new hi(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:gt(o.zoom)?o.zoom:1,pan:{x:vr(o.pan)&>(o.pan.x)?o.pan.x:0,y:vr(o.pan)&>(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var v=g.some(aSe);if(v)return Sf.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=Ut({},o,o.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(vr(g)||$r(g))&&r.add(g),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",v),r.emit("done")});var b=Ut({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,an(o.ready)&&r.on("ready",o.ready);for(var v=0;v<a.length;v++){var y=a[v];r.on("ready",y)}i&&(i.readies=[]),r.emit("ready")},o.done)})},f2=og.prototype;Ut(f2,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return _n;var r=this._private.container.ownerDocument;return r===void 0||r==null?_n:r.defaultView||_n},mount:function(e){if(e!=null){var r=this,n=r._private,i=n.options;return!s2(e)&&s2(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Ut({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),r.startAnimationLoop(),r.style(i.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ys(this._private.options)},json:function(e){var r=this,n=r._private,i=r.mutableElements(),a=function(T){return r.getElementById(T.id())};if(vr(e)){if(r.startBatch(),e.elements){var s={},o=function(T,E){for(var k=[],S=[],L=0;L<T.length;L++){var A=T[L];if(!A.data.id){Cr("cy.json() cannot handle elements without an ID attribute");continue}var R=""+A.data.id,C=r.getElementById(R);s[R]=!0,C.length!==0?S.push({ele:C,json:A}):(E&&(A.group=E),k.push(A))}r.add(k);for(var I=0;I<S.length;I++){var P=S[I],_=P.ele,N=P.json;_.json(N)}};if($r(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var h=l[u],d=e.elements[h];$r(d)&&o(d,h)}var f=r.collection();i.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?f.merge(w):w.remove()}),f.forEach(function(w){return w.children().move({parent:null})}),f.forEach(function(w){return a(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<p.length;g++){var m=p[g];e[m]!=null&&r[m](e[m])}return r.endBatch(),this}else{var v=!!e,y={};v?y.elements=this.elements().map(function(w){return w.json()}):(y.elements={},i.forEach(function(w){var T=w.group();y.elements[T]||(y.elements[T]=[]),y.elements[T].push(w.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Ys(r.data());var b=n.options;return y.zoomingEnabled=n.zoomingEnabled,y.userZoomingEnabled=n.userZoomingEnabled,y.zoom=n.zoom,y.minZoom=n.minZoom,y.maxZoom=n.maxZoom,y.panningEnabled=n.panningEnabled,y.userPanningEnabled=n.userPanningEnabled,y.pan=Ys(n.pan),y.boxSelectionEnabled=n.boxSelectionEnabled,y.renderer=Ys(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}});f2.$id=f2.getElementById;[r8e,o8e,UH,jT,hv,c8e,KT,dv,d8e,pu,sg].forEach(function(t){Ut(f2,t)});var p8e={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:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},g8e={maximal:!1,acyclic:!1},Xu=function(e){return e.scratch("breadthfirst")},QR=function(e,r){return e.scratch("breadthfirst",r)};function qH(t){this.options=Ut({},p8e,g8e,t)}qH.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(re){return re.isChildless()}),i=r,a=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=e.extent(),u=ua(o?t.boundingBox:{x1:l.x1,y1:l.y1,w:l.w,h:l.h}),h;if(Aa(t.roots))h=t.roots;else if($r(t.roots)){for(var d=[],f=0;f<t.roots.length;f++){var p=t.roots[f],g=e.getElementById(p);d.push(g)}h=e.collection(d)}else if(Ft(t.roots))h=e.$(t.roots);else if(a)h=n.roots();else{var m=r.components();h=e.collection();for(var v=function(){var Ne=m[y],me=Ne.maxDegree(!1),Ve=Ne.filter(function(Ue){return Ue.degree(!1)===me});h=h.add(Ve)},y=0;y<m.length;y++)v()}var b=[],w={},T=function(Ne,me){b[me]==null&&(b[me]=[]);var Ve=b[me].length;b[me].push(Ne),QR(Ne,{index:Ve,depth:me})},E=function(Ne,me){var Ve=Xu(Ne),Ue=Ve.depth,Fe=Ve.index;b[Ue][Fe]=null,Ne.isChildless()&&T(Ne,me)};i.bfs({roots:h,directed:t.directed,visit:function(Ne,me,Ve,Ue,Fe){var _e=Ne[0],Oe=_e.id();_e.isChildless()&&T(_e,Fe),w[Oe]=!0}});for(var k=[],S=0;S<n.length;S++){var L=n[S];w[L.id()]||k.push(L)}var A=function(Ne){for(var me=b[Ne],Ve=0;Ve<me.length;Ve++){var Ue=me[Ve];if(Ue==null){me.splice(Ve,1),Ve--;continue}QR(Ue,{depth:Ne,index:Ve})}},R=function(Ne,me){for(var Ve=Xu(Ne),Ue=Ne.incomers().filter(function(ge){return ge.isNode()&&r.has(ge)}),Fe=-1,_e=Ne.id(),Oe=0;Oe<Ue.length;Oe++){var Ce=Ue[Oe],Le=Xu(Ce);Fe=Math.max(Fe,Le.depth)}if(Ve.depth<=Fe){if(!t.acyclic&&me[_e])return null;var ze=Fe+1;return E(Ne,ze),me[_e]=ze,!0}return!1};if(a&&s){var C=[],I={},P=function(Ne){return C.push(Ne)},_=function(){return C.shift()};for(n.forEach(function(re){return C.push(re)});C.length>0;){var N=_(),M=R(N,I);if(M)N.outgoers().filter(function(re){return re.isNode()&&r.has(re)}).forEach(P);else if(M===null){Cr("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var O=0;if(t.avoidOverlap)for(var D=0;D<n.length;D++){var B=n[D],z=B.layoutDimensions(t),F=z.w,G=z.h;O=Math.max(O,F,G)}var q={},Y=function(Ne){if(q[Ne.id()])return q[Ne.id()];for(var me=Xu(Ne).depth,Ve=Ne.neighborhood(),Ue=0,Fe=0,_e=0;_e<Ve.length;_e++){var Oe=Ve[_e];if(!(Oe.isEdge()||Oe.isParent()||!n.has(Oe))){var Ce=Xu(Oe);if(Ce!=null){var Le=Ce.index,ze=Ce.depth;if(!(Le==null||ze==null)){var ge=b[ze].length;ze<me&&(Ue+=Le/ge,Fe++)}}}}return Fe=Math.max(1,Fe),Ue=Ue/Fe,Fe===0&&(Ue=0),q[Ne.id()]=Ue,Ue},ee=function(Ne,me){var Ve=Y(Ne),Ue=Y(me),Fe=Ve-Ue;return Fe===0?Yq(Ne.id(),me.id()):Fe};t.depthSort!==void 0&&(ee=t.depthSort);for(var Q=b.length,oe=0;oe<Q;oe++)b[oe].sort(ee),A(oe);for(var pe=[],j=0;j<k.length;j++)pe.push(k[j]);var W=function(){for(var Ne=0;Ne<Q;Ne++)A(Ne)};pe.length&&(b.unshift(pe),Q=b.length,W());for(var X=0,H=0;H<Q;H++)X=Math.max(b[H].length,X);var K={x:u.x1+u.w/2,y:u.y1+u.h/2},ne=n.reduce(function(re,Ne){return function(me){return{w:re.w===-1?me.w:(re.w+me.w)/2,h:re.h===-1?me.h:(re.h+me.h)/2}}(Ne.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Z=Math.max(Q===1?0:o?(u.h-t.padding*2-ne.h)/(Q-1):(u.h-t.padding*2-ne.h)/(Q+1),O),be=b.reduce(function(re,Ne){return Math.max(re,Ne.length)},0),ce=function(Ne){var me=Xu(Ne),Ve=me.depth,Ue=me.index;if(t.circle){var Fe=Math.min(u.w/2/Q,u.h/2/Q);Fe=Math.max(Fe,O);var _e=Fe*Ve+Fe-(Q>0&&b[0].length<=3?Fe/2:0),Oe=2*Math.PI/b[Ve].length*Ue;return Ve===0&&b[0].length===1&&(_e=1),{x:K.x+_e*Math.cos(Oe),y:K.y+_e*Math.sin(Oe)}}else{var Ce=b[Ve].length,Le=Math.max(Ce===1?0:o?(u.w-t.padding*2-ne.w)/((t.grid?be:Ce)-1):(u.w-t.padding*2-ne.w)/((t.grid?be:Ce)+1),O),ze={x:K.x+(Ue+1-(Ce+1)/2)*Le,y:K.y+(Ve+1-(Q+1)/2)*Z};return ze}};return r.nodes().layoutPositions(this,t,ce),this};var m8e={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function HH(t){this.options=Ut({},m8e,t)}HH.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f<a.length;f++){var p=a[f],g=p.layoutDimensions(e),m=g.w,v=g.h;d=Math.max(d,m,v)}if(gt(e.radius)?h=e.radius:a.length<=1?h=0:h=Math.min(s.h,s.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(d*d/(y*y+b*b));h=Math.max(w,h)}var T=function(k,S){var L=e.startAngle+S*u*(i?1:-1),A=h*Math.cos(L),R=h*Math.sin(L),C={x:o.x+A,y:o.y+R};return C};return n.nodes().layoutPositions(this,e,T),this};var v8e={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function WH(t){this.options=Ut({},v8e,t)}WH.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h<a.length;h++){var d=a[h],f=void 0;f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}a.updateStyle();for(var p=0;p<a.length;p++){var g=a[p],m=g.layoutDimensions(e);u=Math.max(u,m.w,m.h)}l.sort(function(ne,Z){return Z.value-ne.value});for(var v=e.levelWidth(a),y=[[]],b=y[0],w=0;w<l.length;w++){var T=l[w];if(b.length>0){var E=Math.abs(b[0].value-T.value);E>=v&&(b=[],y.push(b))}b.push(T)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=y.length>0&&y[0].length>1,L=Math.min(s.w,s.h)/2-k,A=L/(y.length+S?1:0);k=Math.min(k,A)}for(var R=0,C=0;C<y.length;C++){var I=y[C],P=e.sweep===void 0?2*Math.PI-2*Math.PI/I.length:e.sweep,_=I.dTheta=P/Math.max(1,I.length-1);if(I.length>1&&e.avoidOverlap){var N=Math.cos(_)-Math.cos(0),M=Math.sin(_)-Math.sin(0),O=Math.sqrt(k*k/(N*N+M*M));R=Math.max(O,R)}I.r=R,R+=k}if(e.equidistant){for(var D=0,B=0,z=0;z<y.length;z++){var F=y[z],G=F.r-B;D=Math.max(D,G)}B=0;for(var q=0;q<y.length;q++){var Y=y[q];q===0&&(B=Y.r),Y.r=B,B+=D}}for(var ee={},Q=0;Q<y.length;Q++)for(var oe=y[Q],pe=oe.dTheta,j=oe.r,W=0;W<oe.length;W++){var X=oe[W],H=e.startAngle+(r?1:-1)*pe*W,K={x:o.x+j*Math.cos(H),y:o.y+j*Math.sin(H)};ee[X.node.id()]=K}return i.nodes().layoutPositions(this,e,function(ne){var Z=ne.id();return ee[Z]}),this};var s3,y8e={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function eb(t){this.options=Ut({},y8e,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),o=e.some(function(u){return u.data("id")===a}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}eb.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?s3=!0:s3=!1;var n=x8e(e,r,t);s3&&w8e(n),t.randomize&&T8e(n);var i=Qo(),a=function(){E8e(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(f){return!(r.stopped||f>=t.numIter||(S8e(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)a(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var f=t.eles.nodes(),p=XH(n,t,f);f.layoutPositions(r,t,p)}},l=0,u=!0;if(t.animate===!0){var h=function(){for(var f=0;u&&f<t.refresh;)u=s(l),l++,f++;if(!u)eN(n,t),o();else{var p=Qo();p-i>=t.animationThreshold&&a(),o2(h)}};h()}else{for(;u;)u=s(l),l++;eN(n,t),o()}return this};eb.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};eb.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var x8e=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=ua(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h<l.length;h++)for(var d=l[h],f=0;f<d.length;f++){var p=d[f];u[p.id()]=h}for(var h=0;h<o.nodeSize;h++){var g=a[h],m=g.layoutDimensions(n),v={};v.isLocked=g.locked(),v.id=g.data("id"),v.parentId=g.data("parent"),v.cmptId=u[g.id()],v.children=[],v.positionX=g.position("x"),v.positionY=g.position("y"),v.offsetX=0,v.offsetY=0,v.height=m.w,v.width=m.h,v.maxX=v.positionX+v.width/2,v.minX=v.positionX-v.width/2,v.maxY=v.positionY+v.height/2,v.minY=v.positionY-v.height/2,v.padLeft=parseFloat(g.style("padding")),v.padRight=parseFloat(g.style("padding")),v.padTop=parseFloat(g.style("padding")),v.padBottom=parseFloat(g.style("padding")),v.nodeRepulsion=an(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(v),o.idToIndex[v.id]=h}for(var y=[],b=0,w=-1,T=[],h=0;h<o.nodeSize;h++){var g=o.layoutNodes[h],E=g.parentId;E!=null?o.layoutNodes[o.idToIndex[E]].children.push(g.id):(y[++w]=g.id,T.push(g.id))}for(o.graphSet.push(T);b<=w;){var k=y[b++],S=o.idToIndex[k],p=o.layoutNodes[S],L=p.children;if(L.length>0){o.graphSet.push(L);for(var h=0;h<L.length;h++)y[++w]=L[h]}}for(var h=0;h<o.graphSet.length;h++)for(var A=o.graphSet[h],f=0;f<A.length;f++){var R=o.idToIndex[A[f]];o.indexToGraph[R]=h}for(var h=0;h<o.edgeSize;h++){var C=i[h],I={};I.id=C.data("id"),I.sourceId=C.data("source"),I.targetId=C.data("target");var P=an(n.idealEdgeLength)?n.idealEdgeLength(C):n.idealEdgeLength,_=an(n.edgeElasticity)?n.edgeElasticity(C):n.edgeElasticity,N=o.idToIndex[I.sourceId],M=o.idToIndex[I.targetId],O=o.indexToGraph[N],D=o.indexToGraph[M];if(O!=D){for(var B=b8e(I.sourceId,I.targetId,o),z=o.graphSet[B],F=0,v=o.layoutNodes[N];z.indexOf(v.id)===-1;)v=o.layoutNodes[o.idToIndex[v.parentId]],F++;for(v=o.layoutNodes[M];z.indexOf(v.id)===-1;)v=o.layoutNodes[o.idToIndex[v.parentId]],F++;P*=F*n.nestingFactor}I.idealLength=P,I.elasticity=_,o.layoutEdges.push(I)}return o},b8e=function(e,r,n){var i=YH(e,r,0,n);return 2>i.count?0:i.graph},YH=function(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],u=i.idToIndex[l],h=i.layoutNodes[u].children;if(h.length!==0){var d=i.indexToGraph[i.idToIndex[h[0]]],f=YH(e,r,d,i);if(f.count!==0)if(f.count===1){if(s++,s===2)break}else return f}}return{count:s,graph:n}},w8e,T8e=function(e,r){for(var n=e.clientWidth,i=e.clientHeight,a=0;a<e.nodeSize;a++){var s=e.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*i)}},XH=function(e,r,n){var i=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,o.positionX),a.x2=Math.max(a.x2,o.positionX),a.y1=Math.min(a.y1,o.positionY),a.y2=Math.max(a.y2,o.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=(l.positionX-a.x1)/a.w,h=(l.positionY-a.y1)/a.h;return{x:i.x1+u*i.w,y:i.y1+h*i.h}}else return{x:l.positionX,y:l.positionY}}},E8e=function(e,r,n){var i=n.layout,a=n.eles.nodes(),s=XH(e,n,a);a.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},S8e=function(e,r,n){k8e(e,r),_8e(e),L8e(e,r),R8e(e),N8e(e)},k8e=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],a=i.length,s=0;s<a;s++)for(var o=e.layoutNodes[e.idToIndex[i[s]]],l=s+1;l<a;l++){var u=e.layoutNodes[e.idToIndex[i[l]]];C8e(o,u,e,r)}},JR=function(e){return-1+2*e*Math.random()},C8e=function(e,r,n,i){var a=e.cmptId,s=r.cmptId;if(!(a!==s&&!n.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=JR(u),l=JR(u));var h=A8e(e,r,o,l);if(h>0)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=p2(e,o,l),v=p2(r,-1*o,-1*l),y=v.x-m.x,b=v.y-m.y,w=y*y+b*b,f=Math.sqrt(w),d=(e.nodeRepulsion+r.nodeRepulsion)/w,p=d*y/f,g=d*b/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},A8e=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},p2=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0<n||r===0&&0>n?(h.x=i,h.y=a+s/2,h):0<r&&-1*u<=l&&l<=u?(h.x=i+o/2,h.y=a+o*n/2/r,h):0>r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0<n&&(l<=-1*u||l>=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},_8e=function(e,r){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.idToIndex[i.sourceId],s=e.layoutNodes[a],o=e.idToIndex[i.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,h=l.positionY-s.positionY;if(!(u===0&&h===0)){var d=p2(s,u,h),f=p2(l,-1*u,-1*h),p=f.x-d.x,g=f.y-d.y,m=Math.sqrt(p*p+g*g),v=Math.pow(i.idealLength-m,2)/i.elasticity;if(m!==0)var y=v*p/m,b=v*g/m;else var y=0,b=0;s.isLocked||(s.offsetX+=y,s.offsetY+=b),l.isLocked||(l.offsetX-=y,l.offsetY-=b)}}},L8e=function(e,r){if(r.gravity!==0)for(var n=1,i=0;i<e.graphSet.length;i++){var a=e.graphSet[i],s=a.length;if(i===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[a[0]]],h=e.layoutNodes[e.idToIndex[u.parentId]],o=h.positionX,l=h.positionY;for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[a[d]]];if(!f.isLocked){var p=o-f.positionX,g=l-f.positionY,m=Math.sqrt(p*p+g*g);if(m>n){var v=r.gravity*p/m,y=r.gravity*g/m;f.offsetX+=v,f.offsetY+=y}}}}},R8e=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var h=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var p=e.layoutNodes[e.idToIndex[u[f]]];p.offsetX+=h,p.offsetY+=d,n[++a]=u[f]}l.offsetX=0,l.offsetY=0}}},N8e=function(e,r){for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];if(!(0<i.children.length||i.isLocked)){var a=D8e(i.offsetX,i.offsetY,e.temperature);i.positionX+=a.x,i.positionY+=a.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,jH(i,e)}}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.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)}},D8e=function(e,r,n){var i=Math.sqrt(e*e+r*r);if(i>n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},jH=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a)return jH(i,r)}},eN=function(e,r){for(var n=e.layoutNodes,i=[],a=0;a<n.length;a++){var s=n[a],o=s.cmptId,l=i[o]=i[o]||[];l.push(s)}for(var u=0,a=0;a<i.length;a++){var h=i[a];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var d=0;d<h.length;d++){var f=h[d];h.x1=Math.min(h.x1,f.positionX-f.width/2),h.x2=Math.max(h.x2,f.positionX+f.width/2),h.y1=Math.min(h.y1,f.positionY-f.height/2),h.y2=Math.max(h.y2,f.positionY+f.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,u+=h.w*h.h}}i.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var p=0,g=0,m=0,v=0,y=Math.sqrt(u)*e.clientWidth/e.clientHeight,a=0;a<i.length;a++){var h=i[a];if(h){for(var d=0;d<h.length;d++){var f=h[d];f.isLocked||(f.positionX+=p-h.x1,f.positionY+=g-h.y1)}p+=h.w+r.componentSpacing,m+=h.w+r.componentSpacing,v=Math.max(v,h.h),m>y&&(g+=v+r.componentSpacing,p=0,m=0,v=0)}}},I8e={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function KH(t){this.options=Ut({},I8e,t)}KH.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=ua(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(q){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(Y){if(Y==null)return Math.min(l,u);var ee=Math.min(l,u);ee==l?l=Y:u=Y},d=function(Y){if(Y==null)return Math.max(l,u);var ee=Math.max(l,u);ee==l?l=Y:u=Y},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l<s;){var v=h(),y=d();(y+1)*v>=s?d(y+1):h(v+1)}var b=a.w/u,w=a.h/l;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var T=0;T<i.length;T++){var E=i[T],k=E._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var S=E.layoutDimensions(e),L=e.avoidOverlapPadding,A=S.w+L,R=S.h+L;b=Math.max(b,A),w=Math.max(w,R)}for(var C={},I=function(Y,ee){return!!C["c-"+Y+"-"+ee]},P=function(Y,ee){C["c-"+Y+"-"+ee]=!0},_=0,N=0,M=function(){N++,N>=u&&(N=0,_++)},O={},D=0;D<i.length;D++){var B=i[D],z=e.position(B);if(z&&(z.row!==void 0||z.col!==void 0)){var F={row:z.row,col:z.col};if(F.col===void 0)for(F.col=0;I(F.row,F.col);)F.col++;else if(F.row===void 0)for(F.row=0;I(F.row,F.col);)F.row++;O[B.id()]=F,P(F.row,F.col)}}var G=function(Y,ee){var Q,oe;if(Y.locked()||Y.isParent())return!1;var pe=O[Y.id()];if(pe)Q=pe.col*b+b/2+a.x1,oe=pe.row*w+w/2+a.y1;else{for(;I(_,N);)M();Q=N*b+b/2+a.x1,oe=_*w+w/2+a.y1,P(_,N),M()}return{x:Q,y:oe}};i.layoutPositions(this,e,G)}return this};var M8e={ready:function(){},stop:function(){}};function $k(t){this.options=Ut({},M8e,t)}$k.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};$k.prototype.stop=function(){return this};var O8e={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function ZH(t){this.options=Ut({},O8e,t)}ZH.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=an(t.positions);function i(a){if(t.positions==null)return nke(a.position());if(n)return t.positions(a);var s=t.positions[a._private.data.id];return s??null}return r.layoutPositions(this,t,function(a,s){var o=i(a);return a.locked()||o==null?!1:o}),this};var P8e={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function QH(t){this.options=Ut({},P8e,t)}QH.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=ua(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,i),this};var B8e=[{name:"breadthfirst",impl:qH},{name:"circle",impl:HH},{name:"concentric",impl:WH},{name:"cose",impl:eb},{name:"grid",impl:KH},{name:"null",impl:$k},{name:"preset",impl:ZH},{name:"random",impl:QH}];function JH(t){this.options=t,this.notifications=0}var tN=function(){},rN=function(){throw new Error("A headless instance can not render images")};JH.prototype={recalculateRenderedStyle:tN,notify:function(){this.notifications++},init:tN,isHeadless:function(){return!0},png:rN,jpg:rN};var zk={};zk.arrowShapeWidth=.3;zk.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,h,d,f,p,g,m){var v=p.x-d/2-m,y=p.x+d/2+m,b=p.y-d/2-m,w=p.y+d/2+m,T=v<=u&&u<=y&&b<=h&&h<=w;return T},n=function(u,h,d,f,p){var g=u*Math.cos(f)-h*Math.sin(f),m=u*Math.sin(f)+h*Math.cos(f),v=g*d,y=m*d,b=v+p.x,w=y+p.y;return{x:b,y:w}},i=function(u,h,d,f){for(var p=[],g=0;g<u.length;g+=2){var m=u[g],v=u[g+1];p.push(n(m,v,h,d,f))}return p},a=function(u){for(var h=[],d=0;d<u.length;d++){var f=u[d];h.push(f.x,f.y)}return h},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,h){Ft(h)&&(h=t[h]),t[u]=Ut({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,p,g,m,v,y){var b=a(i(this.points,g+2*y,m,v)),w=ea(f,p,b);return w},roughCollide:r,draw:function(f,p,g,m){var v=i(this.points,p,g,m);e.arrowShapeImpl("polygon")(f,v)},spacing:function(f){return 0},gap:s},h)};o("none",{collide:l2,roughCollide:l2,draw:kk,spacing:yL,gap:yL}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=this.controlPoint,v=n(m[0],m[1],h,d,f);e.arrowShapeImpl(this.name)(u,g,v)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,h,d,f,p,g,m){var v=a(i(this.points,d+2*m,f,p)),y=a(i(this.pointsTee,d+2*m,f,p)),b=ea(u,h,v)||ea(u,h,y);return b},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.pointsTee,h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,h,d,f,p,g,m){var v=p,y=Math.pow(v.x-u,2)+Math.pow(v.y-h,2)<=Math.pow((d+2*m)*this.radius,2),b=a(i(this.points,d+2*m,f,p));return ea(u,h,b)||y},draw:function(u,h,d,f,p){var g=i(this.pointsTr,h,d,f);e.arrowShapeImpl(this.name)(u,g,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,h){var d=this.baseCrossLinePts.slice(),f=h/u,p=3,g=5;return d[p]=d[p]-f,d[g]=d[g]-f,d},collide:function(u,h,d,f,p,g,m){var v=a(i(this.points,d+2*m,f,p)),y=a(i(this.crossLinePts(d,g),d+2*m,f,p)),b=ea(u,h,v)||ea(u,h,y);return b},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.crossLinePts(h,p),h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,h,d,f,p,g,m){var v=p,y=Math.pow(v.x-u,2)+Math.pow(v.y-h,2)<=Math.pow((d+2*m)*this.radius,2);return y},draw:function(u,h,d,f,p){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var Bu={};Bu.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(),u=((t-i)/s-o.x)/l,h=((e-a)/s-o.y)/l;return[u,h]};Bu.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(y){return parseFloat(r.getPropertyValue(y))},i={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},a={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=i.left+i.right,u=i.top+i.bottom,h=a.left+a.right,d=e.width/(s+h),f=s-l,p=o-u,g=e.left+i.left+a.left,m=e.top+i.top+a.top;return this.containerBB=[g,m,f,p,d]};Bu.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Bu.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};Bu.findNearestElements=function(t,e,r,n){var i=this,a=this,s=a.getCachedZSortedEles(),o=[],l=a.cy.zoom(),u=a.cy.hasCompoundNodes(),h=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,p=1/0,g,m;r&&(s=s.interactive);function v(S,L){if(S.isNode()){if(m)return;m=S,o.push(S)}if(S.isEdge()&&(L==null||L<p))if(g){if(g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value){for(var A=0;A<o.length;A++)if(o[A].isEdge()){o[A]=S,g=S,p=L??p;break}}}else o.push(S),g=S,p=L??p}function y(S){var L=S.outerWidth()+2*d,A=S.outerHeight()+2*d,R=L/2,C=A/2,I=S.position(),P=S.pstyle("corner-radius").value==="auto"?"auto":S.pstyle("corner-radius").pfValue,_=S._private.rscratch;if(I.x-R<=t&&t<=I.x+R&&I.y-C<=e&&e<=I.y+C){var N=a.nodeShapes[i.getNodeShape(S)];if(N.checkPoint(t,e,0,L,A,I.x,I.y,P,_))return v(S,0),!0}}function b(S){var L=S._private,A=L.rscratch,R=S.pstyle("width").pfValue,C=S.pstyle("arrow-scale").value,I=R/2+h,P=I*I,_=I*2,D=L.source,B=L.target,N;if(A.edgeType==="segments"||A.edgeType==="straight"||A.edgeType==="haystack"){for(var M=A.allpts,O=0;O+3<M.length;O+=2)if(vke(t,e,M[O],M[O+1],M[O+2],M[O+3],_)&&P>(N=Tke(t,e,M[O],M[O+1],M[O+2],M[O+3])))return v(S,N),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var M=A.allpts,O=0;O+5<A.allpts.length;O+=4)if(yke(t,e,M[O],M[O+1],M[O+2],M[O+3],M[O+4],M[O+5],_)&&P>(N=wke(t,e,M[O],M[O+1],M[O+2],M[O+3],M[O+4],M[O+5])))return v(S,N),!0}for(var D=D||L.source,B=B||L.target,z=i.getArrowWidth(R,C),F=[{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}],O=0;O<F.length;O++){var G=F[O],q=a.arrowShapes[S.pstyle(G.name+"-arrow-shape").value],Y=S.pstyle("width").pfValue;if(q.roughCollide(t,e,z,G.angle,{x:G.x,y:G.y},Y,h)&&q.collide(t,e,z,G.angle,{x:G.x,y:G.y},Y,h))return v(S),!0}u&&o.length>0&&(y(D),y(B))}function w(S,L,A){return Ji(S,L,A)}function T(S,L){var A=S._private,R=f,C;L?C=L+"-":C="",S.boundingBox();var I=A.labelBounds[L||"main"],P=S.pstyle(C+"label").value,_=S.pstyle("text-events").strValue==="yes";if(!(!_||!P)){var N=w(A.rscratch,"labelX",L),M=w(A.rscratch,"labelY",L),O=w(A.rscratch,"labelAngle",L),D=S.pstyle(C+"text-margin-x").pfValue,B=S.pstyle(C+"text-margin-y").pfValue,z=I.x1-R-D,F=I.x2+R-D,G=I.y1-R-B,q=I.y2+R-B;if(O){var Y=Math.cos(O),ee=Math.sin(O),Q=function(K,ne){return K=K-N,ne=ne-M,{x:K*Y-ne*ee+N,y:K*ee+ne*Y+M}},oe=Q(z,G),pe=Q(z,q),j=Q(F,G),W=Q(F,q),X=[oe.x+D,oe.y+B,j.x+D,j.y+B,W.x+D,W.y+B,pe.x+D,pe.y+B];if(ea(t,e,X))return v(S),!0}else if(Jd(I,t,e))return v(S),!0}}for(var E=s.length-1;E>=0;E--){var k=s[E];k.isNode()?y(k)||T(k):b(k)||T(k)||T(k,"source")||T(k,"target")}return o};Bu.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=ua({x1:t,y1:e,x2:r,y2:n});function p(P,_,N){return Ji(P,_,N)}function g(P,_){var N=P._private,M=s,O="";P.boundingBox();var D=N.labelBounds.main,B=p(N.rscratch,"labelX",_),z=p(N.rscratch,"labelY",_),F=p(N.rscratch,"labelAngle",_),G=P.pstyle(O+"text-margin-x").pfValue,q=P.pstyle(O+"text-margin-y").pfValue,Y=D.x1-M-G,ee=D.x2+M-G,Q=D.y1-M-q,oe=D.y2+M-q;if(F){var pe=Math.cos(F),j=Math.sin(F),W=function(H,K){return H=H-B,K=K-z,{x:H*pe-K*j+B,y:H*j+K*pe+z}};return[W(Y,Q),W(ee,Q),W(ee,oe),W(Y,oe)]}else return[{x:Y,y:Q},{x:ee,y:Q},{x:ee,y:oe},{x:Y,y:oe}]}for(var m=0;m<i.length;m++){var v=i[m];if(v.isNode()){var y=v,b=y.pstyle("text-events").strValue==="yes",w=y.pstyle("box-select-labels").strValue==="yes",T=y.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:w&&b});if(Lk(f,T)){var E=g(y),k=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}];Ake(E,k)&&o.push(y)}}else{var S=v,L=S._private,A=L.rscratch;if(A.startX!=null&&A.startY!=null&&!Jd(f,A.startX,A.startY)||A.endX!=null&&A.endY!=null&&!Jd(f,A.endX,A.endY))continue;if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"||A.edgeType==="segments"||A.edgeType==="haystack"){for(var R=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts,C=!0,I=0;I<R.length;I++)if(!gke(f,R[I])){C=!1;break}C&&o.push(S)}else(A.edgeType==="haystack"||A.edgeType==="straight")&&o.push(S)}}return o};var g2={};g2.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",i=e.edgeType==="multibezier",a=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,h,d,f,p,y,b;if(r?(h=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],p=e.haystackPts[3]):(h=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,p=e.arrowEndY),y=e.midX,b=e.midY,a)l=h-e.segpts[0],u=d-e.segpts[1];else if(i||s||o||n){var g=e.allpts,m=Wn(g[0],g[2],g[4],.1),v=Wn(g[1],g[3],g[5],.1);l=h-m,u=d-v}else l=h-y,u=d-b;e.srcArrowAngle=em(l,u);var y=e.midX,b=e.midY;if(r&&(y=(h+f)/2,b=(d+p)/2),l=f-h,u=p-d,a){var g=e.allpts;if(g.length/2%2===0){var w=g.length/2,T=w-2;l=g[w]-g[T],u=g[w+1]-g[T+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var w=g.length/2-1,T=w-2;l=g[w]-g[T],u=g[w+1]-g[T+1]}}else if(i||s||o){var g=e.allpts,E=e.ctrlpts,k,S,L,A;if(E.length/2%2===0){var R=g.length/2-1,C=R+2,I=C+2;k=Wn(g[R],g[C],g[I],0),S=Wn(g[R+1],g[C+1],g[I+1],0),L=Wn(g[R],g[C],g[I],1e-4),A=Wn(g[R+1],g[C+1],g[I+1],1e-4)}else{var C=g.length/2-1,R=C-2,I=C+2;k=Wn(g[R],g[C],g[I],.4999),S=Wn(g[R+1],g[C+1],g[I+1],.4999),L=Wn(g[R],g[C],g[I],.5),A=Wn(g[R+1],g[C+1],g[I+1],.5)}l=L-k,u=A-S}if(e.midtgtArrowAngle=em(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,a){var g=e.allpts;if(g.length/2%2!==0){if(!e.isRound){var w=g.length/2-1,P=w+2;l=-(g[P]-g[w]),u=-(g[P+1]-g[w+1])}}}if(e.midsrcArrowAngle=em(l,u),a)l=f-e.segpts[e.segpts.length-2],u=p-e.segpts[e.segpts.length-1];else if(i||s||o||n){var g=e.allpts,_=g.length,m=Wn(g[_-6],g[_-4],g[_-2],.9),v=Wn(g[_-5],g[_-3],g[_-1],.9);l=f-m,u=p-v}else l=f-y,u=p-b;e.tgtArrowAngle=em(l,u)};g2.getArrowWidth=g2.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var ZT,QT,Os={},Fa={},nN,iN,Nc,fv,bo,yc,Sc,Ns,ju,lm,eW,tW,JT,e6,aN,sN=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},F8e=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},$8e=function(e,r,n,i,a){if(e!==aN?sN(r,e,Os):F8e(Fa,Os),sN(r,n,Fa),nN=Os.nx*Fa.ny-Os.ny*Fa.nx,iN=Os.nx*Fa.nx-Os.ny*-Fa.ny,bo=Math.asin(Math.max(-1,Math.min(1,nN))),Math.abs(bo)<1e-6){ZT=r.x,QT=r.y,Sc=ju=0;return}Nc=1,fv=!1,iN<0?bo<0?bo=Math.PI+bo:(bo=Math.PI-bo,Nc=-1,fv=!0):bo>0&&(Nc=-1,fv=!0),r.radius!==void 0?ju=r.radius:ju=i,yc=bo/2,lm=Math.min(Os.len/2,Fa.len/2),a?(Ns=Math.abs(Math.cos(yc)*ju/Math.sin(yc)),Ns>lm?(Ns=lm,Sc=Math.abs(Ns*Math.sin(yc)/Math.cos(yc))):Sc=ju):(Ns=Math.min(lm,ju),Sc=Math.abs(Ns*Math.sin(yc)/Math.cos(yc))),JT=r.x+Fa.nx*Ns,e6=r.y+Fa.ny*Ns,ZT=JT-Fa.ny*Sc*Nc,QT=e6+Fa.nx*Sc*Nc,eW=r.x+Os.nx*Ns,tW=r.y+Os.ny*Ns,aN=r};function rW(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Vk(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:($8e(t,e,r,n,i),{cx:ZT,cy:QT,radius:Sc,startX:eW,startY:tW,stopX:JT,stopY:e6,startAngle:Os.ang+Math.PI/2*Nc,endAngle:Fa.ang-Math.PI/2*Nc,counterClockwise:fv})}var lg=.01,z8e=Math.sqrt(2*lg),_i={};_i.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(E,k,S,L){var A=L-k,R=S-E,C=Math.sqrt(R*R+A*A);return{x:-A/C,y:R/C}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=Ln(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),v=Ln(m,2),y=v[0],b=v[1],w={x1:p,y1:g,x2:y,y2:b};i=u(p,g,y,b),a=w}else Cr("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};_i.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=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),h=s.width(),d=o.width(),f=s.height(),p=o.height(),g=r.pstyle("haystack-radius").value,m=g/2;i.haystackPts=i.allpts=[i.source.x*h*m+l.x,i.source.y*f*m+l.y,i.target.x*d*m+u.x,i.target.y*p*m+u.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)}};_i.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],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var h=0;h<o;h++){var d=n.pfValue[h],f=i.pfValue[h],p=1-d,g=d,m=this.findMidptPtsEtc(t,e),v=m.midptPts,y=m.vectorNormInverse,b={x:v.x1*p+v.x2*g,y:v.y1*p+v.y2*g};r.segpts.push(b.x+y.x*f,b.y+y.y*f),r.radii.push(a.pfValue[h]!==void 0?a.pfValue[h]:l),r.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:u)==="arc-radius")}};_i.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,u=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var f=r,p=d;n&&(f=0,p=l);var g=u-Math.PI/2,m=g-h/2,v=g+h/2,y=u+"_"+h;f=a[y]===void 0?a[y]=0:++a[y],i.ctrlpts=[s.x+Math.cos(m)*1.4*p*(f/3+1),s.y+Math.sin(m)*1.4*p*(f/3+1),s.x+Math.cos(v)*1.4*p*(f/3+1),s.y+Math.sin(v)*1.4*p*(f/3+1)]};_i.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,u=e.tgtW,h=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),p=f?f.pfValue[0]:void 0,g=r,m=d;n&&(g=0,m=p);var v=50,y={x:a.x-o/2,y:a.y-l/2},b={x:s.x-u/2,y:s.y-h/2},w={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},T=.5,E=Math.max(T,Math.log(o*lg)),k=Math.max(T,Math.log(u*lg));i.ctrlpts=[w.x,w.y-(1+Math.pow(v,1.12)/100)*m*(g/3+1)*E,w.x-(1+Math.pow(v,1.12)/100)*m*(g/3+1)*k,w.y]};_i.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};_i.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"),u=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,d=l.value[0],f=n;a.edgeType=f?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<u;p++){var g=(.5-e.eles.length/2+r)*s*(i?-1:1),m=void 0,v=_k(g);f&&(h=o?o.pfValue[p]:s,d=l.value[p]),n?m=h:m=h!==void 0?v*h:void 0;var y=m!==void 0?m:g,b=1-d,w=d,T=this.findMidptPtsEtc(t,e),E=T.midptPts,k=T.vectorNormInverse,S={x:E.x1*b+E.x2*w,y:E.y1*b+E.y2*w};a.ctrlpts.push(S.x+k.x*y,S.y+k.y*y)}};_i.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",o="downward",l="upward",u="auto",h=e.posPts,d=e.srcW,f=e.srcH,p=e.tgtW,g=e.tgtH,m=t.pstyle("edge-distances").value,v=m!=="node-position",y=t.pstyle("taxi-direction").value,b=y,w=t.pstyle("taxi-turn"),T=w.units==="%",E=w.pfValue,k=E<0,S=t.pstyle("taxi-turn-min-distance").pfValue,L=v?(d+p)/2:0,A=v?(f+g)/2:0,R=h.x2-h.x1,C=h.y2-h.y1,I=function($,se){return $>0?Math.max($-se,0):Math.min($+se,0)},P=I(R,L),_=I(C,A),N=!1;b===u?y=Math.abs(P)>Math.abs(_)?i:n:b===l||b===o?(y=n,N=!0):(b===a||b===s)&&(y=i,N=!0);var M=y===n,O=M?_:P,D=M?C:R,B=_k(D),z=!1;!(N&&(T||k))&&(b===o&&D<0||b===l&&D>0||b===a&&D>0||b===s&&D<0)&&(B*=-1,O=B*Math.abs(O),z=!0);var F;if(T){var G=E<0?1+E:E;F=G*O}else{var q=E<0?O:0;F=q+E*B}var Y=function($){return Math.abs($)<S||Math.abs($)>=Math.abs(O)},ee=Y(F),Q=Y(Math.abs(O)-Math.abs(F)),oe=ee||Q;if(oe&&!z)if(M){var pe=Math.abs(D)<=f/2,j=Math.abs(R)<=p/2;if(pe){var W=(h.x1+h.x2)/2,X=h.y1,H=h.y2;r.segpts=[W,X,W,H]}else if(j){var K=(h.y1+h.y2)/2,ne=h.x1,Z=h.x2;r.segpts=[ne,K,Z,K]}else r.segpts=[h.x1,h.y2]}else{var be=Math.abs(D)<=d/2,ce=Math.abs(C)<=g/2;if(be){var re=(h.y1+h.y2)/2,Ne=h.x1,me=h.x2;r.segpts=[Ne,re,me,re]}else if(ce){var Ve=(h.x1+h.x2)/2,Ue=h.y1,Fe=h.y2;r.segpts=[Ve,Ue,Ve,Fe]}else r.segpts=[h.x2,h.y1]}else if(M){var _e=h.y1+F+(v?f/2*B:0),Oe=h.x1,Ce=h.x2;r.segpts=[Oe,_e,Ce,_e]}else{var Le=h.x1+F+(v?d/2*B:0),ze=h.y1,ge=h.y2;r.segpts=[Le,ze,Le,ge]}if(r.isRound){var Me=t.pstyle("taxi-radius").value,J=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(Me),r.isArcRadius=new Array(r.segpts.length/2).fill(J)}};_i.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!gt(r.startX)||!gt(r.startY),v=!gt(r.arrowStartX)||!gt(r.arrowStartY),y=!gt(r.endX)||!gt(r.endY),b=!gt(r.arrowEndX)||!gt(r.arrowEndY),w=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,E=w*T,k=du({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),S=k<E,L=du({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),A=L<E,R=!1;if(m||v||S){R=!0;var C={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},I=Math.sqrt(C.x*C.x+C.y*C.y),P={x:C.x/I,y:C.y/I},_=Math.max(a,s),N={x:r.ctrlpts[0]+P.x*2*_,y:r.ctrlpts[1]+P.y*2*_},M=u.intersectLine(n.x,n.y,a,s,N.x,N.y,0,d,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(E-k),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(E-k)):(r.ctrlpts[0]=M[0]+P.x*E,r.ctrlpts[1]=M[1]+P.y*E)}if(y||b||A){R=!0;var O={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},D=Math.sqrt(O.x*O.x+O.y*O.y),B={x:O.x/D,y:O.y/D},z=Math.max(a,s),F={x:r.ctrlpts[0]+B.x*2*z,y:r.ctrlpts[1]+B.y*2*z},G=h.intersectLine(i.x,i.y,o,l,F.x,F.y,0,f,g);A?(r.ctrlpts[0]=r.ctrlpts[0]+B.x*(E-L),r.ctrlpts[1]=r.ctrlpts[1]+B.y*(E-L)):(r.ctrlpts[0]=G[0]+B.x*E,r.ctrlpts[1]=G[1]+B.y*E)}R&&this.findEndpoints(t)}};_i.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){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);e.allpts.push(e.endX,e.endY);var n,i;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,i=.5,e.midX=Wn(e.allpts[n],e.allpts[n+2],e.allpts[n+4],i),e.midY=Wn(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],i))}else if(e.edgeType==="straight")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(e.edgeType==="segments"){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 a=2;a+3<e.allpts.length;a+=2){var s=e.radii[a/2-1],o=e.isArcRadius[a/2-1];e.roundCorners.push(Vk({x:e.allpts[a-2],y:e.allpts[a-1]},{x:e.allpts[a],y:e.allpts[a+1],radius:s},{x:e.allpts[a+2],y:e.allpts[a+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var d={x:e.segpts[h],y:e.segpts[h+1]},f=e.roundCorners[h/2];if(f.radius===0){var p={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-p.y,p.x-d.x]}else{var g=[d.x-f.cx,d.y-f.cy],m=f.radius/Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2));g=g.map(function(v){return v*m}),e.midX=f.cx+g[0],e.midY=f.cy+g[1],e.midVector=g}}}}};_i.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||gt(e.startX)&>(e.startY)&>(e.endX)&>(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Cr("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."))};_i.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,i=n.hasCompoundNodes(),a=new Oo,s=function(A,R){return[].concat(a2(A),[R?1:0]).join("-")},o=[],l=[],u=0;u<t.length;u++){var h=t[u],d=h._private,f=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(f==="haystack"){l.push(h);continue}var p=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),g=f==="unbundled-bezier"||f==="bezier",m=d.source,v=d.target,y=m.poolIndex(),b=v.poolIndex(),w=[y,b].sort(),T=s(w,p),E=a.get(T);E==null&&(E={eles:[]},o.push({pairId:w,edgeIsUnbundled:p}),a.set(T,E)),E.eles.push(h),p&&(E.hasUnbundled=!0),g&&(E.hasBezier=!0)}}for(var k=function(){var A=o[S],R=A.pairId,C=A.edgeIsUnbundled,I=s(R,C),P=a.get(I),_;if(!P.hasUnbundled){var N=P.eles[0].parallelEdges().filter(function(J){return J.isBundledBezier()});Ck(P.eles),N.forEach(function(J){return P.eles.push(J)}),P.eles.sort(function(J,ue){return J.poolIndex()-ue.poolIndex()})}var M=P.eles[0],O=M.source(),D=M.target();if(O.poolIndex()>D.poolIndex()){var B=O;O=D,D=B}var z=P.srcPos=O.position(),F=P.tgtPos=D.position(),G=P.srcW=O.outerWidth(),q=P.srcH=O.outerHeight(),Y=P.tgtW=D.outerWidth(),ee=P.tgtH=D.outerHeight(),Q=P.srcShape=r.nodeShapes[e.getNodeShape(O)],oe=P.tgtShape=r.nodeShapes[e.getNodeShape(D)],pe=P.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,j=P.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,W=P.tgtRs=D._private.rscratch,X=P.srcRs=O._private.rscratch;P.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var H=0;H<P.eles.length;H++){var K=P.eles[H],ne=K[0]._private.rscratch,Z=K.pstyle("curve-style").value,be=Z==="unbundled-bezier"||Z.endsWith("segments")||Z.endsWith("taxi"),ce=!O.same(K.source());if(!P.calculatedIntersection&&O!==D&&(P.hasBezier||P.hasUnbundled)){P.calculatedIntersection=!0;var re=Q.intersectLine(z.x,z.y,G,q,F.x,F.y,0,pe,X),Ne=P.srcIntn=re,me=oe.intersectLine(F.x,F.y,Y,ee,z.x,z.y,0,j,W),Ve=P.tgtIntn=me,Ue=P.intersectionPts={x1:re[0],x2:me[0],y1:re[1],y2:me[1]},Fe=P.posPts={x1:z.x,x2:F.x,y1:z.y,y2:F.y},_e=me[1]-re[1],Oe=me[0]-re[0],Ce=Math.sqrt(Oe*Oe+_e*_e);gt(Ce)&&Ce>=z8e||(Ce=Math.sqrt(Math.max(Oe*Oe,lg)+Math.max(_e*_e,lg)));var Le=P.vector={x:Oe,y:_e},ze=P.vectorNorm={x:Le.x/Ce,y:Le.y/Ce},ge={x:-ze.y,y:ze.x};P.nodesOverlap=!gt(Ce)||oe.checkPoint(re[0],re[1],0,Y,ee,F.x,F.y,j,W)||Q.checkPoint(me[0],me[1],0,G,q,z.x,z.y,pe,X),P.vectorNormInverse=ge,_={nodesOverlap:P.nodesOverlap,dirCounts:P.dirCounts,calculatedIntersection:!0,hasBezier:P.hasBezier,hasUnbundled:P.hasUnbundled,eles:P.eles,srcPos:F,srcRs:W,tgtPos:z,tgtRs:X,srcW:Y,srcH:ee,tgtW:G,tgtH:q,srcIntn:Ve,tgtIntn:Ne,srcShape:oe,tgtShape:Q,posPts:{x1:Fe.x2,y1:Fe.y2,x2:Fe.x1,y2:Fe.y1},intersectionPts:{x1:Ue.x2,y1:Ue.y2,x2:Ue.x1,y2:Ue.y1},vector:{x:-Le.x,y:-Le.y},vectorNorm:{x:-ze.x,y:-ze.y},vectorNormInverse:{x:-ge.x,y:-ge.y}}}var Me=ce?_:P;ne.nodesOverlap=Me.nodesOverlap,ne.srcIntn=Me.srcIntn,ne.tgtIntn=Me.tgtIntn,ne.isRound=Z.startsWith("round"),i&&(O.isParent()||O.isChild()||D.isParent()||D.isChild())&&(O.parents().anySame(D)||D.parents().anySame(O)||O.same(D)&&O.isParent())?e.findCompoundLoopPoints(K,Me,H,be):O===D?e.findLoopPoints(K,Me,H,be):Z.endsWith("segments")?e.findSegmentsPoints(K,Me):Z.endsWith("taxi")?e.findTaxiPoints(K,Me):Z==="straight"||!be&&P.eles.length%2===1&&H===Math.floor(P.eles.length/2)?e.findStraightEdgePoints(K):e.findBezierPoints(K,Me,H,be,ce),e.findEndpoints(K),e.tryToCorrectInvalidPoints(K,Me),e.checkForInvalidEdgeWarning(K),e.storeAllpts(K),e.storeEdgeProjections(K),e.calculateArrowAngles(K),e.recalculateEdgeLabelProjections(K),e.calculateLabelAngles(K)}},S=0;S<o.length;S++)k();this.findHaystackPoints(l)}};function nW(t){var e=[];if(t!=null){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}}_i.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return nW(e.segpts)};_i.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return nW(e.ctrlpts)};_i.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var t1={};t1.manualEndptToPx=function(t,e){var r=this,n=t.position(),i=t.outerWidth(),a=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*i),e.units[1]==="%"&&(o[1]=o[1]*a),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(i,a),h=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,i,a,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};t1.findEndpoints=function(t){var e=this,r,n=t.source()[0],i=t.target()[0],a=n.position(),s=i.position(),o=t.pstyle("target-arrow-shape").value,l=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,h=t.pstyle("source-distance-from-node").pfValue,d=n._private.rscratch,f=i._private.rscratch,p=t.pstyle("curve-style").value,g=t._private.rscratch,m=g.edgeType,v=p==="taxi",y=m==="self"||m==="compound",b=m==="bezier"||m==="multibezier"||y,w=m!=="bezier",T=m==="straight"||m==="segments",E=m==="segments",k=b||w||T,S=y||v,L=t.pstyle("source-endpoint"),A=S?"outside-to-node":L.value,R=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,C=t.pstyle("target-endpoint"),I=S?"outside-to-node":C.value,P=i.pstyle("corner-radius").value==="auto"?"auto":i.pstyle("corner-radius").pfValue;g.srcManEndpt=L,g.tgtManEndpt=C;var _,N,M,O;if(b){var D=[g.ctrlpts[0],g.ctrlpts[1]],B=w?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:D;_=B,N=D}else if(T){var z=E?g.segpts.slice(0,2):[s.x,s.y],F=E?g.segpts.slice(g.segpts.length-2):[a.x,a.y];_=F,N=z}if(I==="inside-to-node")r=[s.x,s.y];else if(C.units)r=this.manualEndptToPx(i,C);else if(I==="outside-to-line")r=g.tgtIntn;else if(I==="outside-to-node"||I==="outside-to-node-or-label"?M=_:(I==="outside-to-line"||I==="outside-to-line-or-label")&&(M=[a.x,a.y]),r=e.nodeShapes[this.getNodeShape(i)].intersectLine(s.x,s.y,i.outerWidth(),i.outerHeight(),M[0],M[1],0,P,f),I==="outside-to-node-or-label"||I==="outside-to-line-or-label"){var G=i._private.rscratch,q=G.labelWidth,Y=G.labelHeight,ee=G.labelX,Q=G.labelY,oe=q/2,pe=Y/2,j=i.pstyle("text-valign").value;j==="top"?Q-=pe:j==="bottom"&&(Q+=pe);var W=i.pstyle("text-halign").value;W==="left"?ee-=oe:W==="right"&&(ee+=oe);var X=ng(M[0],M[1],[ee-oe,Q-pe,ee+oe,Q-pe,ee+oe,Q+pe,ee-oe,Q+pe],s.x,s.y);if(X.length>0){var H=a,K=Tc(H,dh(r)),ne=Tc(H,dh(X)),Z=K;if(ne<K&&(r=X,Z=ne),X.length>2){var be=Tc(H,{x:X[2],y:X[3]});be<Z&&(r=[X[2],X[3]])}}}var ce=tm(r,_,e.arrowShapes[o].spacing(t)+u),re=tm(r,_,e.arrowShapes[o].gap(t)+u);if(g.endX=re[0],g.endY=re[1],g.arrowEndX=ce[0],g.arrowEndY=ce[1],A==="inside-to-node")r=[a.x,a.y];else if(L.units)r=this.manualEndptToPx(n,L);else if(A==="outside-to-line")r=g.srcIntn;else if(A==="outside-to-node"||A==="outside-to-node-or-label"?O=N:(A==="outside-to-line"||A==="outside-to-line-or-label")&&(O=[s.x,s.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(a.x,a.y,n.outerWidth(),n.outerHeight(),O[0],O[1],0,R,d),A==="outside-to-node-or-label"||A==="outside-to-line-or-label"){var Ne=n._private.rscratch,me=Ne.labelWidth,Ve=Ne.labelHeight,Ue=Ne.labelX,Fe=Ne.labelY,_e=me/2,Oe=Ve/2,Ce=n.pstyle("text-valign").value;Ce==="top"?Fe-=Oe:Ce==="bottom"&&(Fe+=Oe);var Le=n.pstyle("text-halign").value;Le==="left"?Ue-=_e:Le==="right"&&(Ue+=_e);var ze=ng(O[0],O[1],[Ue-_e,Fe-Oe,Ue+_e,Fe-Oe,Ue+_e,Fe+Oe,Ue-_e,Fe+Oe],a.x,a.y);if(ze.length>0){var ge=s,Me=Tc(ge,dh(r)),J=Tc(ge,dh(ze)),ue=Me;if(J<Me&&(r=[ze[0],ze[1]],ue=J),ze.length>2){var $=Tc(ge,{x:ze[2],y:ze[3]});$<ue&&(r=[ze[2],ze[3]])}}}var se=tm(r,N,e.arrowShapes[l].spacing(t)+h),ae=tm(r,N,e.arrowShapes[l].gap(t)+h);g.startX=ae[0],g.startY=ae[1],g.arrowStartX=se[0],g.arrowStartY=se[1],k&&(!gt(g.startX)||!gt(g.startY)||!gt(g.endX)||!gt(g.endY)?g.badLine=!0:g.badLine=!1)};t1.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};t1.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Gk={};function V8e(t,e,r){for(var n=function(u,h,d,f){return Wn(u,h,d,f)},i=e._private,a=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];a.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}Gk.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,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<r.allpts.length;i+=4)V8e(this,t,r.allpts.slice(i,i+6))}else if(n==="segments")for(var a=e.rstyle.linePts=[],i=0;i+1<r.allpts.length;i+=2)a.push({x:r.allpts[i],y:r.allpts[i+1]});else if(n==="haystack"){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};Gk.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var uo={};uo.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Gl(e)){var r,n,i=t._private,a=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,d=i.rscratch,f=i.rstyle;switch(u){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}d.labelX=r,d.labelY=n,f.labelX=r,f.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var iW=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},aW=function(e,r){var n=r.x-e.x,i=r.y-e.y;return iW(n,i)},G8e=function(e,r,n,i){var a=rg(0,i-.001,1),s=rg(0,i+.001,1),o=Ah(e,r,n,a),l=Ah(e,r,n,s);return aW(o,l)};uo.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=function(d,f,p){_o(r.rscratch,d,f,p),_o(r.rstyle,d,f,p)};s("labelX",null,e.x),s("labelY",null,e.y);var o=iW(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4){var p={x:n.allpts[f],y:n.allpts[f+1]},g={x:n.allpts[f+2],y:n.allpts[f+3]},m={x:n.allpts[f+4],y:n.allpts[f+5]};d.push({p0:p,p1:g,p2:m,startDist:0,length:0,segments:[]})}var v=r.rstyle.bezierPts,y=i.bezierProjPcts.length;function b(S,L,A,R,C){var I=du(L,A),P=S.segments[S.segments.length-1],_={p0:L,p1:A,t0:R,t1:C,startDist:P?P.startDist+P.length:0,length:I};S.segments.push(_),S.length+=I}for(var w=0;w<d.length;w++){var T=d[w],E=d[w-1];E&&(T.startDist=E.startDist+E.length),b(T,T.p0,v[w*y],0,i.bezierProjPcts[0]);for(var k=0;k<y-1;k++)b(T,v[w*y+k],v[w*y+k+1],i.bezierProjPcts[k],i.bezierProjPcts[k+1]);b(T,v[w*y+y-1],T.p2,i.bezierProjPcts[y-1],1)}return l.cache=d},u=function(d){var f,p=d==="source";if(a[d]){var g=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var m=l(),v,y=0,b=0,w=0;w<m.length;w++){for(var T=m[p?w:m.length-1-w],E=0;E<T.segments.length;E++){var k=T.segments[p?E:T.segments.length-1-E],S=w===m.length-1&&E===T.segments.length-1;if(y=b,b+=k.length,b>=g||S){v={cp:T,segment:k};break}}if(v)break}var L=v.cp,A=v.segment,R=(g-y)/A.length,C=A.t1-A.t0,I=p?A.t0+C*R:A.t1-C*R;I=rg(0,I,1),e=Ah(L.p0,L.p1,L.p2,I),f=G8e(L.p0,L.p1,L.p2,I);break}case"straight":case"segments":case"haystack":{for(var P=0,_,N,M,O,D=n.allpts.length,B=0;B+3<D&&(p?(M={x:n.allpts[B],y:n.allpts[B+1]},O={x:n.allpts[B+2],y:n.allpts[B+3]}):(M={x:n.allpts[D-2-B],y:n.allpts[D-1-B]},O={x:n.allpts[D-4-B],y:n.allpts[D-3-B]}),_=du(M,O),N=P,P+=_,!(P>=g));B+=2);var z=g-N,F=z/_;F=rg(0,F,1),e=uke(M,O,F),f=aW(M,O);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};uo.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};uo.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=hu(n,t._private.labelDimsKey);if(Ji(r.rscratch,"prefixedLabelDimsKey",e)!==i){_o(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=Ji(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),h=a.height/u,d=h*s,f=a.width,p=a.height+(u-1)*(s-1)*h;_o(r.rstyle,"labelWidth",e,f),_o(r.rscratch,"labelWidth",e,f),_o(r.rstyle,"labelHeight",e,p),_o(r.rscratch,"labelHeight",e,p),_o(r.rscratch,"labelLineHeight",e,d)}};uo.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(q,Y){return Y?(_o(r.rscratch,q,e,Y),Y):Ji(r.rscratch,q,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="",h=i.split(`
|
|
2390
2390
|
`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,v=0;v<h.length;v++){var y=h[v],b=this.calculateLabelDimensions(t,y),w=b.width;if(p){var T=y.split("").join(u);y=T}if(w>d){var E=y.matchAll(m),k="",S=0,L=na(E),A;try{for(L.s();!(A=L.n()).done;){var R=A.value,C=R[0],I=y.substring(S,R.index);S=R.index+C.length;var P=k.length===0?I:k+I+C,_=this.calculateLabelDimensions(t,P),N=_.width;N<=d?k+=I+C:(k&&g.push(k),k=I+C)}}catch(G){L.e(G)}finally{L.f()}k.match(/^[\s\u200b]+$/)||g.push(k)}else g.push(y)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(`
|
|
2391
2391
|
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,O="",D="…",B=!1;if(this.calculateLabelDimensions(t,i).width<M)return i;for(var z=0;z<i.length;z++){var F=this.calculateLabelDimensions(t,O+i[z]+D).width;if(F>M)break;O+=i[z],z===i.length-1&&(B=!0)}return B||(O+=D),O}return i};uo.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};uo.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),d=this.labelCalcCanvasContext=h.getContext("2d");var f=h.style;f.position="absolute",f.left="-9999px",f.top="-9999px",f.zIndex="-1",f.visibility="hidden",f.pointerEvents="none"}d.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var p=0,g=0,m=e.split(`
|
|
2392
|
-
`),v=0;v<m.length;v++){var y=m[v],b=d.measureText(y),w=Math.ceil(b.width),T=o;p=Math.max(w,p),g+=T}return p+=a,g+=a,{width:p,height:g}};uo.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,i=t.isEdge(),a=e?e+"-":"",s=t.pstyle(a+"text-rotation"),o=s.strValue;return o==="none"?0:i&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};uo.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,i=n.rscratch;i.labelAngle=e.calculateLabelAngle(t),r&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var sW={},oN=28,lN=!1;sW.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<oN||t.height()<oN))return lN||(Cr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),lN=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var tb={};tb.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],h=u._private,d=h.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var i=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],h=u._private.rstyle;u.isNode()&&!h.cleanConnected&&(n(u.connectedEdges()),h.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){i(!0)},r.beforeRender(i,r.beforeRenderPriorities.eleCalcs)};tb.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};tb.recalculateRenderedStyle=function(t,e){var r=function(T){return T._private.rstyle.cleanConnected};if(t.length!==0){var n=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var a=0;a<t.length;a++){var s=t[a],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(w){return!w._private.rstyle.clean&&w.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?i.push(s):n.push(s),l.clean=!0)}for(var u=0;u<i.length;u++){var h=i[u],d=h._private,f=d.rstyle,p=h.position();this.recalculateNodeLabelProjection(h),f.nodeX=p.x,f.nodeY=p.y,f.nodeW=h.pstyle("width").pfValue,f.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var m=n[g],v=m._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}}};var rb={};rb.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};rb.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};rb.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(VH),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var oW={};[Bu,g2,_i,t1,Gk,uo,sW,tb,rb].forEach(function(t){Ut(oW,t)});var lW={};lW.getCachedImage=function(t,e,r){var n=this,i=n.imageCache=n.imageCache||{},a=i[t];if(a)return a.image.complete||a.image.addEventListener("load",r),a.image;a=i[t]=i[t]||{};var s=a.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Af={};Af.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(o!==void 0){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}var l=this.binder(t);return l.on.apply(l,i)};Af.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||nSe(t);if(e.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});r.addEventListener("test",null,a)}catch{}e.supportsPassiveEvents=i}var s=function(l,u,h){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Af.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Af.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Af.load=function(){var t=this,e=t.cy.window(),r=function($){return $.selected()},n=function($){var se=$.getRootNode();if(se&&se.nodeType===11&&se.host!==void 0)return se},i=function($,se,ae,fe){$==null&&($=t.cy);for(var he=0;he<se.length;he++){var Te=se[he];$.emit({originalEvent:ae,type:Te,position:fe})}},a=function($){return $.shiftKey||$.metaKey||$.ctrlKey},s=function($,se){var ae=!0;if(t.cy.hasCompoundNodes()&&$&&$.pannable())for(var fe=0;se&&fe<se.length;fe++){var $=se[fe];if($.isNode()&&$.isParent()&&!$.pannable()){ae=!1;break}}else ae=!0;return ae},o=function($){$[0]._private.grabbed=!0},l=function($){$[0]._private.grabbed=!1},u=function($){$[0]._private.rscratch.inDragLayer=!0},h=function($){$[0]._private.rscratch.inDragLayer=!1},d=function($){$[0]._private.rscratch.isGrabTarget=!0},f=function($){$[0]._private.rscratch.isGrabTarget=!1},p=function($,se){var ae=se.addToList,fe=ae.has($);!fe&&$.grabbable()&&!$.locked()&&(ae.merge($),o($))},g=function($,se){if($.cy().hasCompoundNodes()&&!(se.inDragLayer==null&&se.addToList==null)){var ae=$.descendants();se.inDragLayer&&(ae.forEach(u),ae.connectedEdges().forEach(u)),se.addToList&&p(ae,se)}},m=function($,se){se=se||{};var ae=$.cy().hasCompoundNodes();se.inDragLayer&&($.forEach(u),$.neighborhood().stdFilter(function(fe){return!ae||fe.isEdge()}).forEach(u)),se.addToList&&$.forEach(function(fe){p(fe,se)}),g($,se),b($,{inDragLayer:se.inDragLayer}),t.updateCachedGrabbedEles()},v=m,y=function($){$&&(t.getCachedZSortedEles().forEach(function(se){l(se),h(se),f(se)}),t.updateCachedGrabbedEles())},b=function($,se){if(!(se.inDragLayer==null&&se.addToList==null)&&$.cy().hasCompoundNodes()){var ae=$.ancestors().orphans();if(!ae.same($)){var fe=ae.descendants().spawnSelf().merge(ae).unmerge($).unmerge($.descendants()),he=fe.connectedEdges();se.inDragLayer&&(he.forEach(u),fe.forEach(u)),se.addToList&&fe.forEach(function(Te){p(Te,se)})}}},w=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",E=typeof ResizeObserver<"u";T?(t.removeObserver=new MutationObserver(function(ue){for(var $=0;$<ue.length;$++){var se=ue[$],ae=se.removedNodes;if(ae)for(var fe=0;fe<ae.length;fe++){var he=ae[fe];if(he===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ue){t.destroy()});var k=Zg(function(){t.cy.resize()},100);T&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),E&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var S=function($,se){for(;$!=null;)se($),$=$.parentNode},L=function(){t.invalidateContainerClientCoordsCache()};S(t.container,function(ue){t.registerBinding(ue,"transitionend",L),t.registerBinding(ue,"animationend",L),t.registerBinding(ue,"scroll",L)}),t.registerBinding(t.container,"contextmenu",function(ue){ue.preventDefault()});var A=function(){return t.selection[4]!==0},R=function($){for(var se=t.findContainerClientCoords(),ae=se[0],fe=se[1],he=se[2],Te=se[3],Se=$.touches?$.touches:[$],Ee=!1,Ge=0;Ge<Se.length;Ge++){var Je=Se[Ge];if(ae<=Je.clientX&&Je.clientX<=ae+he&&fe<=Je.clientY&&Je.clientY<=fe+Te){Ee=!0;break}}if(!Ee)return!1;for(var He=t.container,Xe=$.target,Ke=Xe.parentNode,$e=!1;Ke;){if(Ke===He){$e=!0;break}Ke=Ke.parentNode}return!!$e};t.registerBinding(t.container,"mousedown",function($){if(R($)&&!(t.hoverData.which===1&&$.which!==1)){$.preventDefault(),w(),t.hoverData.capture=!0,t.hoverData.which=$.which;var se=t.cy,ae=[$.clientX,$.clientY],fe=t.projectIntoViewport(ae[0],ae[1]),he=t.selection,Te=t.findNearestElements(fe[0],fe[1],!0,!1),Se=Te[0],Ee=t.dragData.possibleDragElements;t.hoverData.mdownPos=fe,t.hoverData.mdownGPos=ae;var Ge=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var je=t.hoverData.down;je?je.emit({originalEvent:$,type:"taphold",position:{x:fe[0],y:fe[1]}}):se.emit({originalEvent:$,type:"taphold",position:{x:fe[0],y:fe[1]}})}},t.tapholdDuration)};if($.which==3){t.hoverData.cxtStarted=!0;var Je={originalEvent:$,type:"cxttapstart",position:{x:fe[0],y:fe[1]}};Se?(Se.activate(),Se.emit(Je),t.hoverData.down=Se):se.emit(Je),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if($.which==1){Se&&Se.activate();{if(Se!=null&&t.nodeIsGrabbable(Se)){var He=function(je){return{originalEvent:$,type:je,position:{x:fe[0],y:fe[1]}}},Xe=function(je){je.emit(He("grab"))};if(d(Se),!Se.selected())Ee=t.dragData.possibleDragElements=se.collection(),v(Se,{addToList:Ee}),Se.emit(He("grabon")).emit(He("grab"));else{Ee=t.dragData.possibleDragElements=se.collection();var Ke=se.$(function($e){return $e.isNode()&&$e.selected()&&t.nodeIsGrabbable($e)});m(Ke,{addToList:Ee}),Se.emit(He("grabon")),Ke.forEach(Xe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Se,t.hoverData.downs=Te,t.hoverData.downTime=new Date().getTime()}i(Se,["mousedown","tapstart","vmousedown"],$,{x:fe[0],y:fe[1]}),Se==null?(he[4]=1,t.data.bgActivePosistion={x:fe[0],y:fe[1]},t.redrawHint("select",!0),t.redraw()):Se.pannable()&&(he[4]=1),Ge()}he[0]=he[2]=fe[0],he[1]=he[3]=fe[1]}},!1);var C=n(t.container);t.registerBinding([e,C],"mousemove",function($){var se=t.hoverData.capture;if(!(!se&&!R($))){var ae=!1,fe=t.cy,he=fe.zoom(),Te=[$.clientX,$.clientY],Se=t.projectIntoViewport(Te[0],Te[1]),Ee=t.hoverData.mdownPos,Ge=t.hoverData.mdownGPos,Je=t.selection,He=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(He=t.findNearestElement(Se[0],Se[1],!0,!1));var Xe=t.hoverData.last,Ke=t.hoverData.down,$e=[Se[0]-Je[2],Se[1]-Je[3]],je=t.dragData.possibleDragElements,lt;if(Ge){var st=Te[0]-Ge[0],qe=st*st,Et=Te[1]-Ge[1],Ye=Et*Et,Ze=qe+Ye;t.hoverData.isOverThresholdDrag=lt=Ze>=t.desktopTapThreshold2}var ht=a($);lt&&(t.hoverData.tapholdCancelled=!0);var ct=function(){var pt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];pt.length===0?(pt.push($e[0]),pt.push($e[1])):(pt[0]+=$e[0],pt[1]+=$e[1])};ae=!0,i(He,["mousemove","vmousemove","tapdrag"],$,{x:Se[0],y:Se[1]});var ut=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||fe.emit({originalEvent:$,type:"boxstart",position:{x:Se[0],y:Se[1]}}),Je[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(lt){var mt={originalEvent:$,type:"cxtdrag",position:{x:Se[0],y:Se[1]}};Ke?Ke.emit(mt):fe.emit(mt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||He!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:Se[0],y:Se[1]}}),t.hoverData.cxtOver=He,He&&He.emit({originalEvent:$,type:"cxtdragover",position:{x:Se[0],y:Se[1]}}))}}else if(t.hoverData.dragging){if(ae=!0,fe.panningEnabled()&&fe.userPanningEnabled()){var sr;if(t.hoverData.justStartedPan){var Rt=t.hoverData.mdownPos;sr={x:(Se[0]-Rt[0])*he,y:(Se[1]-Rt[1])*he},t.hoverData.justStartedPan=!1}else sr={x:$e[0]*he,y:$e[1]*he};fe.panBy(sr),fe.emit("dragpan"),t.hoverData.dragged=!0}Se=t.projectIntoViewport($.clientX,$.clientY)}else if(Je[4]==1&&(Ke==null||Ke.pannable())){if(lt){if(!t.hoverData.dragging&&fe.boxSelectionEnabled()&&(ht||!fe.panningEnabled()||!fe.userPanningEnabled()))ut();else if(!t.hoverData.selecting&&fe.panningEnabled()&&fe.userPanningEnabled()){var hr=s(Ke,t.hoverData.downs);hr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Je[4]=0,t.data.bgActivePosistion=dh(Ee),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&He!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],$,{x:Se[0],y:Se[1]}),He&&i(He,["mouseover","tapdragover"],$,{x:Se[0],y:Se[1]}),t.hoverData.last=He),Ke)if(lt){if(fe.boxSelectionEnabled()&&ht)Ke&&Ke.grabbed()&&(y(je),Ke.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(Ke.emit("dragfreeon"),je.emit("dragfree"))),ut();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var rr=!t.dragData.didDrag;rr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||m(je,{inDragLayer:!0});var er={x:0,y:0};if(gt($e[0])&>($e[1])&&(er.x+=$e[0],er.y+=$e[1],rr)){var Wt=t.hoverData.dragDelta;Wt&>(Wt[0])&>(Wt[1])&&(er.x+=Wt[0],er.y+=Wt[1])}t.hoverData.draggingEles=!0,je.silentShift(er).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else ct();ae=!0}if(Je[2]=Se[0],Je[3]=Se[1],ae)return $.stopPropagation&&$.stopPropagation(),$.preventDefault&&$.preventDefault(),!1}},!1);var I,P,_;t.registerBinding(e,"mouseup",function($){if(!(t.hoverData.which===1&&$.which!==1&&t.hoverData.capture)){var se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var ae=t.cy,fe=t.projectIntoViewport($.clientX,$.clientY),he=t.selection,Te=t.findNearestElement(fe[0],fe[1],!0,!1),Se=t.dragData.possibleDragElements,Ee=t.hoverData.down,Ge=a($);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ee&&Ee.unactivate(),t.hoverData.which===3){var Je={originalEvent:$,type:"cxttapend",position:{x:fe[0],y:fe[1]}};if(Ee?Ee.emit(Je):ae.emit(Je),!t.hoverData.cxtDragged){var He={originalEvent:$,type:"cxttap",position:{x:fe[0],y:fe[1]}};Ee?Ee.emit(He):ae.emit(He)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Te,["mouseup","tapend","vmouseup"],$,{x:fe[0],y:fe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ee,["click","tap","vclick"],$,{x:fe[0],y:fe[1]}),P=!1,$.timeStamp-_<=ae.multiClickDebounceTime()?(I&&clearTimeout(I),P=!0,_=null,i(Ee,["dblclick","dbltap","vdblclick"],$,{x:fe[0],y:fe[1]})):(I=setTimeout(function(){P||i(Ee,["oneclick","onetap","voneclick"],$,{x:fe[0],y:fe[1]})},ae.multiClickDebounceTime()),_=$.timeStamp)),Ee==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a($)&&(ae.$(r).unselect(["tapunselect"]),Se.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Se=ae.collection()),Te==Ee&&!t.dragData.didDrag&&!t.hoverData.selecting&&Te!=null&&Te._private.selectable&&(t.hoverData.dragging||(ae.selectionType()==="additive"||Ge?Te.selected()?Te.unselect(["tapunselect"]):Te.select(["tapselect"]):Ge||(ae.$(r).unmerge(Te).unselect(["tapunselect"]),Te.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Xe=ae.collection(t.getAllInBox(he[0],he[1],he[2],he[3]));t.redrawHint("select",!0),Xe.length>0&&t.redrawHint("eles",!0),ae.emit({type:"boxend",originalEvent:$,position:{x:fe[0],y:fe[1]}});var Ke=function(lt){return lt.selectable()&&!lt.selected()};ae.selectionType()==="additive"||Ge||ae.$(r).unmerge(Xe).unselect(),Xe.emit("box").stdFilter(Ke).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!he[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var $e=Ee&&Ee.grabbed();y(Se),$e&&(Ee.emit("freeon"),Se.emit("free"),t.dragData.didDrag&&(Ee.emit("dragfreeon"),Se.emit("dragfree")))}}he[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var N=[],M=4,O,D=1e5,B=function($,se){for(var ae=0;ae<$.length;ae++)if($[ae]%se!==0)return!1;return!0},z=function($){for(var se=Math.abs($[0]),ae=1;ae<$.length;ae++)if(Math.abs($[ae])!==se)return!1;return!0},F=function($){var se=!1,ae=$.deltaY;if(ae==null&&($.wheelDeltaY!=null?ae=$.wheelDeltaY/4:$.wheelDelta!=null&&(ae=$.wheelDelta/4)),O==null)if(N.length>=M){var fe=N;if(O=B(fe,5),!O){var he=Math.abs(fe[0]);O=z(fe)&&he>5}if(O)for(var Te=0;Te<fe.length;Te++)D=Math.min(Math.abs(fe[Te]),D)}else N.push(ae),se=!0;else O&&(D=Math.min(Math.abs(ae),D));if(!t.scrollingPage){var Se=t.cy,Ee=Se.zoom(),Ge=Se.pan(),Je=t.projectIntoViewport($.clientX,$.clientY),He=[Je[0]*Ee+Ge.x,Je[1]*Ee+Ge.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){$.preventDefault();return}if(Se.panningEnabled()&&Se.userPanningEnabled()&&Se.zoomingEnabled()&&Se.userZoomingEnabled()){$.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Xe;se&&Math.abs(ae)>5&&(ae=_k(ae)*5),Xe=ae/-250,O&&(Xe/=D,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ke=$.deltaMode===1;Ke&&(Xe*=33);var $e=Se.zoom()*Math.pow(10,Xe);$.type==="gesturechange"&&($e=t.gestureStartZoom*$.scale),Se.zoom({level:$e,renderedPosition:{x:He[0],y:He[1]}}),Se.emit($.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function($){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function($){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||$.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ue){t.hasTouchStarted||F(ue)},!0),t.registerBinding(t.container,"mouseout",function($){var se=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function($){var se=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var G,q,Y,ee,Q,oe,pe,j,W,X,H,K,ne,Z=function($,se,ae,fe){return Math.sqrt((ae-$)*(ae-$)+(fe-se)*(fe-se))},be=function($,se,ae,fe){return(ae-$)*(ae-$)+(fe-se)*(fe-se)},ce;t.registerBinding(t.container,"touchstart",ce=function($){if(t.hasTouchStarted=!0,!!R($)){w(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,ae=t.touchData.now,fe=t.touchData.earlier;if($.touches[0]){var he=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);ae[0]=he[0],ae[1]=he[1]}if($.touches[1]){var he=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);ae[2]=he[0],ae[3]=he[1]}if($.touches[2]){var he=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);ae[4]=he[0],ae[5]=he[1]}if($.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var Te=t.findContainerClientCoords();W=Te[0],X=Te[1],H=Te[2],K=Te[3],G=$.touches[0].clientX-W,q=$.touches[0].clientY-X,Y=$.touches[1].clientX-W,ee=$.touches[1].clientY-X,ne=0<=G&&G<=H&&0<=Y&&Y<=H&&0<=q&&q<=K&&0<=ee&&ee<=K;var Se=se.pan(),Ee=se.zoom();Q=Z(G,q,Y,ee),oe=be(G,q,Y,ee),pe=[(G+Y)/2,(q+ee)/2],j=[(pe[0]-Se.x)/Ee,(pe[1]-Se.y)/Ee];var Ge=200,Je=Ge*Ge;if(oe<Je&&!$.touches[2]){var He=t.findNearestElement(ae[0],ae[1],!0,!0),Xe=t.findNearestElement(ae[2],ae[3],!0,!0);He&&He.isNode()?(He.activate().emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start=He):Xe&&Xe.isNode()?(Xe.activate().emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start=Xe):se.emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if($.touches[2])se.boxSelectionEnabled()&&$.preventDefault();else if(!$.touches[1]){if($.touches[0]){var Ke=t.findNearestElements(ae[0],ae[1],!0,!0),$e=Ke[0];if($e!=null&&($e.activate(),t.touchData.start=$e,t.touchData.starts=Ke,t.nodeIsGrabbable($e))){var je=t.dragData.touchDragEles=se.collection(),lt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),$e.selected()?(lt=se.$(function(Ze){return Ze.selected()&&t.nodeIsGrabbable(Ze)}),m(lt,{addToList:je})):v($e,{addToList:je}),d($e);var st=function(ht){return{originalEvent:$,type:ht,position:{x:ae[0],y:ae[1]}}};$e.emit(st("grabon")),lt?lt.forEach(function(Ze){Ze.emit(st("grab"))}):$e.emit(st("grab"))}i($e,["touchstart","tapstart","vmousedown"],$,{x:ae[0],y:ae[1]}),$e==null&&(t.data.bgActivePosistion={x:he[0],y:he[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(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&i(t.touchData.start,["taphold"],$,{x:ae[0],y:ae[1]})},t.tapholdDuration)}}if($.touches.length>=1){for(var qe=t.touchData.startPosition=[null,null,null,null,null,null],Et=0;Et<ae.length;Et++)qe[Et]=fe[Et]=ae[Et];var Ye=$.touches[0];t.touchData.startGPosition=[Ye.clientX,Ye.clientY]}}},!1);var re;t.registerBinding(e,"touchmove",re=function($){var se=t.touchData.capture;if(!(!se&&!R($))){var ae=t.selection,fe=t.cy,he=t.touchData.now,Te=t.touchData.earlier,Se=fe.zoom();if($.touches[0]){var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}if($.touches[1]){var Ee=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);he[2]=Ee[0],he[3]=Ee[1]}if($.touches[2]){var Ee=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);he[4]=Ee[0],he[5]=Ee[1]}var Ge=t.touchData.startGPosition,Je;if(se&&$.touches[0]&&Ge){for(var He=[],Xe=0;Xe<he.length;Xe++)He[Xe]=he[Xe]-Te[Xe];var Ke=$.touches[0].clientX-Ge[0],$e=Ke*Ke,je=$.touches[0].clientY-Ge[1],lt=je*je,st=$e+lt;Je=st>=t.touchTapThreshold2}if(se&&t.touchData.cxt){$.preventDefault();var qe=$.touches[0].clientX-W,Et=$.touches[0].clientY-X,Ye=$.touches[1].clientX-W,Ze=$.touches[1].clientY-X,ht=be(qe,Et,Ye,Ze),ct=ht/oe,ut=150,mt=ut*ut,sr=1.5,Rt=sr*sr;if(ct>=Rt||ht>=mt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var hr={originalEvent:$,type:"cxttapend",position:{x:he[0],y:he[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(hr),t.touchData.start=null):fe.emit(hr)}}if(se&&t.touchData.cxt){var hr={originalEvent:$,type:"cxtdrag",position:{x:he[0],y:he[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(hr):fe.emit(hr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var rr=t.findNearestElement(he[0],he[1],!0,!0);(!t.touchData.cxtOver||rr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:he[0],y:he[1]}}),t.touchData.cxtOver=rr,rr&&rr.emit({originalEvent:$,type:"cxtdragover",position:{x:he[0],y:he[1]}}))}else if(se&&$.touches[2]&&fe.boxSelectionEnabled())$.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||fe.emit({originalEvent:$,type:"boxstart",position:{x:he[0],y:he[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,ae[4]=1,!ae||ae.length===0||ae[0]===void 0?(ae[0]=(he[0]+he[2]+he[4])/3,ae[1]=(he[1]+he[3]+he[5])/3,ae[2]=(he[0]+he[2]+he[4])/3+1,ae[3]=(he[1]+he[3]+he[5])/3+1):(ae[2]=(he[0]+he[2]+he[4])/3,ae[3]=(he[1]+he[3]+he[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&$.touches[1]&&!t.touchData.didSelect&&fe.zoomingEnabled()&&fe.panningEnabled()&&fe.userZoomingEnabled()&&fe.userPanningEnabled()){$.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var er=t.dragData.touchDragEles;if(er){t.redrawHint("drag",!0);for(var Wt=0;Wt<er.length;Wt++){var Xr=er[Wt]._private;Xr.grabbed=!1,Xr.rscratch.inDragLayer=!1}}var pt=t.touchData.start,qe=$.touches[0].clientX-W,Et=$.touches[0].clientY-X,Ye=$.touches[1].clientX-W,Ze=$.touches[1].clientY-X,ke=Z(qe,Et,Ye,Ze),Qe=ke/Q;if(ne){var bt=qe-G,tr=Et-q,Mr=Ye-Y,Or=Ze-ee,Lr=(bt+Mr)/2,Sn=(tr+Or)/2,gi=fe.zoom(),Li=gi*Qe,dr=fe.pan(),At=j[0]*gi+dr.x,wt=j[1]*gi+dr.y,ot={x:-Li/gi*(At-dr.x-Lr)+At,y:-Li/gi*(wt-dr.y-Sn)+wt};if(pt&&pt.active()){var er=t.dragData.touchDragEles;y(er),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt.unactivate().emit("freeon"),er.emit("free"),t.dragData.didDrag&&(pt.emit("dragfreeon"),er.emit("dragfree"))}fe.viewport({zoom:Li,pan:ot,cancelOnFailedZoom:!0}),fe.emit("pinchzoom"),Q=ke,G=qe,q=Et,Y=Ye,ee=Ze,t.pinching=!0}if($.touches[0]){var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}if($.touches[1]){var Ee=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);he[2]=Ee[0],he[3]=Ee[1]}if($.touches[2]){var Ee=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);he[4]=Ee[0],he[5]=Ee[1]}}else if($.touches[0]&&!t.touchData.didSelect){var We=t.touchData.start,ar=t.touchData.last,rr;if(!t.hoverData.draggingEles&&!t.swipePanning&&(rr=t.findNearestElement(he[0],he[1],!0,!0)),se&&We!=null&&$.preventDefault(),se&&We!=null&&t.nodeIsDraggable(We))if(Je){var er=t.dragData.touchDragEles,de=!t.dragData.didDrag;de&&m(er,{inDragLayer:!0}),t.dragData.didDrag=!0;var ss={x:0,y:0};if(gt(He[0])&>(He[1])&&(ss.x+=He[0],ss.y+=He[1],de)){t.redrawHint("eles",!0);var ve=t.touchData.dragDelta;ve&>(ve[0])&>(ve[1])&&(ss.x+=ve[0],ss.y+=ve[1])}t.hoverData.draggingEles=!0,er.silentShift(ss).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Te[0]&&t.touchData.startPosition[1]==Te[1]&&t.redrawHint("eles",!0),t.redraw()}else{var ve=t.touchData.dragDelta=t.touchData.dragDelta||[];ve.length===0?(ve.push(He[0]),ve.push(He[1])):(ve[0]+=He[0],ve[1]+=He[1])}if(i(We||rr,["touchmove","tapdrag","vmousemove"],$,{x:he[0],y:he[1]}),(!We||!We.grabbed())&&rr!=ar&&(ar&&ar.emit({originalEvent:$,type:"tapdragout",position:{x:he[0],y:he[1]}}),rr&&rr.emit({originalEvent:$,type:"tapdragover",position:{x:he[0],y:he[1]}})),t.touchData.last=rr,se)for(var Wt=0;Wt<he.length;Wt++)he[Wt]&&t.touchData.startPosition[Wt]&&Je&&(t.touchData.singleTouchMoved=!0);if(se&&(We==null||We.pannable())&&fe.panningEnabled()&&fe.userPanningEnabled()){var sn=s(We,t.touchData.starts);sn&&($.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=dh(t.touchData.startPosition)),t.swipePanning?(fe.panBy({x:He[0]*Se,y:He[1]*Se}),fe.emit("dragpan")):Je&&(t.swipePanning=!0,fe.panBy({x:Ke*Se,y:je*Se}),fe.emit("dragpan"),We&&(We.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}}for(var Xe=0;Xe<he.length;Xe++)Te[Xe]=he[Xe];se&&$.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function($){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var me,Ve,Ue,Fe;if(t.registerBinding(e,"touchend",me=function($){var se=t.touchData.start,ae=t.touchData.capture;if(ae)$.touches.length===0&&(t.touchData.capture=!1),$.preventDefault();else return;var fe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var he=t.cy,Te=he.zoom(),Se=t.touchData.now,Ee=t.touchData.earlier;if($.touches[0]){var Ge=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);Se[0]=Ge[0],Se[1]=Ge[1]}if($.touches[1]){var Ge=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);Se[2]=Ge[0],Se[3]=Ge[1]}if($.touches[2]){var Ge=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);Se[4]=Ge[0],Se[5]=Ge[1]}se&&se.unactivate();var Je;if(t.touchData.cxt){if(Je={originalEvent:$,type:"cxttapend",position:{x:Se[0],y:Se[1]}},se?se.emit(Je):he.emit(Je),!t.touchData.cxtDragged){var He={originalEvent:$,type:"cxttap",position:{x:Se[0],y:Se[1]}};se?se.emit(He):he.emit(He)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!$.touches[2]&&he.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Xe=he.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));fe[0]=void 0,fe[1]=void 0,fe[2]=void 0,fe[3]=void 0,fe[4]=0,t.redrawHint("select",!0),he.emit({type:"boxend",originalEvent:$,position:{x:Se[0],y:Se[1]}});var Ke=function(mt){return mt.selectable()&&!mt.selected()};Xe.emit("box").stdFilter(Ke).select().emit("boxselect"),Xe.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.unactivate(),$.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!$.touches[1]){if(!$.touches[0]){if(!$.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $e=t.dragData.touchDragEles;if(se!=null){var je=se._private.grabbed;y($e),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(se.emit("freeon"),$e.emit("free"),t.dragData.didDrag&&(se.emit("dragfreeon"),$e.emit("dragfree"))),i(se,["touchend","tapend","vmouseup","tapdragout"],$,{x:Se[0],y:Se[1]}),se.unactivate(),t.touchData.start=null}else{var lt=t.findNearestElement(Se[0],Se[1],!0,!0);i(lt,["touchend","tapend","vmouseup","tapdragout"],$,{x:Se[0],y:Se[1]})}var st=t.touchData.startPosition[0]-Se[0],qe=st*st,Et=t.touchData.startPosition[1]-Se[1],Ye=Et*Et,Ze=qe+Ye,ht=Ze*Te*Te;t.touchData.singleTouchMoved||(se||he.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],$,{x:Se[0],y:Se[1]}),Ve=!1,$.timeStamp-Fe<=he.multiClickDebounceTime()?(Ue&&clearTimeout(Ue),Ve=!0,Fe=null,i(se,["dbltap","vdblclick"],$,{x:Se[0],y:Se[1]})):(Ue=setTimeout(function(){Ve||i(se,["onetap","voneclick"],$,{x:Se[0],y:Se[1]})},he.multiClickDebounceTime()),Fe=$.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(he.selectionType()==="single"?(he.$(r).unmerge(se).unselect(["tapunselect"]),se.select(["tapselect"])):se.selected()?se.unselect(["tapunselect"]):se.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var ct=0;ct<Se.length;ct++)Ee[ct]=Se[ct];t.dragData.didDrag=!1,$.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),$.touches.length<2&&($.touches.length===1&&(t.touchData.startGPosition=[$.touches[0].clientX,$.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var _e=[],Oe=function($){return{clientX:$.clientX,clientY:$.clientY,force:1,identifier:$.pointerId,pageX:$.pageX,pageY:$.pageY,radiusX:$.width/2,radiusY:$.height/2,screenX:$.screenX,screenY:$.screenY,target:$.target}},Ce=function($){return{event:$,touch:Oe($)}},Le=function($){_e.push(Ce($))},ze=function($){for(var se=0;se<_e.length;se++){var ae=_e[se];if(ae.event.pointerId===$.pointerId){_e.splice(se,1);return}}},ge=function($){var se=_e.filter(function(ae){return ae.event.pointerId===$.pointerId})[0];se.event=$,se.touch=Oe($)},Me=function($){$.touches=_e.map(function(se){return se.touch})},J=function($){return $.pointerType==="mouse"||$.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ue){J(ue)||(ue.preventDefault(),Le(ue),Me(ue),ce(ue))}),t.registerBinding(t.container,"pointerup",function(ue){J(ue)||(ze(ue),Me(ue),me(ue))}),t.registerBinding(t.container,"pointercancel",function(ue){J(ue)||(ze(ue),Me(ue),Ne(ue))}),t.registerBinding(t.container,"pointermove",function(ue){J(ue)||(ue.preventDefault(),ge(ue),Me(ue),re(ue))})}};var ol={};ol.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,u,h){return ng(o,l,this.points,n,i,a/2,s/2,u)},checkPoint:function(n,i,a,s,o,l,u,h){return Jo(n,i,this.points,l,u,s,o,[0,-1],a)}}};ol.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){return Ske(a,s,e,r,n/2+o,i/2+o)},checkPoint:function(e,r,n,i,a,s,o,l){return zc(e,r,i,a,s,o,n)}}};ol.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,i,a,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?uH(a,s):o;for(var f=new Array(e.length/2),p=0;p<e.length/2;p++)f[p]={x:n+h*e[p*2],y:i+d*e[p*2+1]};var g,m,v,y,b=f.length;for(m=f[b-1],g=0;g<b;g++)v=f[g%b],y=f[(g+1)%b],l[u][g]=Vk(m,v,y,o),m=v,v=y;return l[u]},draw:function(n,i,a,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,i,a,s,o,this.points,this.getOrCreateCorners(i,a,s,o,l,u,"drawCorners"))},intersectLine:function(n,i,a,s,o,l,u,h,d){return kke(o,l,this.points,n,i,a,s,u,this.getOrCreateCorners(n,i,a,s,h,d,"corners"))},checkPoint:function(n,i,a,s,o,l,u,h,d){return Eke(n,i,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,h,d,"corners"))}}};ol.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){return lH(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){var u=i/2,h=a/2;l=l==="auto"?ql(i,a):l,l=Math.min(u,h,l);var d=l*2;return!!(Jo(e,r,this.points,s,o,i,a-d,[0,-1],n)||Jo(e,r,this.points,s,o,i-d,a,[0,-1],n)||zc(e,r,d,d,s-u+l,o-h+l,n)||zc(e,r,d,d,s+u-l,o-h+l,n)||zc(e,r,d,d,s+u-l,o+h-l,n)||zc(e,r,d,d,s-u+l,o+h-l,n))}}};ol.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Rk(),points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,null,s)},generateCutTrianglePts:function(e,r,n,i,a){var s=a==="auto"?this.cornerLength:a,o=r/2,l=e/2,u=n-l,h=n+l,d=i-o,f=i+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[h-s,d,h,d+s,h-s,d+s],bottomRight:[h,f-s,h-s,f,h-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,i,a,s,o,l){var u=this.generateCutTrianglePts(n+2*o,i+2*o,e,r,l),h=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ng(a,s,h,e,r)},checkPoint:function(e,r,n,i,a,s,o,l){var u=l==="auto"?this.cornerLength:l;if(Jo(e,r,this.points,s,o,i,a-2*u,[0,-1],n)||Jo(e,r,this.points,s,o,i-2*u,a,[0,-1],n))return!0;var h=this.generateCutTrianglePts(i,a,s,o);return ea(e,r,h.topLeft)||ea(e,r,h.topRight)||ea(e,r,h.bottomRight)||ea(e,r,h.bottomLeft)}}};ol.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){var u=.15,h=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,i+2*o,e,r),p=function(v){var y=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},u),b=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},h),w=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},d);return[v[0],v[1],y.x,y.y,b.x,b.y,w.x,w.y,v[4],v[5]]},g=[].concat(p(f.topLeft),p(f.topRight),p(f.bottomRight),p(f.bottomLeft));return ng(a,s,g,e,r)},generateBarrelBezierPts:function(e,r,n,i){var a=r/2,s=e/2,o=n-s,l=n+s,u=i-a,h=i+a,d=GT(e,r),f=d.heightOffset,p=d.widthOffset,g=d.ctrlPtOffsetPct*e,m={topLeft:[o,u+f,o+g,u,o+p,u],topRight:[l-p,u,l-g,u,l,u+f],bottomRight:[l,h-f,l-g,h,l-p,h],bottomLeft:[o+p,h,o+g,h,o,h-f]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,r,n,i,a,s,o,l){var u=GT(i,a),h=u.heightOffset,d=u.widthOffset;if(Jo(e,r,this.points,s,o,i,a-2*h,[0,-1],n)||Jo(e,r,this.points,s,o,i-2*d,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(i,a,s,o),p=function(L,A,R){var C=R[4],I=R[2],P=R[0],_=R[5],N=R[1],M=Math.min(C,P),O=Math.max(C,P),D=Math.min(_,N),B=Math.max(_,N);if(M<=L&&L<=O&&D<=A&&A<=B){var z=Cke(C,I,P),F=xke(z[0],z[1],z[2],L),G=F.filter(function(q){return 0<=q&&q<=1});if(G.length>0)return G[0]}return null},g=Object.keys(f),m=0;m<g.length;m++){var v=g[m],y=f[v],b=p(e,r,y);if(b!=null){var w=y[5],T=y[3],E=y[1],k=Wn(w,T,E,b);if(y.isTop&&k<=r||y.isBottom&&r<=k)return!0}}return!1}}};ol.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){var u=e-(n/2+o),h=r-(i/2+o),d=h,f=e+(n/2+o),p=El(a,s,e,r,u,h,f,d,!1);return p.length>0?p:lH(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?ql(i,a):l;var u=2*l;if(Jo(e,r,this.points,s,o,i,a-u,[0,-1],n)||Jo(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(ea(e,r,f)||zc(e,r,u,u,s+i/2-l,o+a/2-l,n)||zc(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};ol.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ii(3,0)),this.generateRoundPolygon("round-triangle",Ii(3,0)),this.generatePolygon("rectangle",Ii(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",Ii(5,0)),this.generateRoundPolygon("round-pentagon",Ii(5,0)),this.generatePolygon("hexagon",Ii(6,0)),this.generateRoundPolygon("round-hexagon",Ii(6,0)),this.generatePolygon("heptagon",Ii(7,0)),this.generateRoundPolygon("round-heptagon",Ii(7,0)),this.generatePolygon("octagon",Ii(8,0)),this.generateRoundPolygon("round-octagon",Ii(8,0));var n=new Array(20);{var i=VT(5,0),a=VT(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[o*2]*=s,a[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=i[o*2],n[o*4+1]=i[o*2+1],n[o*4+2]=a[o*2],n[o*4+3]=a[o*2+1]}n=cH(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(u){var h=u.join("$"),d="polygon-"+h,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var r1={};r1.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};r1.redraw=function(t){t=t||aH();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};r1.beforeRender=function(t,e){if(!this.destroyed){e==null&&nn("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,i){return i.priority-n.priority})}};var cN=function(e,r,n){for(var i=e.beforeRenderCallbacks,a=0;a<i.length;a++)i[a].fn(r,n)};r1.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){cN(t,!0,i);var a=Qo();t.render(t.renderOptions);var s=t.lastDrawTime=Qo();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-a),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-a;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else cN(t,!1,i);t.skipFrame=!1,o2(r)}};o2(r)}};var U8e=function(e){this.init(e)},cW=U8e,_f=cW.prototype;_f.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];_f.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=i.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=i.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",a.insertBefore(u,a.children[0])}var h=n.getComputedStyle(r),d=h.getPropertyValue("position");d==="static"&&Cr("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=gt(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()};_f.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};_f.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,i=n.target;(i.off||i.removeEventListener).apply(i,n.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{}};_f.isHeadless=function(){return!1};[zk,oW,lW,Af,ol,r1].forEach(function(t){Ut(_f,t)});var o3=1e3/60,uW={setupDequeueing:function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var a=Zg(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(u,h){var d=Qo(),f=i.averageRedrawTime,p=i.lastRedrawTime,g=[],m=i.cy.extent(),v=i.getPixelRatio();for(u||i.flushRenderedStyleQueue();;){var y=Qo(),b=y-d,w=y-h;if(p<o3){var T=o3-(u?f:0);if(w>=e.deqFastCost*T)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(w>=e.deqNoDrawCost*o3)break;var E=e.deq(n,v,m);if(E.length>0)for(var k=0;k<E.length;k++)g.push(E[k]);else break}g.length>0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,m)&&a())},o=e.priority||kk;i.beforeRender(s,o(n))}}}},q8e=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l2;rc(this,t),this.idsByKey=new Oo,this.keyForId=new Oo,this.cachesByLvl=new Oo,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return nc(t,[{key:"getIdsFor",value:function(r){r==null&&nn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Ef,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Oo,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])}(),uN=25,cm=50,pv=-4,t6=3,hW=7.99,H8e=8,W8e=1024,Y8e=1024,X8e=1024,j8e=.2,K8e=.8,Z8e=10,Q8e=.15,J8e=.1,eAe=.9,tAe=.9,rAe=100,nAe=1,ph={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},iAe=fi({getKey:null,doesEleInvalidateKey:l2,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:rH,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ep=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=iAe(r);Ut(n,i),n.lookup=new q8e(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},qn=ep.prototype;qn.reasons=ph;qn.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};qn.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};qn.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Qg(function(r,n){return n.reqs-r.reqs});return e};qn.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};qn.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Ak(o*r))),n<pv)n=pv;else if(o>=hW||n>t6)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=uN?g=uN:h<=cm?g=cm:g=Math.ceil(h/cm)*cm,h>X8e||d>Y8e)return null;var m=a.getTextureQueue(g),v=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};v||(v=m[m.length-1]),v||(v=y()),v.width-v.usedWidth<d&&(v=y());for(var b=function(M){return M&&M.scaledLabelShown===f},w=i&&i===ph.dequeue,T=i&&i===ph.highQuality,E=i&&i===ph.downscale,k,S=n+1;S<=t6;S++){var L=l.get(t,S);if(L){k=L;break}}var A=k&&k.level===n+1?k:null,R=function(){v.context.drawImage(A.texture.canvas,A.x,0,A.width,A.height,v.usedWidth,0,d,h)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,d,g),b(A))R();else if(b(k))if(T){for(var C=k.level;C>n;C--)A=a.getElement(t,e,r,C,ph.downscale);R()}else return a.queueElement(t,k.level-1),k;else{var I;if(!w&&!T&&!E)for(var P=n-1;P>=pv;P--){var _=l.get(t,P);if(_){I=_;break}}if(b(I))return a.queueElement(t,n),I;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,t,e,f,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return p={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:h,scaledLabelShown:f},v.usedWidth+=Math.ceil(d+H8e),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p};qn.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};qn.invalidateElement=function(t){var e=this,r=e.lookup,n=[],i=r.isInvalid(t);if(i){for(var a=pv;a<=t6;a++){var s=r.getForCachedKey(t,a);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],h=u.texture;h.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};qn.checkTextureUtility=function(t){t.invalidatedWidth>=j8e*t.width&&this.retireTexture(t)};qn.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>K8e&&t.fullnessChecks>=Z8e?Ul(r,t):t.fullnessChecks++};qn.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Ul(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s<a.length;s++){var o=a[s];i.deleteCache(o.key,o.level)}Ck(a);var l=e.getRetiredTextureQueue(r);l.push(t)};qn.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),i={};return n.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(W8e,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=r.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};qn.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),i=r.getRetiredTextureQueue(t),a=0;a<i.length;a++){var s=i[a];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Ck(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ul(i,s),n.push(s),s}};qn.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};qn.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<nAe&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,ph.dequeue)}return i};qn.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=Sk,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};qn.onDequeue=function(t){this.onDequeues.push(t)};qn.offDequeue=function(t){Ul(this.onDequeues,t)};qn.setupDequeueing=uW.setupDequeueing({deqRedrawThreshold:rAe,deqCost:Q8e,deqAvgCost:J8e,deqNoDrawCost:eAe,deqFastCost:tAe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var i=e.onDequeues[n];i(r)}},shouldRedraw:function(e,r,n,i){for(var a=0;a<r.length;a++)for(var s=r[a].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(Lk(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var aAe=1,vp=-4,m2=2,sAe=3.99,oAe=50,lAe=50,cAe=.15,uAe=.1,hAe=.9,dAe=.9,fAe=1,hN=250,pAe=4e3*4e3,dN=32767,gAe=!0,dW=function(e){var r=this,n=r.renderer=e,i=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Qo()-2*hN,r.skipping=!1,r.eleTxrDeqs=i.collection(),r.scheduleElementRefinement=Zg(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},lAe),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=hN?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(o,l){return l.reqs-o.reqs};r.layersQueue=new Qg(a),r.setupDequeueing()},pi=dW.prototype,fN=0,mAe=Math.pow(2,53)-1;pi.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:fN=++fN%mAe,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,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};pi.getLayers=function(t,e,r){var n=this,i=n.renderer,a=i.cy,s=a.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Ak(s*e)),r<vp)r=vp;else if(s>=sAe||r>m2)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var R=function(N){if(n.validateLayersElesOrdering(N,t),n.levelIsComplete(N,t))return p=l[N],!0},C=function(N){if(!p)for(var M=r+N;vp<=M&&M<=m2&&!R(M);M+=N);};C(1),C(-1);for(var I=h.length-1;I>=0;I--){var P=h[I];P.invalid&&Ul(h,P)}};if(!f)g();else return h;var m=function(){if(!d){d=ua();for(var R=0;R<t.length;R++)oH(d,t[R].boundingBox())}return d},v=function(R){R=R||{};var C=R.after;m();var I=Math.ceil(d.w*u),P=Math.ceil(d.h*u);if(I>dN||P>dN)return null;var _=I*P;if(_>pAe)return null;var N=n.makeLayer(d,r);if(C!=null){var M=h.indexOf(C)+1;h.splice(M,0,N)}else(R.insert===void 0||R.insert)&&h.unshift(N);return N};if(n.skipping&&!o)return null;for(var y=null,b=t.length/aAe,w=!o,T=0;T<t.length;T++){var E=t[T],k=E._private.rscratch,S=k.imgLayerCaches=k.imgLayerCaches||{},L=S[r];if(L){y=L;continue}if((!y||y.eles.length>=b||!mke(y.bb,E.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;p||w?n.queueLayer(y,E):n.drawEleInLayer(y,E,r,e),y.eles.push(E),S[r]=y}return p||(w?null:h)};pi.getEleLevelForLayerLevel=function(t,e){return t};pi.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,gAe),a.setImgSmoothing(s,!0))};pi.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a<n.length;a++){var s=n[a];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};pi.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);continue}for(var o=a,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}};pi.updateElementsInLayers=function(t,e){for(var r=this,n=Yg(t[0]),i=0;i<t.length;i++)for(var a=n?null:t[i],s=n?t[i]:t[i].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=vp;u<=m2;u++){var h=l[u];h&&(a&&r.getEleLevelForLayerLevel(h.level)!==a.level||e(h,s,a))}};pi.haveLayers=function(){for(var t=this,e=!1,r=vp;r<=m2;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};pi.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Qo(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};pi.invalidateLayer=function(t){if(this.lastInvalidationTime=Qo(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Ul(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)}}};pi.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,i,a){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};pi.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};pi.queueLayer=function(t,e){var r=this,n=r.layersQueue,i=t.elesQueue,a=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(a[e.id()])return;i.push(e),a[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};pi.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],i=0;i<fAe&&r.size()!==0;){var a=r.peek();if(a.replacement){r.pop();continue}if(a.replaces&&a!==a.replaces.replacement){r.pop();continue}if(a.invalid){r.pop();continue}var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),n.length===0&&n.push(!0),a.elesQueue.length===0&&(r.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}return n};pi.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,i=r.indexOf(n);if(!(i<0||n.invalid)){r[i]=t;for(var a=0;a<t.eles.length;a++){var s=t.eles[a]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};pi.requestRedraw=Zg(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);pi.setupDequeueing=uW.setupDequeueing({deqRedrawThreshold:oAe,deqCost:cAe,deqAvgCost:uAe,deqNoDrawCost:hAe,deqFastCost:dAe,deq:function(e,r){return e.dequeue(r)},onDeqd:kk,shouldRedraw:rH,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var fW={},pN;function vAe(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function yAe(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function gN(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(var i=1;i<s.length;i++){var a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function xAe(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,Math.PI*2,!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 bAe(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}fW.arrowShapeImpl=function(t){return(pN||(pN={polygon:vAe,"triangle-backcurve":yAe,"triangle-tee":gN,"circle-triangle":xAe,"triangle-cross":gN,circle:bAe}))[t]};var ho={};ho.drawElement=function(t,e,r,n,i,a){var s=this;e.isNode()?s.drawNode(t,e,r,n,i,a):s.drawEdge(t,e,r,n,i,a)};ho.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};ho.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};ho.drawCachedElementPortion=function(t,e,r,n,i,a,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var h=r.getElement(e,u,n,i,a);if(h!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),p=u.x1,g=u.y1,m=u.w,v=u.h,y,b,w,T,E;if(f!==0){var k=r.getRotationPoint(e);w=k.x,T=k.y,t.translate(w,T),t.rotate(f),E=l.getImgSmoothing(t),E||l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);y=S.x,b=S.y}else y=p,b=g;var L;d!==1&&(L=t.globalAlpha,t.globalAlpha=L*d),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,y,b,m,v),d!==1&&(t.globalAlpha=L),f!==0&&(t.rotate(-f),t.translate(-w,-T),E||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var wAe=function(){return 0},TAe=function(e,r){return e.getTextAngle(r,null)},EAe=function(e,r){return e.getTextAngle(r,"source")},SAe=function(e,r){return e.getTextAngle(r,"target")},kAe=function(e,r){return r.effectiveOpacity()},l3=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};ho.drawCachedElement=function(t,e,r,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,h=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),p=a===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||Lk(f,n))){var g=e.isEdge(),m=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,i,p,wAe,kAe),(!g||!m)&&s.drawCachedElementPortion(t,e,u,r,i,p,TAe,l3),g&&!m&&(s.drawCachedElementPortion(t,e,h,r,i,p,EAe,l3),s.drawCachedElementPortion(t,e,d,r,i,p,SAe,l3)),s.drawElementOverlay(t,e)}};ho.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var i=e[n];r.drawElement(t,i)}};ho.drawCachedElements=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];i.drawCachedElement(t,s,r,n)}};ho.drawCachedNodes=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];s.isNode()&&i.drawCachedElement(t,s,r,n)}};ho.drawLayeredElements=function(t,e,r,n){var i=this,a=i.data.lyrTxrCache.getLayers(e,r);if(a)for(var s=0;s<a.length;s++){var o=a[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(t,e,r,n)};var ll={};ll.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,y=u*h,b=u*h,w=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,N),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,N),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},T=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,v[0],v[1],v[2],N);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},E=function(){i&&s.drawEdgeOverlay(t,e)},k=function(){i&&s.drawEdgeUnderlay(t,e)},S=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,N)},L=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var R=e.pstyle("ghost-offset-x").pfValue,C=e.pstyle("ghost-offset-y").pfValue,I=e.pstyle("ghost-opacity").value,P=y*I;t.translate(R,C),w(P),S(P),t.translate(-R,-C)}else T();k(),w(),S(),E(),L(),r&&t.translate(l.x1,l.y1)}};var pW=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};ll.drawEdgeOverlay=pW("overlay");ll.drawEdgeUnderlay=pW("underlay");ll.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+3<r.length;p+=4)e.quadraticCurveTo(r[p],r[p+1],r[p+2],r[p+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)e.lineTo(r[g],r[g+1]);break;case"segments":if(i.isRound){var m=na(i.roundCorners),v;try{for(m.s();!(v=m.n()).done;){var y=v.value;rW(e,y)}}catch(w){m.e(w)}finally{m.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=a,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};ll.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()}};ll.drawArrowheads=function(t,e,r){var n=e._private.rscratch,i=n.edgeType==="haystack";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)};ll.drawArrowhead=function(t,e,r,n,i,a,s){if(!(isNaN(n)||n==null||isNaN(i)||i==null||isNaN(a)||a==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),p=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(p*=d);var g=e.pstyle("opacity").value;s===void 0&&(s=g);var m=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,p,n,i,a),t.globalCompositeOperation=m);var v=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,v[0],v[1],v[2],s),o.colorStrokeStyle(t,v[0],v[1],v[2],s),o.drawArrowShape(e,t,h,d,l,p,n,i,a)}}};ll.drawArrowShape=function(t,e,r,n,i,a,s,o,l){var u=this,h=this.usePaths()&&i!=="triangle-cross",d=!1,f,p=e,g={x:s,y:o},m=t.pstyle("arrow-scale").value,v=this.getArrowWidth(n,m),y=u.arrowShapes[i];if(h){var b=u.arrowPathCache=u.arrowPathCache||[],w=hu(i),T=b[w];T!=null?(f=e=T,d=!0):(f=e=new Path2D,b[w]=f)}d||(e.beginPath&&e.beginPath(),h?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,v,l,g,n),e.closePath&&e.closePath()),e=p,h&&(e.translate(s,o),e.rotate(l),e.scale(v,v)),(r==="filled"||r==="both")&&(h?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=a/(h?v:1),e.lineJoin="miter",h?e.stroke(f):e.stroke()),h&&(e.scale(1/v,1/v),e.rotate(-l),e.translate(-s,-o))};var Uk={};Uk.safeDrawImage=function(t,e,r,n,i,a,s,o,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{t.drawImage(e,r,n,i,a,s,o,l,u)}catch(h){Cr(h)}};Uk.drawInscribedImage=function(t,e,r,n,i){var a=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),h=u.getIndexedStyle.bind(u),d=h(r,"background-fit","value",n),f=h(r,"background-repeat","value",n),p=r.width(),g=r.height(),m=r.padding()*2,v=p+(h(r,"background-width-relative-to","value",n)==="inner"?0:m),y=g+(h(r,"background-height-relative-to","value",n)==="inner"?0:m),b=r._private.rscratch,w=h(r,"background-clip","value",n),T=w==="node",E=h(r,"background-image-opacity","value",n)*i,k=h(r,"background-image-smoothing","value",n),S=r.pstyle("corner-radius").value;S!=="auto"&&(S=r.pstyle("corner-radius").pfValue);var L=e.width||e.cachedW,A=e.height||e.cachedH;(L==null||A==null)&&(document.body.appendChild(e),L=e.cachedW=e.width||e.offsetWidth,A=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var R=L,C=A;if(h(r,"background-width","value",n)!=="auto"&&(h(r,"background-width","units",n)==="%"?R=h(r,"background-width","pfValue",n)*v:R=h(r,"background-width","pfValue",n)),h(r,"background-height","value",n)!=="auto"&&(h(r,"background-height","units",n)==="%"?C=h(r,"background-height","pfValue",n)*y:C=h(r,"background-height","pfValue",n)),!(R===0||C===0)){if(d==="contain"){var I=Math.min(v/R,y/C);R*=I,C*=I}else if(d==="cover"){var I=Math.max(v/R,y/C);R*=I,C*=I}var P=o-v/2,_=h(r,"background-position-x","units",n),N=h(r,"background-position-x","pfValue",n);_==="%"?P+=(v-R)*N:P+=N;var M=h(r,"background-offset-x","units",n),O=h(r,"background-offset-x","pfValue",n);M==="%"?P+=(v-R)*O:P+=O;var D=l-y/2,B=h(r,"background-position-y","units",n),z=h(r,"background-position-y","pfValue",n);B==="%"?D+=(y-C)*z:D+=z;var F=h(r,"background-offset-y","units",n),G=h(r,"background-offset-y","pfValue",n);F==="%"?D+=(y-C)*G:D+=G,b.pathCache&&(P-=o,D-=l,o=0,l=0);var q=t.globalAlpha;t.globalAlpha=E;var Y=a.getImgSmoothing(t),ee=!1;if(k==="no"&&Y?(a.setImgSmoothing(t,!1),ee=!0):k==="yes"&&!Y&&(a.setImgSmoothing(t,!0),ee=!0),f==="no-repeat")T&&(t.save(),b.pathCache?t.clip(b.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.clip())),a.safeDrawImage(t,e,0,0,L,A,P,D,R,C),T&&t.restore();else{var Q=t.createPattern(e,f);t.fillStyle=Q,a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.translate(P,D),t.fill(),t.translate(-P,-D)}t.globalAlpha=q,ee&&a.setImgSmoothing(t,Y)}};var Fu={};Fu.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(Ak(r*n));e=Math.pow(2,i)}var a=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};Fu.drawElementText=function(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,h=e.pstyle("label"),d=e.pstyle("source-label"),f=e.pstyle("target-label");if(u||(!h||!h.value)&&(!d||!d.value)&&(!f||!f.value))return;t.textAlign="center",t.textBaseline="bottom"}var p=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),i==null?(s.drawText(t,e,null,p,a),e.isEdge()&&(s.drawText(t,e,"source",p,a),s.drawText(t,e,"target",p,a))):s.drawText(t,e,i,p,a),r&&t.translate(g.x1,g.y1)};Fu.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Fu.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function c3(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?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()}Fu.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ji(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};Fu.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ji(s,"labelX",r),u=Ji(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ji(s,"labelWidth",r),m=Ji(s,"labelHeight",r),v=e.pstyle(p+"text-margin-x").pfValue,y=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;b&&(w="center",T="center"),l+=v,u+=y;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(h=l,d=u,t.translate(h,d),t.rotate(E),l=0,u=0),T){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var k=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,A=e.pstyle("text-background-padding").pfValue,R=e.pstyle("text-background-shape").strValue,C=R.indexOf("round")===0,I=2;if(k>0||L>0&&S>0){var P=l-A;switch(w){case"left":P-=g;break;case"center":P-=g/2;break}var _=u-m-A,N=g+2*A,M=m+2*A;if(k>0){var O=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",C?c3(t,P,_,N,M,I):t.fillRect(P,_,N,M),t.fillStyle=O}if(L>0&&S>0){var B=t.strokeStyle,z=t.lineWidth,F=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+F[0]+","+F[1]+","+F[2]+","+S*o+")",t.lineWidth=L,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(C?c3(t,P,_,N,M,I,"stroke"):t.strokeRect(P,_,N,M),G==="double"){var q=L/2;C?c3(t,P+q,_+q,N-q*2,M-q*2,I,"stroke"):t.strokeRect(P+q,_+q,N-q*2,M-q*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=z,t.strokeStyle=B}}var Y=2*e.pstyle("text-outline-width").pfValue;if(Y>0&&(t.lineWidth=Y),e.pstyle("text-wrap").value==="wrap"){var ee=Ji(s,"labelWrapCachedLines",r),Q=Ji(s,"labelLineHeight",r),oe=g/2,pe=this.getLabelJustification(e);switch(pe==="auto"||(w==="left"?pe==="left"?l+=-g:pe==="center"&&(l+=-oe):w==="center"?pe==="left"?l+=-oe:pe==="right"&&(l+=oe):w==="right"&&(pe==="center"?l+=oe:pe==="right"&&(l+=g))),T){case"top":u-=(ee.length-1)*Q;break;case"center":case"bottom":u-=(ee.length-1)*Q;break}for(var j=0;j<ee.length;j++)Y>0&&t.strokeText(ee[j],l,u),t.fillText(ee[j],l,u),u+=Q}else Y>0&&t.strokeText(f,l,u),t.fillText(f,l,u);E!==0&&(t.rotate(-E),t.translate(-h,-d))}}};var ac={};ac.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!gt(d.x)||!gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,v=e.padding();o=e.width()+2*v,l=e.height()+2*v;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,T=new Array(w.length),E=new Array(w.length),k=0,S=0;S<w.length;S++){var L=w[S],A=T[S]=L!=null&&L!=="none";if(A){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);k++,E[S]=s.getCachedImage(L,R,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var C=e.pstyle("background-blacken").value,I=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*f,_=e.pstyle("border-color").value,N=e.pstyle("border-style").value,M=e.pstyle("border-join").value,O=e.pstyle("border-cap").value,D=e.pstyle("border-position").value,B=e.pstyle("border-dash-pattern").pfValue,z=e.pstyle("border-dash-offset").pfValue,F=e.pstyle("border-opacity").value*f,G=e.pstyle("outline-width").pfValue,q=e.pstyle("outline-color").value,Y=e.pstyle("outline-style").value,ee=e.pstyle("outline-opacity").value*f,Q=e.pstyle("outline-offset").value,oe=e.pstyle("corner-radius").value;oe!=="auto"&&(oe=e.pstyle("corner-radius").pfValue);var pe=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.eleFillStyle(t,e,J)},j=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.colorStrokeStyle(t,_[0],_[1],_[2],J)},W=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ee;s.colorStrokeStyle(t,q[0],q[1],q[2],J)},X=function(J,ue,$,se){var ae=s.nodePathCache=s.nodePathCache||[],fe=tH($==="polygon"?$+","+se.join(","):$,""+ue,""+J,""+oe),he=ae[fe],Te,Se=!1;return he!=null?(Te=he,Se=!0,h.pathCache=Te):(Te=new Path2D,ae[fe]=h.pathCache=Te),{path:Te,cacheHit:Se}},H=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ne=X(o,l,H,K);g=ne.path,m=ne.cacheHit}var Z=function(){if(!m){var J=d;p&&(J={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,J.x,J.y,o,l,oe,h)}p?t.fill(g):t.fill()},be=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,$=u.backgrounding,se=0,ae=0;ae<E.length;ae++){var fe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ae);if(ue&&fe==="over"||!ue&&fe==="inside"){se++;continue}T[ae]&&E[ae].complete&&!E[ae].error&&(se++,s.drawInscribedImage(t,E[ae],e,ae,J))}u.backgrounding=se!==k,$!==u.backgrounding&&e.updateStyle(!1)},ce=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ue),J&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h)))},re=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h),t.clip()),s.drawStripe(t,e,ue),t.restore(),J&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h)))},Ne=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(C>0?C:-C)*J,$=C>0?0:255;C!==0&&(s.colorFillStyle(t,$,$,$,ue),p?t.fill(g):t.fill())},me=function(){if(I>0){if(t.lineWidth=I,t.lineCap=O,t.lineJoin=M,t.setLineDash)switch(N){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var J=new Path2D;J.rect(-o/2-I,-l/2-I,o+2*I,l+2*I),J.addPath(g),t.clip(J,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(N==="double"){t.lineWidth=I/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},Ve=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;p&&(J={x:0,y:0});var ue=s.getNodeShape(e),$=I;D==="inside"&&($=0),D==="outside"&&($*=2);var se=(o+$+(G+Q))/o,ae=(l+$+(G+Q))/l,fe=o*se,he=l*ae,Te=s.nodeShapes[ue].points,Se;if(p){var Ee=X(fe,he,ue,Te);Se=Ee.path}if(ue==="ellipse")s.drawEllipsePath(Se||t,J.x,J.y,fe,he);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var Ge=0,Je=0,He=0;ue==="round-diamond"?Ge=($+Q+G)*1.4:ue==="round-heptagon"?(Ge=($+Q+G)*1.075,He=-($/2+Q+G)/35):ue==="round-hexagon"?Ge=($+Q+G)*1.12:ue==="round-pentagon"?(Ge=($+Q+G)*1.13,He=-($/2+Q+G)/15):ue==="round-tag"?(Ge=($+Q+G)*1.12,Je=($/2+G+Q)*.07):ue==="round-triangle"&&(Ge=($+Q+G)*(Math.PI/2),He=-($+Q/2+G)/Math.PI),Ge!==0&&(se=(o+Ge)/o,fe=o*se,["round-hexagon","round-tag"].includes(ue)||(ae=(l+Ge)/l,he=l*ae)),oe=oe==="auto"?uH(fe,he):oe;for(var Xe=fe/2,Ke=he/2,$e=oe+($+G+Q)/2,je=new Array(Te.length/2),lt=new Array(Te.length/2),st=0;st<Te.length/2;st++)je[st]={x:J.x+Je+Xe*Te[st*2],y:J.y+He+Ke*Te[st*2+1]};var qe,Et,Ye,Ze,ht=je.length;for(Et=je[ht-1],qe=0;qe<ht;qe++)Ye=je[qe%ht],Ze=je[(qe+1)%ht],lt[qe]=Vk(Et,Ye,Ze,$e),Et=Ye,Ye=Ze;s.drawRoundPolygonPath(Se||t,J.x+Je,J.y+He,o*se,l*ae,Te,lt)}else if(["roundrectangle","round-rectangle"].includes(ue))oe=oe==="auto"?ql(fe,he):oe,s.drawRoundRectanglePath(Se||t,J.x,J.y,fe,he,oe+($+G+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(ue))oe=oe==="auto"?Rk():oe,s.drawCutRectanglePath(Se||t,J.x,J.y,fe,he,null,oe+($+G+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ue))oe=oe==="auto"?ql(fe,he):oe,s.drawBottomRoundRectanglePath(Se||t,J.x,J.y,fe,he,oe+($+G+Q)/2);else if(ue==="barrel")s.drawBarrelPath(Se||t,J.x,J.y,fe,he);else if(ue.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ue)){var ct=($+G+Q)/o;Te=c2(u2(Te,ct)),s.drawPolygonPath(Se||t,J.x,J.y,o,l,Te)}else{var ut=($+G+Q)/o;Te=c2(u2(Te,-ut)),s.drawPolygonPath(Se||t,J.x,J.y,o,l,Te)}if(p?t.stroke(Se):t.stroke(),Y==="double"){t.lineWidth=$/3;var mt=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(Se):t.stroke(),t.globalCompositeOperation=mt}t.setLineDash&&t.setLineDash([])}},Ue=function(){i&&s.drawNodeOverlay(t,e,d,o,l)},Fe=function(){i&&s.drawNodeUnderlay(t,e,d,o,l)},_e=function(){s.drawElementText(t,e,null,n)},Oe=e.pstyle("ghost").value==="yes";if(Oe){var Ce=e.pstyle("ghost-offset-x").pfValue,Le=e.pstyle("ghost-offset-y").pfValue,ze=e.pstyle("ghost-opacity").value,ge=ze*f;t.translate(Ce,Le),W(),Ve(),pe(ze*P),Z(),be(ge,!0),j(ze*F),me(),ce(C!==0||I!==0),re(C!==0||I!==0),be(ge,!1),Ne(ge),t.translate(-Ce,-Le)}p&&t.translate(-d.x,-d.y),Fe(),p&&t.translate(d.x,d.y),W(),Ve(),pe(),Z(),be(f,!0),j(),me(),ce(C!==0||I!==0),re(C!==0||I!==0),be(f,!1),Ne(),p&&t.translate(-d.x,-d.y),_e(),Ue(),r&&t.translate(y.x1,y.y1)}};var gW=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,i,a,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};ac.drawNodeOverlay=gW("overlay");ac.drawNodeUnderlay=gW("underlay");ac.hasPie=function(t){return t=t[0],t._private.hasPie};ac.hasStripe=function(t){return t=t[0],t._private.hasStripe};ac.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var v=1;v<=i.pieBackgroundN;v++){var y=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,w=e.pstyle("pie-"+v+"-background-opacity").value*r,T=y/100;T+g>1&&(T=1-g);var E=1.5*Math.PI+2*Math.PI*g;E+=o;var k=2*Math.PI*T,S=E+k;y===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,E,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,E,S),t.arc(l,u,p,S,E,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],w),t.fill(),g+=T)}};ac.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var v=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,w=v/100;w+u>1&&(w=1-u),!(v===0||u>=1||u+w>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*w),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=w)}t.restore()};var Xi={},CAe=100;Xi.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Xi.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;i<e.length;i++)if(n=e[i],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Xi.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(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),h=r.targetEndpoint(),d=r.midpoint(),f=du(u,d),p=du(h,d);a=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var g=s?{x:0,y:0}:r.position(),m=r.paddedWidth(),v=r.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(m,v))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();a=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var w=s?{x:0,y:0}:r.position(),T=r.paddedWidth(),E=r.paddedHeight(),k=T/2,S=E/2,L=r.pstyle("background-gradient-direction").value;switch(L){case"to-bottom":a=t.createLinearGradient(w.x,w.y-S,w.x,w.y+S);break;case"to-top":a=t.createLinearGradient(w.x,w.y+S,w.x,w.y-S);break;case"to-left":a=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":a=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(w.x-k,w.y-S,w.x+k,w.y+S);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(w.x-k,w.y+S,w.x+k,w.y-S);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(w.x+k,w.y-S,w.x-k,w.y+S);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(w.x+k,w.y+S,w.x-k,w.y-S);break}}if(!a)return null;for(var A=l.length===o.length,R=o.length,C=0;C<R;C++)a.addColorStop(A?l[C]:C/(R-1),"rgba("+o[C][0]+","+o[C][1]+","+o[C][2]+","+i+")");return a};Xi.gradientFillStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"background",e,r,n);if(!i)return null;t.fillStyle=i};Xi.colorFillStyle=function(t,e,r,n,i){t.fillStyle="rgba("+e+","+r+","+n+","+i+")"};Xi.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],r)}};Xi.gradientStrokeStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"line",e,r,n);if(!i)return null;t.strokeStyle=i};Xi.colorStrokeStyle=function(t,e,r,n,i){t.strokeStyle="rgba("+e+","+r+","+n+","+i+")"};Xi.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],r)}};Xi.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=i*s,u=a*s,h;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=i+"px",d.style.height=a+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)h=r.canvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";for(var f=0;f<e.BUFFER_COUNT;f++)h=r.bufferCanvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";e.textureMult=1,s<=1&&(h=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=l*e.textureMult,h.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};Xi.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Xi.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Xi.render=function(t){var e=this;t=t||aH();var r=e.cy,n=t.forcedContext,i=t.drawAllLayers,a=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,h=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,p=e.motionBlurPxRatio,g=r.hasCompoundNodes(),m=e.hoverData.draggingEles,v=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!v;var y=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(y=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var b=r.style(),w=r.zoom(),T=s!==void 0?s:w,E=r.pan(),k={x:E.x,y:E.y},S={zoom:w,pan:{x:E.x,y:E.y}},L=e.prevViewport,A=L===void 0||S.zoom!==L.zoom||S.pan.x!==L.pan.x||S.pan.y!==L.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(k=o),T*=l,k.x*=l,k.y*=l;var R=e.getCachedZSortedEles();function C(j,W,X,H,K){var ne=j.globalCompositeOperation;j.globalCompositeOperation="destination-out",e.colorFillStyle(j,255,255,255,e.motionBlurTransparency),j.fillRect(W,X,H,K),j.globalCompositeOperation=ne}function I(j,W){var X,H,K,ne;!e.clearingMotionBlur&&(j===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||j===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:E.x*p,y:E.y*p},H=w*p,K=e.canvasWidth*p,ne=e.canvasHeight*p):(X=k,H=T,K=e.canvasWidth,ne=e.canvasHeight),j.setTransform(1,0,0,1,0,0),W==="motionBlur"?C(j,0,0,K,ne):!n&&(W===void 0||W)&&j.clearRect(0,0,K,ne),i||(j.translate(X.x,X.y),j.scale(H,H)),o&&j.translate(o.x,o.y),s&&j.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var P=e.data.bufferContexts[e.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var _=u.contexts[e.NODE],N=e.textureCache.texture,S=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),f?C(_,0,0,S.width,S.height):_.clearRect(0,0,S.width,S.height);var M=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,M[0],M[1],M[2],O),_.fillRect(0,0,S.width,S.height);var w=r.zoom();I(_,!1),_.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),_.drawImage(N,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&B,F=[];if(F[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,F[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),F[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,F[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||F[e.NODE]){var G=f&&!F[e.NODE]&&p!==1,_=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),q=f&&!G?"motionBlur":void 0;I(_,q),z?e.drawCachedNodes(_,R.nondrag,l,D):e.drawLayeredElements(_,R.nondrag,l,D),e.debug&&e.drawDebugPoints(_,R.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||F[e.DRAG])){var G=f&&!F[e.DRAG]&&p!==1,_=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);I(_,f&&!G?"motionBlur":void 0),z?e.drawCachedNodes(_,R.drag,l,D):e.drawCachedElements(_,R.drag,l,D),e.debug&&e.drawDebugPoints(_,R.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,I),f&&p!==1){var Y=u.contexts[e.NODE],ee=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],oe=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],pe=function(W,X,H){W.setTransform(1,0,0,1,0,0),H||!y?W.clearRect(0,0,e.canvasWidth,e.canvasHeight):C(W,0,0,e.canvasWidth,e.canvasHeight);var K=p;W.drawImage(X,0,0,e.canvasWidth*K,e.canvasHeight*K,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||F[e.NODE])&&(pe(Y,ee,F[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||F[e.DRAG])&&(pe(Q,oe,F[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},CAe)),n||r.emit("render")};var e0;Xi.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),v="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!e0){var y=h.measureText(v);e0=y.actualBoundingBoxAscent}h.fillText(v,0,e0);var b=60;h.strokeRect(0,e0+10,250,20),h.fillRect(0,e0+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function mN(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 AAe(t,e,r){var n=mN(t,t.VERTEX_SHADER,e),i=mN(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 _Ae(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function qk(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 LAe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function RAe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function NAe(t){return t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function DAe(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function xc(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 Ku(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 IAe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function MAe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function mW(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 vW(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function OAe(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 PAe(t,e,r,n){var i=mW(t,e),a=Ln(i,2),s=a[0],o=a[1],l=vW(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Ds(t,e,r,n){var i=mW(t,r),a=Ln(i,3),s=a[0],o=a[1],l=a[2],u=vW(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;p<e;p++)f[p]=OAe(t,o,u,h,s,p);return d.dataArray=u,d.stride=h,d.size=s,d.getView=function(g){return f[g]},d.setPoint=function(g,m,v){var y=f[g];y[0]=m,y[1]=v},d.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,d),g?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,g*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function BAe(t,e,r){for(var n=9,i=new Float32Array(e*n),a=new Array(e),s=0;s<e;s++){var o=s*n*4;a[s]=new Float32Array(i.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var h=r+u;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,3*12,u*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return a[d]},l.setData=function(d,f){a[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,i)},l}function FAe(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(n,i){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var vN=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function u3(){var t=new vN(9);return vN!=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 yN(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 $Ae(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],y=r[5],b=r[6],w=r[7],T=r[8];return t[0]=f*n+p*s+g*u,t[1]=f*i+p*o+g*h,t[2]=f*a+p*l+g*d,t[3]=m*n+v*s+y*u,t[4]=m*i+v*o+y*h,t[5]=m*a+v*l+y*d,t[6]=b*n+w*s+T*u,t[7]=b*i+w*o+T*h,t[8]=b*a+w*l+T*d,t}function gv(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=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]=f*n+p*s+u,t[7]=f*i+p*o+h,t[8]=f*a+p*l+d,t}function xN(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*s,t[1]=p*i+f*o,t[2]=p*a+f*l,t[3]=p*s-f*n,t[4]=p*o-f*i,t[5]=p*l-f*a,t[6]=u,t[7]=h,t[8]=d,t}function r6(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 zAe(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}var VAe=function(){function t(e,r,n,i){rc(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,r,r),this.scratch=i(e,r,this.texHeight,"scratch")}return nc(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,i=r.h,a=this.texHeight,s=this.texSize,o=a/i,l=n*o,u=i*o;return l>s&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(w,T){if(i&&T){var E=T.context,k=w.x,S=w.row,L=k,A=l*S;E.save(),E.translate(L,A),E.scale(h,h),i(E,n),E.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},v=function(){var w=a.scratch,T=a.canvas;w.clear(),p({x:0,row:0},w);var E=s-a.freePointer.x,k=d-E,S=l;{var L=a.freePointer.x,A=a.freePointer.row*l,R=E;T.context.drawImage(w,0,0,R,S,L,A,R,S),g[0]={x:L,y:A,w:R,h:f}}{var C=E,I=(a.freePointer.row+1)*l,P=k;T&&T.context.drawImage(w,C,0,P,S,0,I,P,S),g[1]={x:0,y:I,w:P,h:f}}a.freePointer.x=k,a.freePointer.row++},y=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(y(),m()):this.enableWrapping?v():(y(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=MAe(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),GAe=function(){function t(e,r,n,i){rc(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return nc(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas;return new VAe(r,n,i,a)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas,s=Math.floor(n/i);this.scratch=a(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,i){var a=this.styleKeyToAtlas.get(r);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(n))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(r,n,i),this.styleKeyToAtlas.set(r,a)),a}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var i=[],a=new Map,s=null,o=na(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),p=UAe(n,f);if(p.size===0)return i.push(d),f.forEach(function(E){return a.set(E,d)}),1;s||(s=r._createAtlas(),i.push(s));var g=na(f),m;try{for(g.s();!(m=g.n()).done;){var v=m.value;if(!p.has(v)){var y=d.getOffsets(v),b=Ln(y,2),w=b[0],T=b[1];s.canFit({w:w.w+T.w,h:w.h})||(s.lock(),s=r._createAtlas(),i.push(s)),d.canvas&&(r._copyTextureToNewAtlas(v,d,s),a.set(v,s))}}}catch(E){g.e(E)}finally{g.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(h){o.e(h)}finally{o.f()}this.atlases=i,this.styleKeyToAtlas=a,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,i){var a=n.getOffsets(r),s=Ln(a,2),o=s[0],l=s[1];if(l.w===0)i.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var h=o.w+l.w,d=o.h;i.draw(r,{w:h,h:d},function(f){f.drawImage(u,0,0,h,d,0,0,h,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function UAe(t,e){return t.intersection?t.intersection(e):new Set(a2(t).filter(function(r){return e.has(r)}))}var qAe=function(){function t(e,r){rc(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return nc(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var i=this.globalOptions,a=i.webglTexSize,s=i.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new GAe(this.r,a,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var a=this.collections.get(i),s=Ut({type:r,atlasCollection:a},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,i=-1,a=null;return function(s,o,l,u){return u?((!a||o!=n||l!=i)&&(n=o,i=l,a=r(s,o,l)),a):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=na(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=na(this.renderTypes.values()),y;try{var b=function(){var T=y.value,E=T.type;if(h(E)){var k=n.collections.get(T.collection),S=T.getKey(m),L=Array.isArray(S)?S:[S];if(s)L.forEach(function(I){return k.markKeyForGC(I)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),R=n._key(E,A),C=n.typeAndIdToKey.get(R);C!==void 0&&!DAe(L,C)&&(d=!0,n.typeAndIdToKey.delete(R),C.forEach(function(I){return k.markKeyForGC(I)}))}}};for(v.s();!(y=v.n()).done;)b()}catch(w){v.e(w)}finally{v.f()}}}}catch(w){p.e(w)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=na(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ln(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=na(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ln(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),HAe=function(){function t(e){rc(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return nc(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),WAe=`
|
|
2392
|
+
`),v=0;v<m.length;v++){var y=m[v],b=d.measureText(y),w=Math.ceil(b.width),T=o;p=Math.max(w,p),g+=T}return p+=a,g+=a,{width:p,height:g}};uo.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,i=t.isEdge(),a=e?e+"-":"",s=t.pstyle(a+"text-rotation"),o=s.strValue;return o==="none"?0:i&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};uo.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,i=n.rscratch;i.labelAngle=e.calculateLabelAngle(t),r&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var sW={},oN=28,lN=!1;sW.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<oN||t.height()<oN))return lN||(Cr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),lN=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var tb={};tb.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],h=u._private,d=h.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var i=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],h=u._private.rstyle;u.isNode()&&!h.cleanConnected&&(n(u.connectedEdges()),h.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){i(!0)},r.beforeRender(i,r.beforeRenderPriorities.eleCalcs)};tb.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};tb.recalculateRenderedStyle=function(t,e){var r=function(T){return T._private.rstyle.cleanConnected};if(t.length!==0){var n=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var a=0;a<t.length;a++){var s=t[a],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(w){return!w._private.rstyle.clean&&w.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?i.push(s):n.push(s),l.clean=!0)}for(var u=0;u<i.length;u++){var h=i[u],d=h._private,f=d.rstyle,p=h.position();this.recalculateNodeLabelProjection(h),f.nodeX=p.x,f.nodeY=p.y,f.nodeW=h.pstyle("width").pfValue,f.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var m=n[g],v=m._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}}};var rb={};rb.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};rb.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};rb.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(VH),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var oW={};[Bu,g2,_i,t1,Gk,uo,sW,tb,rb].forEach(function(t){Ut(oW,t)});var lW={};lW.getCachedImage=function(t,e,r){var n=this,i=n.imageCache=n.imageCache||{},a=i[t];if(a)return a.image.complete||a.image.addEventListener("load",r),a.image;a=i[t]=i[t]||{};var s=a.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Af={};Af.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(o!==void 0){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}var l=this.binder(t);return l.on.apply(l,i)};Af.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||nSe(t);if(e.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});r.addEventListener("test",null,a)}catch{}e.supportsPassiveEvents=i}var s=function(l,u,h){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Af.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Af.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Af.load=function(){var t=this,e=t.cy.window(),r=function($){return $.selected()},n=function($){var se=$.getRootNode();if(se&&se.nodeType===11&&se.host!==void 0)return se},i=function($,se,ae,fe){$==null&&($=t.cy);for(var he=0;he<se.length;he++){var Te=se[he];$.emit({originalEvent:ae,type:Te,position:fe})}},a=function($){return $.shiftKey||$.metaKey||$.ctrlKey},s=function($,se){var ae=!0;if(t.cy.hasCompoundNodes()&&$&&$.pannable())for(var fe=0;se&&fe<se.length;fe++){var $=se[fe];if($.isNode()&&$.isParent()&&!$.pannable()){ae=!1;break}}else ae=!0;return ae},o=function($){$[0]._private.grabbed=!0},l=function($){$[0]._private.grabbed=!1},u=function($){$[0]._private.rscratch.inDragLayer=!0},h=function($){$[0]._private.rscratch.inDragLayer=!1},d=function($){$[0]._private.rscratch.isGrabTarget=!0},f=function($){$[0]._private.rscratch.isGrabTarget=!1},p=function($,se){var ae=se.addToList,fe=ae.has($);!fe&&$.grabbable()&&!$.locked()&&(ae.merge($),o($))},g=function($,se){if($.cy().hasCompoundNodes()&&!(se.inDragLayer==null&&se.addToList==null)){var ae=$.descendants();se.inDragLayer&&(ae.forEach(u),ae.connectedEdges().forEach(u)),se.addToList&&p(ae,se)}},m=function($,se){se=se||{};var ae=$.cy().hasCompoundNodes();se.inDragLayer&&($.forEach(u),$.neighborhood().stdFilter(function(fe){return!ae||fe.isEdge()}).forEach(u)),se.addToList&&$.forEach(function(fe){p(fe,se)}),g($,se),b($,{inDragLayer:se.inDragLayer}),t.updateCachedGrabbedEles()},v=m,y=function($){$&&(t.getCachedZSortedEles().forEach(function(se){l(se),h(se),f(se)}),t.updateCachedGrabbedEles())},b=function($,se){if(!(se.inDragLayer==null&&se.addToList==null)&&$.cy().hasCompoundNodes()){var ae=$.ancestors().orphans();if(!ae.same($)){var fe=ae.descendants().spawnSelf().merge(ae).unmerge($).unmerge($.descendants()),he=fe.connectedEdges();se.inDragLayer&&(he.forEach(u),fe.forEach(u)),se.addToList&&fe.forEach(function(Te){p(Te,se)})}}},w=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",E=typeof ResizeObserver<"u";T?(t.removeObserver=new MutationObserver(function(ue){for(var $=0;$<ue.length;$++){var se=ue[$],ae=se.removedNodes;if(ae)for(var fe=0;fe<ae.length;fe++){var he=ae[fe];if(he===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ue){t.destroy()});var k=Zg(function(){t.cy.resize()},100);T&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),E&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var S=function($,se){for(;$!=null;)se($),$=$.parentNode},L=function(){t.invalidateContainerClientCoordsCache()};S(t.container,function(ue){t.registerBinding(ue,"transitionend",L),t.registerBinding(ue,"animationend",L),t.registerBinding(ue,"scroll",L)}),t.registerBinding(t.container,"contextmenu",function(ue){ue.preventDefault()});var A=function(){return t.selection[4]!==0},R=function($){for(var se=t.findContainerClientCoords(),ae=se[0],fe=se[1],he=se[2],Te=se[3],Se=$.touches?$.touches:[$],Ee=!1,Ge=0;Ge<Se.length;Ge++){var Je=Se[Ge];if(ae<=Je.clientX&&Je.clientX<=ae+he&&fe<=Je.clientY&&Je.clientY<=fe+Te){Ee=!0;break}}if(!Ee)return!1;for(var He=t.container,Xe=$.target,Ke=Xe.parentNode,$e=!1;Ke;){if(Ke===He){$e=!0;break}Ke=Ke.parentNode}return!!$e};t.registerBinding(t.container,"mousedown",function($){if(R($)&&!(t.hoverData.which===1&&$.which!==1)){$.preventDefault(),w(),t.hoverData.capture=!0,t.hoverData.which=$.which;var se=t.cy,ae=[$.clientX,$.clientY],fe=t.projectIntoViewport(ae[0],ae[1]),he=t.selection,Te=t.findNearestElements(fe[0],fe[1],!0,!1),Se=Te[0],Ee=t.dragData.possibleDragElements;t.hoverData.mdownPos=fe,t.hoverData.mdownGPos=ae;var Ge=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var je=t.hoverData.down;je?je.emit({originalEvent:$,type:"taphold",position:{x:fe[0],y:fe[1]}}):se.emit({originalEvent:$,type:"taphold",position:{x:fe[0],y:fe[1]}})}},t.tapholdDuration)};if($.which==3){t.hoverData.cxtStarted=!0;var Je={originalEvent:$,type:"cxttapstart",position:{x:fe[0],y:fe[1]}};Se?(Se.activate(),Se.emit(Je),t.hoverData.down=Se):se.emit(Je),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if($.which==1){Se&&Se.activate();{if(Se!=null&&t.nodeIsGrabbable(Se)){var He=function(je){return{originalEvent:$,type:je,position:{x:fe[0],y:fe[1]}}},Xe=function(je){je.emit(He("grab"))};if(d(Se),!Se.selected())Ee=t.dragData.possibleDragElements=se.collection(),v(Se,{addToList:Ee}),Se.emit(He("grabon")).emit(He("grab"));else{Ee=t.dragData.possibleDragElements=se.collection();var Ke=se.$(function($e){return $e.isNode()&&$e.selected()&&t.nodeIsGrabbable($e)});m(Ke,{addToList:Ee}),Se.emit(He("grabon")),Ke.forEach(Xe)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Se,t.hoverData.downs=Te,t.hoverData.downTime=new Date().getTime()}i(Se,["mousedown","tapstart","vmousedown"],$,{x:fe[0],y:fe[1]}),Se==null?(he[4]=1,t.data.bgActivePosistion={x:fe[0],y:fe[1]},t.redrawHint("select",!0),t.redraw()):Se.pannable()&&(he[4]=1),Ge()}he[0]=he[2]=fe[0],he[1]=he[3]=fe[1]}},!1);var C=n(t.container);t.registerBinding([e,C],"mousemove",function($){var se=t.hoverData.capture;if(!(!se&&!R($))){var ae=!1,fe=t.cy,he=fe.zoom(),Te=[$.clientX,$.clientY],Se=t.projectIntoViewport(Te[0],Te[1]),Ee=t.hoverData.mdownPos,Ge=t.hoverData.mdownGPos,Je=t.selection,He=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(He=t.findNearestElement(Se[0],Se[1],!0,!1));var Xe=t.hoverData.last,Ke=t.hoverData.down,$e=[Se[0]-Je[2],Se[1]-Je[3]],je=t.dragData.possibleDragElements,lt;if(Ge){var st=Te[0]-Ge[0],qe=st*st,Et=Te[1]-Ge[1],Ye=Et*Et,Ze=qe+Ye;t.hoverData.isOverThresholdDrag=lt=Ze>=t.desktopTapThreshold2}var ht=a($);lt&&(t.hoverData.tapholdCancelled=!0);var ct=function(){var pt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];pt.length===0?(pt.push($e[0]),pt.push($e[1])):(pt[0]+=$e[0],pt[1]+=$e[1])};ae=!0,i(He,["mousemove","vmousemove","tapdrag"],$,{x:Se[0],y:Se[1]});var ut=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||fe.emit({originalEvent:$,type:"boxstart",position:{x:Se[0],y:Se[1]}}),Je[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(lt){var mt={originalEvent:$,type:"cxtdrag",position:{x:Se[0],y:Se[1]}};Ke?Ke.emit(mt):fe.emit(mt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||He!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:Se[0],y:Se[1]}}),t.hoverData.cxtOver=He,He&&He.emit({originalEvent:$,type:"cxtdragover",position:{x:Se[0],y:Se[1]}}))}}else if(t.hoverData.dragging){if(ae=!0,fe.panningEnabled()&&fe.userPanningEnabled()){var sr;if(t.hoverData.justStartedPan){var Rt=t.hoverData.mdownPos;sr={x:(Se[0]-Rt[0])*he,y:(Se[1]-Rt[1])*he},t.hoverData.justStartedPan=!1}else sr={x:$e[0]*he,y:$e[1]*he};fe.panBy(sr),fe.emit("dragpan"),t.hoverData.dragged=!0}Se=t.projectIntoViewport($.clientX,$.clientY)}else if(Je[4]==1&&(Ke==null||Ke.pannable())){if(lt){if(!t.hoverData.dragging&&fe.boxSelectionEnabled()&&(ht||!fe.panningEnabled()||!fe.userPanningEnabled()))ut();else if(!t.hoverData.selecting&&fe.panningEnabled()&&fe.userPanningEnabled()){var hr=s(Ke,t.hoverData.downs);hr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Je[4]=0,t.data.bgActivePosistion=dh(Ee),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&He!=Xe&&(Xe&&i(Xe,["mouseout","tapdragout"],$,{x:Se[0],y:Se[1]}),He&&i(He,["mouseover","tapdragover"],$,{x:Se[0],y:Se[1]}),t.hoverData.last=He),Ke)if(lt){if(fe.boxSelectionEnabled()&&ht)Ke&&Ke.grabbed()&&(y(je),Ke.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(Ke.emit("dragfreeon"),je.emit("dragfree"))),ut();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var rr=!t.dragData.didDrag;rr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||m(je,{inDragLayer:!0});var er={x:0,y:0};if(gt($e[0])&>($e[1])&&(er.x+=$e[0],er.y+=$e[1],rr)){var Wt=t.hoverData.dragDelta;Wt&>(Wt[0])&>(Wt[1])&&(er.x+=Wt[0],er.y+=Wt[1])}t.hoverData.draggingEles=!0,je.silentShift(er).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else ct();ae=!0}if(Je[2]=Se[0],Je[3]=Se[1],ae)return $.stopPropagation&&$.stopPropagation(),$.preventDefault&&$.preventDefault(),!1}},!1);var I,P,_;t.registerBinding(e,"mouseup",function($){if(!(t.hoverData.which===1&&$.which!==1&&t.hoverData.capture)){var se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var ae=t.cy,fe=t.projectIntoViewport($.clientX,$.clientY),he=t.selection,Te=t.findNearestElement(fe[0],fe[1],!0,!1),Se=t.dragData.possibleDragElements,Ee=t.hoverData.down,Ge=a($);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ee&&Ee.unactivate(),t.hoverData.which===3){var Je={originalEvent:$,type:"cxttapend",position:{x:fe[0],y:fe[1]}};if(Ee?Ee.emit(Je):ae.emit(Je),!t.hoverData.cxtDragged){var He={originalEvent:$,type:"cxttap",position:{x:fe[0],y:fe[1]}};Ee?Ee.emit(He):ae.emit(He)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Te,["mouseup","tapend","vmouseup"],$,{x:fe[0],y:fe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ee,["click","tap","vclick"],$,{x:fe[0],y:fe[1]}),P=!1,$.timeStamp-_<=ae.multiClickDebounceTime()?(I&&clearTimeout(I),P=!0,_=null,i(Ee,["dblclick","dbltap","vdblclick"],$,{x:fe[0],y:fe[1]})):(I=setTimeout(function(){P||i(Ee,["oneclick","onetap","voneclick"],$,{x:fe[0],y:fe[1]})},ae.multiClickDebounceTime()),_=$.timeStamp)),Ee==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a($)&&(ae.$(r).unselect(["tapunselect"]),Se.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Se=ae.collection()),Te==Ee&&!t.dragData.didDrag&&!t.hoverData.selecting&&Te!=null&&Te._private.selectable&&(t.hoverData.dragging||(ae.selectionType()==="additive"||Ge?Te.selected()?Te.unselect(["tapunselect"]):Te.select(["tapselect"]):Ge||(ae.$(r).unmerge(Te).unselect(["tapunselect"]),Te.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Xe=ae.collection(t.getAllInBox(he[0],he[1],he[2],he[3]));t.redrawHint("select",!0),Xe.length>0&&t.redrawHint("eles",!0),ae.emit({type:"boxend",originalEvent:$,position:{x:fe[0],y:fe[1]}});var Ke=function(lt){return lt.selectable()&&!lt.selected()};ae.selectionType()==="additive"||Ge||ae.$(r).unmerge(Xe).unselect(),Xe.emit("box").stdFilter(Ke).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!he[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var $e=Ee&&Ee.grabbed();y(Se),$e&&(Ee.emit("freeon"),Se.emit("free"),t.dragData.didDrag&&(Ee.emit("dragfreeon"),Se.emit("dragfree")))}}he[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var N=[],M=4,O,D=1e5,B=function($,se){for(var ae=0;ae<$.length;ae++)if($[ae]%se!==0)return!1;return!0},z=function($){for(var se=Math.abs($[0]),ae=1;ae<$.length;ae++)if(Math.abs($[ae])!==se)return!1;return!0},F=function($){var se=!1,ae=$.deltaY;if(ae==null&&($.wheelDeltaY!=null?ae=$.wheelDeltaY/4:$.wheelDelta!=null&&(ae=$.wheelDelta/4)),O==null)if(N.length>=M){var fe=N;if(O=B(fe,5),!O){var he=Math.abs(fe[0]);O=z(fe)&&he>5}if(O)for(var Te=0;Te<fe.length;Te++)D=Math.min(Math.abs(fe[Te]),D)}else N.push(ae),se=!0;else O&&(D=Math.min(Math.abs(ae),D));if(!t.scrollingPage){var Se=t.cy,Ee=Se.zoom(),Ge=Se.pan(),Je=t.projectIntoViewport($.clientX,$.clientY),He=[Je[0]*Ee+Ge.x,Je[1]*Ee+Ge.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){$.preventDefault();return}if(Se.panningEnabled()&&Se.userPanningEnabled()&&Se.zoomingEnabled()&&Se.userZoomingEnabled()){$.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Xe;se&&Math.abs(ae)>5&&(ae=_k(ae)*5),Xe=ae/-250,O&&(Xe/=D,Xe*=3),Xe=Xe*t.wheelSensitivity;var Ke=$.deltaMode===1;Ke&&(Xe*=33);var $e=Se.zoom()*Math.pow(10,Xe);$.type==="gesturechange"&&($e=t.gestureStartZoom*$.scale),Se.zoom({level:$e,renderedPosition:{x:He[0],y:He[1]}}),Se.emit($.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function($){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function($){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||$.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ue){t.hasTouchStarted||F(ue)},!0),t.registerBinding(t.container,"mouseout",function($){var se=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function($){var se=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var G,q,Y,ee,Q,oe,pe,j,W,X,H,K,ne,Z=function($,se,ae,fe){return Math.sqrt((ae-$)*(ae-$)+(fe-se)*(fe-se))},be=function($,se,ae,fe){return(ae-$)*(ae-$)+(fe-se)*(fe-se)},ce;t.registerBinding(t.container,"touchstart",ce=function($){if(t.hasTouchStarted=!0,!!R($)){w(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,ae=t.touchData.now,fe=t.touchData.earlier;if($.touches[0]){var he=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);ae[0]=he[0],ae[1]=he[1]}if($.touches[1]){var he=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);ae[2]=he[0],ae[3]=he[1]}if($.touches[2]){var he=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);ae[4]=he[0],ae[5]=he[1]}if($.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var Te=t.findContainerClientCoords();W=Te[0],X=Te[1],H=Te[2],K=Te[3],G=$.touches[0].clientX-W,q=$.touches[0].clientY-X,Y=$.touches[1].clientX-W,ee=$.touches[1].clientY-X,ne=0<=G&&G<=H&&0<=Y&&Y<=H&&0<=q&&q<=K&&0<=ee&&ee<=K;var Se=se.pan(),Ee=se.zoom();Q=Z(G,q,Y,ee),oe=be(G,q,Y,ee),pe=[(G+Y)/2,(q+ee)/2],j=[(pe[0]-Se.x)/Ee,(pe[1]-Se.y)/Ee];var Ge=200,Je=Ge*Ge;if(oe<Je&&!$.touches[2]){var He=t.findNearestElement(ae[0],ae[1],!0,!0),Xe=t.findNearestElement(ae[2],ae[3],!0,!0);He&&He.isNode()?(He.activate().emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start=He):Xe&&Xe.isNode()?(Xe.activate().emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start=Xe):se.emit({originalEvent:$,type:"cxttapstart",position:{x:ae[0],y:ae[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if($.touches[2])se.boxSelectionEnabled()&&$.preventDefault();else if(!$.touches[1]){if($.touches[0]){var Ke=t.findNearestElements(ae[0],ae[1],!0,!0),$e=Ke[0];if($e!=null&&($e.activate(),t.touchData.start=$e,t.touchData.starts=Ke,t.nodeIsGrabbable($e))){var je=t.dragData.touchDragEles=se.collection(),lt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),$e.selected()?(lt=se.$(function(Ze){return Ze.selected()&&t.nodeIsGrabbable(Ze)}),m(lt,{addToList:je})):v($e,{addToList:je}),d($e);var st=function(ht){return{originalEvent:$,type:ht,position:{x:ae[0],y:ae[1]}}};$e.emit(st("grabon")),lt?lt.forEach(function(Ze){Ze.emit(st("grab"))}):$e.emit(st("grab"))}i($e,["touchstart","tapstart","vmousedown"],$,{x:ae[0],y:ae[1]}),$e==null&&(t.data.bgActivePosistion={x:he[0],y:he[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(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&i(t.touchData.start,["taphold"],$,{x:ae[0],y:ae[1]})},t.tapholdDuration)}}if($.touches.length>=1){for(var qe=t.touchData.startPosition=[null,null,null,null,null,null],Et=0;Et<ae.length;Et++)qe[Et]=fe[Et]=ae[Et];var Ye=$.touches[0];t.touchData.startGPosition=[Ye.clientX,Ye.clientY]}}},!1);var re;t.registerBinding(e,"touchmove",re=function($){var se=t.touchData.capture;if(!(!se&&!R($))){var ae=t.selection,fe=t.cy,he=t.touchData.now,Te=t.touchData.earlier,Se=fe.zoom();if($.touches[0]){var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}if($.touches[1]){var Ee=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);he[2]=Ee[0],he[3]=Ee[1]}if($.touches[2]){var Ee=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);he[4]=Ee[0],he[5]=Ee[1]}var Ge=t.touchData.startGPosition,Je;if(se&&$.touches[0]&&Ge){for(var He=[],Xe=0;Xe<he.length;Xe++)He[Xe]=he[Xe]-Te[Xe];var Ke=$.touches[0].clientX-Ge[0],$e=Ke*Ke,je=$.touches[0].clientY-Ge[1],lt=je*je,st=$e+lt;Je=st>=t.touchTapThreshold2}if(se&&t.touchData.cxt){$.preventDefault();var qe=$.touches[0].clientX-W,Et=$.touches[0].clientY-X,Ye=$.touches[1].clientX-W,Ze=$.touches[1].clientY-X,ht=be(qe,Et,Ye,Ze),ct=ht/oe,ut=150,mt=ut*ut,sr=1.5,Rt=sr*sr;if(ct>=Rt||ht>=mt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var hr={originalEvent:$,type:"cxttapend",position:{x:he[0],y:he[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(hr),t.touchData.start=null):fe.emit(hr)}}if(se&&t.touchData.cxt){var hr={originalEvent:$,type:"cxtdrag",position:{x:he[0],y:he[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(hr):fe.emit(hr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var rr=t.findNearestElement(he[0],he[1],!0,!0);(!t.touchData.cxtOver||rr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:he[0],y:he[1]}}),t.touchData.cxtOver=rr,rr&&rr.emit({originalEvent:$,type:"cxtdragover",position:{x:he[0],y:he[1]}}))}else if(se&&$.touches[2]&&fe.boxSelectionEnabled())$.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||fe.emit({originalEvent:$,type:"boxstart",position:{x:he[0],y:he[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,ae[4]=1,!ae||ae.length===0||ae[0]===void 0?(ae[0]=(he[0]+he[2]+he[4])/3,ae[1]=(he[1]+he[3]+he[5])/3,ae[2]=(he[0]+he[2]+he[4])/3+1,ae[3]=(he[1]+he[3]+he[5])/3+1):(ae[2]=(he[0]+he[2]+he[4])/3,ae[3]=(he[1]+he[3]+he[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&$.touches[1]&&!t.touchData.didSelect&&fe.zoomingEnabled()&&fe.panningEnabled()&&fe.userZoomingEnabled()&&fe.userPanningEnabled()){$.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var er=t.dragData.touchDragEles;if(er){t.redrawHint("drag",!0);for(var Wt=0;Wt<er.length;Wt++){var Xr=er[Wt]._private;Xr.grabbed=!1,Xr.rscratch.inDragLayer=!1}}var pt=t.touchData.start,qe=$.touches[0].clientX-W,Et=$.touches[0].clientY-X,Ye=$.touches[1].clientX-W,Ze=$.touches[1].clientY-X,ke=Z(qe,Et,Ye,Ze),Qe=ke/Q;if(ne){var xt=qe-G,tr=Et-q,Mr=Ye-Y,Or=Ze-ee,Lr=(xt+Mr)/2,Sn=(tr+Or)/2,gi=fe.zoom(),Li=gi*Qe,dr=fe.pan(),At=j[0]*gi+dr.x,bt=j[1]*gi+dr.y,ot={x:-Li/gi*(At-dr.x-Lr)+At,y:-Li/gi*(bt-dr.y-Sn)+bt};if(pt&&pt.active()){var er=t.dragData.touchDragEles;y(er),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pt.unactivate().emit("freeon"),er.emit("free"),t.dragData.didDrag&&(pt.emit("dragfreeon"),er.emit("dragfree"))}fe.viewport({zoom:Li,pan:ot,cancelOnFailedZoom:!0}),fe.emit("pinchzoom"),Q=ke,G=qe,q=Et,Y=Ye,ee=Ze,t.pinching=!0}if($.touches[0]){var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}if($.touches[1]){var Ee=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);he[2]=Ee[0],he[3]=Ee[1]}if($.touches[2]){var Ee=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);he[4]=Ee[0],he[5]=Ee[1]}}else if($.touches[0]&&!t.touchData.didSelect){var We=t.touchData.start,ar=t.touchData.last,rr;if(!t.hoverData.draggingEles&&!t.swipePanning&&(rr=t.findNearestElement(he[0],he[1],!0,!0)),se&&We!=null&&$.preventDefault(),se&&We!=null&&t.nodeIsDraggable(We))if(Je){var er=t.dragData.touchDragEles,de=!t.dragData.didDrag;de&&m(er,{inDragLayer:!0}),t.dragData.didDrag=!0;var ss={x:0,y:0};if(gt(He[0])&>(He[1])&&(ss.x+=He[0],ss.y+=He[1],de)){t.redrawHint("eles",!0);var ve=t.touchData.dragDelta;ve&>(ve[0])&>(ve[1])&&(ss.x+=ve[0],ss.y+=ve[1])}t.hoverData.draggingEles=!0,er.silentShift(ss).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Te[0]&&t.touchData.startPosition[1]==Te[1]&&t.redrawHint("eles",!0),t.redraw()}else{var ve=t.touchData.dragDelta=t.touchData.dragDelta||[];ve.length===0?(ve.push(He[0]),ve.push(He[1])):(ve[0]+=He[0],ve[1]+=He[1])}if(i(We||rr,["touchmove","tapdrag","vmousemove"],$,{x:he[0],y:he[1]}),(!We||!We.grabbed())&&rr!=ar&&(ar&&ar.emit({originalEvent:$,type:"tapdragout",position:{x:he[0],y:he[1]}}),rr&&rr.emit({originalEvent:$,type:"tapdragover",position:{x:he[0],y:he[1]}})),t.touchData.last=rr,se)for(var Wt=0;Wt<he.length;Wt++)he[Wt]&&t.touchData.startPosition[Wt]&&Je&&(t.touchData.singleTouchMoved=!0);if(se&&(We==null||We.pannable())&&fe.panningEnabled()&&fe.userPanningEnabled()){var sn=s(We,t.touchData.starts);sn&&($.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=dh(t.touchData.startPosition)),t.swipePanning?(fe.panBy({x:He[0]*Se,y:He[1]*Se}),fe.emit("dragpan")):Je&&(t.swipePanning=!0,fe.panBy({x:Ke*Se,y:je*Se}),fe.emit("dragpan"),We&&(We.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Ee=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);he[0]=Ee[0],he[1]=Ee[1]}}for(var Xe=0;Xe<he.length;Xe++)Te[Xe]=he[Xe];se&&$.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ne;t.registerBinding(e,"touchcancel",Ne=function($){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var me,Ve,Ue,Fe;if(t.registerBinding(e,"touchend",me=function($){var se=t.touchData.start,ae=t.touchData.capture;if(ae)$.touches.length===0&&(t.touchData.capture=!1),$.preventDefault();else return;var fe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var he=t.cy,Te=he.zoom(),Se=t.touchData.now,Ee=t.touchData.earlier;if($.touches[0]){var Ge=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);Se[0]=Ge[0],Se[1]=Ge[1]}if($.touches[1]){var Ge=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);Se[2]=Ge[0],Se[3]=Ge[1]}if($.touches[2]){var Ge=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);Se[4]=Ge[0],Se[5]=Ge[1]}se&&se.unactivate();var Je;if(t.touchData.cxt){if(Je={originalEvent:$,type:"cxttapend",position:{x:Se[0],y:Se[1]}},se?se.emit(Je):he.emit(Je),!t.touchData.cxtDragged){var He={originalEvent:$,type:"cxttap",position:{x:Se[0],y:Se[1]}};se?se.emit(He):he.emit(He)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!$.touches[2]&&he.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Xe=he.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));fe[0]=void 0,fe[1]=void 0,fe[2]=void 0,fe[3]=void 0,fe[4]=0,t.redrawHint("select",!0),he.emit({type:"boxend",originalEvent:$,position:{x:Se[0],y:Se[1]}});var Ke=function(mt){return mt.selectable()&&!mt.selected()};Xe.emit("box").stdFilter(Ke).select().emit("boxselect"),Xe.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.unactivate(),$.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!$.touches[1]){if(!$.touches[0]){if(!$.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $e=t.dragData.touchDragEles;if(se!=null){var je=se._private.grabbed;y($e),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(se.emit("freeon"),$e.emit("free"),t.dragData.didDrag&&(se.emit("dragfreeon"),$e.emit("dragfree"))),i(se,["touchend","tapend","vmouseup","tapdragout"],$,{x:Se[0],y:Se[1]}),se.unactivate(),t.touchData.start=null}else{var lt=t.findNearestElement(Se[0],Se[1],!0,!0);i(lt,["touchend","tapend","vmouseup","tapdragout"],$,{x:Se[0],y:Se[1]})}var st=t.touchData.startPosition[0]-Se[0],qe=st*st,Et=t.touchData.startPosition[1]-Se[1],Ye=Et*Et,Ze=qe+Ye,ht=Ze*Te*Te;t.touchData.singleTouchMoved||(se||he.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],$,{x:Se[0],y:Se[1]}),Ve=!1,$.timeStamp-Fe<=he.multiClickDebounceTime()?(Ue&&clearTimeout(Ue),Ve=!0,Fe=null,i(se,["dbltap","vdblclick"],$,{x:Se[0],y:Se[1]})):(Ue=setTimeout(function(){Ve||i(se,["onetap","voneclick"],$,{x:Se[0],y:Se[1]})},he.multiClickDebounceTime()),Fe=$.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(he.selectionType()==="single"?(he.$(r).unmerge(se).unselect(["tapunselect"]),se.select(["tapselect"])):se.selected()?se.unselect(["tapunselect"]):se.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var ct=0;ct<Se.length;ct++)Ee[ct]=Se[ct];t.dragData.didDrag=!1,$.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),$.touches.length<2&&($.touches.length===1&&(t.touchData.startGPosition=[$.touches[0].clientX,$.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var _e=[],Oe=function($){return{clientX:$.clientX,clientY:$.clientY,force:1,identifier:$.pointerId,pageX:$.pageX,pageY:$.pageY,radiusX:$.width/2,radiusY:$.height/2,screenX:$.screenX,screenY:$.screenY,target:$.target}},Ce=function($){return{event:$,touch:Oe($)}},Le=function($){_e.push(Ce($))},ze=function($){for(var se=0;se<_e.length;se++){var ae=_e[se];if(ae.event.pointerId===$.pointerId){_e.splice(se,1);return}}},ge=function($){var se=_e.filter(function(ae){return ae.event.pointerId===$.pointerId})[0];se.event=$,se.touch=Oe($)},Me=function($){$.touches=_e.map(function(se){return se.touch})},J=function($){return $.pointerType==="mouse"||$.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ue){J(ue)||(ue.preventDefault(),Le(ue),Me(ue),ce(ue))}),t.registerBinding(t.container,"pointerup",function(ue){J(ue)||(ze(ue),Me(ue),me(ue))}),t.registerBinding(t.container,"pointercancel",function(ue){J(ue)||(ze(ue),Me(ue),Ne(ue))}),t.registerBinding(t.container,"pointermove",function(ue){J(ue)||(ue.preventDefault(),ge(ue),Me(ue),re(ue))})}};var ol={};ol.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,u,h){return ng(o,l,this.points,n,i,a/2,s/2,u)},checkPoint:function(n,i,a,s,o,l,u,h){return Jo(n,i,this.points,l,u,s,o,[0,-1],a)}}};ol.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){return Ske(a,s,e,r,n/2+o,i/2+o)},checkPoint:function(e,r,n,i,a,s,o,l){return zc(e,r,i,a,s,o,n)}}};ol.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,i,a,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?uH(a,s):o;for(var f=new Array(e.length/2),p=0;p<e.length/2;p++)f[p]={x:n+h*e[p*2],y:i+d*e[p*2+1]};var g,m,v,y,b=f.length;for(m=f[b-1],g=0;g<b;g++)v=f[g%b],y=f[(g+1)%b],l[u][g]=Vk(m,v,y,o),m=v,v=y;return l[u]},draw:function(n,i,a,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,i,a,s,o,this.points,this.getOrCreateCorners(i,a,s,o,l,u,"drawCorners"))},intersectLine:function(n,i,a,s,o,l,u,h,d){return kke(o,l,this.points,n,i,a,s,u,this.getOrCreateCorners(n,i,a,s,h,d,"corners"))},checkPoint:function(n,i,a,s,o,l,u,h,d){return Eke(n,i,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,h,d,"corners"))}}};ol.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){return lH(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){var u=i/2,h=a/2;l=l==="auto"?ql(i,a):l,l=Math.min(u,h,l);var d=l*2;return!!(Jo(e,r,this.points,s,o,i,a-d,[0,-1],n)||Jo(e,r,this.points,s,o,i-d,a,[0,-1],n)||zc(e,r,d,d,s-u+l,o-h+l,n)||zc(e,r,d,d,s+u-l,o-h+l,n)||zc(e,r,d,d,s+u-l,o+h-l,n)||zc(e,r,d,d,s-u+l,o+h-l,n))}}};ol.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Rk(),points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,null,s)},generateCutTrianglePts:function(e,r,n,i,a){var s=a==="auto"?this.cornerLength:a,o=r/2,l=e/2,u=n-l,h=n+l,d=i-o,f=i+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[h-s,d,h,d+s,h-s,d+s],bottomRight:[h,f-s,h-s,f,h-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,i,a,s,o,l){var u=this.generateCutTrianglePts(n+2*o,i+2*o,e,r,l),h=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ng(a,s,h,e,r)},checkPoint:function(e,r,n,i,a,s,o,l){var u=l==="auto"?this.cornerLength:l;if(Jo(e,r,this.points,s,o,i,a-2*u,[0,-1],n)||Jo(e,r,this.points,s,o,i-2*u,a,[0,-1],n))return!0;var h=this.generateCutTrianglePts(i,a,s,o);return ea(e,r,h.topLeft)||ea(e,r,h.topRight)||ea(e,r,h.bottomRight)||ea(e,r,h.bottomLeft)}}};ol.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){var u=.15,h=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,i+2*o,e,r),p=function(v){var y=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},u),b=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},h),w=Ah({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},d);return[v[0],v[1],y.x,y.y,b.x,b.y,w.x,w.y,v[4],v[5]]},g=[].concat(p(f.topLeft),p(f.topRight),p(f.bottomRight),p(f.bottomLeft));return ng(a,s,g,e,r)},generateBarrelBezierPts:function(e,r,n,i){var a=r/2,s=e/2,o=n-s,l=n+s,u=i-a,h=i+a,d=GT(e,r),f=d.heightOffset,p=d.widthOffset,g=d.ctrlPtOffsetPct*e,m={topLeft:[o,u+f,o+g,u,o+p,u],topRight:[l-p,u,l-g,u,l,u+f],bottomRight:[l,h-f,l-g,h,l-p,h],bottomLeft:[o+p,h,o+g,h,o,h-f]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,r,n,i,a,s,o,l){var u=GT(i,a),h=u.heightOffset,d=u.widthOffset;if(Jo(e,r,this.points,s,o,i,a-2*h,[0,-1],n)||Jo(e,r,this.points,s,o,i-2*d,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(i,a,s,o),p=function(L,A,R){var C=R[4],I=R[2],P=R[0],_=R[5],N=R[1],M=Math.min(C,P),O=Math.max(C,P),D=Math.min(_,N),B=Math.max(_,N);if(M<=L&&L<=O&&D<=A&&A<=B){var z=Cke(C,I,P),F=xke(z[0],z[1],z[2],L),G=F.filter(function(q){return 0<=q&&q<=1});if(G.length>0)return G[0]}return null},g=Object.keys(f),m=0;m<g.length;m++){var v=g[m],y=f[v],b=p(e,r,y);if(b!=null){var w=y[5],T=y[3],E=y[1],k=Wn(w,T,E,b);if(y.isTop&&k<=r||y.isBottom&&r<=k)return!0}}return!1}}};ol.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ii(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){var u=e-(n/2+o),h=r-(i/2+o),d=h,f=e+(n/2+o),p=El(a,s,e,r,u,h,f,d,!1);return p.length>0?p:lH(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?ql(i,a):l;var u=2*l;if(Jo(e,r,this.points,s,o,i,a-u,[0,-1],n)||Jo(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(ea(e,r,f)||zc(e,r,u,u,s+i/2-l,o+a/2-l,n)||zc(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};ol.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Ii(3,0)),this.generateRoundPolygon("round-triangle",Ii(3,0)),this.generatePolygon("rectangle",Ii(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",Ii(5,0)),this.generateRoundPolygon("round-pentagon",Ii(5,0)),this.generatePolygon("hexagon",Ii(6,0)),this.generateRoundPolygon("round-hexagon",Ii(6,0)),this.generatePolygon("heptagon",Ii(7,0)),this.generateRoundPolygon("round-heptagon",Ii(7,0)),this.generatePolygon("octagon",Ii(8,0)),this.generateRoundPolygon("round-octagon",Ii(8,0));var n=new Array(20);{var i=VT(5,0),a=VT(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[o*2]*=s,a[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=i[o*2],n[o*4+1]=i[o*2+1],n[o*4+2]=a[o*2],n[o*4+3]=a[o*2+1]}n=cH(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(u){var h=u.join("$"),d="polygon-"+h,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var r1={};r1.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};r1.redraw=function(t){t=t||aH();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};r1.beforeRender=function(t,e){if(!this.destroyed){e==null&&nn("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,i){return i.priority-n.priority})}};var cN=function(e,r,n){for(var i=e.beforeRenderCallbacks,a=0;a<i.length;a++)i[a].fn(r,n)};r1.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){cN(t,!0,i);var a=Qo();t.render(t.renderOptions);var s=t.lastDrawTime=Qo();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-a),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-a;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else cN(t,!1,i);t.skipFrame=!1,o2(r)}};o2(r)}};var U8e=function(e){this.init(e)},cW=U8e,_f=cW.prototype;_f.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];_f.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=i.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=i.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",a.insertBefore(u,a.children[0])}var h=n.getComputedStyle(r),d=h.getPropertyValue("position");d==="static"&&Cr("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=gt(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()};_f.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};_f.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,i=n.target;(i.off||i.removeEventListener).apply(i,n.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{}};_f.isHeadless=function(){return!1};[zk,oW,lW,Af,ol,r1].forEach(function(t){Ut(_f,t)});var o3=1e3/60,uW={setupDequeueing:function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var a=Zg(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(u,h){var d=Qo(),f=i.averageRedrawTime,p=i.lastRedrawTime,g=[],m=i.cy.extent(),v=i.getPixelRatio();for(u||i.flushRenderedStyleQueue();;){var y=Qo(),b=y-d,w=y-h;if(p<o3){var T=o3-(u?f:0);if(w>=e.deqFastCost*T)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(w>=e.deqNoDrawCost*o3)break;var E=e.deq(n,v,m);if(E.length>0)for(var k=0;k<E.length;k++)g.push(E[k]);else break}g.length>0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,m)&&a())},o=e.priority||kk;i.beforeRender(s,o(n))}}}},q8e=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l2;rc(this,t),this.idsByKey=new Oo,this.keyForId=new Oo,this.cachesByLvl=new Oo,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return nc(t,[{key:"getIdsFor",value:function(r){r==null&&nn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Ef,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new Oo,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])}(),uN=25,cm=50,pv=-4,t6=3,hW=7.99,H8e=8,W8e=1024,Y8e=1024,X8e=1024,j8e=.2,K8e=.8,Z8e=10,Q8e=.15,J8e=.1,eAe=.9,tAe=.9,rAe=100,nAe=1,ph={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},iAe=fi({getKey:null,doesEleInvalidateKey:l2,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:rH,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ep=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=iAe(r);Ut(n,i),n.lookup=new q8e(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},qn=ep.prototype;qn.reasons=ph;qn.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};qn.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};qn.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Qg(function(r,n){return n.reqs-r.reqs});return e};qn.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};qn.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Ak(o*r))),n<pv)n=pv;else if(o>=hW||n>t6)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=uN?g=uN:h<=cm?g=cm:g=Math.ceil(h/cm)*cm,h>X8e||d>Y8e)return null;var m=a.getTextureQueue(g),v=m[m.length-2],y=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};v||(v=m[m.length-1]),v||(v=y()),v.width-v.usedWidth<d&&(v=y());for(var b=function(M){return M&&M.scaledLabelShown===f},w=i&&i===ph.dequeue,T=i&&i===ph.highQuality,E=i&&i===ph.downscale,k,S=n+1;S<=t6;S++){var L=l.get(t,S);if(L){k=L;break}}var A=k&&k.level===n+1?k:null,R=function(){v.context.drawImage(A.texture.canvas,A.x,0,A.width,A.height,v.usedWidth,0,d,h)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,d,g),b(A))R();else if(b(k))if(T){for(var C=k.level;C>n;C--)A=a.getElement(t,e,r,C,ph.downscale);R()}else return a.queueElement(t,k.level-1),k;else{var I;if(!w&&!T&&!E)for(var P=n-1;P>=pv;P--){var _=l.get(t,P);if(_){I=_;break}}if(b(I))return a.queueElement(t,n),I;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,t,e,f,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return p={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:h,scaledLabelShown:f},v.usedWidth+=Math.ceil(d+H8e),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p};qn.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};qn.invalidateElement=function(t){var e=this,r=e.lookup,n=[],i=r.isInvalid(t);if(i){for(var a=pv;a<=t6;a++){var s=r.getForCachedKey(t,a);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],h=u.texture;h.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};qn.checkTextureUtility=function(t){t.invalidatedWidth>=j8e*t.width&&this.retireTexture(t)};qn.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>K8e&&t.fullnessChecks>=Z8e?Ul(r,t):t.fullnessChecks++};qn.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;Ul(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s<a.length;s++){var o=a[s];i.deleteCache(o.key,o.level)}Ck(a);var l=e.getRetiredTextureQueue(r);l.push(t)};qn.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),i={};return n.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(W8e,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=r.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};qn.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),i=r.getRetiredTextureQueue(t),a=0;a<i.length;a++){var s=i[a];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Ck(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ul(i,s),n.push(s),s}};qn.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};qn.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<nAe&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,ph.dequeue)}return i};qn.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=Sk,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};qn.onDequeue=function(t){this.onDequeues.push(t)};qn.offDequeue=function(t){Ul(this.onDequeues,t)};qn.setupDequeueing=uW.setupDequeueing({deqRedrawThreshold:rAe,deqCost:Q8e,deqAvgCost:J8e,deqNoDrawCost:eAe,deqFastCost:tAe,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var i=e.onDequeues[n];i(r)}},shouldRedraw:function(e,r,n,i){for(var a=0;a<r.length;a++)for(var s=r[a].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(Lk(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var aAe=1,vp=-4,m2=2,sAe=3.99,oAe=50,lAe=50,cAe=.15,uAe=.1,hAe=.9,dAe=.9,fAe=1,hN=250,pAe=4e3*4e3,dN=32767,gAe=!0,dW=function(e){var r=this,n=r.renderer=e,i=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Qo()-2*hN,r.skipping=!1,r.eleTxrDeqs=i.collection(),r.scheduleElementRefinement=Zg(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},lAe),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=hN?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(o,l){return l.reqs-o.reqs};r.layersQueue=new Qg(a),r.setupDequeueing()},pi=dW.prototype,fN=0,mAe=Math.pow(2,53)-1;pi.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:fN=++fN%mAe,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,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};pi.getLayers=function(t,e,r){var n=this,i=n.renderer,a=i.cy,s=a.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Ak(s*e)),r<vp)r=vp;else if(s>=sAe||r>m2)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var R=function(N){if(n.validateLayersElesOrdering(N,t),n.levelIsComplete(N,t))return p=l[N],!0},C=function(N){if(!p)for(var M=r+N;vp<=M&&M<=m2&&!R(M);M+=N);};C(1),C(-1);for(var I=h.length-1;I>=0;I--){var P=h[I];P.invalid&&Ul(h,P)}};if(!f)g();else return h;var m=function(){if(!d){d=ua();for(var R=0;R<t.length;R++)oH(d,t[R].boundingBox())}return d},v=function(R){R=R||{};var C=R.after;m();var I=Math.ceil(d.w*u),P=Math.ceil(d.h*u);if(I>dN||P>dN)return null;var _=I*P;if(_>pAe)return null;var N=n.makeLayer(d,r);if(C!=null){var M=h.indexOf(C)+1;h.splice(M,0,N)}else(R.insert===void 0||R.insert)&&h.unshift(N);return N};if(n.skipping&&!o)return null;for(var y=null,b=t.length/aAe,w=!o,T=0;T<t.length;T++){var E=t[T],k=E._private.rscratch,S=k.imgLayerCaches=k.imgLayerCaches||{},L=S[r];if(L){y=L;continue}if((!y||y.eles.length>=b||!mke(y.bb,E.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;p||w?n.queueLayer(y,E):n.drawEleInLayer(y,E,r,e),y.eles.push(E),S[r]=y}return p||(w?null:h)};pi.getEleLevelForLayerLevel=function(t,e){return t};pi.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,gAe),a.setImgSmoothing(s,!0))};pi.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a<n.length;a++){var s=n[a];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};pi.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);continue}for(var o=a,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}};pi.updateElementsInLayers=function(t,e){for(var r=this,n=Yg(t[0]),i=0;i<t.length;i++)for(var a=n?null:t[i],s=n?t[i]:t[i].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=vp;u<=m2;u++){var h=l[u];h&&(a&&r.getEleLevelForLayerLevel(h.level)!==a.level||e(h,s,a))}};pi.haveLayers=function(){for(var t=this,e=!1,r=vp;r<=m2;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};pi.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Qo(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};pi.invalidateLayer=function(t){if(this.lastInvalidationTime=Qo(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];Ul(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)}}};pi.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,i,a){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};pi.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};pi.queueLayer=function(t,e){var r=this,n=r.layersQueue,i=t.elesQueue,a=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(a[e.id()])return;i.push(e),a[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};pi.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],i=0;i<fAe&&r.size()!==0;){var a=r.peek();if(a.replacement){r.pop();continue}if(a.replaces&&a!==a.replaces.replacement){r.pop();continue}if(a.invalid){r.pop();continue}var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),n.length===0&&n.push(!0),a.elesQueue.length===0&&(r.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}return n};pi.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,i=r.indexOf(n);if(!(i<0||n.invalid)){r[i]=t;for(var a=0;a<t.eles.length;a++){var s=t.eles[a]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};pi.requestRedraw=Zg(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);pi.setupDequeueing=uW.setupDequeueing({deqRedrawThreshold:oAe,deqCost:cAe,deqAvgCost:uAe,deqNoDrawCost:hAe,deqFastCost:dAe,deq:function(e,r){return e.dequeue(r)},onDeqd:kk,shouldRedraw:rH,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var fW={},pN;function vAe(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function yAe(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function gN(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(var i=1;i<s.length;i++){var a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function xAe(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,Math.PI*2,!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 bAe(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}fW.arrowShapeImpl=function(t){return(pN||(pN={polygon:vAe,"triangle-backcurve":yAe,"triangle-tee":gN,"circle-triangle":xAe,"triangle-cross":gN,circle:bAe}))[t]};var ho={};ho.drawElement=function(t,e,r,n,i,a){var s=this;e.isNode()?s.drawNode(t,e,r,n,i,a):s.drawEdge(t,e,r,n,i,a)};ho.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};ho.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};ho.drawCachedElementPortion=function(t,e,r,n,i,a,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var h=r.getElement(e,u,n,i,a);if(h!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),p=u.x1,g=u.y1,m=u.w,v=u.h,y,b,w,T,E;if(f!==0){var k=r.getRotationPoint(e);w=k.x,T=k.y,t.translate(w,T),t.rotate(f),E=l.getImgSmoothing(t),E||l.setImgSmoothing(t,!0);var S=r.getRotationOffset(e);y=S.x,b=S.y}else y=p,b=g;var L;d!==1&&(L=t.globalAlpha,t.globalAlpha=L*d),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,y,b,m,v),d!==1&&(t.globalAlpha=L),f!==0&&(t.rotate(-f),t.translate(-w,-T),E||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var wAe=function(){return 0},TAe=function(e,r){return e.getTextAngle(r,null)},EAe=function(e,r){return e.getTextAngle(r,"source")},SAe=function(e,r){return e.getTextAngle(r,"target")},kAe=function(e,r){return r.effectiveOpacity()},l3=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};ho.drawCachedElement=function(t,e,r,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,h=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),p=a===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||Lk(f,n))){var g=e.isEdge(),m=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,i,p,wAe,kAe),(!g||!m)&&s.drawCachedElementPortion(t,e,u,r,i,p,TAe,l3),g&&!m&&(s.drawCachedElementPortion(t,e,h,r,i,p,EAe,l3),s.drawCachedElementPortion(t,e,d,r,i,p,SAe,l3)),s.drawElementOverlay(t,e)}};ho.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var i=e[n];r.drawElement(t,i)}};ho.drawCachedElements=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];i.drawCachedElement(t,s,r,n)}};ho.drawCachedNodes=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];s.isNode()&&i.drawCachedElement(t,s,r,n)}};ho.drawLayeredElements=function(t,e,r,n){var i=this,a=i.data.lyrTxrCache.getLayers(e,r);if(a)for(var s=0;s<a.length;s++){var o=a[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(t,e,r,n)};var ll={};ll.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,y=u*h,b=u*h,w=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;d==="straight-triangle"?(s.eleStrokeStyle(t,e,N),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,N),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},T=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,v[0],v[1],v[2],N);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},E=function(){i&&s.drawEdgeOverlay(t,e)},k=function(){i&&s.drawEdgeUnderlay(t,e)},S=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,N)},L=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var R=e.pstyle("ghost-offset-x").pfValue,C=e.pstyle("ghost-offset-y").pfValue,I=e.pstyle("ghost-opacity").value,P=y*I;t.translate(R,C),w(P),S(P),t.translate(-R,-C)}else T();k(),w(),S(),E(),L(),r&&t.translate(l.x1,l.y1)}};var pW=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};ll.drawEdgeOverlay=pW("overlay");ll.drawEdgeUnderlay=pW("underlay");ll.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+3<r.length;p+=4)e.quadraticCurveTo(r[p],r[p+1],r[p+2],r[p+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)e.lineTo(r[g],r[g+1]);break;case"segments":if(i.isRound){var m=na(i.roundCorners),v;try{for(m.s();!(v=m.n()).done;){var y=v.value;rW(e,y)}}catch(w){m.e(w)}finally{m.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=a,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};ll.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()}};ll.drawArrowheads=function(t,e,r){var n=e._private.rscratch,i=n.edgeType==="haystack";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)};ll.drawArrowhead=function(t,e,r,n,i,a,s){if(!(isNaN(n)||n==null||isNaN(i)||i==null||isNaN(a)||a==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),p=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(p*=d);var g=e.pstyle("opacity").value;s===void 0&&(s=g);var m=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,p,n,i,a),t.globalCompositeOperation=m);var v=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,v[0],v[1],v[2],s),o.colorStrokeStyle(t,v[0],v[1],v[2],s),o.drawArrowShape(e,t,h,d,l,p,n,i,a)}}};ll.drawArrowShape=function(t,e,r,n,i,a,s,o,l){var u=this,h=this.usePaths()&&i!=="triangle-cross",d=!1,f,p=e,g={x:s,y:o},m=t.pstyle("arrow-scale").value,v=this.getArrowWidth(n,m),y=u.arrowShapes[i];if(h){var b=u.arrowPathCache=u.arrowPathCache||[],w=hu(i),T=b[w];T!=null?(f=e=T,d=!0):(f=e=new Path2D,b[w]=f)}d||(e.beginPath&&e.beginPath(),h?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,v,l,g,n),e.closePath&&e.closePath()),e=p,h&&(e.translate(s,o),e.rotate(l),e.scale(v,v)),(r==="filled"||r==="both")&&(h?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=a/(h?v:1),e.lineJoin="miter",h?e.stroke(f):e.stroke()),h&&(e.scale(1/v,1/v),e.rotate(-l),e.translate(-s,-o))};var Uk={};Uk.safeDrawImage=function(t,e,r,n,i,a,s,o,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{t.drawImage(e,r,n,i,a,s,o,l,u)}catch(h){Cr(h)}};Uk.drawInscribedImage=function(t,e,r,n,i){var a=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),h=u.getIndexedStyle.bind(u),d=h(r,"background-fit","value",n),f=h(r,"background-repeat","value",n),p=r.width(),g=r.height(),m=r.padding()*2,v=p+(h(r,"background-width-relative-to","value",n)==="inner"?0:m),y=g+(h(r,"background-height-relative-to","value",n)==="inner"?0:m),b=r._private.rscratch,w=h(r,"background-clip","value",n),T=w==="node",E=h(r,"background-image-opacity","value",n)*i,k=h(r,"background-image-smoothing","value",n),S=r.pstyle("corner-radius").value;S!=="auto"&&(S=r.pstyle("corner-radius").pfValue);var L=e.width||e.cachedW,A=e.height||e.cachedH;(L==null||A==null)&&(document.body.appendChild(e),L=e.cachedW=e.width||e.offsetWidth,A=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var R=L,C=A;if(h(r,"background-width","value",n)!=="auto"&&(h(r,"background-width","units",n)==="%"?R=h(r,"background-width","pfValue",n)*v:R=h(r,"background-width","pfValue",n)),h(r,"background-height","value",n)!=="auto"&&(h(r,"background-height","units",n)==="%"?C=h(r,"background-height","pfValue",n)*y:C=h(r,"background-height","pfValue",n)),!(R===0||C===0)){if(d==="contain"){var I=Math.min(v/R,y/C);R*=I,C*=I}else if(d==="cover"){var I=Math.max(v/R,y/C);R*=I,C*=I}var P=o-v/2,_=h(r,"background-position-x","units",n),N=h(r,"background-position-x","pfValue",n);_==="%"?P+=(v-R)*N:P+=N;var M=h(r,"background-offset-x","units",n),O=h(r,"background-offset-x","pfValue",n);M==="%"?P+=(v-R)*O:P+=O;var D=l-y/2,B=h(r,"background-position-y","units",n),z=h(r,"background-position-y","pfValue",n);B==="%"?D+=(y-C)*z:D+=z;var F=h(r,"background-offset-y","units",n),G=h(r,"background-offset-y","pfValue",n);F==="%"?D+=(y-C)*G:D+=G,b.pathCache&&(P-=o,D-=l,o=0,l=0);var q=t.globalAlpha;t.globalAlpha=E;var Y=a.getImgSmoothing(t),ee=!1;if(k==="no"&&Y?(a.setImgSmoothing(t,!1),ee=!0):k==="yes"&&!Y&&(a.setImgSmoothing(t,!0),ee=!0),f==="no-repeat")T&&(t.save(),b.pathCache?t.clip(b.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.clip())),a.safeDrawImage(t,e,0,0,L,A,P,D,R,C),T&&t.restore();else{var Q=t.createPattern(e,f);t.fillStyle=Q,a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,v,y,S,b),t.translate(P,D),t.fill(),t.translate(-P,-D)}t.globalAlpha=q,ee&&a.setImgSmoothing(t,Y)}};var Fu={};Fu.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(Ak(r*n));e=Math.pow(2,i)}var a=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};Fu.drawElementText=function(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,h=e.pstyle("label"),d=e.pstyle("source-label"),f=e.pstyle("target-label");if(u||(!h||!h.value)&&(!d||!d.value)&&(!f||!f.value))return;t.textAlign="center",t.textBaseline="bottom"}var p=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),i==null?(s.drawText(t,e,null,p,a),e.isEdge()&&(s.drawText(t,e,"source",p,a),s.drawText(t,e,"target",p,a))):s.drawText(t,e,i,p,a),r&&t.translate(g.x1,g.y1)};Fu.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Fu.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function c3(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?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()}Fu.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ji(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};Fu.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ji(s,"labelX",r),u=Ji(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ji(s,"labelWidth",r),m=Ji(s,"labelHeight",r),v=e.pstyle(p+"text-margin-x").pfValue,y=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;b&&(w="center",T="center"),l+=v,u+=y;var E;switch(n?E=this.getTextAngle(e,r):E=0,E!==0&&(h=l,d=u,t.translate(h,d),t.rotate(E),l=0,u=0),T){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var k=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,A=e.pstyle("text-background-padding").pfValue,R=e.pstyle("text-background-shape").strValue,C=R.indexOf("round")===0,I=2;if(k>0||L>0&&S>0){var P=l-A;switch(w){case"left":P-=g;break;case"center":P-=g/2;break}var _=u-m-A,N=g+2*A,M=m+2*A;if(k>0){var O=t.fillStyle,D=e.pstyle("text-background-color").value;t.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+k*o+")",C?c3(t,P,_,N,M,I):t.fillRect(P,_,N,M),t.fillStyle=O}if(L>0&&S>0){var B=t.strokeStyle,z=t.lineWidth,F=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+F[0]+","+F[1]+","+F[2]+","+S*o+")",t.lineWidth=L,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(C?c3(t,P,_,N,M,I,"stroke"):t.strokeRect(P,_,N,M),G==="double"){var q=L/2;C?c3(t,P+q,_+q,N-q*2,M-q*2,I,"stroke"):t.strokeRect(P+q,_+q,N-q*2,M-q*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=z,t.strokeStyle=B}}var Y=2*e.pstyle("text-outline-width").pfValue;if(Y>0&&(t.lineWidth=Y),e.pstyle("text-wrap").value==="wrap"){var ee=Ji(s,"labelWrapCachedLines",r),Q=Ji(s,"labelLineHeight",r),oe=g/2,pe=this.getLabelJustification(e);switch(pe==="auto"||(w==="left"?pe==="left"?l+=-g:pe==="center"&&(l+=-oe):w==="center"?pe==="left"?l+=-oe:pe==="right"&&(l+=oe):w==="right"&&(pe==="center"?l+=oe:pe==="right"&&(l+=g))),T){case"top":u-=(ee.length-1)*Q;break;case"center":case"bottom":u-=(ee.length-1)*Q;break}for(var j=0;j<ee.length;j++)Y>0&&t.strokeText(ee[j],l,u),t.fillText(ee[j],l,u),u+=Q}else Y>0&&t.strokeText(f,l,u),t.fillText(f,l,u);E!==0&&(t.rotate(-E),t.translate(-h,-d))}}};var ac={};ac.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!gt(d.x)||!gt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,v=e.padding();o=e.width()+2*v,l=e.height()+2*v;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,T=new Array(w.length),E=new Array(w.length),k=0,S=0;S<w.length;S++){var L=w[S],A=T[S]=L!=null&&L!=="none";if(A){var R=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);k++,E[S]=s.getCachedImage(L,R,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var C=e.pstyle("background-blacken").value,I=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*f,_=e.pstyle("border-color").value,N=e.pstyle("border-style").value,M=e.pstyle("border-join").value,O=e.pstyle("border-cap").value,D=e.pstyle("border-position").value,B=e.pstyle("border-dash-pattern").pfValue,z=e.pstyle("border-dash-offset").pfValue,F=e.pstyle("border-opacity").value*f,G=e.pstyle("outline-width").pfValue,q=e.pstyle("outline-color").value,Y=e.pstyle("outline-style").value,ee=e.pstyle("outline-opacity").value*f,Q=e.pstyle("outline-offset").value,oe=e.pstyle("corner-radius").value;oe!=="auto"&&(oe=e.pstyle("corner-radius").pfValue);var pe=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;s.eleFillStyle(t,e,J)},j=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.colorStrokeStyle(t,_[0],_[1],_[2],J)},W=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ee;s.colorStrokeStyle(t,q[0],q[1],q[2],J)},X=function(J,ue,$,se){var ae=s.nodePathCache=s.nodePathCache||[],fe=tH($==="polygon"?$+","+se.join(","):$,""+ue,""+J,""+oe),he=ae[fe],Te,Se=!1;return he!=null?(Te=he,Se=!0,h.pathCache=Te):(Te=new Path2D,ae[fe]=h.pathCache=Te),{path:Te,cacheHit:Se}},H=e.pstyle("shape").strValue,K=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ne=X(o,l,H,K);g=ne.path,m=ne.cacheHit}var Z=function(){if(!m){var J=d;p&&(J={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,J.x,J.y,o,l,oe,h)}p?t.fill(g):t.fill()},be=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,$=u.backgrounding,se=0,ae=0;ae<E.length;ae++){var fe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ae);if(ue&&fe==="over"||!ue&&fe==="inside"){se++;continue}T[ae]&&E[ae].complete&&!E[ae].error&&(se++,s.drawInscribedImage(t,E[ae],e,ae,J))}u.backgrounding=se!==k,$!==u.backgrounding&&e.updateStyle(!1)},ce=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ue),J&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h)))},re=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h),t.clip()),s.drawStripe(t,e,ue),t.restore(),J&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,oe,h)))},Ne=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ue=(C>0?C:-C)*J,$=C>0?0:255;C!==0&&(s.colorFillStyle(t,$,$,$,ue),p?t.fill(g):t.fill())},me=function(){if(I>0){if(t.lineWidth=I,t.lineCap=O,t.lineJoin=M,t.setLineDash)switch(N){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(D!=="center"){if(t.save(),t.lineWidth*=2,D==="inside")p?t.clip(g):t.clip();else{var J=new Path2D;J.rect(-o/2-I,-l/2-I,o+2*I,l+2*I),J.addPath(g),t.clip(J,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(N==="double"){t.lineWidth=I/3;var ue=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ue}t.setLineDash&&t.setLineDash([])}},Ve=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;p&&(J={x:0,y:0});var ue=s.getNodeShape(e),$=I;D==="inside"&&($=0),D==="outside"&&($*=2);var se=(o+$+(G+Q))/o,ae=(l+$+(G+Q))/l,fe=o*se,he=l*ae,Te=s.nodeShapes[ue].points,Se;if(p){var Ee=X(fe,he,ue,Te);Se=Ee.path}if(ue==="ellipse")s.drawEllipsePath(Se||t,J.x,J.y,fe,he);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ue)){var Ge=0,Je=0,He=0;ue==="round-diamond"?Ge=($+Q+G)*1.4:ue==="round-heptagon"?(Ge=($+Q+G)*1.075,He=-($/2+Q+G)/35):ue==="round-hexagon"?Ge=($+Q+G)*1.12:ue==="round-pentagon"?(Ge=($+Q+G)*1.13,He=-($/2+Q+G)/15):ue==="round-tag"?(Ge=($+Q+G)*1.12,Je=($/2+G+Q)*.07):ue==="round-triangle"&&(Ge=($+Q+G)*(Math.PI/2),He=-($+Q/2+G)/Math.PI),Ge!==0&&(se=(o+Ge)/o,fe=o*se,["round-hexagon","round-tag"].includes(ue)||(ae=(l+Ge)/l,he=l*ae)),oe=oe==="auto"?uH(fe,he):oe;for(var Xe=fe/2,Ke=he/2,$e=oe+($+G+Q)/2,je=new Array(Te.length/2),lt=new Array(Te.length/2),st=0;st<Te.length/2;st++)je[st]={x:J.x+Je+Xe*Te[st*2],y:J.y+He+Ke*Te[st*2+1]};var qe,Et,Ye,Ze,ht=je.length;for(Et=je[ht-1],qe=0;qe<ht;qe++)Ye=je[qe%ht],Ze=je[(qe+1)%ht],lt[qe]=Vk(Et,Ye,Ze,$e),Et=Ye,Ye=Ze;s.drawRoundPolygonPath(Se||t,J.x+Je,J.y+He,o*se,l*ae,Te,lt)}else if(["roundrectangle","round-rectangle"].includes(ue))oe=oe==="auto"?ql(fe,he):oe,s.drawRoundRectanglePath(Se||t,J.x,J.y,fe,he,oe+($+G+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(ue))oe=oe==="auto"?Rk():oe,s.drawCutRectanglePath(Se||t,J.x,J.y,fe,he,null,oe+($+G+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ue))oe=oe==="auto"?ql(fe,he):oe,s.drawBottomRoundRectanglePath(Se||t,J.x,J.y,fe,he,oe+($+G+Q)/2);else if(ue==="barrel")s.drawBarrelPath(Se||t,J.x,J.y,fe,he);else if(ue.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ue)){var ct=($+G+Q)/o;Te=c2(u2(Te,ct)),s.drawPolygonPath(Se||t,J.x,J.y,o,l,Te)}else{var ut=($+G+Q)/o;Te=c2(u2(Te,-ut)),s.drawPolygonPath(Se||t,J.x,J.y,o,l,Te)}if(p?t.stroke(Se):t.stroke(),Y==="double"){t.lineWidth=$/3;var mt=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(Se):t.stroke(),t.globalCompositeOperation=mt}t.setLineDash&&t.setLineDash([])}},Ue=function(){i&&s.drawNodeOverlay(t,e,d,o,l)},Fe=function(){i&&s.drawNodeUnderlay(t,e,d,o,l)},_e=function(){s.drawElementText(t,e,null,n)},Oe=e.pstyle("ghost").value==="yes";if(Oe){var Ce=e.pstyle("ghost-offset-x").pfValue,Le=e.pstyle("ghost-offset-y").pfValue,ze=e.pstyle("ghost-opacity").value,ge=ze*f;t.translate(Ce,Le),W(),Ve(),pe(ze*P),Z(),be(ge,!0),j(ze*F),me(),ce(C!==0||I!==0),re(C!==0||I!==0),be(ge,!1),Ne(ge),t.translate(-Ce,-Le)}p&&t.translate(-d.x,-d.y),Fe(),p&&t.translate(d.x,d.y),W(),Ve(),pe(),Z(),be(f,!0),j(),me(),ce(C!==0||I!==0),re(C!==0||I!==0),be(f,!1),Ne(),p&&t.translate(-d.x,-d.y),_e(),Ue(),r&&t.translate(y.x1,y.y1)}};var gW=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,i,a,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};ac.drawNodeOverlay=gW("overlay");ac.drawNodeUnderlay=gW("underlay");ac.hasPie=function(t){return t=t[0],t._private.hasPie};ac.hasStripe=function(t){return t=t[0],t._private.hasStripe};ac.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var v=1;v<=i.pieBackgroundN;v++){var y=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,w=e.pstyle("pie-"+v+"-background-opacity").value*r,T=y/100;T+g>1&&(T=1-g);var E=1.5*Math.PI+2*Math.PI*g;E+=o;var k=2*Math.PI*T,S=E+k;y===0||g>=1||g+T>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,E,S),t.closePath()):(t.beginPath(),t.arc(l,u,f,E,S),t.arc(l,u,p,S,E,!0),t.closePath()),this.colorFillStyle(t,b[0],b[1],b[2],w),t.fill(),g+=T)}};ac.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var v=e.pstyle("stripe-"+m+"-background-size").value,y=e.pstyle("stripe-"+m+"-background-color").value,b=e.pstyle("stripe-"+m+"-background-opacity").value*r,w=v/100;w+u>1&&(w=1-u),!(v===0||u>=1||u+w>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*w),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=w)}t.restore()};var Xi={},CAe=100;Xi.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Xi.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;i<e.length;i++)if(n=e[i],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Xi.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(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),h=r.targetEndpoint(),d=r.midpoint(),f=du(u,d),p=du(h,d);a=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var g=s?{x:0,y:0}:r.position(),m=r.paddedWidth(),v=r.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(m,v))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();a=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var w=s?{x:0,y:0}:r.position(),T=r.paddedWidth(),E=r.paddedHeight(),k=T/2,S=E/2,L=r.pstyle("background-gradient-direction").value;switch(L){case"to-bottom":a=t.createLinearGradient(w.x,w.y-S,w.x,w.y+S);break;case"to-top":a=t.createLinearGradient(w.x,w.y+S,w.x,w.y-S);break;case"to-left":a=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":a=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(w.x-k,w.y-S,w.x+k,w.y+S);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(w.x-k,w.y+S,w.x+k,w.y-S);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(w.x+k,w.y-S,w.x-k,w.y+S);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(w.x+k,w.y+S,w.x-k,w.y-S);break}}if(!a)return null;for(var A=l.length===o.length,R=o.length,C=0;C<R;C++)a.addColorStop(A?l[C]:C/(R-1),"rgba("+o[C][0]+","+o[C][1]+","+o[C][2]+","+i+")");return a};Xi.gradientFillStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"background",e,r,n);if(!i)return null;t.fillStyle=i};Xi.colorFillStyle=function(t,e,r,n,i){t.fillStyle="rgba("+e+","+r+","+n+","+i+")"};Xi.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],r)}};Xi.gradientStrokeStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"line",e,r,n);if(!i)return null;t.strokeStyle=i};Xi.colorStrokeStyle=function(t,e,r,n,i){t.strokeStyle="rgba("+e+","+r+","+n+","+i+")"};Xi.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],r)}};Xi.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=i*s,u=a*s,h;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=i+"px",d.style.height=a+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)h=r.canvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";for(var f=0;f<e.BUFFER_COUNT;f++)h=r.bufferCanvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";e.textureMult=1,s<=1&&(h=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=l*e.textureMult,h.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};Xi.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Xi.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Xi.render=function(t){var e=this;t=t||aH();var r=e.cy,n=t.forcedContext,i=t.drawAllLayers,a=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,h=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,p=e.motionBlurPxRatio,g=r.hasCompoundNodes(),m=e.hoverData.draggingEles,v=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!v;var y=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(y=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var b=r.style(),w=r.zoom(),T=s!==void 0?s:w,E=r.pan(),k={x:E.x,y:E.y},S={zoom:w,pan:{x:E.x,y:E.y}},L=e.prevViewport,A=L===void 0||S.zoom!==L.zoom||S.pan.x!==L.pan.x||S.pan.y!==L.pan.y;!A&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(k=o),T*=l,k.x*=l,k.y*=l;var R=e.getCachedZSortedEles();function C(j,W,X,H,K){var ne=j.globalCompositeOperation;j.globalCompositeOperation="destination-out",e.colorFillStyle(j,255,255,255,e.motionBlurTransparency),j.fillRect(W,X,H,K),j.globalCompositeOperation=ne}function I(j,W){var X,H,K,ne;!e.clearingMotionBlur&&(j===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||j===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(X={x:E.x*p,y:E.y*p},H=w*p,K=e.canvasWidth*p,ne=e.canvasHeight*p):(X=k,H=T,K=e.canvasWidth,ne=e.canvasHeight),j.setTransform(1,0,0,1,0,0),W==="motionBlur"?C(j,0,0,K,ne):!n&&(W===void 0||W)&&j.clearRect(0,0,K,ne),i||(j.translate(X.x,X.y),j.scale(H,H)),o&&j.translate(o.x,o.y),s&&j.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var P=e.data.bufferContexts[e.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var S=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};S.mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var _=u.contexts[e.NODE],N=e.textureCache.texture,S=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),f?C(_,0,0,S.width,S.height):_.clearRect(0,0,S.width,S.height);var M=b.core("outside-texture-bg-color").value,O=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,M[0],M[1],M[2],O),_.fillRect(0,0,S.width,S.height);var w=r.zoom();I(_,!1),_.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),_.drawImage(N,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var D=r.extent(),B=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&B,F=[];if(F[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,F[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),F[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,F[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||F[e.NODE]){var G=f&&!F[e.NODE]&&p!==1,_=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),q=f&&!G?"motionBlur":void 0;I(_,q),z?e.drawCachedNodes(_,R.nondrag,l,D):e.drawLayeredElements(_,R.nondrag,l,D),e.debug&&e.drawDebugPoints(_,R.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||F[e.DRAG])){var G=f&&!F[e.DRAG]&&p!==1,_=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);I(_,f&&!G?"motionBlur":void 0),z?e.drawCachedNodes(_,R.drag,l,D):e.drawCachedElements(_,R.drag,l,D),e.debug&&e.drawDebugPoints(_,R.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,I),f&&p!==1){var Y=u.contexts[e.NODE],ee=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Q=u.contexts[e.DRAG],oe=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],pe=function(W,X,H){W.setTransform(1,0,0,1,0,0),H||!y?W.clearRect(0,0,e.canvasWidth,e.canvasHeight):C(W,0,0,e.canvasWidth,e.canvasHeight);var K=p;W.drawImage(X,0,0,e.canvasWidth*K,e.canvasHeight*K,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||F[e.NODE])&&(pe(Y,ee,F[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||F[e.DRAG])&&(pe(Q,oe,F[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},CAe)),n||r.emit("render")};var e0;Xi.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),v="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!e0){var y=h.measureText(v);e0=y.actualBoundingBoxAscent}h.fillText(v,0,e0);var b=60;h.strokeRect(0,e0+10,250,20),h.fillRect(0,e0+10,250*Math.min(m/b,1),20)}o||(l[r.SELECT_BOX]=!1)}};function mN(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 AAe(t,e,r){var n=mN(t,t.VERTEX_SHADER,e),i=mN(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 _Ae(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function qk(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 LAe(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function RAe(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function NAe(t){return t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function DAe(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function xc(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 Ku(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 IAe(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function MAe(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function mW(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 vW(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function OAe(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 PAe(t,e,r,n){var i=mW(t,e),a=Ln(i,2),s=a[0],o=a[1],l=vW(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function Ds(t,e,r,n){var i=mW(t,r),a=Ln(i,3),s=a[0],o=a[1],l=a[2],u=vW(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;p<e;p++)f[p]=OAe(t,o,u,h,s,p);return d.dataArray=u,d.stride=h,d.size=s,d.getView=function(g){return f[g]},d.setPoint=function(g,m,v){var y=f[g];y[0]=m,y[1]=v},d.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,d),g?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,g*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function BAe(t,e,r){for(var n=9,i=new Float32Array(e*n),a=new Array(e),s=0;s<e;s++){var o=s*n*4;a[s]=new Float32Array(i.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var h=r+u;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,3*12,u*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return a[d]},l.setData=function(d,f){a[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,i)},l}function FAe(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(n,i){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var vN=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function u3(){var t=new vN(9);return vN!=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 yN(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 $Ae(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1],g=r[2],m=r[3],v=r[4],y=r[5],b=r[6],w=r[7],T=r[8];return t[0]=f*n+p*s+g*u,t[1]=f*i+p*o+g*h,t[2]=f*a+p*l+g*d,t[3]=m*n+v*s+y*u,t[4]=m*i+v*o+y*h,t[5]=m*a+v*l+y*d,t[6]=b*n+w*s+T*u,t[7]=b*i+w*o+T*h,t[8]=b*a+w*l+T*d,t}function gv(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=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]=f*n+p*s+u,t[7]=f*i+p*o+h,t[8]=f*a+p*l+d,t}function xN(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*s,t[1]=p*i+f*o,t[2]=p*a+f*l,t[3]=p*s-f*n,t[4]=p*o-f*i,t[5]=p*l-f*a,t[6]=u,t[7]=h,t[8]=d,t}function r6(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 zAe(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}var VAe=function(){function t(e,r,n,i){rc(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,r,r),this.scratch=i(e,r,this.texHeight,"scratch")}return nc(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,i=r.h,a=this.texHeight,s=this.texSize,o=a/i,l=n*o,u=i*o;return l>s&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(w,T){if(i&&T){var E=T.context,k=w.x,S=w.row,L=k,A=l*S;E.save(),E.translate(L,A),E.scale(h,h),i(E,n),E.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},v=function(){var w=a.scratch,T=a.canvas;w.clear(),p({x:0,row:0},w);var E=s-a.freePointer.x,k=d-E,S=l;{var L=a.freePointer.x,A=a.freePointer.row*l,R=E;T.context.drawImage(w,0,0,R,S,L,A,R,S),g[0]={x:L,y:A,w:R,h:f}}{var C=E,I=(a.freePointer.row+1)*l,P=k;T&&T.context.drawImage(w,C,0,P,S,0,I,P,S),g[1]={x:0,y:I,w:P,h:f}}a.freePointer.x=k,a.freePointer.row++},y=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(y(),m()):this.enableWrapping?v():(y(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=MAe(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),GAe=function(){function t(e,r,n,i){rc(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return nc(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas;return new VAe(r,n,i,a)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas,s=Math.floor(n/i);this.scratch=a(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,i){var a=this.styleKeyToAtlas.get(r);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(n))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(r,n,i),this.styleKeyToAtlas.set(r,a)),a}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var i=[],a=new Map,s=null,o=na(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),p=UAe(n,f);if(p.size===0)return i.push(d),f.forEach(function(E){return a.set(E,d)}),1;s||(s=r._createAtlas(),i.push(s));var g=na(f),m;try{for(g.s();!(m=g.n()).done;){var v=m.value;if(!p.has(v)){var y=d.getOffsets(v),b=Ln(y,2),w=b[0],T=b[1];s.canFit({w:w.w+T.w,h:w.h})||(s.lock(),s=r._createAtlas(),i.push(s)),d.canvas&&(r._copyTextureToNewAtlas(v,d,s),a.set(v,s))}}}catch(E){g.e(E)}finally{g.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(h){o.e(h)}finally{o.f()}this.atlases=i,this.styleKeyToAtlas=a,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,i){var a=n.getOffsets(r),s=Ln(a,2),o=s[0],l=s[1];if(l.w===0)i.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var h=o.w+l.w,d=o.h;i.draw(r,{w:h,h:d},function(f){f.drawImage(u,0,0,h,d,0,0,h,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}();function UAe(t,e){return t.intersection?t.intersection(e):new Set(a2(t).filter(function(r){return e.has(r)}))}var qAe=function(){function t(e,r){rc(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return nc(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var i=this.globalOptions,a=i.webglTexSize,s=i.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new GAe(this.r,a,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var a=this.collections.get(i),s=Ut({type:r,atlasCollection:a},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,i=-1,a=null;return function(s,o,l,u){return u?((!a||o!=n||l!=i)&&(n=o,i=l,a=r(s,o,l)),a):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=na(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=na(this.renderTypes.values()),y;try{var b=function(){var T=y.value,E=T.type;if(h(E)){var k=n.collections.get(T.collection),S=T.getKey(m),L=Array.isArray(S)?S:[S];if(s)L.forEach(function(I){return k.markKeyForGC(I)}),f=!0;else{var A=T.getID?T.getID(m):m.id(),R=n._key(E,A),C=n.typeAndIdToKey.get(R);C!==void 0&&!DAe(L,C)&&(d=!0,n.typeAndIdToKey.delete(R),C.forEach(function(I){return k.markKeyForGC(I)}))}}};for(v.s();!(y=v.n()).done;)b()}catch(w){v.e(w)}finally{v.f()}}}}catch(w){p.e(w)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=na(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=Ln(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=na(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=Ln(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),HAe=function(){function t(e){rc(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return nc(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])}(),WAe=`
|
|
2393
2393
|
float circleSD(vec2 p, float r) {
|
|
2394
2394
|
return distance(vec2(0), p) - r; // signed distance
|
|
2395
2395
|
}
|
|
@@ -3078,7 +3078,7 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":K="Parse error on
|
|
|
3078
3078
|
`,"getStyles"),oRe=sRe,lRe=x((t,e,r,n)=>{e.forEach(i=>{yRe[i](t,r,n)})},"insertMarkers"),cRe=x((t,e,r)=>{ie.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"),uRe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").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"),hRe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").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"),dRe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").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"),fRe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").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"),pRe=x((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"),gRe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),mRe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),vRe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),yRe={extension:cRe,composition:uRe,aggregation:hRe,dependency:dRe,lollipop:fRe,point:pRe,circle:gRe,cross:mRe,barb:vRe},xRe=lRe,KN,ZN,pn=((ZN=(KN=we())==null?void 0:KN.block)==null?void 0:ZN.padding)??8;function ZW(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(ZW,"calculateBlockPosition");var bRe=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};ie.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type!=="space"&&(i>e&&(e=i/(t.widthInColumns??1)),a>r&&(r=a))}return{width:e,height:r}},"getMaxChildSize");function E2(t,e,r=0,n=0){var s,o,l,u,h,d,f,p,g,m,v;ie.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.x,"block width =",t==null?void 0:t.size,"sieblingWidth",r),(o=t==null?void 0:t.size)!=null&&o.width||(t.size={width:r,height:n,x:0,y:0});let i=0,a=0;if(((l=t.children)==null?void 0:l.length)>0){for(const L of t.children)E2(L,e);const y=bRe(t);i=y.width,a=y.height,ie.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",i,a);for(const L of t.children)L.size&&(ie.debug(`abc95 Setting size of children of ${t.id} id=${L.id} ${i} ${a} ${JSON.stringify(L.size)}`),L.size.width=i*(L.widthInColumns??1)+pn*((L.widthInColumns??1)-1),L.size.height=a,L.size.x=0,L.size.y=0,ie.debug(`abc95 updating size of ${t.id} children child:${L.id} maxWidth:${i} maxHeight:${a}`));for(const L of t.children)E2(L,e,i,a);const b=t.columns??-1;let w=0;for(const L of t.children)w+=L.widthInColumns??1;let T=t.children.length;b>0&&b<w&&(T=b);const E=Math.ceil(w/T);let k=T*(i+pn)+pn,S=E*(a+pn)+pn;if(k<r){ie.debug(`Detected to small siebling: abc95 ${t.id} sieblingWidth ${r} sieblingHeight ${n} width ${k}`),k=r,S=n;const L=(r-T*pn-pn)/T,A=(n-E*pn-pn)/E;ie.debug("Size indata abc88",t.id,"childWidth",L,"maxWidth",i),ie.debug("Size indata abc88",t.id,"childHeight",A,"maxHeight",a),ie.debug("Size indata abc88 xSize",T,"padding",pn);for(const R of t.children)R.size&&(R.size.width=L,R.size.height=A,R.size.x=0,R.size.y=0)}if(ie.debug(`abc95 (finale calc) ${t.id} xSize ${T} ySize ${E} columns ${b}${t.children.length} width=${Math.max(k,((u=t.size)==null?void 0:u.width)||0)}`),k<(((h=t==null?void 0:t.size)==null?void 0:h.width)||0)){k=((d=t==null?void 0:t.size)==null?void 0:d.width)||0;const L=b>0?Math.min(t.children.length,b):t.children.length;if(L>0){const A=(k-L*pn-pn)/L;ie.debug("abc95 (growing to fit) width",t.id,k,(f=t.size)==null?void 0:f.width,A);for(const R of t.children)R.size&&(R.size.width=A)}}t.size={width:k,height:S,x:0,y:0}}ie.debug("setBlockSizes abc94 (done)",t.id,(p=t==null?void 0:t.size)==null?void 0:p.x,(g=t==null?void 0:t.size)==null?void 0:g.width,(m=t==null?void 0:t.size)==null?void 0:m.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}x(E2,"setBlockSizes");function Jk(t,e){var n,i,a,s,o,l,u,h,d,f,p,g,m,v,y,b,w;ie.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(n=t==null?void 0:t.size)==null?void 0:n.x} y: ${(i=t==null?void 0:t.size)==null?void 0:i.y} width: ${(a=t==null?void 0:t.size)==null?void 0:a.width}`);const r=t.columns??-1;if(ie.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const T=((o=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:o.width)??0,E=t.children.length*T+(t.children.length-1)*pn;ie.debug("widthOfChildren 88",E,"posX");let k=0;ie.debug("abc91 block?.size?.x",t.id,(l=t==null?void 0:t.size)==null?void 0:l.x);let S=(u=t==null?void 0:t.size)!=null&&u.x?((h=t==null?void 0:t.size)==null?void 0:h.x)+(-((d=t==null?void 0:t.size)==null?void 0:d.width)/2||0):-pn,L=0;for(const A of t.children){const R=t;if(!A.size)continue;const{width:C,height:I}=A.size,{px:P,py:_}=ZW(r,k);if(_!=L&&(L=_,S=(f=t==null?void 0:t.size)!=null&&f.x?((p=t==null?void 0:t.size)==null?void 0:p.x)+(-((g=t==null?void 0:t.size)==null?void 0:g.width)/2||0):-pn,ie.debug("New row in layout for block",t.id," and child ",A.id,L)),ie.debug(`abc89 layout blocks (child) id: ${A.id} Pos: ${k} (px, py) ${P},${_} (${(m=R==null?void 0:R.size)==null?void 0:m.x},${(v=R==null?void 0:R.size)==null?void 0:v.y}) parent: ${R.id} width: ${C}${pn}`),R.size){const N=C/2;A.size.x=S+pn+N,ie.debug(`abc91 layout blocks (calc) px, pyid:${A.id} startingPos=X${S} new startingPosX${A.size.x} ${N} padding=${pn} width=${C} halfWidth=${N} => x:${A.size.x} y:${A.size.y} ${A.widthInColumns} (width * (child?.w || 1)) / 2 ${C*((A==null?void 0:A.widthInColumns)??1)/2}`),S=A.size.x+N,A.size.y=R.size.y-R.size.height/2+_*(I+pn)+I/2+pn,ie.debug(`abc88 layout blocks (calc) px, pyid:${A.id}startingPosX${S}${pn}${N}=>x:${A.size.x}y:${A.size.y}${A.widthInColumns}(width * (child?.w || 1)) / 2${C*((A==null?void 0:A.widthInColumns)??1)/2}`)}A.children&&Jk(A),k+=(A==null?void 0:A.widthInColumns)??1,ie.debug("abc88 columnsPos",A,k)}}ie.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(y=t==null?void 0:t.size)==null?void 0:y.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}x(Jk,"layoutBlocks");function e7(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/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}=e7(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(e7,"findBounds");function QW(t){const e=t.getBlock("root");if(!e)return;E2(e,t,0,0),Jk(e),ie.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:n,maxX:i,maxY:a}=e7(e),s=a-n,o=i-r;return{x:r,y:n,width:o,height:s}}x(QW,"layout");function g6(t,e){e&&t.attr("style",e)}x(g6,"applyStyle");function JW(t){const e=rt(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),g6(a,t.labelStyle),a.attr("class",i),g6(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}x(JW,"addHtmlLabel");var wRe=x((t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),Dr(we().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),ie.debug("vertexText"+i);const a={isNode:n,label:xE(Zs(i)),labelStyle:e.replace("fill:","color:")};return JW(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?s=i:s=[];for(const o of s){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=o.trim(),a.appendChild(l)}return a}},"createLabel"),Ua=wRe,TRe=x((t,e,r,n,i)=>{e.arrowTypeStart&&FN(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&FN(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),ERe={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},FN=x((t,e,r,n,i,a)=>{const s=ERe[r];if(!s){ie.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),m6={},xi={},SRe=x((t,e)=>{const r=we(),n=Dr(r.flowchart.htmlLabels),i=e.labelType==="markdown"?da(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):Ua(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(i);let o=i.getBBox();if(n){const u=i.children[0],h=rt(i);o=u.getBoundingClientRect(),h.attr("width",o.width),h.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),m6[e.id]=a,e.width=o.width,e.height=o.height;let l;if(e.startLabelLeft){const u=Ua(e.startLabelLeft,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xi[e.id]||(xi[e.id]={}),xi[e.id].startLeft=h,rp(l,e.startLabelLeft)}if(e.startLabelRight){const u=Ua(e.startLabelRight,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=h.node().appendChild(u),d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),xi[e.id]||(xi[e.id]={}),xi[e.id].startRight=h,rp(l,e.startLabelRight)}if(e.endLabelLeft){const u=Ua(e.endLabelLeft,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),xi[e.id]||(xi[e.id]={}),xi[e.id].endLeft=h,rp(l,e.endLabelLeft)}if(e.endLabelRight){const u=Ua(e.endLabelRight,e.labelStyle),h=t.insert("g").attr("class","edgeTerminals"),d=h.insert("g").attr("class","inner");l=d.node().appendChild(u);const f=u.getBBox();d.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),h.node().appendChild(u),xi[e.id]||(xi[e.id]={}),xi[e.id].endRight=h,rp(l,e.endLabelRight)}return i},"insertEdgeLabel");function rp(t,e){we().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(rp,"setTerminalWidth");var kRe=x((t,e)=>{ie.debug("Moving label abc88 ",t.id,t.label,m6[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=we(),{subGraphTitleTotalMargin:i}=fg(n);if(t.label){const a=m6[t.id];let s=t.x,o=t.y;if(r){const l=Zt.calcLabelPosition(r);ie.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=xi[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=Zt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=xi[t.id].startRight;let s=t.x,o=t.y;if(r){const l=Zt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=xi[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=Zt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=xi[t.id].endRight;let s=t.x,o=t.y;if(r){const l=Zt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),CRe=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),ARe=x((t,e,r)=>{ie.debug(`intersection calc abc89:
|
|
3079
3079
|
outsidePoint: ${JSON.stringify(e)}
|
|
3080
3080
|
insidePoint : ${JSON.stringify(r)}
|
|
3081
|
-
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,u=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 d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),ie.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return ie.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),$N=x((t,e)=>{ie.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!CRe(e,a)&&!i){const s=ARe(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),_Re=x(function(t,e,r,n,i,a,s){let o=r.points;ie.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ie.debug("to cluster abc88",n[r.toCluster]),o=$N(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ie.debug("from cluster abc88",n[r.fromCluster]),o=$N(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=xh;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=aM(r),m=Dp().x(p).y(g).curve(f);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(we().flowchart.arrowMarkerAbsolute||we().state.arrowMarkerAbsolute)&&(b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)")),TRe(y,r,b,s,i);let w={};return l&&(w.updatedPath=o),w.originalPath=r.points,w},"insertEdge"),LRe=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),RRe=x((t,e,r)=>{const n=LRe(t),i=2,a=e.height+2*r.padding,s=a/i,o=e.width+2*s+r.padding,l=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-a/3},{x:o+2*l,y:-a/2},{x:o,y:-2*a/3},{x:o,y:-a},{x:o-s,y:-a},{x:o/2,y:-a-2*l},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*l,y:-a/2},{x:0,y:-a/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:o-s,y:-a},{x:o,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-a+s},{x:0,y:-a}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:o,y:-a}]:n.has("right")&&n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")&&n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-a}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-a}]:n.has("left")&&n.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-a}]:n.has("left")&&n.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-a}]:n.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a+l}]:n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")?[{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l}]:n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function eY(t,e){return t.intersect(e)}x(eY,"intersectNode");var NRe=eY;function tY(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(tY,"intersectEllipse");var rY=tY;function nY(t,e,r){return rY(t,e,e,r)}x(nY,"intersectCircle");var DRe=nY;function iY(t,e,r,n){var i,a,s,o,l,u,h,d,f,p,g,m,v,y,b;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,f=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(f!==0&&p!==0&&v6(f,p))&&(a=n.y-r.y,o=r.x-n.x,u=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+u,d=a*e.x+o*e.y+u,!(h!==0&&d!==0&&v6(h,d))&&(g=i*o-a*s,g!==0)))return m=Math.abs(g/2),v=s*u-o*l,y=v<0?(v-m)/g:(v+m)/g,v=a*l-i*u,b=v<0?(v-m)/g:(v+m)/g,{x:y,y:b}}x(iY,"intersectLine");function v6(t,e){return t*e>0}x(v6,"sameSign");var IRe=iY,MRe=aY;function aY(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h<e.length;h++){var d=e[h],f=e[h<e.length-1?h+1:0],p=IRe(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(g,m){var v=g.x-r.x,y=g.y-r.y,b=Math.sqrt(v*v+y*y),w=m.x-r.x,T=m.y-r.y,E=Math.sqrt(w*w+T*T);return b<E?-1:b===E?0:1}),a[0]):t}x(aY,"intersectPolygon");var ORe=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),PRe=ORe,Qr={node:NRe,circle:DRe,ellipse:rY,polygon:MRe,rect:PRe},ti=x(async(t,e,r,n)=>{const i=we();let a;const s=e.useHtmlLabels||Dr(i.flowchart.htmlLabels);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];const h=l.node();let d;e.labelType==="markdown"?d=da(l,Fr(Zs(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):d=h.appendChild(Ua(Fr(Zs(u),i),e.labelStyle,!1,n));let f=d.getBBox();const p=e.padding/2;if(Dr(i.flowchart.htmlLabels)){const g=d.children[0],m=rt(d),v=g.getElementsByTagName("img");if(v){const y=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...v].map(b=>new Promise(w=>{function T(){if(b.style.display="flex",b.style.flexDirection="column",y){const E=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,S=parseInt(E,10)*5+"px";b.style.minWidth=S,b.style.maxWidth=S}else b.style.width="100%";w(b)}x(T,"setupImage"),setTimeout(()=>{b.complete&&T()}),b.addEventListener("error",T),b.addEventListener("load",T)})))}f=g.getBoundingClientRect(),m.attr("width",f.width),m.attr("height",f.height)}return s?l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):l.attr("transform","translate(0, "+-f.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:f,halfPadding:p,label:l}},"labelHelper"),dn=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Ls(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(Ls,"insertPolygonShape");var BRe=x(async(t,e)=>{e.useHtmlLabels||we().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ti(t,e,"node "+e.classes,!0);ie.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},n},"note"),FRe=BRe,zN=x(t=>t?" "+t:"","formatClass"),Ia=x((t,e)=>`${e||"node default"}${zN(t.classes)} ${zN(t.class)}`,"getClassesFromNode"),VN=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ie.info("Question main (Circle)");const l=Ls(r,s,s,o);return l.attr("style",e.style),dn(e,l),e.intersect=function(u){return ie.warn("Intersect called"),Qr.polygon(e,o,u)},r},"question"),$Re=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-28/2},{x:-28/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Qr.circle(e,14,s)},r},"choice"),zRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(e,void 0),!0),i=4,a=n.height+e.padding,s=a/i,o=n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Ls(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"hexagon"),VRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,l=RRe(e.directions,n,e),u=Ls(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"block_arrow"),GRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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 Ls(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_left_inv_arrow"),URe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_right"),qRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_left"),HRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"trapezoid"),WRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"inv_trapezoid"),YRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_right_inv_arrow"),XRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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,u=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 dn(e,u),e.intersect=function(h){const d=Qr.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)<e.width/2||Math.abs(f)==e.width/2&&Math.abs(d.y-e.y)>e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),jRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(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,u=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",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(ab(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"rect"),KRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(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,u=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",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(ab(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"composite"),ZRe=x(async(t,e)=>{const{shapeSvg:r}=await ti(t,e,"label",!0);ie.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(ab(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ie.warn(`Unknown node property ${o}`)})}return dn(e,n),e.intersect=function(s){return Qr.rect(e,s)},r},"labelRect");function ab(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ie.debug("add top border"),a(r)):s(r),e.includes("r")?(ie.debug("add right border"),a(n)):s(n),e.includes("b")?(ie.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ie.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(ab,"applyNodePropertyBorders");var QRe=x((t,e)=>{let r;e.classes?r="node "+e.classes:r="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="";typeof o=="object"?l=o[0]:l=o,ie.info("Label text abc79",l,o,typeof o=="object");const u=s.node().appendChild(Ua(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(Dr(we().flowchart.htmlLabels)){const m=u.children[0],v=rt(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}ie.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=s.node().appendChild(Ua(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0));if(Dr(we().flowchart.htmlLabels)){const m=p.children[0],v=rt(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return rt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),rt(u).attr("transform","translate( "+(h.width<f.width?0:-(f.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+f.height+g).attr("y2",-h.height/2-g+f.height+g),dn(e,i),e.intersect=function(m){return Qr.rect(e,m)},n},"rectWithTitle"),JRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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 dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},r},"stadium"),eNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(t,e,Ia(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),ie.info("Circle main"),dn(e,a),e.intersect=function(s){return ie.info("Circle intersect",e,n.width/2+i,s),Qr.circle(e,n.width/2+i,s)},r},"circle"),tNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(t,e,Ia(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.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),ie.info("DoubleCircle main"),dn(e,o),e.intersect=function(u){return ie.info("DoubleCircle intersect",e,n.width/2+i+a,u),Qr.circle(e,n.width/2+i+a,u)},r},"doublecircle"),rNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"subroutine"),nNe=x((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),dn(e,n),e.intersect=function(i){return Qr.circle(e,7,i)},r},"start"),GN=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(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 dn(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Qr.rect(e,o)},n},"forkJoin"),iNe=x((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),dn(e,i),e.intersect=function(a){return Qr.circle(e,7,a)},r},"end"),aNe=x((t,e)=>{var L;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(L=e.classData.annotations)==null?void 0:L[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=f.node().appendChild(Ua(m,e.labelStyle,!0,!0));let y=v.getBBox();if(Dr(we().flowchart.htmlLabels)){const A=v.children[0],R=rt(v);y=A.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(we().flowchart.htmlLabels?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const w=f.node().appendChild(Ua(b,e.labelStyle,!0,!0));rt(w).attr("class","classTitle");let T=w.getBBox();if(Dr(we().flowchart.htmlLabels)){const A=w.children[0],R=rt(w);T=A.getBoundingClientRect(),R.attr("width",T.width),R.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const E=[];e.classData.members.forEach(A=>{const R=A.getDisplayDetails();let C=R.displayText;we().flowchart.htmlLabels&&(C=C.replace(/</g,"<").replace(/>/g,">"));const I=f.node().appendChild(Ua(C,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let P=I.getBBox();if(Dr(we().flowchart.htmlLabels)){const _=I.children[0],N=rt(I);P=_.getBoundingClientRect(),N.attr("width",P.width),N.attr("height",P.height)}P.width>h&&(h=P.width),d+=P.height+n,E.push(I)}),d+=i;const k=[];if(e.classData.methods.forEach(A=>{const R=A.getDisplayDetails();let C=R.displayText;we().flowchart.htmlLabels&&(C=C.replace(/</g,"<").replace(/>/g,">"));const I=f.node().appendChild(Ua(C,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let P=I.getBBox();if(Dr(we().flowchart.htmlLabels)){const _=I.children[0],N=rt(I);P=_.getBoundingClientRect(),N.attr("width",P.width),N.attr("height",P.height)}P.width>h&&(h=P.width),d+=P.height+n,k.push(I)}),d+=i,g){let A=(h-y.width)/2;rt(v).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=y.height+n}let S=(h-T.width)/2;return rt(w).attr("transform","translate( "+(-1*h/2+S)+", "+(-1*d/2+p)+")"),p+=T.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,E.forEach(A=>{rt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(A=>{rt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),dn(e,o),e.intersect=function(A){return Qr.rect(e,A)},s},"class_box"),UN={rhombus:VN,composite:KRe,question:VN,rect:jRe,labelRect:ZRe,rectWithTitle:QRe,choice:$Re,circle:eNe,doublecircle:tNe,stadium:JRe,hexagon:zRe,block_arrow:VRe,rect_left_inv_arrow:GRe,lean_right:URe,lean_left:qRe,trapezoid:HRe,inv_trapezoid:WRe,rect_right_inv_arrow:YRe,cylinder:XRe,start:nNe,end:iNe,note:FRe,subroutine:rNe,fork:GN,join:GN,class_box:aNe},xv={},sY=x(async(t,e,r)=>{let n,i;if(e.link){let a;we().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await UN[e.shape](n,e,r)}else i=await UN[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),xv[e.id]=n,e.haveCallback&&xv[e.id].attr("class",xv[e.id].attr("class")+" clickable"),n},"insertNode"),sNe=x(t=>{const e=xv[t.id];ie.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function t7(t,e,r=!1){var f,p,g;const n=t;let i="default";(((f=n==null?void 0:n.classes)==null?void 0:f.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=sE((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,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:o??((g=(p=Ir())==null?void 0:p.block)==null?void 0:g.padding)??0}}x(t7,"getNodeFromBlock");async function oY(t,e,r){const n=t7(e,r,!1);if(n.type==="group")return;const i=Ir(),a=await sY(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()}x(oY,"calculateBlockSize");async function lY(t,e,r){const n=t7(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Ir();await sY(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,sNe(n)}}x(lY,"insertBlockPositioned");async function sb(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await sb(t,i.children,r,n)}x(sb,"performOperations");async function cY(t,e,r){await sb(t,e,r,oY)}x(cY,"calculateBlockSizes");async function uY(t,e,r){await sb(t,e,r,lY)}x(uY,"insertBlocks");async function hY(t,e,r,n,i){const a=new ga({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}];_Re(t,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),s.label&&(await SRe(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),kRe({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(hY,"insertEdges");var oNe=x(function(t,e){return e.db.getClasses()},"getClasses"),lNe=x(async function(t,e,r,n){const{securityLevel:i,block:a}=Ir(),s=n.db;let o;i==="sandbox"&&(o=rt("#i"+e));const l=rt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):rt(`[id="${e}"]`);xRe(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await cY(g,d,s);const m=QW(s);if(await uY(g,d,s),await hY(g,p,f,s,e),m){const v=m,y=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+y+10,w=v.width+10,{useMaxWidth:T}=a;ha(u,b,w,!!T),ie.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),cNe={draw:lNe,getClasses:oNe},uNe={parser:zLe,db:aRe,renderer:cNe,styles:oRe};const hNe=Object.freeze(Object.defineProperty({__proto__:null,diagram:uNe},Symbol.toStringTag,{value:"Module"}));var bv={exports:{}},wv={exports:{}},Tv={exports:{}},dNe=Tv.exports,qN;function fNe(){return qN||(qN=1,function(t,e){(function(n,i){t.exports=i()})(dNe,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;y<v.length;y++)g=v[y],m=g.withChildren(),m.forEach(function(b){p.add(b)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),v=0;v<m.length;v++)g=m[v],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?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)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,v=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(v-m)+m;var y=-l.INITIAL_WORLD_BOUNDARY,b=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(b-y)+y,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(g+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>g?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var w=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(w)>-1)throw"Node already in graph!";return w.owner=this,this.getNodes().push(w),w}else{var T=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(T.source=y,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),y.edges.push(T),b!=y&&b.edges.push(T),T)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),w,T=b.length,E=0;E<T;E++)w=b[E],w.isInterGraph?this.graphManager.remove(w):w.source.owner.remove(w);var k=this.nodes.indexOf(y);if(k==-1)throw"Node not in owner node list!";this.nodes.splice(k,1)}else if(v instanceof h){var w=v;if(w==null)throw"Edge is null!";if(!(w.source!=null&&w.target!=null))throw"Source and/or target is null!";if(!(w.source.owner!=null&&w.target.owner!=null&&w.source.owner==this&&w.target.owner==this))throw"Source and/or target owner is invalid!";var S=w.source.edges.indexOf(w),L=w.target.edges.indexOf(w);if(!(S>-1&&L>-1))throw"Source and/or target doesn't know this edge!";w.source.edges.splice(S,1),w.target!=w.source&&w.target.edges.splice(L,1);var k=w.source.owner.getEdges().indexOf(w);if(k==-1)throw"Not in owner's edge list!";w.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,w,T,E=this.getNodes(),k=E.length,S=0;S<k;S++){var L=E[S];b=L.getTop(),w=L.getLeft(),v>b&&(v=b),y>w&&(y=w)}return v==s.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?T=E[0].getParent().paddingLeft:T=this.margin,this.left=y-T,this.top=v-T,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,k,S,L,A,R=this.nodes,C=R.length,I=0;I<C;I++){var P=R[I];v&&P.child!=null&&P.updateBounds(),E=P.getLeft(),k=P.getRight(),S=P.getTop(),L=P.getBottom(),y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var _=new d(y,w,b-y,T-w);y==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?A=R[0].getParent().paddingLeft:A=this.margin,this.left=_.x-A,this.right=_.x+_.width+A,this.top=_.y-A,this.bottom=_.y+_.height+A},g.calculateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,k,S,L,A=v.length,R=0;R<A;R++){var C=v[R];E=C.getLeft(),k=C.getRight(),S=C.getTop(),L=C.getBottom(),y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var I=new d(y,w,b-y,T-w);return I},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var v=0,y=this.nodes,b=y.length,w=0;w<b;w++){var T=y[w];v+=T.calcEstimatedSize()}return v==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=v/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var v=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new p,b=new Set,w=this.nodes[0],T,E,k=w.withChildren();for(k.forEach(function(I){y.push(I),b.add(I)});y.length!==0;){w=y.shift(),T=w.getEdges();for(var S=T.length,L=0;L<S;L++){var A=T[L];if(E=A.getOtherEndInGraph(w,this),E!=null&&!b.has(E)){var R=E.withChildren();R.forEach(function(I){y.push(I),b.add(I)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var C=0;b.forEach(function(I){I.owner==v&&C++}),C==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(u);this.graphs.splice(v,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var v=d.source.edges.indexOf(d);if(d.source.edges.splice(v,1),v=d.target.edges.indexOf(d),d.target.edges.splice(v,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var v=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(v,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=[],h=this.edges.length,d=0;d<h;d++)l=this.edges[d],this.isOneAncestorOfOther(l.source,l.target)&&u.push(l);for(var d=0;d<u.length;d++)this.remove(u[d]);return!1},r.exports=o},function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),v=o.getRight(),y=o.getX(),b=o.getBottom(),w=o.getRight(),T=o.getWidthHalf(),E=o.getHeightHalf(),k=l.getX(),S=l.getY(),L=l.getRight(),A=l.getX(),R=l.getBottom(),C=l.getRight(),I=l.getWidthHalf(),P=l.getHeightHalf(),_=!1,N=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(d<p)return u[0]=h,u[1]=b,u[2]=f,u[3]=S,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=L,u[3]=p,!1;if(h<f)return u[0]=v,u[1]=d,u[2]=k,u[3]=p,!1}else{var M=o.height/o.width,O=l.height/l.width,D=(p-d)/(f-h),B=void 0,z=void 0,F=void 0,G=void 0,q=void 0,Y=void 0;if(-M===D?h>f?(u[0]=y,u[1]=b,_=!0):(u[0]=v,u[1]=m,_=!0):M===D&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=w,u[1]=b,_=!0)),-O===D?f>h?(u[2]=A,u[3]=R,N=!0):(u[2]=L,u[3]=S,N=!0):O===D&&(f>h?(u[2]=k,u[3]=S,N=!0):(u[2]=C,u[3]=R,N=!0)),_&&N)return!1;if(h>f?d>p?(B=this.getCardinalDirection(M,D,4),z=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-M,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-M,D,1),z=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection(M,D,2),z=this.getCardinalDirection(O,D,4)),!_)switch(B){case 1:G=m,F=h+-E/D,u[0]=F,u[1]=G;break;case 2:F=w,G=d+T*D,u[0]=F,u[1]=G;break;case 3:G=b,F=h+E/D,u[0]=F,u[1]=G;break;case 4:F=y,G=d+-T*D,u[0]=F,u[1]=G;break}if(!N)switch(z){case 1:Y=S,q=f+-P/D,u[2]=q,u[3]=Y;break;case 2:q=C,Y=p+I*D,u[2]=q,u[3]=Y;break;case 3:Y=R,q=f+P/D,u[2]=q,u[3]=Y;break;case 4:q=A,Y=p+-I*D,u[2]=q,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=void 0,T=void 0,E=void 0,k=void 0,S=void 0,L=void 0,A=void 0,R=void 0,C=void 0;return E=g-f,S=d-p,A=p*f-d*g,k=b-v,L=m-y,R=y*v-m*b,C=E*L-k*S,C===0?null:(w=(S*R-L*A)/C,T=(k*A-E*R)/C,new a(w,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=(p-d)*(b-v)-(y-m)*(g-f);if(w===0)return!1;var T=((b-v)*(y-d)+(m-y)*(b-f))/w,E=((f-g)*(y-d)+(p-d)*(b-f))/w;return 0<T&&T<1&&0<E&&E<1},s.findCircleLineIntersections=function(o,l,u,h,d,f,p){var g=(u-o)*(u-o)+(h-l)*(h-l),m=2*((o-d)*(u-o)+(l-f)*(h-l)),v=(o-d)*(o-d)+(l-f)*(l-f)-p*p,y=m*m-4*g*v;if(y>=0){var b=(-m+Math.sqrt(m*m-4*g*v))/(2*g),w=(-m-Math.sqrt(m*m-4*g*v))/(2*g),T=null;return b>=0&&b<=1?[b]:w>=0&&w<=1?[w]:T}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}}();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f!=null&&f.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,v=this.head;m<p;)v=v.next,m++;v.value=g}}}]),d}();r.exports=h},function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a},function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a},function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v<m.length;v++)y[v]=m[v];return y}else return Array.from(m)}var s=i(0),o=i(7),l=i(3),u=i(1),h=i(6),d=i(5),f=i(17),p=i(29);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),v=0;v<m.length;v++)m[v];for(var y=this.graphManager.getRoot().getNodes(),v=0;v<y.length;v++)y[v];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var v=m;if(v.getChild()!=null)for(var y=v.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(v.vGraphObject!=null){var w=v.vGraphObject;w.update(v)}}else if(m instanceof u){var T=m;if(T.vGraphObject!=null){var E=T.vGraphObject;E.update(T)}}else if(m instanceof h){var k=m;if(k.vGraphObject!=null){var S=k.vGraphObject;S.update(k)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var v=new f,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){v.setWorldOrgX(m.x),v.setWorldOrgY(m.y),v.setDeviceOrgX(y.x),v.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),w,T=0;T<b.length;T++)w=b[T],w.transform(v)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,y,b=m.getNodes(),w=0;w<b.length;w++)v=b[w],y=v.getChild(),y==null||y.getNodes().length==0?v.scatter():(this.positionNodesRandomly(y),v.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],v=!0,y=this.graphManager.getRoot().getNodes(),b=!0,w=0;w<y.length;w++)y[w].getChild()!=null&&(b=!1);if(!b)return m;var T=new Set,E=[],k=new Map,S=[];for(S=S.concat(y);S.length>0&&v;){for(E.push(S[0]);E.length>0&&v;){var L=E[0];E.splice(0,1),T.add(L);for(var A=L.getEdges(),w=0;w<A.length;w++){var R=A[w].getOtherEnd(L);if(k.get(L)!=R)if(!T.has(R))E.push(R),k.set(R,L);else{v=!1;break}}}if(!v)m=[];else{var C=[].concat(a(T));m.push(C);for(var w=0;w<C.length;w++){var I=C[w],P=S.indexOf(I);P>-1&&S.splice(P,1)}T=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),w=0;w<m.bendpoints.length;w++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),b.add(T);var E=this.newEdge(null);this.graphManager.add(E,y,T),v.add(T),y=T}var E=this.newEdge(null);return this.graphManager.add(E,y,m.target),this.edgeToDummyNodes.set(m,v),m.isInterGraph()?this.graphManager.remove(m):b.remove(m),v},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var v=0;v<m.length;v++){var y=m[v];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),w=0;w<b.length;w++){var T=b[w],E=new d(T.getCenterX(),T.getCenterY()),k=y.bendpoints.get(w);k.x=E.x,k.y=E.y,T.getOwner().remove(T)}this.graphManager.add(y,y.source,y.target)}}},g.transform=function(m,v,y,b){if(y!=null&&b!=null){var w=v;if(m<=50){var T=v/y;w-=(v-T)/50*(50-m)}else{var E=v*b;w+=(E-v)/50*(m-50)}return w}else{var k,S;return m<=50?(k=9*v/500,S=v/10):(k=9*v/50,S=-8*v),k*m+S}},g.findCenterOfTree=function(m){var v=[];v=v.concat(m);var y=[],b=new Map,w=!1,T=null;(v.length==1||v.length==2)&&(w=!0,T=v[0]);for(var E=0;E<v.length;E++){var k=v[E],S=k.getNeighborsList().size;b.set(k,k.getNeighborsList().size),S==1&&y.push(k)}var L=[];for(L=L.concat(y);!w;){var A=[];A=A.concat(L),L=[];for(var E=0;E<v.length;E++){var k=v[E],R=v.indexOf(k);R>=0&&v.splice(R,1);var C=k.getNeighborsList();C.forEach(function(_){if(y.indexOf(_)<0){var N=b.get(_),M=N-1;M==1&&L.push(_),b.set(_,M)}})}y=y.concat(L),(v.length==1||v.length==2)&&(w=!0,T=v[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(4),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,v,y,b,w,T=this.getGraphManager().getAllEdges(),E=0;E<T.length;E++)p=T[E],g=p.idealLength,p.isInterGraph&&(v=p.getSource(),y=p.getTarget(),b=p.getSourceInLca().getEstimatedSize(),w=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=b+w-2*l.SIMPLE_NODE_SIZE),m=p.getLca().getInclusionTreeDepth(),p.idealLength+=g*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(v.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*m))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,w=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;m<w.length;m++)y=w[m],this.calculateRepulsionForceOfANode(y,T,p,g),T.add(y);else for(m=0;m<w.length;m++)for(y=w[m],v=m+1;v<w.length;v++)b=w[v],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),v=p.getTarget(),y,b,w,T;if(this.uniformLeafNodeSizes&&m.getChild()==null&&v.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;y=p.getLength(),y!=0&&(b=p.edgeElasticity*(y-g),w=b*(p.lengthX/y),T=b*(p.lengthY/y),m.springForceX+=w,m.springForceY+=T,v.springForceX-=w,v.springForceY-=T)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),v=g.getRect(),y=new Array(2),b=new Array(4),w,T,E,k,S,L,A;if(m.intersects(v)){u.calcSeparationAmount(m,v,y,o.DEFAULT_EDGE_LENGTH/2),L=2*y[0],A=2*y[1];var R=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=R*L,p.repulsionForceY-=R*A,g.repulsionForceX+=R*L,g.repulsionForceY+=R*A}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(w=v.getCenterX()-m.getCenterX(),T=v.getCenterY()-m.getCenterY()):(u.getIntersection(m,v,b),w=b[2]-b[0],T=b[3]-b[1]),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=h.sign(T)*o.MIN_REPULSION_DIST),E=w*w+T*T,k=Math.sqrt(E),S=(p.nodeRepulsion/2+g.nodeRepulsion/2)*p.noOfChildren*g.noOfChildren/E,L=S*w/k,A=S*T/k,p.repulsionForceX-=L,p.repulsionForceY-=A,g.repulsionForceX+=L,g.repulsionForceY+=A},d.prototype.calcGravitationalForce=function(p){var g,m,v,y,b,w,T,E;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,v=(g.getTop()+g.getBottom())/2,y=p.getCenterX()-m,b=p.getCenterY()-v,w=Math.abs(y)+p.getWidth()/2,T=Math.abs(b)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(E=g.getEstimatedSize()*this.gravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(E=g.getEstimatedSize()*this.compoundGravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var v=new Array(g),y=0;y<g;y++)v[y]=new Array(m);for(var y=0;y<g;y++)for(var b=0;b<m;b++)v[y][b]=new Array;return v},d.prototype.addNodeToGrid=function(p,g,m){var v=0,y=0,b=0,w=0;v=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),w=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var T=v;T<=y;T++)for(var E=b;E<=w;E++)this.grid[T][E].push(p),p.setGridCoordinates(v,y,b,w)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,v){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||v){var y=new Set;p.surrounding=new Array;for(var b,w=this.grid,T=p.startX-1;T<p.finishX+2;T++)for(var E=p.startY-1;E<p.finishY+2;E++)if(!(T<0||E<0||T>=w.length||E>=w[0].length)){for(var k=0;k<w[T][E].length;k++)if(b=w[T][E][k],!(p.getOwner()!=b.getOwner()||p==b)&&!g.has(b)&&!y.has(b)){var S=Math.abs(p.getCenterX()-b.getCenterX())-(p.getWidth()/2+b.getWidth()/2),L=Math.abs(p.getCenterY()-b.getCenterY())-(p.getHeight()/2+b.getHeight()/2);S<=this.repulsionRange&&L<=this.repulsionRange&&y.add(b)}}p.surrounding=[].concat(a(y))}for(T=0;T<p.surrounding.length;T++)this.calcRepulsionForce(p,p.surrounding[T])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d},function(r,n,i){var a=i(1),s=i(4);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o},function(r,n,i){var a=i(3),s=i(4);function o(u,h,d,f){a.call(this,u,h,d,f),this.nodeRepulsion=s.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=[]}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];o.prototype.setGridCoordinates=function(u,h,d,f){this.startX=u,this.finishX=h,this.startY=d,this.finishY=f},r.exports=o},function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a},function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s},function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s},function(r,n,i){function a(){}a.multMat=function(s,o){for(var l=[],u=0;u<s.length;u++){l[u]=[];for(var h=0;h<o[0].length;h++){l[u][h]=0;for(var d=0;d<s[0].length;d++)l[u][h]+=s[u][d]*o[d][h]}}return l},a.transpose=function(s){for(var o=[],l=0;l<s[0].length;l++){o[l]=[];for(var u=0;u<s.length;u++)o[l][u]=s[u][l]}return o},a.multCons=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]*o;return l},a.minusOp=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]-o[u];return l},a.dotProduct=function(s,o){for(var l=0,u=0;u<s.length;u++)l+=s[u]*o[u];return l},a.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},a.normalize=function(s){for(var o=[],l=this.mag(s),u=0;u<s.length;u++)o[u]=s[u]/l;return o},a.multGamma=function(s){for(var o=[],l=0,u=0;u<s.length;u++)l+=s[u];l*=-1/s.length;for(var h=0;h<s.length;h++)o[h]=l+s[h];return o},a.multL=function(s,o,l){for(var u=[],h=[],d=[],f=0;f<o[0].length;f++){for(var p=0,g=0;g<o.length;g++)p+=-.5*o[g][f]*s[g];h[f]=p}for(var m=0;m<l.length;m++){for(var v=0,y=0;y<l.length;y++)v+=l[m][y]*h[y];d[m]=v}for(var b=0;b<o.length;b++){for(var w=0,T=0;T<o[0].length;T++)w+=o[b][T]*d[T];u[b]=w}return u},r.exports=a},function(r,n,i){var a=function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}}();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,v=p;;){for(;this.compareFunction(g,this._get(d,v));)v--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<v)this._swap(d,m,v),m++,v--;else return v}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u}();r.exports=l},function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(Math.min(this.m+1,this.n)),this.U=function(Ye){var Ze=function ht(ct){if(ct.length==0)return 0;for(var ut=[],mt=0;mt<ct[0];mt++)ut.push(ht(ct.slice(1)));return ut};return Ze(Ye)}([this.m,o]),this.V=function(Ye){var Ze=function ht(ct){if(ct.length==0)return 0;for(var ut=[],mt=0;mt<ct[0];mt++)ut.push(ht(ct.slice(1)));return ut};return Ze(Ye)}([this.n,this.n]);for(var l=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(this.n),u=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p<Math.max(d,f);p++){if(p<d){this.s[p]=0;for(var g=p;g<this.m;g++)this.s[p]=a.hypot(this.s[p],s[g][p]);if(this.s[p]!==0){s[p][p]<0&&(this.s[p]=-this.s[p]);for(var m=p;m<this.m;m++)s[m][p]/=this.s[p];s[p][p]+=1}this.s[p]=-this.s[p]}for(var v=p+1;v<this.n;v++){if(function(Ye,Ze){return Ye&&Ze}(p<d,this.s[p]!==0)){for(var y=0,b=p;b<this.m;b++)y+=s[b][p]*s[b][v];y=-y/s[p][p];for(var w=p;w<this.m;w++)s[w][v]+=y*s[w][p]}l[v]=s[p][v]}if(function(Ye,Ze){return Ze}(h,p<d))for(var T=p;T<this.m;T++)this.U[T][p]=s[T][p];if(p<f){l[p]=0;for(var E=p+1;E<this.n;E++)l[p]=a.hypot(l[p],l[E]);if(l[p]!==0){l[p+1]<0&&(l[p]=-l[p]);for(var k=p+1;k<this.n;k++)l[k]/=l[p];l[p+1]+=1}if(l[p]=-l[p],function(Ye,Ze){return Ye&&Ze}(p+1<this.m,l[p]!==0)){for(var S=p+1;S<this.m;S++)u[S]=0;for(var L=p+1;L<this.n;L++)for(var A=p+1;A<this.m;A++)u[A]+=l[L]*s[A][L];for(var R=p+1;R<this.n;R++)for(var C=-l[R]/l[p+1],I=p+1;I<this.m;I++)s[I][R]+=C*u[I]}for(var P=p+1;P<this.n;P++)this.V[P][p]=l[P]}}var _=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=s[d][d]),this.m<_&&(this.s[_-1]=0),f+1<_&&(l[f]=s[f][_-1]),l[_-1]=0;{for(var N=d;N<o;N++){for(var M=0;M<this.m;M++)this.U[M][N]=0;this.U[N][N]=1}for(var O=d-1;O>=0;O--)if(this.s[O]!==0){for(var D=O+1;D<o;D++){for(var B=0,z=O;z<this.m;z++)B+=this.U[z][O]*this.U[z][D];B=-B/this.U[O][O];for(var F=O;F<this.m;F++)this.U[F][D]+=B*this.U[F][O]}for(var G=O;G<this.m;G++)this.U[G][O]=-this.U[G][O];this.U[O][O]=1+this.U[O][O];for(var q=0;q<O-1;q++)this.U[q][O]=0}else{for(var Y=0;Y<this.m;Y++)this.U[Y][O]=0;this.U[O][O]=1}}for(var ee=this.n-1;ee>=0;ee--){if(function(Ye,Ze){return Ye&&Ze}(ee<f,l[ee]!==0))for(var Q=ee+1;Q<o;Q++){for(var oe=0,pe=ee+1;pe<this.n;pe++)oe+=this.V[pe][ee]*this.V[pe][Q];oe=-oe/this.V[ee+1][ee];for(var j=ee+1;j<this.n;j++)this.V[j][Q]+=oe*this.V[j][ee]}for(var W=0;W<this.n;W++)this.V[W][ee]=0;this.V[ee][ee]=1}for(var X=_-1,H=Math.pow(2,-52),K=Math.pow(2,-966);_>0;){var ne=void 0,Z=void 0;for(ne=_-2;ne>=-1&&ne!==-1;ne--)if(Math.abs(l[ne])<=K+H*(Math.abs(this.s[ne])+Math.abs(this.s[ne+1]))){l[ne]=0;break}if(ne===_-2)Z=4;else{var be=void 0;for(be=_-1;be>=ne&&be!==ne;be--){var ce=(be!==_?Math.abs(l[be]):0)+(be!==ne+1?Math.abs(l[be-1]):0);if(Math.abs(this.s[be])<=K+H*ce){this.s[be]=0;break}}be===ne?Z=3:be===_-1?Z=1:(Z=2,ne=be)}switch(ne++,Z){case 1:{var re=l[_-2];l[_-2]=0;for(var Ne=_-2;Ne>=ne;Ne--){var me=a.hypot(this.s[Ne],re),Ve=this.s[Ne]/me,Ue=re/me;this.s[Ne]=me,Ne!==ne&&(re=-Ue*l[Ne-1],l[Ne-1]=Ve*l[Ne-1]);for(var Fe=0;Fe<this.n;Fe++)me=Ve*this.V[Fe][Ne]+Ue*this.V[Fe][_-1],this.V[Fe][_-1]=-Ue*this.V[Fe][Ne]+Ve*this.V[Fe][_-1],this.V[Fe][Ne]=me}}break;case 2:{var _e=l[ne-1];l[ne-1]=0;for(var Oe=ne;Oe<_;Oe++){var Ce=a.hypot(this.s[Oe],_e),Le=this.s[Oe]/Ce,ze=_e/Ce;this.s[Oe]=Ce,_e=-ze*l[Oe],l[Oe]=Le*l[Oe];for(var ge=0;ge<this.m;ge++)Ce=Le*this.U[ge][Oe]+ze*this.U[ge][ne-1],this.U[ge][ne-1]=-ze*this.U[ge][Oe]+Le*this.U[ge][ne-1],this.U[ge][Oe]=Ce}}break;case 3:{var Me=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[_-1]),Math.abs(this.s[_-2])),Math.abs(l[_-2])),Math.abs(this.s[ne])),Math.abs(l[ne])),J=this.s[_-1]/Me,ue=this.s[_-2]/Me,$=l[_-2]/Me,se=this.s[ne]/Me,ae=l[ne]/Me,fe=((ue+J)*(ue-J)+$*$)/2,he=J*$*(J*$),Te=0;(function(Ye,Ze){return Ye||Ze})(fe!==0,he!==0)&&(Te=Math.sqrt(fe*fe+he),fe<0&&(Te=-Te),Te=he/(fe+Te));for(var Se=(se+J)*(se-J)+Te,Ee=se*ae,Ge=ne;Ge<_-1;Ge++){var Je=a.hypot(Se,Ee),He=Se/Je,Xe=Ee/Je;Ge!==ne&&(l[Ge-1]=Je),Se=He*this.s[Ge]+Xe*l[Ge],l[Ge]=He*l[Ge]-Xe*this.s[Ge],Ee=Xe*this.s[Ge+1],this.s[Ge+1]=He*this.s[Ge+1];for(var Ke=0;Ke<this.n;Ke++)Je=He*this.V[Ke][Ge]+Xe*this.V[Ke][Ge+1],this.V[Ke][Ge+1]=-Xe*this.V[Ke][Ge]+He*this.V[Ke][Ge+1],this.V[Ke][Ge]=Je;if(Je=a.hypot(Se,Ee),He=Se/Je,Xe=Ee/Je,this.s[Ge]=Je,Se=He*l[Ge]+Xe*this.s[Ge+1],this.s[Ge+1]=-Xe*l[Ge]+He*this.s[Ge+1],Ee=Xe*l[Ge+1],l[Ge+1]=He*l[Ge+1],Ge<this.m-1)for(var $e=0;$e<this.m;$e++)Je=He*this.U[$e][Ge]+Xe*this.U[$e][Ge+1],this.U[$e][Ge+1]=-Xe*this.U[$e][Ge]+He*this.U[$e][Ge+1],this.U[$e][Ge]=Je}l[_-2]=Se}break;case 4:{if(this.s[ne]<=0){this.s[ne]=this.s[ne]<0?-this.s[ne]:0;for(var je=0;je<=X;je++)this.V[je][ne]=-this.V[je][ne]}for(;ne<X&&!(this.s[ne]>=this.s[ne+1]);){var lt=this.s[ne];if(this.s[ne]=this.s[ne+1],this.s[ne+1]=lt,ne<this.n-1)for(var st=0;st<this.n;st++)lt=this.V[st][ne+1],this.V[st][ne+1]=this.V[st][ne],this.V[st][ne]=lt;if(ne<this.m-1)for(var qe=0;qe<this.m;qe++)lt=this.U[qe][ne+1],this.U[qe][ne+1]=this.U[qe][ne],this.U[qe][ne]=lt;ne++}_--}break}}var Et={U:this.U,V:this.V,S:this.s};return Et},a.hypot=function(s,o){var l=void 0;return Math.abs(s)>Math.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}}();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var v=0;v<this.iMax;v++){this.tracebackGrid[v]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[v][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,v=this.grid[f][p-1]+this.gap_penalty,y=[g,m,v],b=this.arrayAllMaxIndexes(y);this.grid[f][p]=y[b[0]],this.tracebackGrid[f][p]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l}();r.exports=o},function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(4),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(5),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(25),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(6),a.LEdge=i(1),a.LGraphManager=i(7),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(27),a.Matrix=i(24),a.SVD=i(26),r.exports=a},function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a}])})}(Tv)),Tv.exports}var pNe=wv.exports,HN;function gNe(){return HN||(HN=1,function(t,e){(function(n,i){t.exports=i(fNe())})(pNe,function(r){return(()=>{var n={45:(o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h},806:(o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},880:(o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},578:(o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},765:(o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),v=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,w=u(551).Point,T=u(551).PointD,E=u(551).DimensionD,k=u(551).Layout,S=u(551).Integer,L=u(551).IGeometry,A=u(551).LGraph,R=u(551).Transform,C=u(551).LinkedList;function I(){h.call(this),this.toBeTiled={},this.constraints={}}I.prototype=Object.create(h.prototype);for(var P in h)I[P]=h[P];I.prototype.newGraphManager=function(){var _=new d(this);return this.graphManager=_,_},I.prototype.newGraph=function(_){return new f(null,this.graphManager,_)},I.prototype.newNode=function(_){return new p(this.graphManager,_)},I.prototype.newEdge=function(_){return new g(null,null,_)},I.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var _=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return _&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(B){return N.has(B)});this.graphManager.setAllNodesToApplyGravitation(M)}}else{var _=this.getFlatForest();if(_.length>0)this.positionNodesRadially(_);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(O){return N.has(O)});this.graphManager.setAllNodesToApplyGravitation(M),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(D){return _.has(D)});this.graphManager.setAllNodesToApplyGravitation(N),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var M=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var _=this.graphManager.getAllNodes(),N={},M=0;M<_.length;M++){var O=_[M].rect,D=_[M].id;N[D]={id:D,x:O.getCenterX(),y:O.getCenterY(),w:O.width,h:O.height}}return N},I.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var _=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!_;)_=this.tick();this.graphManager.updateBounds()}},I.prototype.moveNodes=function(){for(var _=this.getAllNodes(),N,M=0;M<_.length;M++)N=_[M],N.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var M=0;M<_.length;M++)N=_[M],N.move()},I.prototype.initConstraintVariables=function(){var _=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var N=this.graphManager.getAllNodes(),M=0;M<N.length;M++){var O=N[M];this.idToNodeMap.set(O.id,O)}var D=function j(W){for(var X=W.getChild().getNodes(),H,K=0,ne=0;ne<X.length;ne++)H=X[ne],H.getChild()==null?_.fixedNodeSet.has(H.id)&&(K+=100):K+=j(H);return K};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){_.fixedNodeSet.add(X.nodeId)});for(var N=this.graphManager.getAllNodes(),O,M=0;M<N.length;M++)if(O=N[M],O.getChild()!=null){var B=D(O);B>0&&(O.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var z=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(j){_.fixedNodesOnHorizontal.add(j),_.fixedNodesOnVertical.add(j)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,M=0;M<G.length;M++)this.dummyToNodeForVerticalAlignment.set("dummy"+M,[]),G[M].forEach(function(W){z.set(W,"dummy"+M),_.dummyToNodeForVerticalAlignment.get("dummy"+M).push(W),_.fixedNodeSet.has(W)&&_.fixedNodesOnHorizontal.add("dummy"+M)});if(this.constraints.alignmentConstraint.horizontal)for(var q=this.constraints.alignmentConstraint.horizontal,M=0;M<q.length;M++)this.dummyToNodeForHorizontalAlignment.set("dummy"+M,[]),q[M].forEach(function(W){F.set(W,"dummy"+M),_.dummyToNodeForHorizontalAlignment.get("dummy"+M).push(W),_.fixedNodeSet.has(W)&&_.fixedNodesOnVertical.add("dummy"+M)})}if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(j){var W,X,H;for(H=j.length-1;H>=2*j.length/3;H--)W=Math.floor(Math.random()*(H+1)),X=j[H],j[H]=j[W],j[W]=X;return j},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(j){if(j.left){var W=z.has(j.left)?z.get(j.left):j.left,X=z.has(j.right)?z.get(j.right):j.right;_.nodesInRelativeHorizontal.includes(W)||(_.nodesInRelativeHorizontal.push(W),_.nodeToRelativeConstraintMapHorizontal.set(W,[]),_.dummyToNodeForVerticalAlignment.has(W)?_.nodeToTempPositionMapHorizontal.set(W,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(W)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(W,_.idToNodeMap.get(W).getCenterX())),_.nodesInRelativeHorizontal.includes(X)||(_.nodesInRelativeHorizontal.push(X),_.nodeToRelativeConstraintMapHorizontal.set(X,[]),_.dummyToNodeForVerticalAlignment.has(X)?_.nodeToTempPositionMapHorizontal.set(X,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(X,_.idToNodeMap.get(X).getCenterX())),_.nodeToRelativeConstraintMapHorizontal.get(W).push({right:X,gap:j.gap}),_.nodeToRelativeConstraintMapHorizontal.get(X).push({left:W,gap:j.gap})}else{var H=F.has(j.top)?F.get(j.top):j.top,K=F.has(j.bottom)?F.get(j.bottom):j.bottom;_.nodesInRelativeVertical.includes(H)||(_.nodesInRelativeVertical.push(H),_.nodeToRelativeConstraintMapVertical.set(H,[]),_.dummyToNodeForHorizontalAlignment.has(H)?_.nodeToTempPositionMapVertical.set(H,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(H)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(H,_.idToNodeMap.get(H).getCenterY())),_.nodesInRelativeVertical.includes(K)||(_.nodesInRelativeVertical.push(K),_.nodeToRelativeConstraintMapVertical.set(K,[]),_.dummyToNodeForHorizontalAlignment.has(K)?_.nodeToTempPositionMapVertical.set(K,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(K,_.idToNodeMap.get(K).getCenterY())),_.nodeToRelativeConstraintMapVertical.get(H).push({bottom:K,gap:j.gap}),_.nodeToRelativeConstraintMapVertical.get(K).push({top:H,gap:j.gap})}});else{var Y=new Map,ee=new Map;this.constraints.relativePlacementConstraint.forEach(function(j){if(j.left){var W=z.has(j.left)?z.get(j.left):j.left,X=z.has(j.right)?z.get(j.right):j.right;Y.has(W)?Y.get(W).push(X):Y.set(W,[X]),Y.has(X)?Y.get(X).push(W):Y.set(X,[W])}else{var H=F.has(j.top)?F.get(j.top):j.top,K=F.has(j.bottom)?F.get(j.bottom):j.bottom;ee.has(H)?ee.get(H).push(K):ee.set(H,[K]),ee.has(K)?ee.get(K).push(H):ee.set(K,[H])}});var Q=function(W,X){var H=[],K=[],ne=new C,Z=new Set,be=0;return W.forEach(function(ce,re){if(!Z.has(re)){H[be]=[],K[be]=!1;var Ne=re;for(ne.push(Ne),Z.add(Ne),H[be].push(Ne);ne.length!=0;){Ne=ne.shift(),X.has(Ne)&&(K[be]=!0);var me=W.get(Ne);me.forEach(function(Ve){Z.has(Ve)||(ne.push(Ve),Z.add(Ve),H[be].push(Ve))})}be++}}),{components:H,isFixed:K}},oe=Q(Y,_.fixedNodesOnHorizontal);this.componentsOnHorizontal=oe.components,this.fixedComponentsOnHorizontal=oe.isFixed;var pe=Q(ee,_.fixedNodesOnVertical);this.componentsOnVertical=pe.components,this.fixedComponentsOnVertical=pe.isFixed}}},I.prototype.updateDisplacements=function(){var _=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(pe){var j=_.idToNodeMap.get(pe.nodeId);j.displacementX=0,j.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var N=this.constraints.alignmentConstraint.vertical,M=0;M<N.length;M++){for(var O=0,D=0;D<N[M].length;D++){if(this.fixedNodeSet.has(N[M][D])){O=0;break}O+=this.idToNodeMap.get(N[M][D]).displacementX}for(var B=O/N[M].length,D=0;D<N[M].length;D++)this.idToNodeMap.get(N[M][D]).displacementX=B}if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,M=0;M<z.length;M++){for(var F=0,D=0;D<z[M].length;D++){if(this.fixedNodeSet.has(z[M][D])){F=0;break}F+=this.idToNodeMap.get(z[M][D]).displacementY}for(var G=F/z[M].length,D=0;D<z[M].length;D++)this.idToNodeMap.get(z[M][D]).displacementY=G}}if(this.constraints.relativePlacementConstraint)if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(pe){if(!_.fixedNodesOnHorizontal.has(pe)){var j=0;_.dummyToNodeForVerticalAlignment.has(pe)?j=_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(pe)[0]).displacementX:j=_.idToNodeMap.get(pe).displacementX,_.nodeToRelativeConstraintMapHorizontal.get(pe).forEach(function(W){if(W.right){var X=_.nodeToTempPositionMapHorizontal.get(W.right)-_.nodeToTempPositionMapHorizontal.get(pe)-j;X<W.gap&&(j-=W.gap-X)}else{var X=_.nodeToTempPositionMapHorizontal.get(pe)-_.nodeToTempPositionMapHorizontal.get(W.left)+j;X<W.gap&&(j+=W.gap-X)}}),_.nodeToTempPositionMapHorizontal.set(pe,_.nodeToTempPositionMapHorizontal.get(pe)+j),_.dummyToNodeForVerticalAlignment.has(pe)?_.dummyToNodeForVerticalAlignment.get(pe).forEach(function(W){_.idToNodeMap.get(W).displacementX=j}):_.idToNodeMap.get(pe).displacementX=j}}),this.nodesInRelativeVertical.forEach(function(pe){if(!_.fixedNodesOnHorizontal.has(pe)){var j=0;_.dummyToNodeForHorizontalAlignment.has(pe)?j=_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(pe)[0]).displacementY:j=_.idToNodeMap.get(pe).displacementY,_.nodeToRelativeConstraintMapVertical.get(pe).forEach(function(W){if(W.bottom){var X=_.nodeToTempPositionMapVertical.get(W.bottom)-_.nodeToTempPositionMapVertical.get(pe)-j;X<W.gap&&(j-=W.gap-X)}else{var X=_.nodeToTempPositionMapVertical.get(pe)-_.nodeToTempPositionMapVertical.get(W.top)+j;X<W.gap&&(j+=W.gap-X)}}),_.nodeToTempPositionMapVertical.set(pe,_.nodeToTempPositionMapVertical.get(pe)+j),_.dummyToNodeForHorizontalAlignment.has(pe)?_.dummyToNodeForHorizontalAlignment.get(pe).forEach(function(W){_.idToNodeMap.get(W).displacementY=j}):_.idToNodeMap.get(pe).displacementY=j}});else{for(var M=0;M<this.componentsOnHorizontal.length;M++){var q=this.componentsOnHorizontal[M];if(this.fixedComponentsOnHorizontal[M])for(var D=0;D<q.length;D++)this.dummyToNodeForVerticalAlignment.has(q[D])?this.dummyToNodeForVerticalAlignment.get(q[D]).forEach(function(W){_.idToNodeMap.get(W).displacementX=0}):this.idToNodeMap.get(q[D]).displacementX=0;else{for(var Y=0,ee=0,D=0;D<q.length;D++)if(this.dummyToNodeForVerticalAlignment.has(q[D])){var Q=this.dummyToNodeForVerticalAlignment.get(q[D]);Y+=Q.length*this.idToNodeMap.get(Q[0]).displacementX,ee+=Q.length}else Y+=this.idToNodeMap.get(q[D]).displacementX,ee++;for(var oe=Y/ee,D=0;D<q.length;D++)this.dummyToNodeForVerticalAlignment.has(q[D])?this.dummyToNodeForVerticalAlignment.get(q[D]).forEach(function(W){_.idToNodeMap.get(W).displacementX=oe}):this.idToNodeMap.get(q[D]).displacementX=oe}}for(var M=0;M<this.componentsOnVertical.length;M++){var q=this.componentsOnVertical[M];if(this.fixedComponentsOnVertical[M])for(var D=0;D<q.length;D++)this.dummyToNodeForHorizontalAlignment.has(q[D])?this.dummyToNodeForHorizontalAlignment.get(q[D]).forEach(function(X){_.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(q[D]).displacementY=0;else{for(var Y=0,ee=0,D=0;D<q.length;D++)if(this.dummyToNodeForHorizontalAlignment.has(q[D])){var Q=this.dummyToNodeForHorizontalAlignment.get(q[D]);Y+=Q.length*this.idToNodeMap.get(Q[0]).displacementY,ee+=Q.length}else Y+=this.idToNodeMap.get(q[D]).displacementY,ee++;for(var oe=Y/ee,D=0;D<q.length;D++)this.dummyToNodeForHorizontalAlignment.has(q[D])?this.dummyToNodeForHorizontalAlignment.get(q[D]).forEach(function(ne){_.idToNodeMap.get(ne).displacementY=oe}):this.idToNodeMap.get(q[D]).displacementY=oe}}}},I.prototype.calculateNodesToApplyGravitationTo=function(){var _=[],N,M=this.graphManager.getGraphs(),O=M.length,D;for(D=0;D<O;D++)N=M[D],N.updateConnected(),N.isConnected||(_=_.concat(N.getNodes()));return _},I.prototype.createBendpoints=function(){var _=[];_=_.concat(this.graphManager.getAllEdges());var N=new Set,M;for(M=0;M<_.length;M++){var O=_[M];if(!N.has(O)){var D=O.getSource(),B=O.getTarget();if(D==B)O.getBendpoints().push(new T),O.getBendpoints().push(new T),this.createDummyNodesForBendpoints(O),N.add(O);else{var z=[];if(z=z.concat(D.getEdgeListToNode(B)),z=z.concat(B.getEdgeListToNode(D)),!N.has(z[0])){if(z.length>1){var F;for(F=0;F<z.length;F++){var G=z[F];G.getBendpoints().push(new T),this.createDummyNodesForBendpoints(G)}}z.forEach(function(q){N.add(q)})}}}if(N.size==_.length)break}},I.prototype.positionNodesRadially=function(_){for(var N=new w(0,0),M=Math.ceil(Math.sqrt(_.length)),O=0,D=0,B=0,z=new T(0,0),F=0;F<_.length;F++){F%M==0&&(B=0,D=O,F!=0&&(D+=m.DEFAULT_COMPONENT_SEPERATION),O=0);var G=_[F],q=k.findCenterOfTree(G);N.x=B,N.y=D,z=I.radialLayout(G,q,N),z.y>O&&(O=Math.floor(z.y)),B=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(b.WORLD_CENTER_X-z.x/2,b.WORLD_CENTER_Y-z.y/2))},I.radialLayout=function(_,N,M){var O=Math.max(this.maxDiagonalInTree(_),m.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(N,null,0,359,0,O);var D=A.calculateBounds(_),B=new R;B.setDeviceOrgX(D.getMinX()),B.setDeviceOrgY(D.getMinY()),B.setWorldOrgX(M.x),B.setWorldOrgY(M.y);for(var z=0;z<_.length;z++){var F=_[z];F.transform(B)}var G=new T(D.getMaxX(),D.getMaxY());return B.inverseTransformPoint(G)},I.branchRadialLayout=function(_,N,M,O,D,B){var z=(O-M+1)/2;z<0&&(z+=180);var F=(z+M)%360,G=F*L.TWO_PI/360,q=D*Math.cos(G),Y=D*Math.sin(G);_.setCenter(q,Y);var ee=[];ee=ee.concat(_.getEdges());var Q=ee.length;N!=null&&Q--;for(var oe=0,pe=ee.length,j,W=_.getEdgesBetween(N);W.length>1;){var X=W[0];W.splice(0,1);var H=ee.indexOf(X);H>=0&&ee.splice(H,1),pe--,Q--}N!=null?j=(ee.indexOf(W[0])+1)%pe:j=0;for(var K=Math.abs(O-M)/Q,ne=j;oe!=Q;ne=++ne%pe){var Z=ee[ne].getOtherEnd(_);if(Z!=N){var be=(M+oe*K)%360,ce=(be+K)%360;I.branchRadialLayout(Z,_,be,ce,D+B,B),oe++}}},I.maxDiagonalInTree=function(_){for(var N=S.MIN_VALUE,M=0;M<_.length;M++){var O=_[M],D=O.getDiagonal();D>N&&(N=D)}return N},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var _=this,N={};this.memberGroups={},this.idToDummyNode={};for(var M=[],O=this.graphManager.getAllNodes(),D=0;D<O.length;D++){var B=O[D],z=B.getParent();this.getNodeDegreeWithChildren(B)===0&&(z.id==null||!this.getToBeTiled(z))&&M.push(B)}for(var D=0;D<M.length;D++){var B=M[D],F=B.getParent().id;typeof N[F]>"u"&&(N[F]=[]),N[F]=N[F].concat(B)}Object.keys(N).forEach(function(G){if(N[G].length>1){var q="DummyCompound_"+G;_.memberGroups[q]=N[G];var Y=N[G][0].getParent(),ee=new p(_.graphManager);ee.id=q,ee.paddingLeft=Y.paddingLeft||0,ee.paddingRight=Y.paddingRight||0,ee.paddingBottom=Y.paddingBottom||0,ee.paddingTop=Y.paddingTop||0,_.idToDummyNode[q]=ee;var Q=_.getGraphManager().add(_.newGraph(),ee),oe=Y.getChild();oe.add(ee);for(var pe=0;pe<N[G].length;pe++){var j=N[G][pe];oe.remove(j),Q.add(j)}}})},I.prototype.clearCompounds=function(){var _={},N={};this.performDFSOnCompounds();for(var M=0;M<this.compoundOrder.length;M++)N[this.compoundOrder[M].id]=this.compoundOrder[M],_[this.compoundOrder[M].id]=[].concat(this.compoundOrder[M].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[M].getChild()),this.compoundOrder[M].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(_,N)},I.prototype.clearZeroDegreeMembers=function(){var _=this,N=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(M){var O=_.idToDummyNode[M];if(N[M]=_.tileNodes(_.memberGroups[M],O.paddingLeft+O.paddingRight),O.rect.width=N[M].width,O.rect.height=N[M].height,O.setCenter(N[M].centerX,N[M].centerY),O.labelMarginLeft=0,O.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var D=O.rect.width,B=O.rect.height;O.labelWidth&&(O.labelPosHorizontal=="left"?(O.rect.x-=O.labelWidth,O.setWidth(D+O.labelWidth),O.labelMarginLeft=O.labelWidth):O.labelPosHorizontal=="center"&&O.labelWidth>D?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(B+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>B?(O.rect.y-=(O.labelHeight-B)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-B)/2):O.labelPosVertical=="bottom"&&O.setHeight(B+O.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var _=this.compoundOrder.length-1;_>=0;_--){var N=this.compoundOrder[_],M=N.id,O=N.paddingLeft,D=N.paddingTop,B=N.labelMarginLeft,z=N.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],N.rect.x,N.rect.y,O,D,B,z)}},I.prototype.repopulateZeroDegreeMembers=function(){var _=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(M){var O=_.idToDummyNode[M],D=O.paddingLeft,B=O.paddingTop,z=O.labelMarginLeft,F=O.labelMarginTop;_.adjustLocations(N[M],O.rect.x,O.rect.y,D,B,z,F)})},I.prototype.getToBeTiled=function(_){var N=_.id;if(this.toBeTiled[N]!=null)return this.toBeTiled[N];var M=_.getChild();if(M==null)return this.toBeTiled[N]=!1,!1;for(var O=M.getNodes(),D=0;D<O.length;D++){var B=O[D];if(this.getNodeDegree(B)>0)return this.toBeTiled[N]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[N]=!1,!1}return this.toBeTiled[N]=!0,!0},I.prototype.getNodeDegree=function(_){_.id;for(var N=_.getEdges(),M=0,O=0;O<N.length;O++){var D=N[O];D.getSource().id!==D.getTarget().id&&(M=M+1)}return M},I.prototype.getNodeDegreeWithChildren=function(_){var N=this.getNodeDegree(_);if(_.getChild()==null)return N;for(var M=_.getChild().getNodes(),O=0;O<M.length;O++){var D=M[O];N+=this.getNodeDegreeWithChildren(D)}return N},I.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},I.prototype.fillCompexOrderByDFS=function(_){for(var N=0;N<_.length;N++){var M=_[N];M.getChild()!=null&&this.fillCompexOrderByDFS(M.getChild().getNodes()),this.getToBeTiled(M)&&this.compoundOrder.push(M)}},I.prototype.adjustLocations=function(_,N,M,O,D,B,z){N+=O+B,M+=D+z;for(var F=N,G=0;G<_.rows.length;G++){var q=_.rows[G];N=F;for(var Y=0,ee=0;ee<q.length;ee++){var Q=q[ee];Q.rect.x=N,Q.rect.y=M,N+=Q.rect.width+_.horizontalPadding,Q.rect.height>Y&&(Y=Q.rect.height)}M+=Y+_.verticalPadding}},I.prototype.tileCompoundMembers=function(_,N){var M=this;this.tiledMemberPack=[],Object.keys(_).forEach(function(O){var D=N[O];if(M.tiledMemberPack[O]=M.tileNodes(_[O],D.paddingLeft+D.paddingRight),D.rect.width=M.tiledMemberPack[O].width,D.rect.height=M.tiledMemberPack[O].height,D.setCenter(M.tiledMemberPack[O].centerX,M.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=D.rect.width,z=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(B+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>B?(D.rect.x-=(D.labelWidth-B)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-B)/2):D.labelPosHorizontal=="right"&&D.setWidth(B+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(z+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>z?(D.rect.y-=(D.labelHeight-z)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-z)/2):D.labelPosVertical=="bottom"&&D.setHeight(z+D.labelHeight))}})},I.prototype.tileNodes=function(_,N){var M=this.tileNodesByFavoringDim(_,N,!0),O=this.tileNodesByFavoringDim(_,N,!1),D=this.getOrgRatio(M),B=this.getOrgRatio(O),z;return B<D?z=O:z=M,z},I.prototype.getOrgRatio=function(_){var N=_.width,M=_.height,O=N/M;return O<1&&(O=1/O),O},I.prototype.calcIdealRowWidth=function(_,N){var M=m.TILING_PADDING_VERTICAL,O=m.TILING_PADDING_HORIZONTAL,D=_.length,B=0,z=0,F=0;_.forEach(function(pe){B+=pe.getWidth(),z+=pe.getHeight(),pe.getWidth()>F&&(F=pe.getWidth())});var G=B/D,q=z/D,Y=Math.pow(M-O,2)+4*(G+O)*(q+M)*D,ee=(O-M+Math.sqrt(Y))/(2*(G+O)),Q;N?(Q=Math.ceil(ee),Q==ee&&Q++):Q=Math.floor(ee);var oe=Q*(G+O)-O;return F>oe&&(oe=F),oe+=O*2,oe},I.prototype.tileNodesByFavoringDim=function(_,N,M){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};B&&(z.idealRowWidth=this.calcIdealRowWidth(_,M));var F=function(j){return j.rect.width*j.rect.height},G=function(j,W){return F(W)-F(j)};_.sort(function(pe,j){var W=G;return z.idealRowWidth?(W=B,W(pe.id,j.id)):W(pe,j)});for(var q=0,Y=0,ee=0;ee<_.length;ee++){var Q=_[ee];q+=Q.getCenterX(),Y+=Q.getCenterY()}z.centerX=q/_.length,z.centerY=Y/_.length;for(var ee=0;ee<_.length;ee++){var Q=_[ee];if(z.rows.length==0)this.insertNodeToRow(z,Q,0,N);else if(this.canAddHorizontal(z,Q.rect.width,Q.rect.height)){var oe=z.rows.length-1;z.idealRowWidth||(oe=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Q,oe,N)}else this.insertNodeToRow(z,Q,z.rows.length,N);this.shiftToLastRow(z)}return z},I.prototype.insertNodeToRow=function(_,N,M,O){var D=O;if(M==_.rows.length){var B=[];_.rows.push(B),_.rowWidth.push(D),_.rowHeight.push(0)}var z=_.rowWidth[M]+N.rect.width;_.rows[M].length>0&&(z+=_.horizontalPadding),_.rowWidth[M]=z,_.width<z&&(_.width=z);var F=N.rect.height;M>0&&(F+=_.verticalPadding);var G=0;F>_.rowHeight[M]&&(G=_.rowHeight[M],_.rowHeight[M]=F,G=_.rowHeight[M]-G),_.height+=G,_.rows[M].push(N)},I.prototype.getShortestRowIndex=function(_){for(var N=-1,M=Number.MAX_VALUE,O=0;O<_.rows.length;O++)_.rowWidth[O]<M&&(N=O,M=_.rowWidth[O]);return N},I.prototype.getLongestRowIndex=function(_){for(var N=-1,M=Number.MIN_VALUE,O=0;O<_.rows.length;O++)_.rowWidth[O]>M&&(N=O,M=_.rowWidth[O]);return N},I.prototype.canAddHorizontal=function(_,N,M){if(_.idealRowWidth){var O=_.rows.length-1,D=_.rowWidth[O];return D+N+_.horizontalPadding<=_.idealRowWidth}var B=this.getShortestRowIndex(_);if(B<0)return!0;var z=_.rowWidth[B];if(z+_.horizontalPadding+N<=_.width)return!0;var F=0;_.rowHeight[B]<M&&B>0&&(F=M+_.verticalPadding-_.rowHeight[B]);var G;_.width-z>=N+_.horizontalPadding?G=(_.height+F)/(z+N+_.horizontalPadding):G=(_.height+F)/_.width,F=M+_.verticalPadding;var q;return _.width<N?q=(_.height+F)/N:q=(_.height+F)/_.width,q<1&&(q=1/q),G<1&&(G=1/G),G<q},I.prototype.shiftToLastRow=function(_){var N=this.getLongestRowIndex(_),M=_.rowWidth.length-1,O=_.rows[N],D=O[O.length-1],B=D.width+_.horizontalPadding;if(_.width-_.rowWidth[M]>B&&N!=M){O.splice(-1,1),_.rows[M].push(D),_.rowWidth[N]=_.rowWidth[N]-B,_.rowWidth[M]=_.rowWidth[M]+B,_.width=_.rowWidth[instance.getLongestRowIndex(_)];for(var z=Number.MIN_VALUE,F=0;F<O.length;F++)O[F].height>z&&(z=O[F].height);N>0&&(z+=_.verticalPadding);var G=_.rowHeight[N]+_.rowHeight[M];_.rowHeight[N]=z,_.rowHeight[M]<D.height+_.verticalPadding&&(_.rowHeight[M]=D.height+_.verticalPadding);var q=_.rowHeight[N]+_.rowHeight[M];_.height+=q-G,this.shiftToLastRow(_)}},I.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},I.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},I.prototype.reduceTrees=function(){for(var _=[],N=!0,M;N;){var O=this.graphManager.getAllNodes(),D=[];N=!1;for(var B=0;B<O.length;B++)if(M=O[B],M.getEdges().length==1&&!M.getEdges()[0].isInterGraph&&M.getChild()==null){if(m.PURE_INCREMENTAL){var z=M.getEdges()[0].getOtherEnd(M),F=new E(M.getCenterX()-z.getCenterX(),M.getCenterY()-z.getCenterY());D.push([M,M.getEdges()[0],M.getOwner(),F])}else D.push([M,M.getEdges()[0],M.getOwner()]);N=!0}if(N==!0){for(var G=[],q=0;q<D.length;q++)D[q][0].getEdges().length==1&&(G.push(D[q]),D[q][0].getOwner().remove(D[q][0]));_.push(G),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=_},I.prototype.growTree=function(_){for(var N=_.length,M=_[N-1],O,D=0;D<M.length;D++)O=M[D],this.findPlaceforPrunedNode(O),O[2].add(O[0]),O[2].add(O[1],O[1].source,O[1].target);_.splice(_.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},I.prototype.findPlaceforPrunedNode=function(_){var N,M,O=_[0];if(O==_[1].source?M=_[1].target:M=_[1].source,m.PURE_INCREMENTAL)O.setCenter(M.getCenterX()+_[3].getWidth(),M.getCenterY()+_[3].getHeight());else{var D=M.startX,B=M.finishX,z=M.startY,F=M.finishY,G=0,q=0,Y=0,ee=0,Q=[G,Y,q,ee];if(z>0)for(var oe=D;oe<=B;oe++)Q[0]+=this.grid[oe][z-1].length+this.grid[oe][z].length-1;if(B<this.grid.length-1)for(var oe=z;oe<=F;oe++)Q[1]+=this.grid[B+1][oe].length+this.grid[B][oe].length-1;if(F<this.grid[0].length-1)for(var oe=D;oe<=B;oe++)Q[2]+=this.grid[oe][F+1].length+this.grid[oe][F].length-1;if(D>0)for(var oe=z;oe<=F;oe++)Q[3]+=this.grid[D-1][oe].length+this.grid[D][oe].length-1;for(var pe=S.MAX_VALUE,j,W,X=0;X<Q.length;X++)Q[X]<pe?(pe=Q[X],j=1,W=X):Q[X]==pe&&j++;if(j==3&&pe==0)Q[0]==0&&Q[1]==0&&Q[2]==0?N=1:Q[0]==0&&Q[1]==0&&Q[3]==0?N=0:Q[0]==0&&Q[2]==0&&Q[3]==0?N=3:Q[1]==0&&Q[2]==0&&Q[3]==0&&(N=2);else if(j==2&&pe==0){var H=Math.floor(Math.random()*2);Q[0]==0&&Q[1]==0?H==0?N=0:N=1:Q[0]==0&&Q[2]==0?H==0?N=0:N=2:Q[0]==0&&Q[3]==0?H==0?N=0:N=3:Q[1]==0&&Q[2]==0?H==0?N=1:N=2:Q[1]==0&&Q[3]==0?H==0?N=1:N=3:H==0?N=2:N=3}else if(j==4&&pe==0){var H=Math.floor(Math.random()*4);N=H}else N=W;N==0?O.setCenter(M.getCenterX(),M.getCenterY()-M.getHeight()/2-y.DEFAULT_EDGE_LENGTH-O.getHeight()/2):N==1?O.setCenter(M.getCenterX()+M.getWidth()/2+y.DEFAULT_EDGE_LENGTH+O.getWidth()/2,M.getCenterY()):N==2?O.setCenter(M.getCenterX(),M.getCenterY()+M.getHeight()/2+y.DEFAULT_EDGE_LENGTH+O.getHeight()/2):O.setCenter(M.getCenterX()-M.getWidth()/2-y.DEFAULT_EDGE_LENGTH-O.getWidth()/2,M.getCenterY())}},o.exports=I},991:(o,l,u)=>{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,v,y){h.call(this,g,m,v,y)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var v=this.getChild().getNodes(),y,b=0;b<v.length;b++)y=v[b],y.getChild()==null?(y.displacementX+=g,y.displacementY+=m):y.propogateDisplacementToChildren(g,m)},f.prototype.move=function(){var g=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),g.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},f.prototype.setPred1=function(g){this.pred1=g},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(g){this.next=g},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(g){this.processed=g},f.prototype.isProcessed=function(){return processed},o.exports=f},902:(o,l,u)=>{function h(v){if(Array.isArray(v)){for(var y=0,b=Array(v.length);y<v.length;y++)b[y]=v[y];return b}else return Array.from(v)}var d=u(806),f=u(551).LinkedList,p=u(551).Matrix,g=u(551).SVD;function m(){}m.handleConstraints=function(v){var y={};y.fixedNodeConstraint=v.constraints.fixedNodeConstraint,y.alignmentConstraint=v.constraints.alignmentConstraint,y.relativePlacementConstraint=v.constraints.relativePlacementConstraint;for(var b=new Map,w=new Map,T=[],E=[],k=v.getAllNodes(),S=0,L=0;L<k.length;L++){var A=k[L];A.getChild()==null&&(w.set(A.id,S++),T.push(A.getCenterX()),E.push(A.getCenterY()),b.set(A.id,A))}y.relativePlacementConstraint&&y.relativePlacementConstraint.forEach(function(ue){!ue.gap&&ue.gap!=0&&(ue.left?ue.gap=d.DEFAULT_EDGE_LENGTH+b.get(ue.left).getWidth()/2+b.get(ue.right).getWidth()/2:ue.gap=d.DEFAULT_EDGE_LENGTH+b.get(ue.top).getHeight()/2+b.get(ue.bottom).getHeight()/2)});var R=function($,se){return{x:$.x-se.x,y:$.y-se.y}},C=function($){var se=0,ae=0;return $.forEach(function(fe){se+=T[w.get(fe)],ae+=E[w.get(fe)]}),{x:se/$.size,y:ae/$.size}},I=function($,se,ae,fe,he){function Te($e,je){var lt=new Set($e),st=!0,qe=!1,Et=void 0;try{for(var Ye=je[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;lt.add(ht)}}catch(ct){qe=!0,Et=ct}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}return lt}var Se=new Map;$.forEach(function($e,je){Se.set(je,0)}),$.forEach(function($e,je){$e.forEach(function(lt){Se.set(lt.id,Se.get(lt.id)+1)})});var Ee=new Map,Ge=new Map,Je=new f;Se.forEach(function($e,je){$e==0?(Je.push(je),ae||(se=="horizontal"?Ee.set(je,w.has(je)?T[w.get(je)]:fe.get(je)):Ee.set(je,w.has(je)?E[w.get(je)]:fe.get(je)))):Ee.set(je,Number.NEGATIVE_INFINITY),ae&&Ge.set(je,new Set([je]))}),ae&&he.forEach(function($e){var je=[];if($e.forEach(function(qe){ae.has(qe)&&je.push(qe)}),je.length>0){var lt=0;je.forEach(function(qe){se=="horizontal"?(Ee.set(qe,w.has(qe)?T[w.get(qe)]:fe.get(qe)),lt+=Ee.get(qe)):(Ee.set(qe,w.has(qe)?E[w.get(qe)]:fe.get(qe)),lt+=Ee.get(qe))}),lt=lt/je.length,$e.forEach(function(qe){ae.has(qe)||Ee.set(qe,lt)})}else{var st=0;$e.forEach(function(qe){se=="horizontal"?st+=w.has(qe)?T[w.get(qe)]:fe.get(qe):st+=w.has(qe)?E[w.get(qe)]:fe.get(qe)}),st=st/$e.length,$e.forEach(function(qe){Ee.set(qe,st)})}});for(var He=function(){var je=Je.shift(),lt=$.get(je);lt.forEach(function(st){if(Ee.get(st.id)<Ee.get(je)+st.gap)if(ae&&ae.has(st.id)){var qe=void 0;if(se=="horizontal"?qe=w.has(st.id)?T[w.get(st.id)]:fe.get(st.id):qe=w.has(st.id)?E[w.get(st.id)]:fe.get(st.id),Ee.set(st.id,qe),qe<Ee.get(je)+st.gap){var Et=Ee.get(je)+st.gap-qe;Ge.get(je).forEach(function(Ye){Ee.set(Ye,Ee.get(Ye)-Et)})}}else Ee.set(st.id,Ee.get(je)+st.gap);Se.set(st.id,Se.get(st.id)-1),Se.get(st.id)==0&&Je.push(st.id),ae&&Ge.set(st.id,Te(Ge.get(je),Ge.get(st.id)))})};Je.length!=0;)He();if(ae){var Xe=new Set;$.forEach(function($e,je){$e.length==0&&Xe.add(je)});var Ke=[];Ge.forEach(function($e,je){if(Xe.has(je)){var lt=!1,st=!0,qe=!1,Et=void 0;try{for(var Ye=$e[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;ae.has(ht)&&(lt=!0)}}catch(mt){qe=!0,Et=mt}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}if(!lt){var ct=!1,ut=void 0;Ke.forEach(function(mt,sr){mt.has([].concat(h($e))[0])&&(ct=!0,ut=sr)}),ct?$e.forEach(function(mt){Ke[ut].add(mt)}):Ke.push(new Set($e))}}}),Ke.forEach(function($e,je){var lt=Number.POSITIVE_INFINITY,st=Number.POSITIVE_INFINITY,qe=Number.NEGATIVE_INFINITY,Et=Number.NEGATIVE_INFINITY,Ye=!0,Ze=!1,ht=void 0;try{for(var ct=$e[Symbol.iterator](),ut;!(Ye=(ut=ct.next()).done);Ye=!0){var mt=ut.value,sr=void 0;se=="horizontal"?sr=w.has(mt)?T[w.get(mt)]:fe.get(mt):sr=w.has(mt)?E[w.get(mt)]:fe.get(mt);var Rt=Ee.get(mt);sr<lt&&(lt=sr),sr>qe&&(qe=sr),Rt<st&&(st=Rt),Rt>Et&&(Et=Rt)}}catch(Qe){Ze=!0,ht=Qe}finally{try{!Ye&&ct.return&&ct.return()}finally{if(Ze)throw ht}}var hr=(lt+qe)/2-(st+Et)/2,rr=!0,er=!1,Wt=void 0;try{for(var Xr=$e[Symbol.iterator](),pt;!(rr=(pt=Xr.next()).done);rr=!0){var ke=pt.value;Ee.set(ke,Ee.get(ke)+hr)}}catch(Qe){er=!0,Wt=Qe}finally{try{!rr&&Xr.return&&Xr.return()}finally{if(er)throw Wt}}})}return Ee},P=function($){var se=0,ae=0,fe=0,he=0;if($.forEach(function(Ge){Ge.left?T[w.get(Ge.left)]-T[w.get(Ge.right)]>=0?se++:ae++:E[w.get(Ge.top)]-E[w.get(Ge.bottom)]>=0?fe++:he++}),se>ae&&fe>he)for(var Te=0;Te<w.size;Te++)T[Te]=-1*T[Te],E[Te]=-1*E[Te];else if(se>ae)for(var Se=0;Se<w.size;Se++)T[Se]=-1*T[Se];else if(fe>he)for(var Ee=0;Ee<w.size;Ee++)E[Ee]=-1*E[Ee]},_=function($){var se=[],ae=new f,fe=new Set,he=0;return $.forEach(function(Te,Se){if(!fe.has(Se)){se[he]=[];var Ee=Se;for(ae.push(Ee),fe.add(Ee),se[he].push(Ee);ae.length!=0;){Ee=ae.shift();var Ge=$.get(Ee);Ge.forEach(function(Je){fe.has(Je.id)||(ae.push(Je.id),fe.add(Je.id),se[he].push(Je.id))})}he++}}),se},N=function($){var se=new Map;return $.forEach(function(ae,fe){se.set(fe,[])}),$.forEach(function(ae,fe){ae.forEach(function(he){se.get(fe).push(he),se.get(he.id).push({id:fe,gap:he.gap,direction:he.direction})})}),se},M=function($){var se=new Map;return $.forEach(function(ae,fe){se.set(fe,[])}),$.forEach(function(ae,fe){ae.forEach(function(he){se.get(he.id).push({id:fe,gap:he.gap,direction:he.direction})})}),se},O=[],D=[],B=!1,z=!1,F=new Set,G=new Map,q=new Map,Y=[];if(y.fixedNodeConstraint&&y.fixedNodeConstraint.forEach(function(ue){F.add(ue.nodeId)}),y.relativePlacementConstraint&&(y.relativePlacementConstraint.forEach(function(ue){ue.left?(G.has(ue.left)?G.get(ue.left).push({id:ue.right,gap:ue.gap,direction:"horizontal"}):G.set(ue.left,[{id:ue.right,gap:ue.gap,direction:"horizontal"}]),G.has(ue.right)||G.set(ue.right,[])):(G.has(ue.top)?G.get(ue.top).push({id:ue.bottom,gap:ue.gap,direction:"vertical"}):G.set(ue.top,[{id:ue.bottom,gap:ue.gap,direction:"vertical"}]),G.has(ue.bottom)||G.set(ue.bottom,[]))}),q=N(G),Y=_(q)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>1)y.fixedNodeConstraint.forEach(function(ue,$){O[$]=[ue.position.x,ue.position.y],D[$]=[T[w.get(ue.nodeId)],E[w.get(ue.nodeId)]]}),B=!0;else if(y.alignmentConstraint)(function(){var ue=0;if(y.alignmentConstraint.vertical){for(var $=y.alignmentConstraint.vertical,se=function(Ee){var Ge=new Set;$[Ee].forEach(function(Xe){Ge.add(Xe)});var Je=new Set([].concat(h(Ge)).filter(function(Xe){return F.has(Xe)})),He=void 0;Je.size>0?He=T[w.get(Je.values().next().value)]:He=C(Ge).x,$[Ee].forEach(function(Xe){O[ue]=[He,E[w.get(Xe)]],D[ue]=[T[w.get(Xe)],E[w.get(Xe)]],ue++})},ae=0;ae<$.length;ae++)se(ae);B=!0}if(y.alignmentConstraint.horizontal){for(var fe=y.alignmentConstraint.horizontal,he=function(Ee){var Ge=new Set;fe[Ee].forEach(function(Xe){Ge.add(Xe)});var Je=new Set([].concat(h(Ge)).filter(function(Xe){return F.has(Xe)})),He=void 0;Je.size>0?He=T[w.get(Je.values().next().value)]:He=C(Ge).y,fe[Ee].forEach(function(Xe){O[ue]=[T[w.get(Xe)],He],D[ue]=[T[w.get(Xe)],E[w.get(Xe)]],ue++})},Te=0;Te<fe.length;Te++)he(Te);B=!0}y.relativePlacementConstraint&&(z=!0)})();else if(y.relativePlacementConstraint){for(var ee=0,Q=0,oe=0;oe<Y.length;oe++)Y[oe].length>ee&&(ee=Y[oe].length,Q=oe);if(ee<q.size/2)P(y.relativePlacementConstraint),B=!1,z=!1;else{var pe=new Map,j=new Map,W=[];Y[Q].forEach(function(ue){G.get(ue).forEach(function($){$.direction=="horizontal"?(pe.has(ue)?pe.get(ue).push($):pe.set(ue,[$]),pe.has($.id)||pe.set($.id,[]),W.push({left:ue,right:$.id})):(j.has(ue)?j.get(ue).push($):j.set(ue,[$]),j.has($.id)||j.set($.id,[]),W.push({top:ue,bottom:$.id}))})}),P(W),z=!1;var X=I(pe,"horizontal"),H=I(j,"vertical");Y[Q].forEach(function(ue,$){D[$]=[T[w.get(ue)],E[w.get(ue)]],O[$]=[],X.has(ue)?O[$][0]=X.get(ue):O[$][0]=T[w.get(ue)],H.has(ue)?O[$][1]=H.get(ue):O[$][1]=E[w.get(ue)]}),B=!0}}if(B){for(var K=void 0,ne=p.transpose(O),Z=p.transpose(D),be=0;be<ne.length;be++)ne[be]=p.multGamma(ne[be]),Z[be]=p.multGamma(Z[be]);var ce=p.multMat(ne,p.transpose(Z)),re=g.svd(ce);K=p.multMat(re.V,p.transpose(re.U));for(var Ne=0;Ne<w.size;Ne++){var me=[T[Ne],E[Ne]],Ve=[K[0][0],K[1][0]],Ue=[K[0][1],K[1][1]];T[Ne]=p.dotProduct(me,Ve),E[Ne]=p.dotProduct(me,Ue)}z&&P(y.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>0){var Fe={x:0,y:0};y.fixedNodeConstraint.forEach(function(ue,$){var se={x:T[w.get(ue.nodeId)],y:E[w.get(ue.nodeId)]},ae=ue.position,fe=R(ae,se);Fe.x+=fe.x,Fe.y+=fe.y}),Fe.x/=y.fixedNodeConstraint.length,Fe.y/=y.fixedNodeConstraint.length,T.forEach(function(ue,$){T[$]+=Fe.x}),E.forEach(function(ue,$){E[$]+=Fe.y}),y.fixedNodeConstraint.forEach(function(ue){T[w.get(ue.nodeId)]=ue.position.x,E[w.get(ue.nodeId)]=ue.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var _e=y.alignmentConstraint.vertical,Oe=function($){var se=new Set;_e[$].forEach(function(he){se.add(he)});var ae=new Set([].concat(h(se)).filter(function(he){return F.has(he)})),fe=void 0;ae.size>0?fe=T[w.get(ae.values().next().value)]:fe=C(se).x,se.forEach(function(he){F.has(he)||(T[w.get(he)]=fe)})},Ce=0;Ce<_e.length;Ce++)Oe(Ce);if(y.alignmentConstraint.horizontal)for(var Le=y.alignmentConstraint.horizontal,ze=function($){var se=new Set;Le[$].forEach(function(he){se.add(he)});var ae=new Set([].concat(h(se)).filter(function(he){return F.has(he)})),fe=void 0;ae.size>0?fe=E[w.get(ae.values().next().value)]:fe=C(se).y,se.forEach(function(he){F.has(he)||(E[w.get(he)]=fe)})},ge=0;ge<Le.length;ge++)ze(ge)}y.relativePlacementConstraint&&function(){var ue=new Map,$=new Map,se=new Map,ae=new Map,fe=new Map,he=new Map,Te=new Set,Se=new Set;if(F.forEach(function(wt){Te.add(wt),Se.add(wt)}),y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Ee=y.alignmentConstraint.vertical,Ge=function(ot){se.set("dummy"+ot,[]),Ee[ot].forEach(function(We){ue.set(We,"dummy"+ot),se.get("dummy"+ot).push(We),F.has(We)&&Te.add("dummy"+ot)}),fe.set("dummy"+ot,T[w.get(Ee[ot][0])])},Je=0;Je<Ee.length;Je++)Ge(Je);if(y.alignmentConstraint.horizontal)for(var He=y.alignmentConstraint.horizontal,Xe=function(ot){ae.set("dummy"+ot,[]),He[ot].forEach(function(We){$.set(We,"dummy"+ot),ae.get("dummy"+ot).push(We),F.has(We)&&Se.add("dummy"+ot)}),he.set("dummy"+ot,E[w.get(He[ot][0])])},Ke=0;Ke<He.length;Ke++)Xe(Ke)}var $e=new Map,je=new Map,lt=function(ot){G.get(ot).forEach(function(We){var ar=void 0,de=void 0;We.direction=="horizontal"?(ar=ue.get(ot)?ue.get(ot):ot,ue.get(We.id)?de={id:ue.get(We.id),gap:We.gap,direction:We.direction}:de=We,$e.has(ar)?$e.get(ar).push(de):$e.set(ar,[de]),$e.has(de.id)||$e.set(de.id,[])):(ar=$.get(ot)?$.get(ot):ot,$.get(We.id)?de={id:$.get(We.id),gap:We.gap,direction:We.direction}:de=We,je.has(ar)?je.get(ar).push(de):je.set(ar,[de]),je.has(de.id)||je.set(de.id,[]))})},st=!0,qe=!1,Et=void 0;try{for(var Ye=G.keys()[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;lt(ht)}}catch(wt){qe=!0,Et=wt}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}var ct=N($e),ut=N(je),mt=_(ct),sr=_(ut),Rt=M($e),hr=M(je),rr=[],er=[];mt.forEach(function(wt,ot){rr[ot]=[],wt.forEach(function(We){Rt.get(We).length==0&&rr[ot].push(We)})}),sr.forEach(function(wt,ot){er[ot]=[],wt.forEach(function(We){hr.get(We).length==0&&er[ot].push(We)})});var Wt=I($e,"horizontal",Te,fe,rr),Xr=I(je,"vertical",Se,he,er),pt=function(ot){se.get(ot)?se.get(ot).forEach(function(We){T[w.get(We)]=Wt.get(ot)}):T[w.get(ot)]=Wt.get(ot)},ke=!0,Qe=!1,bt=void 0;try{for(var tr=Wt.keys()[Symbol.iterator](),Mr;!(ke=(Mr=tr.next()).done);ke=!0){var Or=Mr.value;pt(Or)}}catch(wt){Qe=!0,bt=wt}finally{try{!ke&&tr.return&&tr.return()}finally{if(Qe)throw bt}}var Lr=function(ot){ae.get(ot)?ae.get(ot).forEach(function(We){E[w.get(We)]=Xr.get(ot)}):E[w.get(ot)]=Xr.get(ot)},Sn=!0,gi=!1,Li=void 0;try{for(var dr=Xr.keys()[Symbol.iterator](),At;!(Sn=(At=dr.next()).done);Sn=!0){var Or=At.value;Lr(Or)}}catch(wt){gi=!0,Li=wt}finally{try{!Sn&&dr.return&&dr.return()}finally{if(gi)throw Li}}}()}for(var Me=0;Me<k.length;Me++){var J=k[Me];J.getChild()==null&&J.setCenter(T[w.get(J.id)],E[w.get(J.id)])}},o.exports=m},551:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})}(wv)),wv.exports}var mNe=bv.exports,WN;function vNe(){return WN||(WN=1,function(t,e){(function(n,i){t.exports=i(gNe())})(mNe,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return h.forEach(function(f){Object.keys(f).forEach(function(p){return l[p]=f[p]})}),l}},548:(o,l,u)=>{var h=function(){function p(g,m){var v=[],y=!0,b=!1,w=void 0;try{for(var T=g[Symbol.iterator](),E;!(y=(E=T.next()).done)&&(v.push(E.value),!(m&&v.length===m));y=!0);}catch(k){b=!0,w=k}finally{try{!y&&T.return&&T.return()}finally{if(b)throw w}}return v}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m<p.length;m++)g[p[m].id()]=!0;var v=p.filter(function(y,b){typeof y=="number"&&(y=b);for(var w=y.parent()[0];w!=null;){if(g[w.id()])return!1;w=w.parent()[0]}return!0});return v},f.connectComponents=function(p,g,m,v){var y=new d,b=new Set,w=[],T=void 0,E=void 0,k=void 0,S=!1,L=1,A=[],R=[],C=function(){var P=p.collection();R.push(P);var _=m[0],N=p.collection();N.merge(_).merge(_.descendants().intersection(g)),w.push(_),N.forEach(function(D){y.push(D),b.add(D),P.merge(D)});for(var M=function(){_=y.shift();var B=p.collection();_.neighborhood().nodes().forEach(function(q){g.intersection(_.edgesWith(q)).length>0&&B.merge(q)});for(var z=0;z<B.length;z++){var F=B[z];if(T=m.intersection(F.union(F.ancestors())),T!=null&&!b.has(T[0])){var G=T.union(T.descendants());G.forEach(function(q){y.push(q),b.add(q),P.merge(q),m.has(q)&&w.push(q)})}}};y.length!=0;)M();if(P.forEach(function(D){g.intersection(D.connectedEdges()).forEach(function(B){P.has(B.source())&&P.has(B.target())&&P.merge(B)})}),w.length==m.length&&(S=!0),!S||S&&L>1){E=w[0],k=E.connectedEdges().length,w.forEach(function(D){D.connectedEdges().length<k&&(k=D.connectedEdges().length,E=D)}),A.push(E.id());var O=p.collection();O.merge(w[0]),w.forEach(function(D){O.merge(D)}),w=[],m=m.difference(O),L++}};do C();while(!S);return v&&A.length>0&&v.set("dummy"+(v.size+1),A),R},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,E=!1,k=void 0;try{for(var S=g.nodeIndexes[Symbol.iterator](),L;!(T=(L=S.next()).done);T=!0){var A=L.value,R=h(A,2),C=R[0],I=R[1],P=m.cy.getElementById(C);if(P){var _=P.boundingBox(),N=g.xCoords[I]-_.w/2,M=g.xCoords[I]+_.w/2,O=g.yCoords[I]-_.h/2,D=g.yCoords[I]+_.h/2;N<v&&(v=N),M>y&&(y=M),O<b&&(b=O),D>w&&(w=D)}}}catch(q){E=!0,k=q}finally{try{!T&&S.return&&S.return()}finally{if(E)throw k}}var B=p.x-(y+v)/2,z=p.y-(w+b)/2;g.xCoords=g.xCoords.map(function(q){return q+B}),g.yCoords=g.yCoords.map(function(q){return q+z})}else{Object.keys(g).forEach(function(q){var Y=g[q],ee=Y.getRect().x,Q=Y.getRect().x+Y.getRect().width,oe=Y.getRect().y,pe=Y.getRect().y+Y.getRect().height;ee<v&&(v=ee),Q>y&&(y=Q),oe<b&&(b=oe),pe>w&&(w=pe)});var F=p.x-(y+v)/2,G=p.y-(w+b)/2;Object.keys(g).forEach(function(q){var Y=g[q];Y.setCenter(Y.getCenterX()+F,Y.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,v){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,w=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,E=void 0,k=void 0,S=void 0,L=void 0,A=p.descendants().not(":parent"),R=A.length,C=0;C<R;C++){var I=A[C];E=g[v.get(I.id())]-I.width()/2,k=g[v.get(I.id())]+I.width()/2,S=m[v.get(I.id())]-I.height()/2,L=m[v.get(I.id())]+I.height()/2,y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var P={};return P.topLeftX=y,P.topLeftY=w,P.width=b-y,P.height=T-w,P},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(v){var y=!1;v.children().forEach(function(b){b.css("display")!="none"&&(y=!0)}),y||m.merge(v)}),m},o.exports=f},816:(o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,v=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(T,E){var k=T.cy,S=T.eles,L=S.nodes(),A=S.edges(),R=void 0,C=void 0,I=void 0,P={};T.randomize&&(R=E.nodeIndexes,C=E.xCoords,I=E.yCoords);var _=function(q){return typeof q=="function"},N=function(q,Y){return _(q)?q(Y):q},M=h.calcParentsWithoutChildren(k,S),O=function G(q,Y,ee,Q){for(var oe=Y.length,pe=0;pe<oe;pe++){var j=Y[pe],W=null;j.intersection(M).length==0&&(W=j.children());var X=void 0,H=j.layoutDimensions({nodeDimensionsIncludeLabels:Q.nodeDimensionsIncludeLabels});if(j.outerWidth()!=null&&j.outerHeight()!=null)if(Q.randomize)if(!j.isParent())X=q.add(new f(ee.graphManager,new p(C[R.get(j.id())]-H.w/2,I[R.get(j.id())]-H.h/2),new g(parseFloat(H.w),parseFloat(H.h))));else{var K=h.calcBoundingBox(j,C,I,R);j.intersection(M).length==0?X=q.add(new f(ee.graphManager,new p(K.topLeftX,K.topLeftY),new g(K.width,K.height))):X=q.add(new f(ee.graphManager,new p(K.topLeftX,K.topLeftY),new g(parseFloat(H.w),parseFloat(H.h))))}else X=q.add(new f(ee.graphManager,new p(j.position("x")-H.w/2,j.position("y")-H.h/2),new g(parseFloat(H.w),parseFloat(H.h))));else X=q.add(new f(this.graphManager));if(X.id=j.data("id"),X.nodeRepulsion=N(Q.nodeRepulsion,j),X.paddingLeft=parseInt(j.css("padding")),X.paddingTop=parseInt(j.css("padding")),X.paddingRight=parseInt(j.css("padding")),X.paddingBottom=parseInt(j.css("padding")),Q.nodeDimensionsIncludeLabels&&(X.labelWidth=j.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=j.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=j.css("text-valign"),X.labelPosHorizontal=j.css("text-halign")),P[j.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),W!=null&&W.length>0){var ne=void 0;ne=ee.getGraphManager().add(ee.newGraph(),X),G(ne,W,ee,Q)}}},D=function(q,Y,ee){for(var Q=0,oe=0,pe=0;pe<ee.length;pe++){var j=ee[pe],W=P[j.data("source")],X=P[j.data("target")];if(W&&X&&W!==X&&W.getEdgesBetween(X).length==0){var H=Y.add(q.newEdge(),W,X);H.id=j.id(),H.idealLength=N(T.idealEdgeLength,j),H.edgeElasticity=N(T.edgeElasticity,j),Q+=H.idealLength,oe++}}T.idealEdgeLength!=null&&(oe>0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=Q/oe:_(T.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,y.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},B=function(q,Y){Y.fixedNodeConstraint&&(q.constraints.fixedNodeConstraint=Y.fixedNodeConstraint),Y.alignmentConstraint&&(q.constraints.alignmentConstraint=Y.alignmentConstraint),Y.relativePlacementConstraint&&(q.constraints.relativePlacementConstraint=Y.relativePlacementConstraint)};T.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(y.MAX_ITERATIONS=v.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,y.ANIMATE=v.ANIMATE=m.ANIMATE=T.animate,y.TILE=T.tile,y.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),T.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),T.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,F=z.newGraphManager();return O(F.addRoot(),h.getTopMostNodes(L),z,T),D(z,F,A),B(z,T),z.runLayout(),P};o.exports={coseLayout:b}},212:(o,l,u)=>{var h=function(){function T(E,k){for(var S=0;S<k.length;S++){var L=k[S];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,L.key,L)}}return function(E,k,S){return k&&T(E.prototype,k),S&&T(E,S),E}}();function d(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}var f=u(658),p=u(548),g=u(657),m=g.spectralLayout,v=u(816),y=v.coseLayout,b=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:function(E){return 4500},idealEdgeLength:function(E){return 50},edgeElasticity:function(E){return .45},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:function(){},stop:function(){}}),w=function(){function T(E){d(this,T),this.options=f({},b,E)}return h(T,[{key:"run",value:function(){var k=this,S=this.options,L=S.cy,A=S.eles,R=[],C=[],I=void 0,P=[];S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0)&&(S.fixedNodeConstraint=void 0),S.alignmentConstraint&&(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0)&&(S.alignmentConstraint.vertical=void 0),S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0)&&(S.alignmentConstraint.horizontal=void 0)),S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0)&&(S.relativePlacementConstraint=void 0);var _=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;_&&(S.tile=!1,S.packComponents=!1);var N=void 0,M=!1;if(L.layoutUtilities&&S.packComponents&&(N=L.layoutUtilities("get"),N||(N=L.layoutUtilities()),M=!0),A.nodes().length>0)if(M){var B=p.getTopMostNodes(S.eles.nodes());if(I=p.connectComponents(L,S.eles,B),I.forEach(function(ce){var re=ce.boundingBox();P.push({x:re.x1+re.w/2,y:re.y1+re.h/2})}),S.randomize&&I.forEach(function(ce){S.eles=ce,R.push(m(S))}),S.quality=="default"||S.quality=="proof"){var z=L.collection();if(S.tile){var F=new Map,G=[],q=[],Y=0,ee={nodeIndexes:F,xCoords:G,yCoords:q},Q=[];if(I.forEach(function(ce,re){ce.edges().length==0&&(ce.nodes().forEach(function(Ne,me){z.merge(ce.nodes()[me]),Ne.isParent()||(ee.nodeIndexes.set(ce.nodes()[me].id(),Y++),ee.xCoords.push(ce.nodes()[0].position().x),ee.yCoords.push(ce.nodes()[0].position().y))}),Q.push(re))}),z.length>1){var oe=z.boundingBox();P.push({x:oe.x1+oe.w/2,y:oe.y1+oe.h/2}),I.push(z),R.push(ee);for(var pe=Q.length-1;pe>=0;pe--)I.splice(Q[pe],1),R.splice(Q[pe],1),P.splice(Q[pe],1)}}I.forEach(function(ce,re){S.eles=ce,C.push(y(S,R[re])),p.relocateComponent(P[re],C[re],S)})}else I.forEach(function(ce,re){p.relocateComponent(P[re],R[re],S)});var j=new Set;if(I.length>1){var W=[],X=A.filter(function(ce){return ce.css("display")=="none"});I.forEach(function(ce,re){var Ne=void 0;if(S.quality=="draft"&&(Ne=R[re].nodeIndexes),ce.nodes().not(X).length>0){var me={};me.edges=[],me.nodes=[];var Ve=void 0;ce.nodes().not(X).forEach(function(Ue){if(S.quality=="draft")if(!Ue.isParent())Ve=Ne.get(Ue.id()),me.nodes.push({x:R[re].xCoords[Ve]-Ue.boundingbox().w/2,y:R[re].yCoords[Ve]-Ue.boundingbox().h/2,width:Ue.boundingbox().w,height:Ue.boundingbox().h});else{var Fe=p.calcBoundingBox(Ue,R[re].xCoords,R[re].yCoords,Ne);me.nodes.push({x:Fe.topLeftX,y:Fe.topLeftY,width:Fe.width,height:Fe.height})}else C[re][Ue.id()]&&me.nodes.push({x:C[re][Ue.id()].getLeft(),y:C[re][Ue.id()].getTop(),width:C[re][Ue.id()].getWidth(),height:C[re][Ue.id()].getHeight()})}),ce.edges().forEach(function(Ue){var Fe=Ue.source(),_e=Ue.target();if(Fe.css("display")!="none"&&_e.css("display")!="none")if(S.quality=="draft"){var Oe=Ne.get(Fe.id()),Ce=Ne.get(_e.id()),Le=[],ze=[];if(Fe.isParent()){var ge=p.calcBoundingBox(Fe,R[re].xCoords,R[re].yCoords,Ne);Le.push(ge.topLeftX+ge.width/2),Le.push(ge.topLeftY+ge.height/2)}else Le.push(R[re].xCoords[Oe]),Le.push(R[re].yCoords[Oe]);if(_e.isParent()){var Me=p.calcBoundingBox(_e,R[re].xCoords,R[re].yCoords,Ne);ze.push(Me.topLeftX+Me.width/2),ze.push(Me.topLeftY+Me.height/2)}else ze.push(R[re].xCoords[Ce]),ze.push(R[re].yCoords[Ce]);me.edges.push({startX:Le[0],startY:Le[1],endX:ze[0],endY:ze[1]})}else C[re][Fe.id()]&&C[re][_e.id()]&&me.edges.push({startX:C[re][Fe.id()].getCenterX(),startY:C[re][Fe.id()].getCenterY(),endX:C[re][_e.id()].getCenterX(),endY:C[re][_e.id()].getCenterY()})}),me.nodes.length>0&&(W.push(me),j.add(re))}});var H=N.packComponents(W,S.randomize).shifts;if(S.quality=="draft")R.forEach(function(ce,re){var Ne=ce.xCoords.map(function(Ve){return Ve+H[re].dx}),me=ce.yCoords.map(function(Ve){return Ve+H[re].dy});ce.xCoords=Ne,ce.yCoords=me});else{var K=0;j.forEach(function(ce){Object.keys(C[ce]).forEach(function(re){var Ne=C[ce][re];Ne.setCenter(Ne.getCenterX()+H[K].dx,Ne.getCenterY()+H[K].dy)}),K++})}}}else{var O=S.eles.boundingBox();if(P.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),S.randomize){var D=m(S);R.push(D)}S.quality=="default"||S.quality=="proof"?(C.push(y(S,R[0])),p.relocateComponent(P[0],C[0],S)):p.relocateComponent(P[0],R[0],S)}var ne=function(re,Ne){if(S.quality=="default"||S.quality=="proof"){typeof re=="number"&&(re=Ne);var me=void 0,Ve=void 0,Ue=re.data("id");return C.forEach(function(_e){Ue in _e&&(me={x:_e[Ue].getRect().getCenterX(),y:_e[Ue].getRect().getCenterY()},Ve=_e[Ue])}),S.nodeDimensionsIncludeLabels&&(Ve.labelWidth&&(Ve.labelPosHorizontal=="left"?me.x+=Ve.labelWidth/2:Ve.labelPosHorizontal=="right"&&(me.x-=Ve.labelWidth/2)),Ve.labelHeight&&(Ve.labelPosVertical=="top"?me.y+=Ve.labelHeight/2:Ve.labelPosVertical=="bottom"&&(me.y-=Ve.labelHeight/2))),me==null&&(me={x:re.position("x"),y:re.position("y")}),{x:me.x,y:me.y}}else{var Fe=void 0;return R.forEach(function(_e){var Oe=_e.nodeIndexes.get(re.id());Oe!=null&&(Fe={x:_e.xCoords[Oe],y:_e.yCoords[Oe]})}),Fe==null&&(Fe={x:re.position("x"),y:re.position("y")}),{x:Fe.x,y:Fe.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var Z=p.calcParentsWithoutChildren(L,A),be=A.filter(function(ce){return ce.css("display")=="none"});S.eles=A.not(be),A.nodes().not(":parent").not(be).layoutPositions(k,S,ne),Z.length>0&&Z.forEach(function(ce){ce.position(ne(ce))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T}();o.exports=w},657:(o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var v=m.cy,y=m.eles,b=y.nodes(),w=y.nodes(":parent"),T=new Map,E=new Map,k=new Map,S=[],L=[],A=[],R=[],C=[],I=[],P=[],_=[],N=void 0,M=1e8,O=1e-9,D=m.piTol,B=m.samplingType,z=m.nodeSeparation,F=void 0,G=function(){for(var $=0,se=0,ae=!1;se<F;){$=Math.floor(Math.random()*N),ae=!1;for(var fe=0;fe<se;fe++)if(R[fe]==$){ae=!0;break}if(!ae)R[se]=$,se++;else continue}},q=function($,se,ae){for(var fe=[],he=0,Te=0,Se=0,Ee=void 0,Ge=[],Je=0,He=1,Xe=0;Xe<N;Xe++)Ge[Xe]=M;for(fe[Te]=$,Ge[$]=0;Te>=he;){Se=fe[he++];for(var Ke=S[Se],$e=0;$e<Ke.length;$e++)Ee=E.get(Ke[$e]),Ge[Ee]==M&&(Ge[Ee]=Ge[Se]+1,fe[++Te]=Ee);I[Se][se]=Ge[Se]*z}if(ae){for(var je=0;je<N;je++)I[je][se]<C[je]&&(C[je]=I[je][se]);for(var lt=0;lt<N;lt++)C[lt]>Je&&(Je=C[lt],He=lt)}return He},Y=function($){var se=void 0;if($){se=Math.floor(Math.random()*N);for(var fe=0;fe<N;fe++)C[fe]=M;for(var he=0;he<F;he++)R[he]=se,se=q(se,he,$)}else{G();for(var ae=0;ae<F;ae++)q(R[ae],ae,$)}for(var Te=0;Te<N;Te++)for(var Se=0;Se<F;Se++)I[Te][Se]*=I[Te][Se];for(var Ee=0;Ee<F;Ee++)P[Ee]=[];for(var Ge=0;Ge<F;Ge++)for(var Je=0;Je<F;Je++)P[Ge][Je]=I[R[Je]][Ge]},ee=function(){for(var $=f.svd(P),se=$.S,ae=$.U,fe=$.V,he=se[0]*se[0]*se[0],Te=[],Se=0;Se<F;Se++){Te[Se]=[];for(var Ee=0;Ee<F;Ee++)Te[Se][Ee]=0,Se==Ee&&(Te[Se][Ee]=se[Se]/(se[Se]*se[Se]+he/(se[Se]*se[Se])))}_=d.multMat(d.multMat(fe,Te),d.transpose(ae))},Q=function(){for(var $=void 0,se=void 0,ae=[],fe=[],he=[],Te=[],Se=0;Se<N;Se++)ae[Se]=Math.random(),fe[Se]=Math.random();ae=d.normalize(ae),fe=d.normalize(fe);for(var Ee=O,Ge=O,Je=void 0;;){for(var He=0;He<N;He++)he[He]=ae[He];if(ae=d.multGamma(d.multL(d.multGamma(he),I,_)),$=d.dotProduct(he,ae),ae=d.normalize(ae),Ee=d.dotProduct(he,ae),Je=Math.abs(Ee/Ge),Je<=1+D&&Je>=1)break;Ge=Ee}for(var Xe=0;Xe<N;Xe++)he[Xe]=ae[Xe];for(Ge=O;;){for(var Ke=0;Ke<N;Ke++)Te[Ke]=fe[Ke];if(Te=d.minusOp(Te,d.multCons(he,d.dotProduct(he,Te))),fe=d.multGamma(d.multL(d.multGamma(Te),I,_)),se=d.dotProduct(Te,fe),fe=d.normalize(fe),Ee=d.dotProduct(Te,fe),Je=Math.abs(Ee/Ge),Je<=1+D&&Je>=1)break;Ge=Ee}for(var $e=0;$e<N;$e++)Te[$e]=fe[$e];L=d.multCons(he,Math.sqrt(Math.abs($))),A=d.multCons(Te,Math.sqrt(Math.abs(se)))};h.connectComponents(v,y,h.getTopMostNodes(b),T),w.forEach(function(ue){h.connectComponents(v,y,h.getTopMostNodes(ue.descendants().intersection(y)),T)});for(var oe=0,pe=0;pe<b.length;pe++)b[pe].isParent()||E.set(b[pe].id(),oe++);var j=!0,W=!1,X=void 0;try{for(var H=T.keys()[Symbol.iterator](),K;!(j=(K=H.next()).done);j=!0){var ne=K.value;E.set(ne,oe++)}}catch(ue){W=!0,X=ue}finally{try{!j&&H.return&&H.return()}finally{if(W)throw X}}for(var Z=0;Z<E.size;Z++)S[Z]=[];w.forEach(function(ue){for(var $=ue.children().intersection(y);$.nodes(":childless").length==0;)$=$.nodes()[0].children().intersection(y);var se=0,ae=$.nodes(":childless")[0].connectedEdges().length;$.nodes(":childless").forEach(function(fe,he){fe.connectedEdges().length<ae&&(ae=fe.connectedEdges().length,se=he)}),k.set(ue.id(),$.nodes(":childless")[se].id())}),b.forEach(function(ue){var $=void 0;ue.isParent()?$=E.get(k.get(ue.id())):$=E.get(ue.id()),ue.neighborhood().nodes().forEach(function(se){y.intersection(ue.edgesWith(se)).length>0&&(se.isParent()?S[$].push(k.get(se.id())):S[$].push(se.id()))})});var be=function($){var se=E.get($),ae=void 0;T.get($).forEach(function(fe){v.getElementById(fe).isParent()?ae=k.get(fe):ae=fe,S[se].push(ae),S[E.get(ae)].push($)})},ce=!0,re=!1,Ne=void 0;try{for(var me=T.keys()[Symbol.iterator](),Ve;!(ce=(Ve=me.next()).done);ce=!0){var Ue=Ve.value;be(Ue)}}catch(ue){re=!0,Ne=ue}finally{try{!ce&&me.return&&me.return()}finally{if(re)throw Ne}}N=E.size;var Fe=void 0;if(N>2){F=N<m.sampleSize?N:m.sampleSize;for(var _e=0;_e<N;_e++)I[_e]=[];for(var Oe=0;Oe<F;Oe++)_[Oe]=[];return m.quality=="draft"||m.step=="all"?(Y(B),ee(),Q(),Fe={nodeIndexes:E,xCoords:L,yCoords:A}):(E.forEach(function(ue,$){L.push(v.getElementById($).position("x")),A.push(v.getElementById($).position("y"))}),Fe={nodeIndexes:E,xCoords:L,yCoords:A}),Fe}else{var Ce=E.keys(),Le=v.getElementById(Ce.next().value),ze=Le.position(),ge=Le.outerWidth();if(L.push(ze.x),A.push(ze.y),N==2){var Me=v.getElementById(Ce.next().value),J=Me.outerWidth();L.push(ze.x+ge/2+J/2+m.idealEdgeLength),A.push(ze.y)}return Fe={nodeIndexes:E,xCoords:L,yCoords:A},Fe}};o.exports={spectralLayout:p}},579:(o,l,u)=>{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})}(bv)),bv.exports}var yNe=vNe();const xNe=nf(yNe);var YN={L:"left",R:"right",T:"top",B:"bottom"},XN={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},fm={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},bNe=x(function(t){return Mi(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),jN=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Mi=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Xl=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),r7=x(function(t,e){const r=Mi(t)&&Xl(e),n=Xl(t)&&Mi(e);return r||n},"isArchitectureDirectionXY"),wNe=x(function(t){const e=t[0],r=t[1],n=Mi(e)&&Xl(r),i=Xl(e)&&Mi(r);return n||i},"isArchitecturePairXY"),TNe=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),y6=x(function(t,e){const r=`${t}${e}`;return TNe(r)?r:void 0},"getArchitectureDirectionPair"),ENe=x(function([t,e],r){const n=r[0],i=r[1];return Mi(n)?Xl(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Mi(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),SNe=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),kNe=x(function(t,e){return r7(t,e)?"bend":Mi(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),CNe=x(function(t){return t.type==="service"},"isArchitectureService"),ANe=x(function(t){return t.type==="junction"},"isArchitectureJunction"),dY=x(t=>t.data(),"edgeData"),gh=x(t=>t.data(),"nodeData"),fY=fr.architecture,Qt=new xS(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:fY,dataStructures:void 0,elements:{}})),_Ne=x(()=>{Qt.reset(),Vn()},"clear"),LNe=x(function({id:t,icon:e,in:r,title:n,iconText:i}){if(Qt.records.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${Qt.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(Qt.records.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(Qt.records.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}Qt.records.registeredIds[t]="node",Qt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}},"addService"),RNe=x(()=>Object.values(Qt.records.nodes).filter(CNe),"getServices"),NNe=x(function({id:t,in:e}){Qt.records.registeredIds[t]="node",Qt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}},"addJunction"),DNe=x(()=>Object.values(Qt.records.nodes).filter(ANe),"getJunctions"),INe=x(()=>Object.values(Qt.records.nodes),"getNodes"),x6=x(t=>Qt.records.nodes[t],"getNode"),MNe=x(function({id:t,icon:e,in:r,title:n}){if(Qt.records.registeredIds[t]!==void 0)throw new Error(`The group id [${t}] is already in use by another ${Qt.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(Qt.records.registeredIds[r]===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(Qt.records.registeredIds[r]==="node")throw new Error(`The group [${t}]'s parent is not a group`)}Qt.records.registeredIds[t]="group",Qt.records.groups[t]={id:t,icon:e,title:n,in:r}},"addGroup"),ONe=x(()=>Object.values(Qt.records.groups),"getGroups"),PNe=x(function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!jN(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!jN(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(Qt.records.nodes[t]===void 0&&Qt.records.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(Qt.records.nodes[e]===void 0&&Qt.records.groups[t]===void 0)throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const u=Qt.records.nodes[t].in,h=Qt.records.nodes[e].in;if(s&&u&&h&&u==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&&u&&h&&u==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 d={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:o,title:l};Qt.records.edges.push(d),Qt.records.nodes[t]&&Qt.records.nodes[e]&&(Qt.records.nodes[t].edges.push(Qt.records.edges[Qt.records.edges.length-1]),Qt.records.nodes[e].edges.push(Qt.records.edges[Qt.records.edges.length-1]))},"addEdge"),BNe=x(()=>Qt.records.edges,"getEdges"),FNe=x(()=>{if(Qt.records.dataStructures===void 0){const t={},e=Object.entries(Qt.records.nodes).reduce((o,[l,u])=>(o[l]=u.edges.reduce((h,d)=>{var g,m;const f=(g=x6(d.lhsId))==null?void 0:g.in,p=(m=x6(d.rhsId))==null?void 0:m.in;if(f&&p&&f!==p){const v=kNe(d.lhsDir,d.rhsDir);v!=="bend"&&(t[f]??(t[f]={}),t[f][p]=v,t[p]??(t[p]={}),t[p][f]=v)}if(d.lhsId===l){const v=y6(d.lhsDir,d.rhsDir);v&&(h[v]=d.rhsId)}else{const v=y6(d.rhsDir,d.lhsDir);v&&(h[v]=d.lhsId)}return h},{}),o),{}),r=Object.keys(e)[0],n={[r]:1},i=Object.keys(e).reduce((o,l)=>l===r?o:{...o,[l]:1},{}),a=x(o=>{const l={[o]:[0,0]},u=[o];for(;u.length>0;){const h=u.shift();if(h){n[h]=1,delete i[h];const d=e[h],[f,p]=l[h];Object.entries(d).forEach(([g,m])=>{n[m]||(l[m]=ENe([f,p],g),u.push(m))})}}return l},"BFS"),s=[a(r)];for(;Object.keys(i).length>0;)s.push(a(Object.keys(i)[0]));Qt.records.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return Qt.records.dataStructures},"getDataStructures"),$Ne=x((t,e)=>{Qt.records.elements[t]=e},"setElementForId"),zNe=x(t=>Qt.records.elements[t],"getElementById"),S2={clear:_Ne,setDiagramTitle:di,getDiagramTitle:Gn,setAccTitle:Bn,getAccTitle:Kn,setAccDescription:Zn,getAccDescription:Qn,addService:LNe,getServices:RNe,addJunction:NNe,getJunctions:DNe,getNodes:INe,getNode:x6,addGroup:MNe,getGroups:ONe,addEdge:PNe,getEdges:BNe,setElementForId:$Ne,getElementById:zNe,getDataStructures:FNe};function Pn(t){const e=we().architecture;return e!=null&&e[t]?e[t]:fY[t]}x(Pn,"getConfigField");var VNe=x((t,e)=>{mf(t,e),t.groups.map(e.addGroup),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(e.addEdge)},"populateDb"),GNe={parse:x(async t=>{const e=await Mu("architecture",t);ie.debug(e),VNe(e,S2)},"parse")},UNe=x(t=>`
|
|
3081
|
+
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,u=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 d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),ie.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return ie.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),$N=x((t,e)=>{ie.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!CRe(e,a)&&!i){const s=ARe(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),_Re=x(function(t,e,r,n,i,a,s){let o=r.points;ie.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(ie.debug("to cluster abc88",n[r.toCluster]),o=$N(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ie.debug("from cluster abc88",n[r.fromCluster]),o=$N(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(T=>!Number.isNaN(T.y));let f=xh;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=aM(r),m=Dp().x(p).y(g).curve(f);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":v="edge-thickness-thick";break;case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed";break}const y=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let b="";(we().flowchart.arrowMarkerAbsolute||we().state.arrowMarkerAbsolute)&&(b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,b=b.replace(/\(/g,"\\("),b=b.replace(/\)/g,"\\)")),TRe(y,r,b,s,i);let w={};return l&&(w.updatedPath=o),w.originalPath=r.points,w},"insertEdge"),LRe=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),RRe=x((t,e,r)=>{const n=LRe(t),i=2,a=e.height+2*r.padding,s=a/i,o=e.width+2*s+r.padding,l=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:s,y:0},{x:o/2,y:2*l},{x:o-s,y:0},{x:o,y:0},{x:o,y:-a/3},{x:o+2*l,y:-a/2},{x:o,y:-2*a/3},{x:o,y:-a},{x:o-s,y:-a},{x:o/2,y:-a-2*l},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*l,y:-a/2},{x:0,y:-a/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:s,y:-a},{x:o-s,y:-a},{x:o,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:o,y:-s},{x:o,y:-a+s},{x:0,y:-a}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:o,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:o,y:-a}]:n.has("right")&&n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")&&n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:o,y:-s},{x:0,y:-a}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-a}]:n.has("left")&&n.has("up")?[{x:o,y:0},{x:0,y:-s},{x:o,y:-a}]:n.has("left")&&n.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-a}]:n.has("right")?[{x:s,y:-l},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a+l}]:n.has("left")?[{x:s,y:0},{x:s,y:-l},{x:o-s,y:-l},{x:o-s,y:-a+l},{x:s,y:-a+l},{x:s,y:-a},{x:0,y:-a/2}]:n.has("up")?[{x:s,y:-l},{x:s,y:-a+l},{x:0,y:-a+l},{x:o/2,y:-a},{x:o,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l}]:n.has("down")?[{x:o/2,y:0},{x:0,y:-l},{x:s,y:-l},{x:s,y:-a+l},{x:o-s,y:-a+l},{x:o-s,y:-l},{x:o,y:-l}]:[{x:0,y:0}]},"getArrowPoints");function eY(t,e){return t.intersect(e)}x(eY,"intersectNode");var NRe=eY;function tY(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(tY,"intersectEllipse");var rY=tY;function nY(t,e,r){return rY(t,e,e,r)}x(nY,"intersectCircle");var DRe=nY;function iY(t,e,r,n){var i,a,s,o,l,u,h,d,f,p,g,m,v,y,b;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,f=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(f!==0&&p!==0&&v6(f,p))&&(a=n.y-r.y,o=r.x-n.x,u=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+u,d=a*e.x+o*e.y+u,!(h!==0&&d!==0&&v6(h,d))&&(g=i*o-a*s,g!==0)))return m=Math.abs(g/2),v=s*u-o*l,y=v<0?(v-m)/g:(v+m)/g,v=a*l-i*u,b=v<0?(v-m)/g:(v+m)/g,{x:y,y:b}}x(iY,"intersectLine");function v6(t,e){return t*e>0}x(v6,"sameSign");var IRe=iY,MRe=aY;function aY(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h<e.length;h++){var d=e[h],f=e[h<e.length-1?h+1:0],p=IRe(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(g,m){var v=g.x-r.x,y=g.y-r.y,b=Math.sqrt(v*v+y*y),w=m.x-r.x,T=m.y-r.y,E=Math.sqrt(w*w+T*T);return b<E?-1:b===E?0:1}),a[0]):t}x(aY,"intersectPolygon");var ORe=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),PRe=ORe,Qr={node:NRe,circle:DRe,ellipse:rY,polygon:MRe,rect:PRe},ti=x(async(t,e,r,n)=>{const i=we();let a;const s=e.useHtmlLabels||Dr(i.flowchart.htmlLabels);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];const h=l.node();let d;e.labelType==="markdown"?d=da(l,Fr(Zs(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):d=h.appendChild(Ua(Fr(Zs(u),i),e.labelStyle,!1,n));let f=d.getBBox();const p=e.padding/2;if(Dr(i.flowchart.htmlLabels)){const g=d.children[0],m=rt(d),v=g.getElementsByTagName("img");if(v){const y=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...v].map(b=>new Promise(w=>{function T(){if(b.style.display="flex",b.style.flexDirection="column",y){const E=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,S=parseInt(E,10)*5+"px";b.style.minWidth=S,b.style.maxWidth=S}else b.style.width="100%";w(b)}x(T,"setupImage"),setTimeout(()=>{b.complete&&T()}),b.addEventListener("error",T),b.addEventListener("load",T)})))}f=g.getBoundingClientRect(),m.attr("width",f.width),m.attr("height",f.height)}return s?l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):l.attr("transform","translate(0, "+-f.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:f,halfPadding:p,label:l}},"labelHelper"),dn=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Ls(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(Ls,"insertPolygonShape");var BRe=x(async(t,e)=>{e.useHtmlLabels||we().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await ti(t,e,"node "+e.classes,!0);ie.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},n},"note"),FRe=BRe,zN=x(t=>t?" "+t:"","formatClass"),Ia=x((t,e)=>`${e||"node default"}${zN(t.classes)} ${zN(t.class)}`,"getClassesFromNode"),VN=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];ie.info("Question main (Circle)");const l=Ls(r,s,s,o);return l.attr("style",e.style),dn(e,l),e.intersect=function(u){return ie.warn("Intersect called"),Qr.polygon(e,o,u)},r},"question"),$Re=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-28/2},{x:-28/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return Qr.circle(e,14,s)},r},"choice"),zRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(e,void 0),!0),i=4,a=n.height+e.padding,s=a/i,o=n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=Ls(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"hexagon"),VRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,l=RRe(e.directions,n,e),u=Ls(r,o,a,l);return u.attr("style",e.style),dn(e,u),e.intersect=function(h){return Qr.polygon(e,l,h)},r},"block_arrow"),GRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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 Ls(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_left_inv_arrow"),URe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_right"),qRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"lean_left"),HRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"trapezoid"),WRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"inv_trapezoid"),YRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"rect_right_inv_arrow"),XRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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,u=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 dn(e,u),e.intersect=function(h){const d=Qr.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)<e.width/2||Math.abs(f)==e.width/2&&Math.abs(d.y-e.y)>e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),jRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(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,u=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",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(ab(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"rect"),KRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(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,u=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",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(ab(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{ie.warn(`Unknown node property ${d}`)})}return dn(e,a),e.intersect=function(h){return Qr.rect(e,h)},r},"composite"),ZRe=x(async(t,e)=>{const{shapeSvg:r}=await ti(t,e,"label",!0);ie.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(ab(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{ie.warn(`Unknown node property ${o}`)})}return dn(e,n),e.intersect=function(s){return Qr.rect(e,s)},r},"labelRect");function ab(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(ie.debug("add top border"),a(r)):s(r),e.includes("r")?(ie.debug("add right border"),a(n)):s(n),e.includes("b")?(ie.debug("add bottom border"),a(r)):s(r),e.includes("l")?(ie.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(ab,"applyNodePropertyBorders");var QRe=x((t,e)=>{let r;e.classes?r="node "+e.classes:r="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="";typeof o=="object"?l=o[0]:l=o,ie.info("Label text abc79",l,o,typeof o=="object");const u=s.node().appendChild(Ua(l,e.labelStyle,!0,!0));let h={width:0,height:0};if(Dr(we().flowchart.htmlLabels)){const m=u.children[0],v=rt(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}ie.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=s.node().appendChild(Ua(d.join?d.join("<br/>"):d,e.labelStyle,!0,!0));if(Dr(we().flowchart.htmlLabels)){const m=p.children[0],v=rt(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return rt(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),rt(u).attr("transform","translate( "+(h.width<f.width?0:-(f.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+f.height+g).attr("y2",-h.height/2-g+f.height+g),dn(e,i),e.intersect=function(m){return Qr.rect(e,m)},n},"rectWithTitle"),JRe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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 dn(e,s),e.intersect=function(o){return Qr.rect(e,o)},r},"stadium"),eNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(t,e,Ia(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),ie.info("Circle main"),dn(e,a),e.intersect=function(s){return ie.info("Circle intersect",e,n.width/2+i,s),Qr.circle(e,n.width/2+i,s)},r},"circle"),tNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await ti(t,e,Ia(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.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),ie.info("DoubleCircle main"),dn(e,o),e.intersect=function(u){return ie.info("DoubleCircle intersect",e,n.width/2+i+a,u),Qr.circle(e,n.width/2+i+a,u)},r},"doublecircle"),rNe=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await ti(t,e,Ia(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=Ls(r,i,a,s);return o.attr("style",e.style),dn(e,o),e.intersect=function(l){return Qr.polygon(e,s,l)},r},"subroutine"),nNe=x((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),dn(e,n),e.intersect=function(i){return Qr.circle(e,7,i)},r},"start"),GN=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(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 dn(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return Qr.rect(e,o)},n},"forkJoin"),iNe=x((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),dn(e,i),e.intersect=function(a){return Qr.circle(e,7,a)},r},"end"),aNe=x((t,e)=>{var L;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(L=e.classData.annotations)==null?void 0:L[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=f.node().appendChild(Ua(m,e.labelStyle,!0,!0));let y=v.getBBox();if(Dr(we().flowchart.htmlLabels)){const A=v.children[0],R=rt(v);y=A.getBoundingClientRect(),R.attr("width",y.width),R.attr("height",y.height)}e.classData.annotations[0]&&(d+=y.height+n,h+=y.width);let b=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(we().flowchart.htmlLabels?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const w=f.node().appendChild(Ua(b,e.labelStyle,!0,!0));rt(w).attr("class","classTitle");let T=w.getBBox();if(Dr(we().flowchart.htmlLabels)){const A=w.children[0],R=rt(w);T=A.getBoundingClientRect(),R.attr("width",T.width),R.attr("height",T.height)}d+=T.height+n,T.width>h&&(h=T.width);const E=[];e.classData.members.forEach(A=>{const R=A.getDisplayDetails();let C=R.displayText;we().flowchart.htmlLabels&&(C=C.replace(/</g,"<").replace(/>/g,">"));const I=f.node().appendChild(Ua(C,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let P=I.getBBox();if(Dr(we().flowchart.htmlLabels)){const _=I.children[0],N=rt(I);P=_.getBoundingClientRect(),N.attr("width",P.width),N.attr("height",P.height)}P.width>h&&(h=P.width),d+=P.height+n,E.push(I)}),d+=i;const k=[];if(e.classData.methods.forEach(A=>{const R=A.getDisplayDetails();let C=R.displayText;we().flowchart.htmlLabels&&(C=C.replace(/</g,"<").replace(/>/g,">"));const I=f.node().appendChild(Ua(C,R.cssStyle?R.cssStyle:e.labelStyle,!0,!0));let P=I.getBBox();if(Dr(we().flowchart.htmlLabels)){const _=I.children[0],N=rt(I);P=_.getBoundingClientRect(),N.attr("width",P.width),N.attr("height",P.height)}P.width>h&&(h=P.width),d+=P.height+n,k.push(I)}),d+=i,g){let A=(h-y.width)/2;rt(v).attr("transform","translate( "+(-1*h/2+A)+", "+-1*d/2+")"),p=y.height+n}let S=(h-T.width)/2;return rt(w).attr("transform","translate( "+(-1*h/2+S)+", "+(-1*d/2+p)+")"),p+=T.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,E.forEach(A=>{rt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,k.forEach(A=>{rt(A).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const R=A==null?void 0:A.getBBox();p+=((R==null?void 0:R.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),dn(e,o),e.intersect=function(A){return Qr.rect(e,A)},s},"class_box"),UN={rhombus:VN,composite:KRe,question:VN,rect:jRe,labelRect:ZRe,rectWithTitle:QRe,choice:$Re,circle:eNe,doublecircle:tNe,stadium:JRe,hexagon:zRe,block_arrow:VRe,rect_left_inv_arrow:GRe,lean_right:URe,lean_left:qRe,trapezoid:HRe,inv_trapezoid:WRe,rect_right_inv_arrow:YRe,cylinder:XRe,start:nNe,end:iNe,note:FRe,subroutine:rNe,fork:GN,join:GN,class_box:aNe},xv={},sY=x(async(t,e,r)=>{let n,i;if(e.link){let a;we().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await UN[e.shape](n,e,r)}else i=await UN[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),xv[e.id]=n,e.haveCallback&&xv[e.id].attr("class",xv[e.id].attr("class")+" clickable"),n},"insertNode"),sNe=x(t=>{const e=xv[t.id];ie.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function t7(t,e,r=!1){var f,p,g;const n=t;let i="default";(((f=n==null?void 0:n.classes)==null?void 0:f.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=sE((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,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:o??((g=(p=Ir())==null?void 0:p.block)==null?void 0:g.padding)??0}}x(t7,"getNodeFromBlock");async function oY(t,e,r){const n=t7(e,r,!1);if(n.type==="group")return;const i=Ir(),a=await sY(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()}x(oY,"calculateBlockSize");async function lY(t,e,r){const n=t7(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Ir();await sY(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,sNe(n)}}x(lY,"insertBlockPositioned");async function sb(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await sb(t,i.children,r,n)}x(sb,"performOperations");async function cY(t,e,r){await sb(t,e,r,oY)}x(cY,"calculateBlockSizes");async function uY(t,e,r){await sb(t,e,r,lY)}x(uY,"insertBlocks");async function hY(t,e,r,n,i){const a=new ga({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}];_Re(t,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),s.label&&(await SRe(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),kRe({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(hY,"insertEdges");var oNe=x(function(t,e){return e.db.getClasses()},"getClasses"),lNe=x(async function(t,e,r,n){const{securityLevel:i,block:a}=Ir(),s=n.db;let o;i==="sandbox"&&(o=rt("#i"+e));const l=rt(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):rt(`[id="${e}"]`);xRe(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await cY(g,d,s);const m=QW(s);if(await uY(g,d,s),await hY(g,p,f,s,e),m){const v=m,y=Math.max(1,Math.round(.125*(v.width/v.height))),b=v.height+y+10,w=v.width+10,{useMaxWidth:T}=a;ha(u,b,w,!!T),ie.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),cNe={draw:lNe,getClasses:oNe},uNe={parser:zLe,db:aRe,renderer:cNe,styles:oRe};const hNe=Object.freeze(Object.defineProperty({__proto__:null,diagram:uNe},Symbol.toStringTag,{value:"Module"}));var bv={exports:{}},wv={exports:{}},Tv={exports:{}},dNe=Tv.exports,qN;function fNe(){return qN||(qN=1,function(t,e){(function(n,i){t.exports=i()})(dNe,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)}([function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a},function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,v){m==null&&v==null&&(v=g),a.call(this,v),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(v.target==p){if(v.source!=m)throw"Incorrect edge source!";g.push(v)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(v){if(!(v.source==m||v.target==m))throw"Incorrect edge source and/or target";(v.target==p||v.source==p)&&g.push(v)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var v=this.child.getNodes(),y=0;y<v.length;y++)g=v[y],m=g.withChildren(),m.forEach(function(b){p.add(b)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),v=0;v<m.length;v++)g=m[v],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?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)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,v=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(v-m)+m;var y=-l.INITIAL_WORLD_BOUNDARY,b=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(b-y)+y,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(g+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>g?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var v=new h(g,m),y=p.inverseTransformPoint(v);this.setLocation(y.x,y.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d},function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s},function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a},function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(v,y,b){a.call(this,b),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=v,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(v,y,b){if(y==null&&b==null){var w=v;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(w)>-1)throw"Node already in graph!";return w.owner=this,this.getNodes().push(w),w}else{var T=v;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(T.source=y,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),y.edges.push(T),b!=y&&b.edges.push(T),T)}},g.prototype.remove=function(v){var y=v;if(v instanceof u){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),w,T=b.length,E=0;E<T;E++)w=b[E],w.isInterGraph?this.graphManager.remove(w):w.source.owner.remove(w);var k=this.nodes.indexOf(y);if(k==-1)throw"Node not in owner node list!";this.nodes.splice(k,1)}else if(v instanceof h){var w=v;if(w==null)throw"Edge is null!";if(!(w.source!=null&&w.target!=null))throw"Source and/or target is null!";if(!(w.source.owner!=null&&w.target.owner!=null&&w.source.owner==this&&w.target.owner==this))throw"Source and/or target owner is invalid!";var S=w.source.edges.indexOf(w),L=w.target.edges.indexOf(w);if(!(S>-1&&L>-1))throw"Source and/or target doesn't know this edge!";w.source.edges.splice(S,1),w.target!=w.source&&w.target.edges.splice(L,1);var k=w.source.owner.getEdges().indexOf(w);if(k==-1)throw"Not in owner's edge list!";w.source.owner.getEdges().splice(k,1)}},g.prototype.updateLeftTop=function(){for(var v=s.MAX_VALUE,y=s.MAX_VALUE,b,w,T,E=this.getNodes(),k=E.length,S=0;S<k;S++){var L=E[S];b=L.getTop(),w=L.getLeft(),v>b&&(v=b),y>w&&(y=w)}return v==s.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?T=E[0].getParent().paddingLeft:T=this.margin,this.left=y-T,this.top=v-T,new f(this.left,this.top))},g.prototype.updateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,k,S,L,A,R=this.nodes,C=R.length,I=0;I<C;I++){var P=R[I];v&&P.child!=null&&P.updateBounds(),E=P.getLeft(),k=P.getRight(),S=P.getTop(),L=P.getBottom(),y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var _=new d(y,w,b-y,T-w);y==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),R[0].getParent().paddingLeft!=null?A=R[0].getParent().paddingLeft:A=this.margin,this.left=_.x-A,this.right=_.x+_.width+A,this.top=_.y-A,this.bottom=_.y+_.height+A},g.calculateBounds=function(v){for(var y=s.MAX_VALUE,b=-s.MAX_VALUE,w=s.MAX_VALUE,T=-s.MAX_VALUE,E,k,S,L,A=v.length,R=0;R<A;R++){var C=v[R];E=C.getLeft(),k=C.getRight(),S=C.getTop(),L=C.getBottom(),y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var I=new d(y,w,b-y,T-w);return I},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var v=0,y=this.nodes,b=y.length,w=0;w<b;w++){var T=y[w];v+=T.calcEstimatedSize()}return v==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=v/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var v=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new p,b=new Set,w=this.nodes[0],T,E,k=w.withChildren();for(k.forEach(function(I){y.push(I),b.add(I)});y.length!==0;){w=y.shift(),T=w.getEdges();for(var S=T.length,L=0;L<S;L++){var A=T[L];if(E=A.getOtherEndInGraph(w,this),E!=null&&!b.has(E)){var R=E.withChildren();R.forEach(function(I){y.push(I),b.add(I)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var C=0;b.forEach(function(I){I.owner==v&&C++}),C==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var v=this.graphs.indexOf(u);this.graphs.splice(v,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var v=d.source.edges.indexOf(d);if(d.source.edges.splice(v,1),v=d.target.edges.indexOf(d),d.target.edges.splice(v,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var v=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(v,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=[],h=this.edges.length,d=0;d<h;d++)l=this.edges[d],this.isOneAncestorOfOther(l.source,l.target)&&u.push(l);for(var d=0;d<u.length;d++)this.remove(u[d]);return!1},r.exports=o},function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),v=o.getRight(),y=o.getX(),b=o.getBottom(),w=o.getRight(),T=o.getWidthHalf(),E=o.getHeightHalf(),k=l.getX(),S=l.getY(),L=l.getRight(),A=l.getX(),R=l.getBottom(),C=l.getRight(),I=l.getWidthHalf(),P=l.getHeightHalf(),_=!1,N=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=R,!1;if(d<p)return u[0]=h,u[1]=b,u[2]=f,u[3]=S,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=L,u[3]=p,!1;if(h<f)return u[0]=v,u[1]=d,u[2]=k,u[3]=p,!1}else{var M=o.height/o.width,O=l.height/l.width,D=(p-d)/(f-h),B=void 0,z=void 0,F=void 0,G=void 0,q=void 0,Y=void 0;if(-M===D?h>f?(u[0]=y,u[1]=b,_=!0):(u[0]=v,u[1]=m,_=!0):M===D&&(h>f?(u[0]=g,u[1]=m,_=!0):(u[0]=w,u[1]=b,_=!0)),-O===D?f>h?(u[2]=A,u[3]=R,N=!0):(u[2]=L,u[3]=S,N=!0):O===D&&(f>h?(u[2]=k,u[3]=S,N=!0):(u[2]=C,u[3]=R,N=!0)),_&&N)return!1;if(h>f?d>p?(B=this.getCardinalDirection(M,D,4),z=this.getCardinalDirection(O,D,2)):(B=this.getCardinalDirection(-M,D,3),z=this.getCardinalDirection(-O,D,1)):d>p?(B=this.getCardinalDirection(-M,D,1),z=this.getCardinalDirection(-O,D,3)):(B=this.getCardinalDirection(M,D,2),z=this.getCardinalDirection(O,D,4)),!_)switch(B){case 1:G=m,F=h+-E/D,u[0]=F,u[1]=G;break;case 2:F=w,G=d+T*D,u[0]=F,u[1]=G;break;case 3:G=b,F=h+E/D,u[0]=F,u[1]=G;break;case 4:F=y,G=d+-T*D,u[0]=F,u[1]=G;break}if(!N)switch(z){case 1:Y=S,q=f+-P/D,u[2]=q,u[3]=Y;break;case 2:q=C,Y=p+I*D,u[2]=q,u[3]=Y;break;case 3:Y=R,q=f+P/D,u[2]=q,u[3]=Y;break;case 4:q=A,Y=p+-I*D,u[2]=q,u[3]=Y;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=void 0,T=void 0,E=void 0,k=void 0,S=void 0,L=void 0,A=void 0,R=void 0,C=void 0;return E=g-f,S=d-p,A=p*f-d*g,k=b-v,L=m-y,R=y*v-m*b,C=E*L-k*S,C===0?null:(w=(S*R-L*A)/C,T=(k*A-E*R)/C,new a(w,T))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,v=u.y,y=h.x,b=h.y,w=(p-d)*(b-v)-(y-m)*(g-f);if(w===0)return!1;var T=((b-v)*(y-d)+(m-y)*(b-f))/w,E=((f-g)*(y-d)+(p-d)*(b-f))/w;return 0<T&&T<1&&0<E&&E<1},s.findCircleLineIntersections=function(o,l,u,h,d,f,p){var g=(u-o)*(u-o)+(h-l)*(h-l),m=2*((o-d)*(u-o)+(l-f)*(h-l)),v=(o-d)*(o-d)+(l-f)*(l-f)-p*p,y=m*m-4*g*v;if(y>=0){var b=(-m+Math.sqrt(m*m-4*g*v))/(2*g),w=(-m-Math.sqrt(m*m-4*g*v))/(2*g),T=null;return b>=0&&b<=1?[b]:w>=0&&w<=1?[w]:T}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s},function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a},function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a},function(r,n,i){var a=function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}}();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f!=null&&f.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,v=this.head;m<p;)v=v.next,m++;v.value=g}}}]),d}();r.exports=h},function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a},function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a},function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s},function(r,n,i){function a(m){if(Array.isArray(m)){for(var v=0,y=Array(m.length);v<m.length;v++)y[v]=m[v];return y}else return Array.from(m)}var s=i(0),o=i(7),l=i(3),u=i(1),h=i(6),d=i(5),f=i(17),p=i(29);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),v=0;v<m.length;v++)m[v];for(var y=this.graphManager.getRoot().getNodes(),v=0;v<y.length;v++)y[v];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var v=m;if(v.getChild()!=null)for(var y=v.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(v.vGraphObject!=null){var w=v.vGraphObject;w.update(v)}}else if(m instanceof u){var T=m;if(T.vGraphObject!=null){var E=T.vGraphObject;E.update(T)}}else if(m instanceof h){var k=m;if(k.vGraphObject!=null){var S=k.vGraphObject;S.update(k)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var v=new f,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){v.setWorldOrgX(m.x),v.setWorldOrgY(m.y),v.setDeviceOrgX(y.x),v.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),w,T=0;T<b.length;T++)w=b[T],w.transform(v)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var v,y,b=m.getNodes(),w=0;w<b.length;w++)v=b[w],y=v.getChild(),y==null||y.getNodes().length==0?v.scatter():(this.positionNodesRandomly(y),v.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],v=!0,y=this.graphManager.getRoot().getNodes(),b=!0,w=0;w<y.length;w++)y[w].getChild()!=null&&(b=!1);if(!b)return m;var T=new Set,E=[],k=new Map,S=[];for(S=S.concat(y);S.length>0&&v;){for(E.push(S[0]);E.length>0&&v;){var L=E[0];E.splice(0,1),T.add(L);for(var A=L.getEdges(),w=0;w<A.length;w++){var R=A[w].getOtherEnd(L);if(k.get(L)!=R)if(!T.has(R))E.push(R),k.set(R,L);else{v=!1;break}}}if(!v)m=[];else{var C=[].concat(a(T));m.push(C);for(var w=0;w<C.length;w++){var I=C[w],P=S.indexOf(I);P>-1&&S.splice(P,1)}T=new Set,k=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var v=[],y=m.source,b=this.graphManager.calcLowestCommonAncestor(m.source,m.target),w=0;w<m.bendpoints.length;w++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),b.add(T);var E=this.newEdge(null);this.graphManager.add(E,y,T),v.add(T),y=T}var E=this.newEdge(null);return this.graphManager.add(E,y,m.target),this.edgeToDummyNodes.set(m,v),m.isInterGraph()?this.graphManager.remove(m):b.remove(m),v},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var v=0;v<m.length;v++){var y=m[v];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),w=0;w<b.length;w++){var T=b[w],E=new d(T.getCenterX(),T.getCenterY()),k=y.bendpoints.get(w);k.x=E.x,k.y=E.y,T.getOwner().remove(T)}this.graphManager.add(y,y.source,y.target)}}},g.transform=function(m,v,y,b){if(y!=null&&b!=null){var w=v;if(m<=50){var T=v/y;w-=(v-T)/50*(50-m)}else{var E=v*b;w+=(E-v)/50*(m-50)}return w}else{var k,S;return m<=50?(k=9*v/500,S=v/10):(k=9*v/50,S=-8*v),k*m+S}},g.findCenterOfTree=function(m){var v=[];v=v.concat(m);var y=[],b=new Map,w=!1,T=null;(v.length==1||v.length==2)&&(w=!0,T=v[0]);for(var E=0;E<v.length;E++){var k=v[E],S=k.getNeighborsList().size;b.set(k,k.getNeighborsList().size),S==1&&y.push(k)}var L=[];for(L=L.concat(y);!w;){var A=[];A=A.concat(L),L=[];for(var E=0;E<v.length;E++){var k=v[E],R=v.indexOf(k);R>=0&&v.splice(R,1);var C=k.getNeighborsList();C.forEach(function(_){if(y.indexOf(_)<0){var N=b.get(_),M=N-1;M==1&&L.push(_),b.set(_,M)}})}y=y.concat(L),(v.length==1||v.length==2)&&(w=!0,T=v[0])}return T},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g},function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a},function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(4),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,v,y,b,w,T=this.getGraphManager().getAllEdges(),E=0;E<T.length;E++)p=T[E],g=p.idealLength,p.isInterGraph&&(v=p.getSource(),y=p.getTarget(),b=p.getSourceInLca().getEstimatedSize(),w=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=b+w-2*l.SIMPLE_NODE_SIZE),m=p.getLca().getInclusionTreeDepth(),p.idealLength+=g*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(v.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*m))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,v,y,b,w=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),T=new Set,m=0;m<w.length;m++)y=w[m],this.calculateRepulsionForceOfANode(y,T,p,g),T.add(y);else for(m=0;m<w.length;m++)for(y=w[m],v=m+1;v<w.length;v++)b=w[v],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),v=p.getTarget(),y,b,w,T;if(this.uniformLeafNodeSizes&&m.getChild()==null&&v.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;y=p.getLength(),y!=0&&(b=p.edgeElasticity*(y-g),w=b*(p.lengthX/y),T=b*(p.lengthY/y),m.springForceX+=w,m.springForceY+=T,v.springForceX-=w,v.springForceY-=T)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),v=g.getRect(),y=new Array(2),b=new Array(4),w,T,E,k,S,L,A;if(m.intersects(v)){u.calcSeparationAmount(m,v,y,o.DEFAULT_EDGE_LENGTH/2),L=2*y[0],A=2*y[1];var R=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=R*L,p.repulsionForceY-=R*A,g.repulsionForceX+=R*L,g.repulsionForceY+=R*A}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(w=v.getCenterX()-m.getCenterX(),T=v.getCenterY()-m.getCenterY()):(u.getIntersection(m,v,b),w=b[2]-b[0],T=b[3]-b[1]),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=h.sign(T)*o.MIN_REPULSION_DIST),E=w*w+T*T,k=Math.sqrt(E),S=(p.nodeRepulsion/2+g.nodeRepulsion/2)*p.noOfChildren*g.noOfChildren/E,L=S*w/k,A=S*T/k,p.repulsionForceX-=L,p.repulsionForceY-=A,g.repulsionForceX+=L,g.repulsionForceY+=A},d.prototype.calcGravitationalForce=function(p){var g,m,v,y,b,w,T,E;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,v=(g.getTop()+g.getBottom())/2,y=p.getCenterX()-m,b=p.getCenterY()-v,w=Math.abs(y)+p.getWidth()/2,T=Math.abs(b)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(E=g.getEstimatedSize()*this.gravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y,p.gravitationForceY=-this.gravityConstant*b)):(E=g.getEstimatedSize()*this.compoundGravityRangeFactor,(w>E||T>E)&&(p.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var v=new Array(g),y=0;y<g;y++)v[y]=new Array(m);for(var y=0;y<g;y++)for(var b=0;b<m;b++)v[y][b]=new Array;return v},d.prototype.addNodeToGrid=function(p,g,m){var v=0,y=0,b=0,w=0;v=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),w=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var T=v;T<=y;T++)for(var E=b;E<=w;E++)this.grid[T][E].push(p),p.setGridCoordinates(v,y,b,w)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,v){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||v){var y=new Set;p.surrounding=new Array;for(var b,w=this.grid,T=p.startX-1;T<p.finishX+2;T++)for(var E=p.startY-1;E<p.finishY+2;E++)if(!(T<0||E<0||T>=w.length||E>=w[0].length)){for(var k=0;k<w[T][E].length;k++)if(b=w[T][E][k],!(p.getOwner()!=b.getOwner()||p==b)&&!g.has(b)&&!y.has(b)){var S=Math.abs(p.getCenterX()-b.getCenterX())-(p.getWidth()/2+b.getWidth()/2),L=Math.abs(p.getCenterY()-b.getCenterY())-(p.getHeight()/2+b.getHeight()/2);S<=this.repulsionRange&&L<=this.repulsionRange&&y.add(b)}}p.surrounding=[].concat(a(y))}for(T=0;T<p.surrounding.length;T++)this.calcRepulsionForce(p,p.surrounding[T])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d},function(r,n,i){var a=i(1),s=i(4);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o},function(r,n,i){var a=i(3),s=i(4);function o(u,h,d,f){a.call(this,u,h,d,f),this.nodeRepulsion=s.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=[]}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];o.prototype.setGridCoordinates=function(u,h,d,f){this.startX=u,this.finishX=h,this.startY=d,this.finishY=f},r.exports=o},function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a},function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s},function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s},function(r,n,i){function a(){}a.multMat=function(s,o){for(var l=[],u=0;u<s.length;u++){l[u]=[];for(var h=0;h<o[0].length;h++){l[u][h]=0;for(var d=0;d<s[0].length;d++)l[u][h]+=s[u][d]*o[d][h]}}return l},a.transpose=function(s){for(var o=[],l=0;l<s[0].length;l++){o[l]=[];for(var u=0;u<s.length;u++)o[l][u]=s[u][l]}return o},a.multCons=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]*o;return l},a.minusOp=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]-o[u];return l},a.dotProduct=function(s,o){for(var l=0,u=0;u<s.length;u++)l+=s[u]*o[u];return l},a.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},a.normalize=function(s){for(var o=[],l=this.mag(s),u=0;u<s.length;u++)o[u]=s[u]/l;return o},a.multGamma=function(s){for(var o=[],l=0,u=0;u<s.length;u++)l+=s[u];l*=-1/s.length;for(var h=0;h<s.length;h++)o[h]=l+s[h];return o},a.multL=function(s,o,l){for(var u=[],h=[],d=[],f=0;f<o[0].length;f++){for(var p=0,g=0;g<o.length;g++)p+=-.5*o[g][f]*s[g];h[f]=p}for(var m=0;m<l.length;m++){for(var v=0,y=0;y<l.length;y++)v+=l[m][y]*h[y];d[m]=v}for(var b=0;b<o.length;b++){for(var w=0,T=0;T<o[0].length;T++)w+=o[b][T]*d[T];u[b]=w}return u},r.exports=a},function(r,n,i){var a=function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}}();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,v=p;;){for(;this.compareFunction(g,this._get(d,v));)v--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<v)this._swap(d,m,v),m++,v--;else return v}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u}();r.exports=l},function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(Math.min(this.m+1,this.n)),this.U=function(Ye){var Ze=function ht(ct){if(ct.length==0)return 0;for(var ut=[],mt=0;mt<ct[0];mt++)ut.push(ht(ct.slice(1)));return ut};return Ze(Ye)}([this.m,o]),this.V=function(Ye){var Ze=function ht(ct){if(ct.length==0)return 0;for(var ut=[],mt=0;mt<ct[0];mt++)ut.push(ht(ct.slice(1)));return ut};return Ze(Ye)}([this.n,this.n]);for(var l=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(this.n),u=function(Ye){for(var Ze=[];Ye-- >0;)Ze.push(0);return Ze}(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p<Math.max(d,f);p++){if(p<d){this.s[p]=0;for(var g=p;g<this.m;g++)this.s[p]=a.hypot(this.s[p],s[g][p]);if(this.s[p]!==0){s[p][p]<0&&(this.s[p]=-this.s[p]);for(var m=p;m<this.m;m++)s[m][p]/=this.s[p];s[p][p]+=1}this.s[p]=-this.s[p]}for(var v=p+1;v<this.n;v++){if(function(Ye,Ze){return Ye&&Ze}(p<d,this.s[p]!==0)){for(var y=0,b=p;b<this.m;b++)y+=s[b][p]*s[b][v];y=-y/s[p][p];for(var w=p;w<this.m;w++)s[w][v]+=y*s[w][p]}l[v]=s[p][v]}if(function(Ye,Ze){return Ze}(h,p<d))for(var T=p;T<this.m;T++)this.U[T][p]=s[T][p];if(p<f){l[p]=0;for(var E=p+1;E<this.n;E++)l[p]=a.hypot(l[p],l[E]);if(l[p]!==0){l[p+1]<0&&(l[p]=-l[p]);for(var k=p+1;k<this.n;k++)l[k]/=l[p];l[p+1]+=1}if(l[p]=-l[p],function(Ye,Ze){return Ye&&Ze}(p+1<this.m,l[p]!==0)){for(var S=p+1;S<this.m;S++)u[S]=0;for(var L=p+1;L<this.n;L++)for(var A=p+1;A<this.m;A++)u[A]+=l[L]*s[A][L];for(var R=p+1;R<this.n;R++)for(var C=-l[R]/l[p+1],I=p+1;I<this.m;I++)s[I][R]+=C*u[I]}for(var P=p+1;P<this.n;P++)this.V[P][p]=l[P]}}var _=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=s[d][d]),this.m<_&&(this.s[_-1]=0),f+1<_&&(l[f]=s[f][_-1]),l[_-1]=0;{for(var N=d;N<o;N++){for(var M=0;M<this.m;M++)this.U[M][N]=0;this.U[N][N]=1}for(var O=d-1;O>=0;O--)if(this.s[O]!==0){for(var D=O+1;D<o;D++){for(var B=0,z=O;z<this.m;z++)B+=this.U[z][O]*this.U[z][D];B=-B/this.U[O][O];for(var F=O;F<this.m;F++)this.U[F][D]+=B*this.U[F][O]}for(var G=O;G<this.m;G++)this.U[G][O]=-this.U[G][O];this.U[O][O]=1+this.U[O][O];for(var q=0;q<O-1;q++)this.U[q][O]=0}else{for(var Y=0;Y<this.m;Y++)this.U[Y][O]=0;this.U[O][O]=1}}for(var ee=this.n-1;ee>=0;ee--){if(function(Ye,Ze){return Ye&&Ze}(ee<f,l[ee]!==0))for(var Q=ee+1;Q<o;Q++){for(var oe=0,pe=ee+1;pe<this.n;pe++)oe+=this.V[pe][ee]*this.V[pe][Q];oe=-oe/this.V[ee+1][ee];for(var j=ee+1;j<this.n;j++)this.V[j][Q]+=oe*this.V[j][ee]}for(var W=0;W<this.n;W++)this.V[W][ee]=0;this.V[ee][ee]=1}for(var X=_-1,H=Math.pow(2,-52),K=Math.pow(2,-966);_>0;){var ne=void 0,Z=void 0;for(ne=_-2;ne>=-1&&ne!==-1;ne--)if(Math.abs(l[ne])<=K+H*(Math.abs(this.s[ne])+Math.abs(this.s[ne+1]))){l[ne]=0;break}if(ne===_-2)Z=4;else{var be=void 0;for(be=_-1;be>=ne&&be!==ne;be--){var ce=(be!==_?Math.abs(l[be]):0)+(be!==ne+1?Math.abs(l[be-1]):0);if(Math.abs(this.s[be])<=K+H*ce){this.s[be]=0;break}}be===ne?Z=3:be===_-1?Z=1:(Z=2,ne=be)}switch(ne++,Z){case 1:{var re=l[_-2];l[_-2]=0;for(var Ne=_-2;Ne>=ne;Ne--){var me=a.hypot(this.s[Ne],re),Ve=this.s[Ne]/me,Ue=re/me;this.s[Ne]=me,Ne!==ne&&(re=-Ue*l[Ne-1],l[Ne-1]=Ve*l[Ne-1]);for(var Fe=0;Fe<this.n;Fe++)me=Ve*this.V[Fe][Ne]+Ue*this.V[Fe][_-1],this.V[Fe][_-1]=-Ue*this.V[Fe][Ne]+Ve*this.V[Fe][_-1],this.V[Fe][Ne]=me}}break;case 2:{var _e=l[ne-1];l[ne-1]=0;for(var Oe=ne;Oe<_;Oe++){var Ce=a.hypot(this.s[Oe],_e),Le=this.s[Oe]/Ce,ze=_e/Ce;this.s[Oe]=Ce,_e=-ze*l[Oe],l[Oe]=Le*l[Oe];for(var ge=0;ge<this.m;ge++)Ce=Le*this.U[ge][Oe]+ze*this.U[ge][ne-1],this.U[ge][ne-1]=-ze*this.U[ge][Oe]+Le*this.U[ge][ne-1],this.U[ge][Oe]=Ce}}break;case 3:{var Me=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[_-1]),Math.abs(this.s[_-2])),Math.abs(l[_-2])),Math.abs(this.s[ne])),Math.abs(l[ne])),J=this.s[_-1]/Me,ue=this.s[_-2]/Me,$=l[_-2]/Me,se=this.s[ne]/Me,ae=l[ne]/Me,fe=((ue+J)*(ue-J)+$*$)/2,he=J*$*(J*$),Te=0;(function(Ye,Ze){return Ye||Ze})(fe!==0,he!==0)&&(Te=Math.sqrt(fe*fe+he),fe<0&&(Te=-Te),Te=he/(fe+Te));for(var Se=(se+J)*(se-J)+Te,Ee=se*ae,Ge=ne;Ge<_-1;Ge++){var Je=a.hypot(Se,Ee),He=Se/Je,Xe=Ee/Je;Ge!==ne&&(l[Ge-1]=Je),Se=He*this.s[Ge]+Xe*l[Ge],l[Ge]=He*l[Ge]-Xe*this.s[Ge],Ee=Xe*this.s[Ge+1],this.s[Ge+1]=He*this.s[Ge+1];for(var Ke=0;Ke<this.n;Ke++)Je=He*this.V[Ke][Ge]+Xe*this.V[Ke][Ge+1],this.V[Ke][Ge+1]=-Xe*this.V[Ke][Ge]+He*this.V[Ke][Ge+1],this.V[Ke][Ge]=Je;if(Je=a.hypot(Se,Ee),He=Se/Je,Xe=Ee/Je,this.s[Ge]=Je,Se=He*l[Ge]+Xe*this.s[Ge+1],this.s[Ge+1]=-Xe*l[Ge]+He*this.s[Ge+1],Ee=Xe*l[Ge+1],l[Ge+1]=He*l[Ge+1],Ge<this.m-1)for(var $e=0;$e<this.m;$e++)Je=He*this.U[$e][Ge]+Xe*this.U[$e][Ge+1],this.U[$e][Ge+1]=-Xe*this.U[$e][Ge]+He*this.U[$e][Ge+1],this.U[$e][Ge]=Je}l[_-2]=Se}break;case 4:{if(this.s[ne]<=0){this.s[ne]=this.s[ne]<0?-this.s[ne]:0;for(var je=0;je<=X;je++)this.V[je][ne]=-this.V[je][ne]}for(;ne<X&&!(this.s[ne]>=this.s[ne+1]);){var lt=this.s[ne];if(this.s[ne]=this.s[ne+1],this.s[ne+1]=lt,ne<this.n-1)for(var st=0;st<this.n;st++)lt=this.V[st][ne+1],this.V[st][ne+1]=this.V[st][ne],this.V[st][ne]=lt;if(ne<this.m-1)for(var qe=0;qe<this.m;qe++)lt=this.U[qe][ne+1],this.U[qe][ne+1]=this.U[qe][ne],this.U[qe][ne]=lt;ne++}_--}break}}var Et={U:this.U,V:this.V,S:this.s};return Et},a.hypot=function(s,o){var l=void 0;return Math.abs(s)>Math.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a},function(r,n,i){var a=function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}}();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var v=0;v<this.iMax;v++){this.tracebackGrid[v]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[v][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,v=this.grid[f][p-1]+this.gap_penalty,y=[g,m,v],b=this.arrayAllMaxIndexes(y);this.grid[f][p]=y[b[0]],this.tracebackGrid[f][p]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l}();r.exports=o},function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(4),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(5),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(25),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(6),a.LEdge=i(1),a.LGraphManager=i(7),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(27),a.Matrix=i(24),a.SVD=i(26),r.exports=a},function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a}])})}(Tv)),Tv.exports}var pNe=wv.exports,HN;function gNe(){return HN||(HN=1,function(t,e){(function(n,i){t.exports=i(fNe())})(pNe,function(r){return(()=>{var n={45:(o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h},806:(o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d},767:(o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},880:(o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},578:(o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d},765:(o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),v=u(902),y=u(551).FDLayoutConstants,b=u(551).LayoutConstants,w=u(551).Point,T=u(551).PointD,E=u(551).DimensionD,k=u(551).Layout,S=u(551).Integer,L=u(551).IGeometry,A=u(551).LGraph,R=u(551).Transform,C=u(551).LinkedList;function I(){h.call(this),this.toBeTiled={},this.constraints={}}I.prototype=Object.create(h.prototype);for(var P in h)I[P]=h[P];I.prototype.newGraphManager=function(){var _=new d(this);return this.graphManager=_,_},I.prototype.newGraph=function(_){return new f(null,this.graphManager,_)},I.prototype.newNode=function(_){return new p(this.graphManager,_)},I.prototype.newEdge=function(_){return new g(null,null,_)},I.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var _=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return _&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(B){return N.has(B)});this.graphManager.setAllNodesToApplyGravitation(M)}}else{var _=this.getFlatForest();if(_.length>0)this.positionNodesRadially(_);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),M=this.nodesWithGravity.filter(function(O){return N.has(O)});this.graphManager.setAllNodesToApplyGravitation(M),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(v.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var _=new Set(this.getAllNodes()),N=this.nodesWithGravity.filter(function(D){return _.has(D)});this.graphManager.setAllNodesToApplyGravitation(N),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var M=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var _=this.graphManager.getAllNodes(),N={},M=0;M<_.length;M++){var O=_[M].rect,D=_[M].id;N[D]={id:D,x:O.getCenterX(),y:O.getCenterY(),w:O.width,h:O.height}}return N},I.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var _=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{for(;!_;)_=this.tick();this.graphManager.updateBounds()}},I.prototype.moveNodes=function(){for(var _=this.getAllNodes(),N,M=0;M<_.length;M++)N=_[M],N.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var M=0;M<_.length;M++)N=_[M],N.move()},I.prototype.initConstraintVariables=function(){var _=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var N=this.graphManager.getAllNodes(),M=0;M<N.length;M++){var O=N[M];this.idToNodeMap.set(O.id,O)}var D=function j(W){for(var X=W.getChild().getNodes(),H,K=0,ne=0;ne<X.length;ne++)H=X[ne],H.getChild()==null?_.fixedNodeSet.has(H.id)&&(K+=100):K+=j(H);return K};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){_.fixedNodeSet.add(X.nodeId)});for(var N=this.graphManager.getAllNodes(),O,M=0;M<N.length;M++)if(O=N[M],O.getChild()!=null){var B=D(O);B>0&&(O.fixedNodeWeight=B)}}if(this.constraints.relativePlacementConstraint){var z=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(j){_.fixedNodesOnHorizontal.add(j),_.fixedNodesOnVertical.add(j)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var G=this.constraints.alignmentConstraint.vertical,M=0;M<G.length;M++)this.dummyToNodeForVerticalAlignment.set("dummy"+M,[]),G[M].forEach(function(W){z.set(W,"dummy"+M),_.dummyToNodeForVerticalAlignment.get("dummy"+M).push(W),_.fixedNodeSet.has(W)&&_.fixedNodesOnHorizontal.add("dummy"+M)});if(this.constraints.alignmentConstraint.horizontal)for(var q=this.constraints.alignmentConstraint.horizontal,M=0;M<q.length;M++)this.dummyToNodeForHorizontalAlignment.set("dummy"+M,[]),q[M].forEach(function(W){F.set(W,"dummy"+M),_.dummyToNodeForHorizontalAlignment.get("dummy"+M).push(W),_.fixedNodeSet.has(W)&&_.fixedNodesOnVertical.add("dummy"+M)})}if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(j){var W,X,H;for(H=j.length-1;H>=2*j.length/3;H--)W=Math.floor(Math.random()*(H+1)),X=j[H],j[H]=j[W],j[W]=X;return j},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(j){if(j.left){var W=z.has(j.left)?z.get(j.left):j.left,X=z.has(j.right)?z.get(j.right):j.right;_.nodesInRelativeHorizontal.includes(W)||(_.nodesInRelativeHorizontal.push(W),_.nodeToRelativeConstraintMapHorizontal.set(W,[]),_.dummyToNodeForVerticalAlignment.has(W)?_.nodeToTempPositionMapHorizontal.set(W,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(W)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(W,_.idToNodeMap.get(W).getCenterX())),_.nodesInRelativeHorizontal.includes(X)||(_.nodesInRelativeHorizontal.push(X),_.nodeToRelativeConstraintMapHorizontal.set(X,[]),_.dummyToNodeForVerticalAlignment.has(X)?_.nodeToTempPositionMapHorizontal.set(X,_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):_.nodeToTempPositionMapHorizontal.set(X,_.idToNodeMap.get(X).getCenterX())),_.nodeToRelativeConstraintMapHorizontal.get(W).push({right:X,gap:j.gap}),_.nodeToRelativeConstraintMapHorizontal.get(X).push({left:W,gap:j.gap})}else{var H=F.has(j.top)?F.get(j.top):j.top,K=F.has(j.bottom)?F.get(j.bottom):j.bottom;_.nodesInRelativeVertical.includes(H)||(_.nodesInRelativeVertical.push(H),_.nodeToRelativeConstraintMapVertical.set(H,[]),_.dummyToNodeForHorizontalAlignment.has(H)?_.nodeToTempPositionMapVertical.set(H,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(H)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(H,_.idToNodeMap.get(H).getCenterY())),_.nodesInRelativeVertical.includes(K)||(_.nodesInRelativeVertical.push(K),_.nodeToRelativeConstraintMapVertical.set(K,[]),_.dummyToNodeForHorizontalAlignment.has(K)?_.nodeToTempPositionMapVertical.set(K,_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):_.nodeToTempPositionMapVertical.set(K,_.idToNodeMap.get(K).getCenterY())),_.nodeToRelativeConstraintMapVertical.get(H).push({bottom:K,gap:j.gap}),_.nodeToRelativeConstraintMapVertical.get(K).push({top:H,gap:j.gap})}});else{var Y=new Map,ee=new Map;this.constraints.relativePlacementConstraint.forEach(function(j){if(j.left){var W=z.has(j.left)?z.get(j.left):j.left,X=z.has(j.right)?z.get(j.right):j.right;Y.has(W)?Y.get(W).push(X):Y.set(W,[X]),Y.has(X)?Y.get(X).push(W):Y.set(X,[W])}else{var H=F.has(j.top)?F.get(j.top):j.top,K=F.has(j.bottom)?F.get(j.bottom):j.bottom;ee.has(H)?ee.get(H).push(K):ee.set(H,[K]),ee.has(K)?ee.get(K).push(H):ee.set(K,[H])}});var Q=function(W,X){var H=[],K=[],ne=new C,Z=new Set,be=0;return W.forEach(function(ce,re){if(!Z.has(re)){H[be]=[],K[be]=!1;var Ne=re;for(ne.push(Ne),Z.add(Ne),H[be].push(Ne);ne.length!=0;){Ne=ne.shift(),X.has(Ne)&&(K[be]=!0);var me=W.get(Ne);me.forEach(function(Ve){Z.has(Ve)||(ne.push(Ve),Z.add(Ve),H[be].push(Ve))})}be++}}),{components:H,isFixed:K}},oe=Q(Y,_.fixedNodesOnHorizontal);this.componentsOnHorizontal=oe.components,this.fixedComponentsOnHorizontal=oe.isFixed;var pe=Q(ee,_.fixedNodesOnVertical);this.componentsOnVertical=pe.components,this.fixedComponentsOnVertical=pe.isFixed}}},I.prototype.updateDisplacements=function(){var _=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(pe){var j=_.idToNodeMap.get(pe.nodeId);j.displacementX=0,j.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var N=this.constraints.alignmentConstraint.vertical,M=0;M<N.length;M++){for(var O=0,D=0;D<N[M].length;D++){if(this.fixedNodeSet.has(N[M][D])){O=0;break}O+=this.idToNodeMap.get(N[M][D]).displacementX}for(var B=O/N[M].length,D=0;D<N[M].length;D++)this.idToNodeMap.get(N[M][D]).displacementX=B}if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,M=0;M<z.length;M++){for(var F=0,D=0;D<z[M].length;D++){if(this.fixedNodeSet.has(z[M][D])){F=0;break}F+=this.idToNodeMap.get(z[M][D]).displacementY}for(var G=F/z[M].length,D=0;D<z[M].length;D++)this.idToNodeMap.get(z[M][D]).displacementY=G}}if(this.constraints.relativePlacementConstraint)if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(pe){if(!_.fixedNodesOnHorizontal.has(pe)){var j=0;_.dummyToNodeForVerticalAlignment.has(pe)?j=_.idToNodeMap.get(_.dummyToNodeForVerticalAlignment.get(pe)[0]).displacementX:j=_.idToNodeMap.get(pe).displacementX,_.nodeToRelativeConstraintMapHorizontal.get(pe).forEach(function(W){if(W.right){var X=_.nodeToTempPositionMapHorizontal.get(W.right)-_.nodeToTempPositionMapHorizontal.get(pe)-j;X<W.gap&&(j-=W.gap-X)}else{var X=_.nodeToTempPositionMapHorizontal.get(pe)-_.nodeToTempPositionMapHorizontal.get(W.left)+j;X<W.gap&&(j+=W.gap-X)}}),_.nodeToTempPositionMapHorizontal.set(pe,_.nodeToTempPositionMapHorizontal.get(pe)+j),_.dummyToNodeForVerticalAlignment.has(pe)?_.dummyToNodeForVerticalAlignment.get(pe).forEach(function(W){_.idToNodeMap.get(W).displacementX=j}):_.idToNodeMap.get(pe).displacementX=j}}),this.nodesInRelativeVertical.forEach(function(pe){if(!_.fixedNodesOnHorizontal.has(pe)){var j=0;_.dummyToNodeForHorizontalAlignment.has(pe)?j=_.idToNodeMap.get(_.dummyToNodeForHorizontalAlignment.get(pe)[0]).displacementY:j=_.idToNodeMap.get(pe).displacementY,_.nodeToRelativeConstraintMapVertical.get(pe).forEach(function(W){if(W.bottom){var X=_.nodeToTempPositionMapVertical.get(W.bottom)-_.nodeToTempPositionMapVertical.get(pe)-j;X<W.gap&&(j-=W.gap-X)}else{var X=_.nodeToTempPositionMapVertical.get(pe)-_.nodeToTempPositionMapVertical.get(W.top)+j;X<W.gap&&(j+=W.gap-X)}}),_.nodeToTempPositionMapVertical.set(pe,_.nodeToTempPositionMapVertical.get(pe)+j),_.dummyToNodeForHorizontalAlignment.has(pe)?_.dummyToNodeForHorizontalAlignment.get(pe).forEach(function(W){_.idToNodeMap.get(W).displacementY=j}):_.idToNodeMap.get(pe).displacementY=j}});else{for(var M=0;M<this.componentsOnHorizontal.length;M++){var q=this.componentsOnHorizontal[M];if(this.fixedComponentsOnHorizontal[M])for(var D=0;D<q.length;D++)this.dummyToNodeForVerticalAlignment.has(q[D])?this.dummyToNodeForVerticalAlignment.get(q[D]).forEach(function(W){_.idToNodeMap.get(W).displacementX=0}):this.idToNodeMap.get(q[D]).displacementX=0;else{for(var Y=0,ee=0,D=0;D<q.length;D++)if(this.dummyToNodeForVerticalAlignment.has(q[D])){var Q=this.dummyToNodeForVerticalAlignment.get(q[D]);Y+=Q.length*this.idToNodeMap.get(Q[0]).displacementX,ee+=Q.length}else Y+=this.idToNodeMap.get(q[D]).displacementX,ee++;for(var oe=Y/ee,D=0;D<q.length;D++)this.dummyToNodeForVerticalAlignment.has(q[D])?this.dummyToNodeForVerticalAlignment.get(q[D]).forEach(function(W){_.idToNodeMap.get(W).displacementX=oe}):this.idToNodeMap.get(q[D]).displacementX=oe}}for(var M=0;M<this.componentsOnVertical.length;M++){var q=this.componentsOnVertical[M];if(this.fixedComponentsOnVertical[M])for(var D=0;D<q.length;D++)this.dummyToNodeForHorizontalAlignment.has(q[D])?this.dummyToNodeForHorizontalAlignment.get(q[D]).forEach(function(X){_.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(q[D]).displacementY=0;else{for(var Y=0,ee=0,D=0;D<q.length;D++)if(this.dummyToNodeForHorizontalAlignment.has(q[D])){var Q=this.dummyToNodeForHorizontalAlignment.get(q[D]);Y+=Q.length*this.idToNodeMap.get(Q[0]).displacementY,ee+=Q.length}else Y+=this.idToNodeMap.get(q[D]).displacementY,ee++;for(var oe=Y/ee,D=0;D<q.length;D++)this.dummyToNodeForHorizontalAlignment.has(q[D])?this.dummyToNodeForHorizontalAlignment.get(q[D]).forEach(function(ne){_.idToNodeMap.get(ne).displacementY=oe}):this.idToNodeMap.get(q[D]).displacementY=oe}}}},I.prototype.calculateNodesToApplyGravitationTo=function(){var _=[],N,M=this.graphManager.getGraphs(),O=M.length,D;for(D=0;D<O;D++)N=M[D],N.updateConnected(),N.isConnected||(_=_.concat(N.getNodes()));return _},I.prototype.createBendpoints=function(){var _=[];_=_.concat(this.graphManager.getAllEdges());var N=new Set,M;for(M=0;M<_.length;M++){var O=_[M];if(!N.has(O)){var D=O.getSource(),B=O.getTarget();if(D==B)O.getBendpoints().push(new T),O.getBendpoints().push(new T),this.createDummyNodesForBendpoints(O),N.add(O);else{var z=[];if(z=z.concat(D.getEdgeListToNode(B)),z=z.concat(B.getEdgeListToNode(D)),!N.has(z[0])){if(z.length>1){var F;for(F=0;F<z.length;F++){var G=z[F];G.getBendpoints().push(new T),this.createDummyNodesForBendpoints(G)}}z.forEach(function(q){N.add(q)})}}}if(N.size==_.length)break}},I.prototype.positionNodesRadially=function(_){for(var N=new w(0,0),M=Math.ceil(Math.sqrt(_.length)),O=0,D=0,B=0,z=new T(0,0),F=0;F<_.length;F++){F%M==0&&(B=0,D=O,F!=0&&(D+=m.DEFAULT_COMPONENT_SEPERATION),O=0);var G=_[F],q=k.findCenterOfTree(G);N.x=B,N.y=D,z=I.radialLayout(G,q,N),z.y>O&&(O=Math.floor(z.y)),B=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(b.WORLD_CENTER_X-z.x/2,b.WORLD_CENTER_Y-z.y/2))},I.radialLayout=function(_,N,M){var O=Math.max(this.maxDiagonalInTree(_),m.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(N,null,0,359,0,O);var D=A.calculateBounds(_),B=new R;B.setDeviceOrgX(D.getMinX()),B.setDeviceOrgY(D.getMinY()),B.setWorldOrgX(M.x),B.setWorldOrgY(M.y);for(var z=0;z<_.length;z++){var F=_[z];F.transform(B)}var G=new T(D.getMaxX(),D.getMaxY());return B.inverseTransformPoint(G)},I.branchRadialLayout=function(_,N,M,O,D,B){var z=(O-M+1)/2;z<0&&(z+=180);var F=(z+M)%360,G=F*L.TWO_PI/360,q=D*Math.cos(G),Y=D*Math.sin(G);_.setCenter(q,Y);var ee=[];ee=ee.concat(_.getEdges());var Q=ee.length;N!=null&&Q--;for(var oe=0,pe=ee.length,j,W=_.getEdgesBetween(N);W.length>1;){var X=W[0];W.splice(0,1);var H=ee.indexOf(X);H>=0&&ee.splice(H,1),pe--,Q--}N!=null?j=(ee.indexOf(W[0])+1)%pe:j=0;for(var K=Math.abs(O-M)/Q,ne=j;oe!=Q;ne=++ne%pe){var Z=ee[ne].getOtherEnd(_);if(Z!=N){var be=(M+oe*K)%360,ce=(be+K)%360;I.branchRadialLayout(Z,_,be,ce,D+B,B),oe++}}},I.maxDiagonalInTree=function(_){for(var N=S.MIN_VALUE,M=0;M<_.length;M++){var O=_[M],D=O.getDiagonal();D>N&&(N=D)}return N},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var _=this,N={};this.memberGroups={},this.idToDummyNode={};for(var M=[],O=this.graphManager.getAllNodes(),D=0;D<O.length;D++){var B=O[D],z=B.getParent();this.getNodeDegreeWithChildren(B)===0&&(z.id==null||!this.getToBeTiled(z))&&M.push(B)}for(var D=0;D<M.length;D++){var B=M[D],F=B.getParent().id;typeof N[F]>"u"&&(N[F]=[]),N[F]=N[F].concat(B)}Object.keys(N).forEach(function(G){if(N[G].length>1){var q="DummyCompound_"+G;_.memberGroups[q]=N[G];var Y=N[G][0].getParent(),ee=new p(_.graphManager);ee.id=q,ee.paddingLeft=Y.paddingLeft||0,ee.paddingRight=Y.paddingRight||0,ee.paddingBottom=Y.paddingBottom||0,ee.paddingTop=Y.paddingTop||0,_.idToDummyNode[q]=ee;var Q=_.getGraphManager().add(_.newGraph(),ee),oe=Y.getChild();oe.add(ee);for(var pe=0;pe<N[G].length;pe++){var j=N[G][pe];oe.remove(j),Q.add(j)}}})},I.prototype.clearCompounds=function(){var _={},N={};this.performDFSOnCompounds();for(var M=0;M<this.compoundOrder.length;M++)N[this.compoundOrder[M].id]=this.compoundOrder[M],_[this.compoundOrder[M].id]=[].concat(this.compoundOrder[M].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[M].getChild()),this.compoundOrder[M].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(_,N)},I.prototype.clearZeroDegreeMembers=function(){var _=this,N=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(M){var O=_.idToDummyNode[M];if(N[M]=_.tileNodes(_.memberGroups[M],O.paddingLeft+O.paddingRight),O.rect.width=N[M].width,O.rect.height=N[M].height,O.setCenter(N[M].centerX,N[M].centerY),O.labelMarginLeft=0,O.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var D=O.rect.width,B=O.rect.height;O.labelWidth&&(O.labelPosHorizontal=="left"?(O.rect.x-=O.labelWidth,O.setWidth(D+O.labelWidth),O.labelMarginLeft=O.labelWidth):O.labelPosHorizontal=="center"&&O.labelWidth>D?(O.rect.x-=(O.labelWidth-D)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-D)/2):O.labelPosHorizontal=="right"&&O.setWidth(D+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(B+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>B?(O.rect.y-=(O.labelHeight-B)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-B)/2):O.labelPosVertical=="bottom"&&O.setHeight(B+O.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var _=this.compoundOrder.length-1;_>=0;_--){var N=this.compoundOrder[_],M=N.id,O=N.paddingLeft,D=N.paddingTop,B=N.labelMarginLeft,z=N.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],N.rect.x,N.rect.y,O,D,B,z)}},I.prototype.repopulateZeroDegreeMembers=function(){var _=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(M){var O=_.idToDummyNode[M],D=O.paddingLeft,B=O.paddingTop,z=O.labelMarginLeft,F=O.labelMarginTop;_.adjustLocations(N[M],O.rect.x,O.rect.y,D,B,z,F)})},I.prototype.getToBeTiled=function(_){var N=_.id;if(this.toBeTiled[N]!=null)return this.toBeTiled[N];var M=_.getChild();if(M==null)return this.toBeTiled[N]=!1,!1;for(var O=M.getNodes(),D=0;D<O.length;D++){var B=O[D];if(this.getNodeDegree(B)>0)return this.toBeTiled[N]=!1,!1;if(B.getChild()==null){this.toBeTiled[B.id]=!1;continue}if(!this.getToBeTiled(B))return this.toBeTiled[N]=!1,!1}return this.toBeTiled[N]=!0,!0},I.prototype.getNodeDegree=function(_){_.id;for(var N=_.getEdges(),M=0,O=0;O<N.length;O++){var D=N[O];D.getSource().id!==D.getTarget().id&&(M=M+1)}return M},I.prototype.getNodeDegreeWithChildren=function(_){var N=this.getNodeDegree(_);if(_.getChild()==null)return N;for(var M=_.getChild().getNodes(),O=0;O<M.length;O++){var D=M[O];N+=this.getNodeDegreeWithChildren(D)}return N},I.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},I.prototype.fillCompexOrderByDFS=function(_){for(var N=0;N<_.length;N++){var M=_[N];M.getChild()!=null&&this.fillCompexOrderByDFS(M.getChild().getNodes()),this.getToBeTiled(M)&&this.compoundOrder.push(M)}},I.prototype.adjustLocations=function(_,N,M,O,D,B,z){N+=O+B,M+=D+z;for(var F=N,G=0;G<_.rows.length;G++){var q=_.rows[G];N=F;for(var Y=0,ee=0;ee<q.length;ee++){var Q=q[ee];Q.rect.x=N,Q.rect.y=M,N+=Q.rect.width+_.horizontalPadding,Q.rect.height>Y&&(Y=Q.rect.height)}M+=Y+_.verticalPadding}},I.prototype.tileCompoundMembers=function(_,N){var M=this;this.tiledMemberPack=[],Object.keys(_).forEach(function(O){var D=N[O];if(M.tiledMemberPack[O]=M.tileNodes(_[O],D.paddingLeft+D.paddingRight),D.rect.width=M.tiledMemberPack[O].width,D.rect.height=M.tiledMemberPack[O].height,D.setCenter(M.tiledMemberPack[O].centerX,M.tiledMemberPack[O].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var B=D.rect.width,z=D.rect.height;D.labelWidth&&(D.labelPosHorizontal=="left"?(D.rect.x-=D.labelWidth,D.setWidth(B+D.labelWidth),D.labelMarginLeft=D.labelWidth):D.labelPosHorizontal=="center"&&D.labelWidth>B?(D.rect.x-=(D.labelWidth-B)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-B)/2):D.labelPosHorizontal=="right"&&D.setWidth(B+D.labelWidth)),D.labelHeight&&(D.labelPosVertical=="top"?(D.rect.y-=D.labelHeight,D.setHeight(z+D.labelHeight),D.labelMarginTop=D.labelHeight):D.labelPosVertical=="center"&&D.labelHeight>z?(D.rect.y-=(D.labelHeight-z)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-z)/2):D.labelPosVertical=="bottom"&&D.setHeight(z+D.labelHeight))}})},I.prototype.tileNodes=function(_,N){var M=this.tileNodesByFavoringDim(_,N,!0),O=this.tileNodesByFavoringDim(_,N,!1),D=this.getOrgRatio(M),B=this.getOrgRatio(O),z;return B<D?z=O:z=M,z},I.prototype.getOrgRatio=function(_){var N=_.width,M=_.height,O=N/M;return O<1&&(O=1/O),O},I.prototype.calcIdealRowWidth=function(_,N){var M=m.TILING_PADDING_VERTICAL,O=m.TILING_PADDING_HORIZONTAL,D=_.length,B=0,z=0,F=0;_.forEach(function(pe){B+=pe.getWidth(),z+=pe.getHeight(),pe.getWidth()>F&&(F=pe.getWidth())});var G=B/D,q=z/D,Y=Math.pow(M-O,2)+4*(G+O)*(q+M)*D,ee=(O-M+Math.sqrt(Y))/(2*(G+O)),Q;N?(Q=Math.ceil(ee),Q==ee&&Q++):Q=Math.floor(ee);var oe=Q*(G+O)-O;return F>oe&&(oe=F),oe+=O*2,oe},I.prototype.tileNodesByFavoringDim=function(_,N,M){var O=m.TILING_PADDING_VERTICAL,D=m.TILING_PADDING_HORIZONTAL,B=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:O,horizontalPadding:D,centerX:0,centerY:0};B&&(z.idealRowWidth=this.calcIdealRowWidth(_,M));var F=function(j){return j.rect.width*j.rect.height},G=function(j,W){return F(W)-F(j)};_.sort(function(pe,j){var W=G;return z.idealRowWidth?(W=B,W(pe.id,j.id)):W(pe,j)});for(var q=0,Y=0,ee=0;ee<_.length;ee++){var Q=_[ee];q+=Q.getCenterX(),Y+=Q.getCenterY()}z.centerX=q/_.length,z.centerY=Y/_.length;for(var ee=0;ee<_.length;ee++){var Q=_[ee];if(z.rows.length==0)this.insertNodeToRow(z,Q,0,N);else if(this.canAddHorizontal(z,Q.rect.width,Q.rect.height)){var oe=z.rows.length-1;z.idealRowWidth||(oe=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Q,oe,N)}else this.insertNodeToRow(z,Q,z.rows.length,N);this.shiftToLastRow(z)}return z},I.prototype.insertNodeToRow=function(_,N,M,O){var D=O;if(M==_.rows.length){var B=[];_.rows.push(B),_.rowWidth.push(D),_.rowHeight.push(0)}var z=_.rowWidth[M]+N.rect.width;_.rows[M].length>0&&(z+=_.horizontalPadding),_.rowWidth[M]=z,_.width<z&&(_.width=z);var F=N.rect.height;M>0&&(F+=_.verticalPadding);var G=0;F>_.rowHeight[M]&&(G=_.rowHeight[M],_.rowHeight[M]=F,G=_.rowHeight[M]-G),_.height+=G,_.rows[M].push(N)},I.prototype.getShortestRowIndex=function(_){for(var N=-1,M=Number.MAX_VALUE,O=0;O<_.rows.length;O++)_.rowWidth[O]<M&&(N=O,M=_.rowWidth[O]);return N},I.prototype.getLongestRowIndex=function(_){for(var N=-1,M=Number.MIN_VALUE,O=0;O<_.rows.length;O++)_.rowWidth[O]>M&&(N=O,M=_.rowWidth[O]);return N},I.prototype.canAddHorizontal=function(_,N,M){if(_.idealRowWidth){var O=_.rows.length-1,D=_.rowWidth[O];return D+N+_.horizontalPadding<=_.idealRowWidth}var B=this.getShortestRowIndex(_);if(B<0)return!0;var z=_.rowWidth[B];if(z+_.horizontalPadding+N<=_.width)return!0;var F=0;_.rowHeight[B]<M&&B>0&&(F=M+_.verticalPadding-_.rowHeight[B]);var G;_.width-z>=N+_.horizontalPadding?G=(_.height+F)/(z+N+_.horizontalPadding):G=(_.height+F)/_.width,F=M+_.verticalPadding;var q;return _.width<N?q=(_.height+F)/N:q=(_.height+F)/_.width,q<1&&(q=1/q),G<1&&(G=1/G),G<q},I.prototype.shiftToLastRow=function(_){var N=this.getLongestRowIndex(_),M=_.rowWidth.length-1,O=_.rows[N],D=O[O.length-1],B=D.width+_.horizontalPadding;if(_.width-_.rowWidth[M]>B&&N!=M){O.splice(-1,1),_.rows[M].push(D),_.rowWidth[N]=_.rowWidth[N]-B,_.rowWidth[M]=_.rowWidth[M]+B,_.width=_.rowWidth[instance.getLongestRowIndex(_)];for(var z=Number.MIN_VALUE,F=0;F<O.length;F++)O[F].height>z&&(z=O[F].height);N>0&&(z+=_.verticalPadding);var G=_.rowHeight[N]+_.rowHeight[M];_.rowHeight[N]=z,_.rowHeight[M]<D.height+_.verticalPadding&&(_.rowHeight[M]=D.height+_.verticalPadding);var q=_.rowHeight[N]+_.rowHeight[M];_.height+=q-G,this.shiftToLastRow(_)}},I.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},I.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},I.prototype.reduceTrees=function(){for(var _=[],N=!0,M;N;){var O=this.graphManager.getAllNodes(),D=[];N=!1;for(var B=0;B<O.length;B++)if(M=O[B],M.getEdges().length==1&&!M.getEdges()[0].isInterGraph&&M.getChild()==null){if(m.PURE_INCREMENTAL){var z=M.getEdges()[0].getOtherEnd(M),F=new E(M.getCenterX()-z.getCenterX(),M.getCenterY()-z.getCenterY());D.push([M,M.getEdges()[0],M.getOwner(),F])}else D.push([M,M.getEdges()[0],M.getOwner()]);N=!0}if(N==!0){for(var G=[],q=0;q<D.length;q++)D[q][0].getEdges().length==1&&(G.push(D[q]),D[q][0].getOwner().remove(D[q][0]));_.push(G),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=_},I.prototype.growTree=function(_){for(var N=_.length,M=_[N-1],O,D=0;D<M.length;D++)O=M[D],this.findPlaceforPrunedNode(O),O[2].add(O[0]),O[2].add(O[1],O[1].source,O[1].target);_.splice(_.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},I.prototype.findPlaceforPrunedNode=function(_){var N,M,O=_[0];if(O==_[1].source?M=_[1].target:M=_[1].source,m.PURE_INCREMENTAL)O.setCenter(M.getCenterX()+_[3].getWidth(),M.getCenterY()+_[3].getHeight());else{var D=M.startX,B=M.finishX,z=M.startY,F=M.finishY,G=0,q=0,Y=0,ee=0,Q=[G,Y,q,ee];if(z>0)for(var oe=D;oe<=B;oe++)Q[0]+=this.grid[oe][z-1].length+this.grid[oe][z].length-1;if(B<this.grid.length-1)for(var oe=z;oe<=F;oe++)Q[1]+=this.grid[B+1][oe].length+this.grid[B][oe].length-1;if(F<this.grid[0].length-1)for(var oe=D;oe<=B;oe++)Q[2]+=this.grid[oe][F+1].length+this.grid[oe][F].length-1;if(D>0)for(var oe=z;oe<=F;oe++)Q[3]+=this.grid[D-1][oe].length+this.grid[D][oe].length-1;for(var pe=S.MAX_VALUE,j,W,X=0;X<Q.length;X++)Q[X]<pe?(pe=Q[X],j=1,W=X):Q[X]==pe&&j++;if(j==3&&pe==0)Q[0]==0&&Q[1]==0&&Q[2]==0?N=1:Q[0]==0&&Q[1]==0&&Q[3]==0?N=0:Q[0]==0&&Q[2]==0&&Q[3]==0?N=3:Q[1]==0&&Q[2]==0&&Q[3]==0&&(N=2);else if(j==2&&pe==0){var H=Math.floor(Math.random()*2);Q[0]==0&&Q[1]==0?H==0?N=0:N=1:Q[0]==0&&Q[2]==0?H==0?N=0:N=2:Q[0]==0&&Q[3]==0?H==0?N=0:N=3:Q[1]==0&&Q[2]==0?H==0?N=1:N=2:Q[1]==0&&Q[3]==0?H==0?N=1:N=3:H==0?N=2:N=3}else if(j==4&&pe==0){var H=Math.floor(Math.random()*4);N=H}else N=W;N==0?O.setCenter(M.getCenterX(),M.getCenterY()-M.getHeight()/2-y.DEFAULT_EDGE_LENGTH-O.getHeight()/2):N==1?O.setCenter(M.getCenterX()+M.getWidth()/2+y.DEFAULT_EDGE_LENGTH+O.getWidth()/2,M.getCenterY()):N==2?O.setCenter(M.getCenterX(),M.getCenterY()+M.getHeight()/2+y.DEFAULT_EDGE_LENGTH+O.getHeight()/2):O.setCenter(M.getCenterX()-M.getWidth()/2-y.DEFAULT_EDGE_LENGTH-O.getWidth()/2,M.getCenterY())}},o.exports=I},991:(o,l,u)=>{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,v,y){h.call(this,g,m,v,y)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var v=this.getChild().getNodes(),y,b=0;b<v.length;b++)y=v[b],y.getChild()==null?(y.displacementX+=g,y.displacementY+=m):y.propogateDisplacementToChildren(g,m)},f.prototype.move=function(){var g=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),g.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},f.prototype.setPred1=function(g){this.pred1=g},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(g){this.next=g},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(g){this.processed=g},f.prototype.isProcessed=function(){return processed},o.exports=f},902:(o,l,u)=>{function h(v){if(Array.isArray(v)){for(var y=0,b=Array(v.length);y<v.length;y++)b[y]=v[y];return b}else return Array.from(v)}var d=u(806),f=u(551).LinkedList,p=u(551).Matrix,g=u(551).SVD;function m(){}m.handleConstraints=function(v){var y={};y.fixedNodeConstraint=v.constraints.fixedNodeConstraint,y.alignmentConstraint=v.constraints.alignmentConstraint,y.relativePlacementConstraint=v.constraints.relativePlacementConstraint;for(var b=new Map,w=new Map,T=[],E=[],k=v.getAllNodes(),S=0,L=0;L<k.length;L++){var A=k[L];A.getChild()==null&&(w.set(A.id,S++),T.push(A.getCenterX()),E.push(A.getCenterY()),b.set(A.id,A))}y.relativePlacementConstraint&&y.relativePlacementConstraint.forEach(function(ue){!ue.gap&&ue.gap!=0&&(ue.left?ue.gap=d.DEFAULT_EDGE_LENGTH+b.get(ue.left).getWidth()/2+b.get(ue.right).getWidth()/2:ue.gap=d.DEFAULT_EDGE_LENGTH+b.get(ue.top).getHeight()/2+b.get(ue.bottom).getHeight()/2)});var R=function($,se){return{x:$.x-se.x,y:$.y-se.y}},C=function($){var se=0,ae=0;return $.forEach(function(fe){se+=T[w.get(fe)],ae+=E[w.get(fe)]}),{x:se/$.size,y:ae/$.size}},I=function($,se,ae,fe,he){function Te($e,je){var lt=new Set($e),st=!0,qe=!1,Et=void 0;try{for(var Ye=je[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;lt.add(ht)}}catch(ct){qe=!0,Et=ct}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}return lt}var Se=new Map;$.forEach(function($e,je){Se.set(je,0)}),$.forEach(function($e,je){$e.forEach(function(lt){Se.set(lt.id,Se.get(lt.id)+1)})});var Ee=new Map,Ge=new Map,Je=new f;Se.forEach(function($e,je){$e==0?(Je.push(je),ae||(se=="horizontal"?Ee.set(je,w.has(je)?T[w.get(je)]:fe.get(je)):Ee.set(je,w.has(je)?E[w.get(je)]:fe.get(je)))):Ee.set(je,Number.NEGATIVE_INFINITY),ae&&Ge.set(je,new Set([je]))}),ae&&he.forEach(function($e){var je=[];if($e.forEach(function(qe){ae.has(qe)&&je.push(qe)}),je.length>0){var lt=0;je.forEach(function(qe){se=="horizontal"?(Ee.set(qe,w.has(qe)?T[w.get(qe)]:fe.get(qe)),lt+=Ee.get(qe)):(Ee.set(qe,w.has(qe)?E[w.get(qe)]:fe.get(qe)),lt+=Ee.get(qe))}),lt=lt/je.length,$e.forEach(function(qe){ae.has(qe)||Ee.set(qe,lt)})}else{var st=0;$e.forEach(function(qe){se=="horizontal"?st+=w.has(qe)?T[w.get(qe)]:fe.get(qe):st+=w.has(qe)?E[w.get(qe)]:fe.get(qe)}),st=st/$e.length,$e.forEach(function(qe){Ee.set(qe,st)})}});for(var He=function(){var je=Je.shift(),lt=$.get(je);lt.forEach(function(st){if(Ee.get(st.id)<Ee.get(je)+st.gap)if(ae&&ae.has(st.id)){var qe=void 0;if(se=="horizontal"?qe=w.has(st.id)?T[w.get(st.id)]:fe.get(st.id):qe=w.has(st.id)?E[w.get(st.id)]:fe.get(st.id),Ee.set(st.id,qe),qe<Ee.get(je)+st.gap){var Et=Ee.get(je)+st.gap-qe;Ge.get(je).forEach(function(Ye){Ee.set(Ye,Ee.get(Ye)-Et)})}}else Ee.set(st.id,Ee.get(je)+st.gap);Se.set(st.id,Se.get(st.id)-1),Se.get(st.id)==0&&Je.push(st.id),ae&&Ge.set(st.id,Te(Ge.get(je),Ge.get(st.id)))})};Je.length!=0;)He();if(ae){var Xe=new Set;$.forEach(function($e,je){$e.length==0&&Xe.add(je)});var Ke=[];Ge.forEach(function($e,je){if(Xe.has(je)){var lt=!1,st=!0,qe=!1,Et=void 0;try{for(var Ye=$e[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;ae.has(ht)&&(lt=!0)}}catch(mt){qe=!0,Et=mt}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}if(!lt){var ct=!1,ut=void 0;Ke.forEach(function(mt,sr){mt.has([].concat(h($e))[0])&&(ct=!0,ut=sr)}),ct?$e.forEach(function(mt){Ke[ut].add(mt)}):Ke.push(new Set($e))}}}),Ke.forEach(function($e,je){var lt=Number.POSITIVE_INFINITY,st=Number.POSITIVE_INFINITY,qe=Number.NEGATIVE_INFINITY,Et=Number.NEGATIVE_INFINITY,Ye=!0,Ze=!1,ht=void 0;try{for(var ct=$e[Symbol.iterator](),ut;!(Ye=(ut=ct.next()).done);Ye=!0){var mt=ut.value,sr=void 0;se=="horizontal"?sr=w.has(mt)?T[w.get(mt)]:fe.get(mt):sr=w.has(mt)?E[w.get(mt)]:fe.get(mt);var Rt=Ee.get(mt);sr<lt&&(lt=sr),sr>qe&&(qe=sr),Rt<st&&(st=Rt),Rt>Et&&(Et=Rt)}}catch(Qe){Ze=!0,ht=Qe}finally{try{!Ye&&ct.return&&ct.return()}finally{if(Ze)throw ht}}var hr=(lt+qe)/2-(st+Et)/2,rr=!0,er=!1,Wt=void 0;try{for(var Xr=$e[Symbol.iterator](),pt;!(rr=(pt=Xr.next()).done);rr=!0){var ke=pt.value;Ee.set(ke,Ee.get(ke)+hr)}}catch(Qe){er=!0,Wt=Qe}finally{try{!rr&&Xr.return&&Xr.return()}finally{if(er)throw Wt}}})}return Ee},P=function($){var se=0,ae=0,fe=0,he=0;if($.forEach(function(Ge){Ge.left?T[w.get(Ge.left)]-T[w.get(Ge.right)]>=0?se++:ae++:E[w.get(Ge.top)]-E[w.get(Ge.bottom)]>=0?fe++:he++}),se>ae&&fe>he)for(var Te=0;Te<w.size;Te++)T[Te]=-1*T[Te],E[Te]=-1*E[Te];else if(se>ae)for(var Se=0;Se<w.size;Se++)T[Se]=-1*T[Se];else if(fe>he)for(var Ee=0;Ee<w.size;Ee++)E[Ee]=-1*E[Ee]},_=function($){var se=[],ae=new f,fe=new Set,he=0;return $.forEach(function(Te,Se){if(!fe.has(Se)){se[he]=[];var Ee=Se;for(ae.push(Ee),fe.add(Ee),se[he].push(Ee);ae.length!=0;){Ee=ae.shift();var Ge=$.get(Ee);Ge.forEach(function(Je){fe.has(Je.id)||(ae.push(Je.id),fe.add(Je.id),se[he].push(Je.id))})}he++}}),se},N=function($){var se=new Map;return $.forEach(function(ae,fe){se.set(fe,[])}),$.forEach(function(ae,fe){ae.forEach(function(he){se.get(fe).push(he),se.get(he.id).push({id:fe,gap:he.gap,direction:he.direction})})}),se},M=function($){var se=new Map;return $.forEach(function(ae,fe){se.set(fe,[])}),$.forEach(function(ae,fe){ae.forEach(function(he){se.get(he.id).push({id:fe,gap:he.gap,direction:he.direction})})}),se},O=[],D=[],B=!1,z=!1,F=new Set,G=new Map,q=new Map,Y=[];if(y.fixedNodeConstraint&&y.fixedNodeConstraint.forEach(function(ue){F.add(ue.nodeId)}),y.relativePlacementConstraint&&(y.relativePlacementConstraint.forEach(function(ue){ue.left?(G.has(ue.left)?G.get(ue.left).push({id:ue.right,gap:ue.gap,direction:"horizontal"}):G.set(ue.left,[{id:ue.right,gap:ue.gap,direction:"horizontal"}]),G.has(ue.right)||G.set(ue.right,[])):(G.has(ue.top)?G.get(ue.top).push({id:ue.bottom,gap:ue.gap,direction:"vertical"}):G.set(ue.top,[{id:ue.bottom,gap:ue.gap,direction:"vertical"}]),G.has(ue.bottom)||G.set(ue.bottom,[]))}),q=N(G),Y=_(q)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>1)y.fixedNodeConstraint.forEach(function(ue,$){O[$]=[ue.position.x,ue.position.y],D[$]=[T[w.get(ue.nodeId)],E[w.get(ue.nodeId)]]}),B=!0;else if(y.alignmentConstraint)(function(){var ue=0;if(y.alignmentConstraint.vertical){for(var $=y.alignmentConstraint.vertical,se=function(Ee){var Ge=new Set;$[Ee].forEach(function(Xe){Ge.add(Xe)});var Je=new Set([].concat(h(Ge)).filter(function(Xe){return F.has(Xe)})),He=void 0;Je.size>0?He=T[w.get(Je.values().next().value)]:He=C(Ge).x,$[Ee].forEach(function(Xe){O[ue]=[He,E[w.get(Xe)]],D[ue]=[T[w.get(Xe)],E[w.get(Xe)]],ue++})},ae=0;ae<$.length;ae++)se(ae);B=!0}if(y.alignmentConstraint.horizontal){for(var fe=y.alignmentConstraint.horizontal,he=function(Ee){var Ge=new Set;fe[Ee].forEach(function(Xe){Ge.add(Xe)});var Je=new Set([].concat(h(Ge)).filter(function(Xe){return F.has(Xe)})),He=void 0;Je.size>0?He=T[w.get(Je.values().next().value)]:He=C(Ge).y,fe[Ee].forEach(function(Xe){O[ue]=[T[w.get(Xe)],He],D[ue]=[T[w.get(Xe)],E[w.get(Xe)]],ue++})},Te=0;Te<fe.length;Te++)he(Te);B=!0}y.relativePlacementConstraint&&(z=!0)})();else if(y.relativePlacementConstraint){for(var ee=0,Q=0,oe=0;oe<Y.length;oe++)Y[oe].length>ee&&(ee=Y[oe].length,Q=oe);if(ee<q.size/2)P(y.relativePlacementConstraint),B=!1,z=!1;else{var pe=new Map,j=new Map,W=[];Y[Q].forEach(function(ue){G.get(ue).forEach(function($){$.direction=="horizontal"?(pe.has(ue)?pe.get(ue).push($):pe.set(ue,[$]),pe.has($.id)||pe.set($.id,[]),W.push({left:ue,right:$.id})):(j.has(ue)?j.get(ue).push($):j.set(ue,[$]),j.has($.id)||j.set($.id,[]),W.push({top:ue,bottom:$.id}))})}),P(W),z=!1;var X=I(pe,"horizontal"),H=I(j,"vertical");Y[Q].forEach(function(ue,$){D[$]=[T[w.get(ue)],E[w.get(ue)]],O[$]=[],X.has(ue)?O[$][0]=X.get(ue):O[$][0]=T[w.get(ue)],H.has(ue)?O[$][1]=H.get(ue):O[$][1]=E[w.get(ue)]}),B=!0}}if(B){for(var K=void 0,ne=p.transpose(O),Z=p.transpose(D),be=0;be<ne.length;be++)ne[be]=p.multGamma(ne[be]),Z[be]=p.multGamma(Z[be]);var ce=p.multMat(ne,p.transpose(Z)),re=g.svd(ce);K=p.multMat(re.V,p.transpose(re.U));for(var Ne=0;Ne<w.size;Ne++){var me=[T[Ne],E[Ne]],Ve=[K[0][0],K[1][0]],Ue=[K[0][1],K[1][1]];T[Ne]=p.dotProduct(me,Ve),E[Ne]=p.dotProduct(me,Ue)}z&&P(y.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(y.fixedNodeConstraint&&y.fixedNodeConstraint.length>0){var Fe={x:0,y:0};y.fixedNodeConstraint.forEach(function(ue,$){var se={x:T[w.get(ue.nodeId)],y:E[w.get(ue.nodeId)]},ae=ue.position,fe=R(ae,se);Fe.x+=fe.x,Fe.y+=fe.y}),Fe.x/=y.fixedNodeConstraint.length,Fe.y/=y.fixedNodeConstraint.length,T.forEach(function(ue,$){T[$]+=Fe.x}),E.forEach(function(ue,$){E[$]+=Fe.y}),y.fixedNodeConstraint.forEach(function(ue){T[w.get(ue.nodeId)]=ue.position.x,E[w.get(ue.nodeId)]=ue.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var _e=y.alignmentConstraint.vertical,Oe=function($){var se=new Set;_e[$].forEach(function(he){se.add(he)});var ae=new Set([].concat(h(se)).filter(function(he){return F.has(he)})),fe=void 0;ae.size>0?fe=T[w.get(ae.values().next().value)]:fe=C(se).x,se.forEach(function(he){F.has(he)||(T[w.get(he)]=fe)})},Ce=0;Ce<_e.length;Ce++)Oe(Ce);if(y.alignmentConstraint.horizontal)for(var Le=y.alignmentConstraint.horizontal,ze=function($){var se=new Set;Le[$].forEach(function(he){se.add(he)});var ae=new Set([].concat(h(se)).filter(function(he){return F.has(he)})),fe=void 0;ae.size>0?fe=E[w.get(ae.values().next().value)]:fe=C(se).y,se.forEach(function(he){F.has(he)||(E[w.get(he)]=fe)})},ge=0;ge<Le.length;ge++)ze(ge)}y.relativePlacementConstraint&&function(){var ue=new Map,$=new Map,se=new Map,ae=new Map,fe=new Map,he=new Map,Te=new Set,Se=new Set;if(F.forEach(function(bt){Te.add(bt),Se.add(bt)}),y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Ee=y.alignmentConstraint.vertical,Ge=function(ot){se.set("dummy"+ot,[]),Ee[ot].forEach(function(We){ue.set(We,"dummy"+ot),se.get("dummy"+ot).push(We),F.has(We)&&Te.add("dummy"+ot)}),fe.set("dummy"+ot,T[w.get(Ee[ot][0])])},Je=0;Je<Ee.length;Je++)Ge(Je);if(y.alignmentConstraint.horizontal)for(var He=y.alignmentConstraint.horizontal,Xe=function(ot){ae.set("dummy"+ot,[]),He[ot].forEach(function(We){$.set(We,"dummy"+ot),ae.get("dummy"+ot).push(We),F.has(We)&&Se.add("dummy"+ot)}),he.set("dummy"+ot,E[w.get(He[ot][0])])},Ke=0;Ke<He.length;Ke++)Xe(Ke)}var $e=new Map,je=new Map,lt=function(ot){G.get(ot).forEach(function(We){var ar=void 0,de=void 0;We.direction=="horizontal"?(ar=ue.get(ot)?ue.get(ot):ot,ue.get(We.id)?de={id:ue.get(We.id),gap:We.gap,direction:We.direction}:de=We,$e.has(ar)?$e.get(ar).push(de):$e.set(ar,[de]),$e.has(de.id)||$e.set(de.id,[])):(ar=$.get(ot)?$.get(ot):ot,$.get(We.id)?de={id:$.get(We.id),gap:We.gap,direction:We.direction}:de=We,je.has(ar)?je.get(ar).push(de):je.set(ar,[de]),je.has(de.id)||je.set(de.id,[]))})},st=!0,qe=!1,Et=void 0;try{for(var Ye=G.keys()[Symbol.iterator](),Ze;!(st=(Ze=Ye.next()).done);st=!0){var ht=Ze.value;lt(ht)}}catch(bt){qe=!0,Et=bt}finally{try{!st&&Ye.return&&Ye.return()}finally{if(qe)throw Et}}var ct=N($e),ut=N(je),mt=_(ct),sr=_(ut),Rt=M($e),hr=M(je),rr=[],er=[];mt.forEach(function(bt,ot){rr[ot]=[],bt.forEach(function(We){Rt.get(We).length==0&&rr[ot].push(We)})}),sr.forEach(function(bt,ot){er[ot]=[],bt.forEach(function(We){hr.get(We).length==0&&er[ot].push(We)})});var Wt=I($e,"horizontal",Te,fe,rr),Xr=I(je,"vertical",Se,he,er),pt=function(ot){se.get(ot)?se.get(ot).forEach(function(We){T[w.get(We)]=Wt.get(ot)}):T[w.get(ot)]=Wt.get(ot)},ke=!0,Qe=!1,xt=void 0;try{for(var tr=Wt.keys()[Symbol.iterator](),Mr;!(ke=(Mr=tr.next()).done);ke=!0){var Or=Mr.value;pt(Or)}}catch(bt){Qe=!0,xt=bt}finally{try{!ke&&tr.return&&tr.return()}finally{if(Qe)throw xt}}var Lr=function(ot){ae.get(ot)?ae.get(ot).forEach(function(We){E[w.get(We)]=Xr.get(ot)}):E[w.get(ot)]=Xr.get(ot)},Sn=!0,gi=!1,Li=void 0;try{for(var dr=Xr.keys()[Symbol.iterator](),At;!(Sn=(At=dr.next()).done);Sn=!0){var Or=At.value;Lr(Or)}}catch(bt){gi=!0,Li=bt}finally{try{!Sn&&dr.return&&dr.return()}finally{if(gi)throw Li}}}()}for(var Me=0;Me<k.length;Me++){var J=k[Me];J.getChild()==null&&J.setCenter(T[w.get(J.id)],E[w.get(J.id)])}},o.exports=m},551:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})}(wv)),wv.exports}var mNe=bv.exports,WN;function vNe(){return WN||(WN=1,function(t,e){(function(n,i){t.exports=i(gNe())})(mNe,function(r){return(()=>{var n={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return h.forEach(function(f){Object.keys(f).forEach(function(p){return l[p]=f[p]})}),l}},548:(o,l,u)=>{var h=function(){function p(g,m){var v=[],y=!0,b=!1,w=void 0;try{for(var T=g[Symbol.iterator](),E;!(y=(E=T.next()).done)&&(v.push(E.value),!(m&&v.length===m));y=!0);}catch(k){b=!0,w=k}finally{try{!y&&T.return&&T.return()}finally{if(b)throw w}}return v}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m<p.length;m++)g[p[m].id()]=!0;var v=p.filter(function(y,b){typeof y=="number"&&(y=b);for(var w=y.parent()[0];w!=null;){if(g[w.id()])return!1;w=w.parent()[0]}return!0});return v},f.connectComponents=function(p,g,m,v){var y=new d,b=new Set,w=[],T=void 0,E=void 0,k=void 0,S=!1,L=1,A=[],R=[],C=function(){var P=p.collection();R.push(P);var _=m[0],N=p.collection();N.merge(_).merge(_.descendants().intersection(g)),w.push(_),N.forEach(function(D){y.push(D),b.add(D),P.merge(D)});for(var M=function(){_=y.shift();var B=p.collection();_.neighborhood().nodes().forEach(function(q){g.intersection(_.edgesWith(q)).length>0&&B.merge(q)});for(var z=0;z<B.length;z++){var F=B[z];if(T=m.intersection(F.union(F.ancestors())),T!=null&&!b.has(T[0])){var G=T.union(T.descendants());G.forEach(function(q){y.push(q),b.add(q),P.merge(q),m.has(q)&&w.push(q)})}}};y.length!=0;)M();if(P.forEach(function(D){g.intersection(D.connectedEdges()).forEach(function(B){P.has(B.source())&&P.has(B.target())&&P.merge(B)})}),w.length==m.length&&(S=!0),!S||S&&L>1){E=w[0],k=E.connectedEdges().length,w.forEach(function(D){D.connectedEdges().length<k&&(k=D.connectedEdges().length,E=D)}),A.push(E.id());var O=p.collection();O.merge(w[0]),w.forEach(function(D){O.merge(D)}),w=[],m=m.difference(O),L++}};do C();while(!S);return v&&A.length>0&&v.set("dummy"+(v.size+1),A),R},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var T=!0,E=!1,k=void 0;try{for(var S=g.nodeIndexes[Symbol.iterator](),L;!(T=(L=S.next()).done);T=!0){var A=L.value,R=h(A,2),C=R[0],I=R[1],P=m.cy.getElementById(C);if(P){var _=P.boundingBox(),N=g.xCoords[I]-_.w/2,M=g.xCoords[I]+_.w/2,O=g.yCoords[I]-_.h/2,D=g.yCoords[I]+_.h/2;N<v&&(v=N),M>y&&(y=M),O<b&&(b=O),D>w&&(w=D)}}}catch(q){E=!0,k=q}finally{try{!T&&S.return&&S.return()}finally{if(E)throw k}}var B=p.x-(y+v)/2,z=p.y-(w+b)/2;g.xCoords=g.xCoords.map(function(q){return q+B}),g.yCoords=g.yCoords.map(function(q){return q+z})}else{Object.keys(g).forEach(function(q){var Y=g[q],ee=Y.getRect().x,Q=Y.getRect().x+Y.getRect().width,oe=Y.getRect().y,pe=Y.getRect().y+Y.getRect().height;ee<v&&(v=ee),Q>y&&(y=Q),oe<b&&(b=oe),pe>w&&(w=pe)});var F=p.x-(y+v)/2,G=p.y-(w+b)/2;Object.keys(g).forEach(function(q){var Y=g[q];Y.setCenter(Y.getCenterX()+F,Y.getCenterY()+G)})}}},f.calcBoundingBox=function(p,g,m,v){for(var y=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,w=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,E=void 0,k=void 0,S=void 0,L=void 0,A=p.descendants().not(":parent"),R=A.length,C=0;C<R;C++){var I=A[C];E=g[v.get(I.id())]-I.width()/2,k=g[v.get(I.id())]+I.width()/2,S=m[v.get(I.id())]-I.height()/2,L=m[v.get(I.id())]+I.height()/2,y>E&&(y=E),b<k&&(b=k),w>S&&(w=S),T<L&&(T=L)}var P={};return P.topLeftX=y,P.topLeftY=w,P.width=b-y,P.height=T-w,P},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(v){var y=!1;v.children().forEach(function(b){b.css("display")!="none"&&(y=!0)}),y||m.merge(v)}),m},o.exports=f},816:(o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,v=u(140).layoutBase.FDLayoutConstants,y=u(140).CoSEConstants,b=function(T,E){var k=T.cy,S=T.eles,L=S.nodes(),A=S.edges(),R=void 0,C=void 0,I=void 0,P={};T.randomize&&(R=E.nodeIndexes,C=E.xCoords,I=E.yCoords);var _=function(q){return typeof q=="function"},N=function(q,Y){return _(q)?q(Y):q},M=h.calcParentsWithoutChildren(k,S),O=function G(q,Y,ee,Q){for(var oe=Y.length,pe=0;pe<oe;pe++){var j=Y[pe],W=null;j.intersection(M).length==0&&(W=j.children());var X=void 0,H=j.layoutDimensions({nodeDimensionsIncludeLabels:Q.nodeDimensionsIncludeLabels});if(j.outerWidth()!=null&&j.outerHeight()!=null)if(Q.randomize)if(!j.isParent())X=q.add(new f(ee.graphManager,new p(C[R.get(j.id())]-H.w/2,I[R.get(j.id())]-H.h/2),new g(parseFloat(H.w),parseFloat(H.h))));else{var K=h.calcBoundingBox(j,C,I,R);j.intersection(M).length==0?X=q.add(new f(ee.graphManager,new p(K.topLeftX,K.topLeftY),new g(K.width,K.height))):X=q.add(new f(ee.graphManager,new p(K.topLeftX,K.topLeftY),new g(parseFloat(H.w),parseFloat(H.h))))}else X=q.add(new f(ee.graphManager,new p(j.position("x")-H.w/2,j.position("y")-H.h/2),new g(parseFloat(H.w),parseFloat(H.h))));else X=q.add(new f(this.graphManager));if(X.id=j.data("id"),X.nodeRepulsion=N(Q.nodeRepulsion,j),X.paddingLeft=parseInt(j.css("padding")),X.paddingTop=parseInt(j.css("padding")),X.paddingRight=parseInt(j.css("padding")),X.paddingBottom=parseInt(j.css("padding")),Q.nodeDimensionsIncludeLabels&&(X.labelWidth=j.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=j.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=j.css("text-valign"),X.labelPosHorizontal=j.css("text-halign")),P[j.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),W!=null&&W.length>0){var ne=void 0;ne=ee.getGraphManager().add(ee.newGraph(),X),G(ne,W,ee,Q)}}},D=function(q,Y,ee){for(var Q=0,oe=0,pe=0;pe<ee.length;pe++){var j=ee[pe],W=P[j.data("source")],X=P[j.data("target")];if(W&&X&&W!==X&&W.getEdgesBetween(X).length==0){var H=Y.add(q.newEdge(),W,X);H.id=j.id(),H.idealLength=N(T.idealEdgeLength,j),H.edgeElasticity=N(T.edgeElasticity,j),Q+=H.idealLength,oe++}}T.idealEdgeLength!=null&&(oe>0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=Q/oe:_(T.idealEdgeLength)?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=50:y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=T.idealEdgeLength,y.MIN_REPULSION_DIST=v.MIN_REPULSION_DIST=v.DEFAULT_EDGE_LENGTH/10,y.DEFAULT_RADIAL_SEPARATION=v.DEFAULT_EDGE_LENGTH)},B=function(q,Y){Y.fixedNodeConstraint&&(q.constraints.fixedNodeConstraint=Y.fixedNodeConstraint),Y.alignmentConstraint&&(q.constraints.alignmentConstraint=Y.alignmentConstraint),Y.relativePlacementConstraint&&(q.constraints.relativePlacementConstraint=Y.relativePlacementConstraint)};T.nestingFactor!=null&&(y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor),T.gravity!=null&&(y.DEFAULT_GRAVITY_STRENGTH=v.DEFAULT_GRAVITY_STRENGTH=T.gravity),T.numIter!=null&&(y.MAX_ITERATIONS=v.MAX_ITERATIONS=T.numIter),T.gravityRange!=null&&(y.DEFAULT_GRAVITY_RANGE_FACTOR=v.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange),T.gravityCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound),T.gravityRangeCompound!=null&&(y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound),T.initialEnergyOnIncremental!=null&&(y.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental),T.tilingCompareBy!=null&&(y.TILING_COMPARE_BY=T.tilingCompareBy),T.quality=="proof"?m.QUALITY=2:m.QUALITY=0,y.NODE_DIMENSIONS_INCLUDE_LABELS=v.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!T.randomize,y.ANIMATE=v.ANIMATE=m.ANIMATE=T.animate,y.TILE=T.tile,y.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical=="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,y.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal=="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,y.DEFAULT_INCREMENTAL=v.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,y.PURE_INCREMENTAL=!T.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!1),T.step=="enforced"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!1),T.step=="cose"&&(y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!1,y.APPLY_LAYOUT=!0),T.step=="all"&&(T.randomize?y.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:y.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,y.ENFORCE_CONSTRAINTS=!0,y.APPLY_LAYOUT=!0),T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint?y.TREE_REDUCTION_ON_INCREMENTAL=!1:y.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,F=z.newGraphManager();return O(F.addRoot(),h.getTopMostNodes(L),z,T),D(z,F,A),B(z,T),z.runLayout(),P};o.exports={coseLayout:b}},212:(o,l,u)=>{var h=function(){function T(E,k){for(var S=0;S<k.length;S++){var L=k[S];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,L.key,L)}}return function(E,k,S){return k&&T(E.prototype,k),S&&T(E,S),E}}();function d(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}var f=u(658),p=u(548),g=u(657),m=g.spectralLayout,v=u(816),y=v.coseLayout,b=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:function(E){return 4500},idealEdgeLength:function(E){return 50},edgeElasticity:function(E){return .45},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:function(){},stop:function(){}}),w=function(){function T(E){d(this,T),this.options=f({},b,E)}return h(T,[{key:"run",value:function(){var k=this,S=this.options,L=S.cy,A=S.eles,R=[],C=[],I=void 0,P=[];S.fixedNodeConstraint&&(!Array.isArray(S.fixedNodeConstraint)||S.fixedNodeConstraint.length==0)&&(S.fixedNodeConstraint=void 0),S.alignmentConstraint&&(S.alignmentConstraint.vertical&&(!Array.isArray(S.alignmentConstraint.vertical)||S.alignmentConstraint.vertical.length==0)&&(S.alignmentConstraint.vertical=void 0),S.alignmentConstraint.horizontal&&(!Array.isArray(S.alignmentConstraint.horizontal)||S.alignmentConstraint.horizontal.length==0)&&(S.alignmentConstraint.horizontal=void 0)),S.relativePlacementConstraint&&(!Array.isArray(S.relativePlacementConstraint)||S.relativePlacementConstraint.length==0)&&(S.relativePlacementConstraint=void 0);var _=S.fixedNodeConstraint||S.alignmentConstraint||S.relativePlacementConstraint;_&&(S.tile=!1,S.packComponents=!1);var N=void 0,M=!1;if(L.layoutUtilities&&S.packComponents&&(N=L.layoutUtilities("get"),N||(N=L.layoutUtilities()),M=!0),A.nodes().length>0)if(M){var B=p.getTopMostNodes(S.eles.nodes());if(I=p.connectComponents(L,S.eles,B),I.forEach(function(ce){var re=ce.boundingBox();P.push({x:re.x1+re.w/2,y:re.y1+re.h/2})}),S.randomize&&I.forEach(function(ce){S.eles=ce,R.push(m(S))}),S.quality=="default"||S.quality=="proof"){var z=L.collection();if(S.tile){var F=new Map,G=[],q=[],Y=0,ee={nodeIndexes:F,xCoords:G,yCoords:q},Q=[];if(I.forEach(function(ce,re){ce.edges().length==0&&(ce.nodes().forEach(function(Ne,me){z.merge(ce.nodes()[me]),Ne.isParent()||(ee.nodeIndexes.set(ce.nodes()[me].id(),Y++),ee.xCoords.push(ce.nodes()[0].position().x),ee.yCoords.push(ce.nodes()[0].position().y))}),Q.push(re))}),z.length>1){var oe=z.boundingBox();P.push({x:oe.x1+oe.w/2,y:oe.y1+oe.h/2}),I.push(z),R.push(ee);for(var pe=Q.length-1;pe>=0;pe--)I.splice(Q[pe],1),R.splice(Q[pe],1),P.splice(Q[pe],1)}}I.forEach(function(ce,re){S.eles=ce,C.push(y(S,R[re])),p.relocateComponent(P[re],C[re],S)})}else I.forEach(function(ce,re){p.relocateComponent(P[re],R[re],S)});var j=new Set;if(I.length>1){var W=[],X=A.filter(function(ce){return ce.css("display")=="none"});I.forEach(function(ce,re){var Ne=void 0;if(S.quality=="draft"&&(Ne=R[re].nodeIndexes),ce.nodes().not(X).length>0){var me={};me.edges=[],me.nodes=[];var Ve=void 0;ce.nodes().not(X).forEach(function(Ue){if(S.quality=="draft")if(!Ue.isParent())Ve=Ne.get(Ue.id()),me.nodes.push({x:R[re].xCoords[Ve]-Ue.boundingbox().w/2,y:R[re].yCoords[Ve]-Ue.boundingbox().h/2,width:Ue.boundingbox().w,height:Ue.boundingbox().h});else{var Fe=p.calcBoundingBox(Ue,R[re].xCoords,R[re].yCoords,Ne);me.nodes.push({x:Fe.topLeftX,y:Fe.topLeftY,width:Fe.width,height:Fe.height})}else C[re][Ue.id()]&&me.nodes.push({x:C[re][Ue.id()].getLeft(),y:C[re][Ue.id()].getTop(),width:C[re][Ue.id()].getWidth(),height:C[re][Ue.id()].getHeight()})}),ce.edges().forEach(function(Ue){var Fe=Ue.source(),_e=Ue.target();if(Fe.css("display")!="none"&&_e.css("display")!="none")if(S.quality=="draft"){var Oe=Ne.get(Fe.id()),Ce=Ne.get(_e.id()),Le=[],ze=[];if(Fe.isParent()){var ge=p.calcBoundingBox(Fe,R[re].xCoords,R[re].yCoords,Ne);Le.push(ge.topLeftX+ge.width/2),Le.push(ge.topLeftY+ge.height/2)}else Le.push(R[re].xCoords[Oe]),Le.push(R[re].yCoords[Oe]);if(_e.isParent()){var Me=p.calcBoundingBox(_e,R[re].xCoords,R[re].yCoords,Ne);ze.push(Me.topLeftX+Me.width/2),ze.push(Me.topLeftY+Me.height/2)}else ze.push(R[re].xCoords[Ce]),ze.push(R[re].yCoords[Ce]);me.edges.push({startX:Le[0],startY:Le[1],endX:ze[0],endY:ze[1]})}else C[re][Fe.id()]&&C[re][_e.id()]&&me.edges.push({startX:C[re][Fe.id()].getCenterX(),startY:C[re][Fe.id()].getCenterY(),endX:C[re][_e.id()].getCenterX(),endY:C[re][_e.id()].getCenterY()})}),me.nodes.length>0&&(W.push(me),j.add(re))}});var H=N.packComponents(W,S.randomize).shifts;if(S.quality=="draft")R.forEach(function(ce,re){var Ne=ce.xCoords.map(function(Ve){return Ve+H[re].dx}),me=ce.yCoords.map(function(Ve){return Ve+H[re].dy});ce.xCoords=Ne,ce.yCoords=me});else{var K=0;j.forEach(function(ce){Object.keys(C[ce]).forEach(function(re){var Ne=C[ce][re];Ne.setCenter(Ne.getCenterX()+H[K].dx,Ne.getCenterY()+H[K].dy)}),K++})}}}else{var O=S.eles.boundingBox();if(P.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),S.randomize){var D=m(S);R.push(D)}S.quality=="default"||S.quality=="proof"?(C.push(y(S,R[0])),p.relocateComponent(P[0],C[0],S)):p.relocateComponent(P[0],R[0],S)}var ne=function(re,Ne){if(S.quality=="default"||S.quality=="proof"){typeof re=="number"&&(re=Ne);var me=void 0,Ve=void 0,Ue=re.data("id");return C.forEach(function(_e){Ue in _e&&(me={x:_e[Ue].getRect().getCenterX(),y:_e[Ue].getRect().getCenterY()},Ve=_e[Ue])}),S.nodeDimensionsIncludeLabels&&(Ve.labelWidth&&(Ve.labelPosHorizontal=="left"?me.x+=Ve.labelWidth/2:Ve.labelPosHorizontal=="right"&&(me.x-=Ve.labelWidth/2)),Ve.labelHeight&&(Ve.labelPosVertical=="top"?me.y+=Ve.labelHeight/2:Ve.labelPosVertical=="bottom"&&(me.y-=Ve.labelHeight/2))),me==null&&(me={x:re.position("x"),y:re.position("y")}),{x:me.x,y:me.y}}else{var Fe=void 0;return R.forEach(function(_e){var Oe=_e.nodeIndexes.get(re.id());Oe!=null&&(Fe={x:_e.xCoords[Oe],y:_e.yCoords[Oe]})}),Fe==null&&(Fe={x:re.position("x"),y:re.position("y")}),{x:Fe.x,y:Fe.y}}};if(S.quality=="default"||S.quality=="proof"||S.randomize){var Z=p.calcParentsWithoutChildren(L,A),be=A.filter(function(ce){return ce.css("display")=="none"});S.eles=A.not(be),A.nodes().not(":parent").not(be).layoutPositions(k,S,ne),Z.length>0&&Z.forEach(function(ce){ce.position(ne(ce))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),T}();o.exports=w},657:(o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var v=m.cy,y=m.eles,b=y.nodes(),w=y.nodes(":parent"),T=new Map,E=new Map,k=new Map,S=[],L=[],A=[],R=[],C=[],I=[],P=[],_=[],N=void 0,M=1e8,O=1e-9,D=m.piTol,B=m.samplingType,z=m.nodeSeparation,F=void 0,G=function(){for(var $=0,se=0,ae=!1;se<F;){$=Math.floor(Math.random()*N),ae=!1;for(var fe=0;fe<se;fe++)if(R[fe]==$){ae=!0;break}if(!ae)R[se]=$,se++;else continue}},q=function($,se,ae){for(var fe=[],he=0,Te=0,Se=0,Ee=void 0,Ge=[],Je=0,He=1,Xe=0;Xe<N;Xe++)Ge[Xe]=M;for(fe[Te]=$,Ge[$]=0;Te>=he;){Se=fe[he++];for(var Ke=S[Se],$e=0;$e<Ke.length;$e++)Ee=E.get(Ke[$e]),Ge[Ee]==M&&(Ge[Ee]=Ge[Se]+1,fe[++Te]=Ee);I[Se][se]=Ge[Se]*z}if(ae){for(var je=0;je<N;je++)I[je][se]<C[je]&&(C[je]=I[je][se]);for(var lt=0;lt<N;lt++)C[lt]>Je&&(Je=C[lt],He=lt)}return He},Y=function($){var se=void 0;if($){se=Math.floor(Math.random()*N);for(var fe=0;fe<N;fe++)C[fe]=M;for(var he=0;he<F;he++)R[he]=se,se=q(se,he,$)}else{G();for(var ae=0;ae<F;ae++)q(R[ae],ae,$)}for(var Te=0;Te<N;Te++)for(var Se=0;Se<F;Se++)I[Te][Se]*=I[Te][Se];for(var Ee=0;Ee<F;Ee++)P[Ee]=[];for(var Ge=0;Ge<F;Ge++)for(var Je=0;Je<F;Je++)P[Ge][Je]=I[R[Je]][Ge]},ee=function(){for(var $=f.svd(P),se=$.S,ae=$.U,fe=$.V,he=se[0]*se[0]*se[0],Te=[],Se=0;Se<F;Se++){Te[Se]=[];for(var Ee=0;Ee<F;Ee++)Te[Se][Ee]=0,Se==Ee&&(Te[Se][Ee]=se[Se]/(se[Se]*se[Se]+he/(se[Se]*se[Se])))}_=d.multMat(d.multMat(fe,Te),d.transpose(ae))},Q=function(){for(var $=void 0,se=void 0,ae=[],fe=[],he=[],Te=[],Se=0;Se<N;Se++)ae[Se]=Math.random(),fe[Se]=Math.random();ae=d.normalize(ae),fe=d.normalize(fe);for(var Ee=O,Ge=O,Je=void 0;;){for(var He=0;He<N;He++)he[He]=ae[He];if(ae=d.multGamma(d.multL(d.multGamma(he),I,_)),$=d.dotProduct(he,ae),ae=d.normalize(ae),Ee=d.dotProduct(he,ae),Je=Math.abs(Ee/Ge),Je<=1+D&&Je>=1)break;Ge=Ee}for(var Xe=0;Xe<N;Xe++)he[Xe]=ae[Xe];for(Ge=O;;){for(var Ke=0;Ke<N;Ke++)Te[Ke]=fe[Ke];if(Te=d.minusOp(Te,d.multCons(he,d.dotProduct(he,Te))),fe=d.multGamma(d.multL(d.multGamma(Te),I,_)),se=d.dotProduct(Te,fe),fe=d.normalize(fe),Ee=d.dotProduct(Te,fe),Je=Math.abs(Ee/Ge),Je<=1+D&&Je>=1)break;Ge=Ee}for(var $e=0;$e<N;$e++)Te[$e]=fe[$e];L=d.multCons(he,Math.sqrt(Math.abs($))),A=d.multCons(Te,Math.sqrt(Math.abs(se)))};h.connectComponents(v,y,h.getTopMostNodes(b),T),w.forEach(function(ue){h.connectComponents(v,y,h.getTopMostNodes(ue.descendants().intersection(y)),T)});for(var oe=0,pe=0;pe<b.length;pe++)b[pe].isParent()||E.set(b[pe].id(),oe++);var j=!0,W=!1,X=void 0;try{for(var H=T.keys()[Symbol.iterator](),K;!(j=(K=H.next()).done);j=!0){var ne=K.value;E.set(ne,oe++)}}catch(ue){W=!0,X=ue}finally{try{!j&&H.return&&H.return()}finally{if(W)throw X}}for(var Z=0;Z<E.size;Z++)S[Z]=[];w.forEach(function(ue){for(var $=ue.children().intersection(y);$.nodes(":childless").length==0;)$=$.nodes()[0].children().intersection(y);var se=0,ae=$.nodes(":childless")[0].connectedEdges().length;$.nodes(":childless").forEach(function(fe,he){fe.connectedEdges().length<ae&&(ae=fe.connectedEdges().length,se=he)}),k.set(ue.id(),$.nodes(":childless")[se].id())}),b.forEach(function(ue){var $=void 0;ue.isParent()?$=E.get(k.get(ue.id())):$=E.get(ue.id()),ue.neighborhood().nodes().forEach(function(se){y.intersection(ue.edgesWith(se)).length>0&&(se.isParent()?S[$].push(k.get(se.id())):S[$].push(se.id()))})});var be=function($){var se=E.get($),ae=void 0;T.get($).forEach(function(fe){v.getElementById(fe).isParent()?ae=k.get(fe):ae=fe,S[se].push(ae),S[E.get(ae)].push($)})},ce=!0,re=!1,Ne=void 0;try{for(var me=T.keys()[Symbol.iterator](),Ve;!(ce=(Ve=me.next()).done);ce=!0){var Ue=Ve.value;be(Ue)}}catch(ue){re=!0,Ne=ue}finally{try{!ce&&me.return&&me.return()}finally{if(re)throw Ne}}N=E.size;var Fe=void 0;if(N>2){F=N<m.sampleSize?N:m.sampleSize;for(var _e=0;_e<N;_e++)I[_e]=[];for(var Oe=0;Oe<F;Oe++)_[Oe]=[];return m.quality=="draft"||m.step=="all"?(Y(B),ee(),Q(),Fe={nodeIndexes:E,xCoords:L,yCoords:A}):(E.forEach(function(ue,$){L.push(v.getElementById($).position("x")),A.push(v.getElementById($).position("y"))}),Fe={nodeIndexes:E,xCoords:L,yCoords:A}),Fe}else{var Ce=E.keys(),Le=v.getElementById(Ce.next().value),ze=Le.position(),ge=Le.outerWidth();if(L.push(ze.x),A.push(ze.y),N==2){var Me=v.getElementById(Ce.next().value),J=Me.outerWidth();L.push(ze.x+ge/2+J/2+m.idealEdgeLength),A.push(ze.y)}return Fe={nodeIndexes:E,xCoords:L,yCoords:A},Fe}};o.exports={spectralLayout:p}},579:(o,l,u)=>{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d},140:o=>{o.exports=r}},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})}(bv)),bv.exports}var yNe=vNe();const xNe=nf(yNe);var YN={L:"left",R:"right",T:"top",B:"bottom"},XN={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},fm={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},bNe=x(function(t){return Mi(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),jN=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Mi=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Xl=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),r7=x(function(t,e){const r=Mi(t)&&Xl(e),n=Xl(t)&&Mi(e);return r||n},"isArchitectureDirectionXY"),wNe=x(function(t){const e=t[0],r=t[1],n=Mi(e)&&Xl(r),i=Xl(e)&&Mi(r);return n||i},"isArchitecturePairXY"),TNe=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),y6=x(function(t,e){const r=`${t}${e}`;return TNe(r)?r:void 0},"getArchitectureDirectionPair"),ENe=x(function([t,e],r){const n=r[0],i=r[1];return Mi(n)?Xl(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Mi(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),SNe=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),kNe=x(function(t,e){return r7(t,e)?"bend":Mi(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),CNe=x(function(t){return t.type==="service"},"isArchitectureService"),ANe=x(function(t){return t.type==="junction"},"isArchitectureJunction"),dY=x(t=>t.data(),"edgeData"),gh=x(t=>t.data(),"nodeData"),fY=fr.architecture,Qt=new xS(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:fY,dataStructures:void 0,elements:{}})),_Ne=x(()=>{Qt.reset(),Vn()},"clear"),LNe=x(function({id:t,icon:e,in:r,title:n,iconText:i}){if(Qt.records.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${Qt.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(Qt.records.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(Qt.records.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}Qt.records.registeredIds[t]="node",Qt.records.nodes[t]={id:t,type:"service",icon:e,iconText:i,title:n,edges:[],in:r}},"addService"),RNe=x(()=>Object.values(Qt.records.nodes).filter(CNe),"getServices"),NNe=x(function({id:t,in:e}){Qt.records.registeredIds[t]="node",Qt.records.nodes[t]={id:t,type:"junction",edges:[],in:e}},"addJunction"),DNe=x(()=>Object.values(Qt.records.nodes).filter(ANe),"getJunctions"),INe=x(()=>Object.values(Qt.records.nodes),"getNodes"),x6=x(t=>Qt.records.nodes[t],"getNode"),MNe=x(function({id:t,icon:e,in:r,title:n}){if(Qt.records.registeredIds[t]!==void 0)throw new Error(`The group id [${t}] is already in use by another ${Qt.records.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(Qt.records.registeredIds[r]===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(Qt.records.registeredIds[r]==="node")throw new Error(`The group [${t}]'s parent is not a group`)}Qt.records.registeredIds[t]="group",Qt.records.groups[t]={id:t,icon:e,title:n,in:r}},"addGroup"),ONe=x(()=>Object.values(Qt.records.groups),"getGroups"),PNe=x(function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:n,lhsInto:i,rhsInto:a,lhsGroup:s,rhsGroup:o,title:l}){if(!jN(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`);if(!jN(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${n}`);if(Qt.records.nodes[t]===void 0&&Qt.records.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(Qt.records.nodes[e]===void 0&&Qt.records.groups[t]===void 0)throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);const u=Qt.records.nodes[t].in,h=Qt.records.nodes[e].in;if(s&&u&&h&&u==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&&u&&h&&u==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 d={lhsId:t,lhsDir:r,lhsInto:i,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:a,rhsGroup:o,title:l};Qt.records.edges.push(d),Qt.records.nodes[t]&&Qt.records.nodes[e]&&(Qt.records.nodes[t].edges.push(Qt.records.edges[Qt.records.edges.length-1]),Qt.records.nodes[e].edges.push(Qt.records.edges[Qt.records.edges.length-1]))},"addEdge"),BNe=x(()=>Qt.records.edges,"getEdges"),FNe=x(()=>{if(Qt.records.dataStructures===void 0){const t={},e=Object.entries(Qt.records.nodes).reduce((o,[l,u])=>(o[l]=u.edges.reduce((h,d)=>{var g,m;const f=(g=x6(d.lhsId))==null?void 0:g.in,p=(m=x6(d.rhsId))==null?void 0:m.in;if(f&&p&&f!==p){const v=kNe(d.lhsDir,d.rhsDir);v!=="bend"&&(t[f]??(t[f]={}),t[f][p]=v,t[p]??(t[p]={}),t[p][f]=v)}if(d.lhsId===l){const v=y6(d.lhsDir,d.rhsDir);v&&(h[v]=d.rhsId)}else{const v=y6(d.rhsDir,d.lhsDir);v&&(h[v]=d.lhsId)}return h},{}),o),{}),r=Object.keys(e)[0],n={[r]:1},i=Object.keys(e).reduce((o,l)=>l===r?o:{...o,[l]:1},{}),a=x(o=>{const l={[o]:[0,0]},u=[o];for(;u.length>0;){const h=u.shift();if(h){n[h]=1,delete i[h];const d=e[h],[f,p]=l[h];Object.entries(d).forEach(([g,m])=>{n[m]||(l[m]=ENe([f,p],g),u.push(m))})}}return l},"BFS"),s=[a(r)];for(;Object.keys(i).length>0;)s.push(a(Object.keys(i)[0]));Qt.records.dataStructures={adjList:e,spatialMaps:s,groupAlignments:t}}return Qt.records.dataStructures},"getDataStructures"),$Ne=x((t,e)=>{Qt.records.elements[t]=e},"setElementForId"),zNe=x(t=>Qt.records.elements[t],"getElementById"),S2={clear:_Ne,setDiagramTitle:di,getDiagramTitle:Gn,setAccTitle:Bn,getAccTitle:Kn,setAccDescription:Zn,getAccDescription:Qn,addService:LNe,getServices:RNe,addJunction:NNe,getJunctions:DNe,getNodes:INe,getNode:x6,addGroup:MNe,getGroups:ONe,addEdge:PNe,getEdges:BNe,setElementForId:$Ne,getElementById:zNe,getDataStructures:FNe};function Pn(t){const e=we().architecture;return e!=null&&e[t]?e[t]:fY[t]}x(Pn,"getConfigField");var VNe=x((t,e)=>{mf(t,e),t.groups.map(e.addGroup),t.services.map(r=>e.addService({...r,type:"service"})),t.junctions.map(r=>e.addJunction({...r,type:"junction"})),t.edges.map(e.addEdge)},"populateDb"),GNe={parse:x(async t=>{const e=await Mu("architecture",t);ie.debug(e),VNe(e,S2)},"parse")},UNe=x(t=>`
|
|
3082
3082
|
.edge {
|
|
3083
3083
|
stroke-width: ${t.archEdgeWidth};
|
|
3084
3084
|
stroke: ${t.archEdgeColor};
|