@matdata/yasgui-graph-plugin 1.6.0 → 1.6.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.
@@ -1,5 +1,6 @@
1
- "use strict";var TablePlugin=(()=>{var hC=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var nc=Object.getOwnPropertyNames;var rc=Object.prototype.hasOwnProperty;var sc=(I,e)=>{for(var g in e)hC(I,g,{get:e[g],enumerable:!0})},oc=(I,e,g,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of nc(e))!rc.call(I,A)&&A!==g&&hC(I,A,{get:()=>e[A],enumerable:!(t=ic(e,A))||t.enumerable});return I};var ac=I=>oc(hC({},"__esModule",{value:!0}),I);var d5={};sc(d5,{default:()=>a5});function Vr(I){let e=new Map;if(I&&I.getPrefixes){let t=I.getPrefixes();t&&typeof t=="object"&&Object.entries(t).forEach(([A,C])=>{C&&A&&e.set(C,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([t,A])=>{e.has(t)||e.set(t,A)}),e}function hg(I,e){if(!I||typeof I!="string")return I;for(let[g,t]of e.entries())if(I.startsWith(g)){let A=I.substring(g.length);return`${t}:${A}`}return I}function qg(I,e=50){return!I||typeof I!="string"||I.length<=e?I:I.substring(0,e-3)+"..."}function cC(I,e){let g=!e||e.edgeStyle!=="straight",t={small:6,medium:10,large:16},A=e!=null&&e.nodeSize?t[e.nodeSize]:10,C=(e==null?void 0:e.showNodeLabels)!==!1;return{configure:{enabled:!1},physics:{enabled:(e==null?void 0:e.physicsEnabled)!==!1,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1},nodes:{shape:"dot",size:A,font:{size:C?12:0,color:I.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:g,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:I.edgeLabel,background:I.edgeLabelBackground,strokeWidth:0},color:{color:I.edge}}}}async function Yr(I){var e,g;if(!I)return[];try{let t;if(typeof I.json=="function")t=await I.json();else if(typeof I.data=="string")t=JSON.parse(I.data);else if(typeof I=="object")t=I;else return[];let A=(g=(e=t==null?void 0:t.results)==null?void 0:e.bindings)!=null?g:[],C=[];for(let i of A)!i.subject||!i.predicate||!i.object||typeof i.subject.value!="string"||typeof i.predicate.value!="string"||typeof i.object.value!="string"||C.push({subject:i.subject.value,predicate:i.predicate.value,object:{value:i.object.value,type:i.object.type||"uri",datatype:i.object.datatype,lang:i.object["xml:lang"]}});return C}catch(t){return[]}}function Wr(I){let e=[];return!I||!I.getBindings||I.getBindings().forEach(t=>{if(!t.subject||!t.predicate||!t.object)return;let A={subject:t.subject.value,predicate:t.predicate.value,object:{value:t.object.value,type:t.object.type||"uri",datatype:t.object.datatype,lang:t.object["xml:lang"]}};e.push(A)}),e}function uC(I,e,g){return I.uri&&I.uri.startsWith("_:")?g.blankNode:I.type==="literal"?g.literal:e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri)?g.typeObject:g.uri}var dc={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"a","http://www.w3.org/1999/02/22-rdf-syntax-ns#value":"val","http://www.w3.org/2000/01/rdf-schema#label":"lbl","http://www.w3.org/2000/01/rdf-schema#comment":"cmt","http://www.w3.org/2000/01/rdf-schema#subClassOf":"\u2282","http://www.w3.org/2000/01/rdf-schema#subPropertyOf":"\u2286","http://www.w3.org/2000/01/rdf-schema#domain":"dom","http://www.w3.org/2000/01/rdf-schema#range":"rng","http://www.w3.org/2000/01/rdf-schema#seeAlso":"see","http://www.w3.org/2000/01/rdf-schema#isDefinedBy":"idb","http://www.w3.org/2002/07/owl#sameAs":"\u2261","http://www.w3.org/2002/07/owl#equivalentClass":"\u2245","http://www.w3.org/2002/07/owl#inverseOf":"\u21C4","http://www.w3.org/2002/07/owl#disjointWith":"\u2260","http://www.w3.org/2004/02/skos/core#prefLabel":"\u2605","http://www.w3.org/2004/02/skos/core#altLabel":"\u2606","http://www.w3.org/2004/02/skos/core#definition":"def","http://www.w3.org/2004/02/skos/core#broader":"\u2191","http://www.w3.org/2004/02/skos/core#narrower":"\u2193","http://www.w3.org/2004/02/skos/core#related":"\u2194","http://www.w3.org/2004/02/skos/core#note":"note","http://www.w3.org/2004/02/skos/core#exactMatch":"\u2261","http://www.w3.org/2004/02/skos/core#closeMatch":"\u2248","http://purl.org/dc/terms/title":"ttl","http://purl.org/dc/terms/description":"dsc","http://purl.org/dc/terms/created":"crt","http://purl.org/dc/terms/modified":"mod","http://purl.org/dc/terms/creator":"by","http://purl.org/dc/terms/subject":"sbj","http://xmlns.com/foaf/0.1/name":"nm","http://xmlns.com/foaf/0.1/knows":"\u27F7","http://xmlns.com/foaf/0.1/member":"mbr","http://schema.org/name":"nm","http://schema.org/description":"dsc"};function _r(I){return dc[I]}var Hr="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Ur="https://schema.org/image",Kr="https://schema.org/icon",Qr="http://www.w3.org/2000/01/rdf-schema#label",lc="http://www.w3.org/2000/01/rdf-schema#subClassOf",Xr=new Set([Ur,Kr,Qr]);function fC(I,e){let g="</div>",t=I.lastIndexOf(g);return t===-1?I+e:I.slice(0,t)+e+g}function pC(I,e){return`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${De(I)}</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`}function De(I){return I.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hc(I,e,g){let t=I.startsWith("_:"),A=`<div class="yasgui-tooltip-type">${t?"Blank Node":"URI"}</div>`;return A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${t?"Identifier":"Full URI"}</span><span class="yasgui-tooltip-val">${De(I)}</span></div>`,e.filter(C=>C.subject===I&&C.predicate===Hr).forEach(C=>{let i=hg(C.object.value,g);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">rdf:type</span><span class="yasgui-tooltip-val">${De(i)}</span></div>`}),e.filter(C=>C.subject===I&&C.object.type==="literal").forEach(C=>{let i=hg(C.predicate,g);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${De(i)}</span><span class="yasgui-tooltip-val">${De(C.object.value)}</span></div>`}),`<div class="yasgui-graph-tooltip">${A}</div>`}function zA(I,e,g,t,A){let i=`<div class="yasgui-tooltip-type">${I==="uri"?"URI":I==="literal"?"Literal":"Blank Node"}</div>`;if(I==="literal"){if(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Value</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`,g){let n=A?hg(g,A):g;i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Datatype</span><span class="yasgui-tooltip-val">${De(n)}</span></div>`}t&&(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Language</span><span class="yasgui-tooltip-val">${De(t)}</span></div>`)}else I==="uri"?i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`:I==="bnode"&&(i+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Identifier</span><span class="yasgui-tooltip-val">${De(e)}</span></div>`);return`<div class="yasgui-graph-tooltip">${i}</div>`}function cc(I){return`<div class="yasgui-graph-tooltip">${`<div class="yasgui-tooltip-type">Predicate</div><div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${De(I)}</span></div>`}</div>`}function uc(I,e,g,t){let A=new Map,C=1,i=(t==null?void 0:t.nodeSize)==="small"?.5:(t==null?void 0:t.nodeSize)==="large"?2:1;return I.forEach(n=>{if(!A.has(n.subject)){let s=n.subject.startsWith("_:"),o=s?n.subject:qg(hg(n.subject,e));A.set(n.subject,{id:C++,uri:n.subject,label:o,color:uC({uri:n.subject,type:"uri"},I,g),type:"uri",fullValue:n.subject,size:10*i,title:zA(s?"bnode":"uri",n.subject,void 0,void 0,e)})}let r=n.object.value;if(!A.has(r)&&!Xr.has(n.predicate)){let s=n.object.type==="literal",o=!s&&r.startsWith("_:"),d,a,l;s?(d=qg(r),a=r,l=zA("literal",r,n.object.datatype,n.object.lang,e)):o?(d=r,a=r,l=zA("bnode",r)):(d=qg(hg(r,e)),a=r,l=zA("uri",r,void 0,void 0,e)),A.set(r,{id:C++,uri:s?null:r,label:d,color:uC({uri:r,type:s?"literal":"uri"},I,g),type:s?"literal":"uri",fullValue:a,size:(s?5:10)*i,title:l})}}),A}function fc(I,e,g,t){let A=[],C=new Set;return I.forEach(i=>{var o,d;if(Xr.has(i.predicate))return;let n=e.get(i.subject),r=e.get(i.object.value);if(!n||!r)return;let s=`${n.id}-${i.predicate}-${r.id}`;if(!C.has(s)){C.add(s);let a,l=(o=t==null?void 0:t.predicateDisplay)!=null?o:"label";l==="none"?a="":l==="icon"?a=(d=_r(i.predicate))!=null?d:qg(hg(i.predicate,g)):a=qg(hg(i.predicate,g)),A.push({id:`edge_${n.id}_${r.id}_${A.length}`,from:n.id,to:r.id,label:a,predicate:i.predicate,title:cc(i.predicate),arrows:"to"})}}),A}function pc(I,e,g){return I.uri&&I.uri.startsWith("_:")||!g.compactMode?!0:!(I.type==="literal"||e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===I.uri))}function BA(I,e,g,t){let A=uc(I,e,g,t),C=(t==null?void 0:t.nodeSize)==="small"?.5:(t==null?void 0:t.nodeSize)==="large"?2:1,i=new Map;for(let a of I){i.has(a.subject)||i.set(a.subject,new Map);let l=i.get(a.subject);l.has(a.predicate)||l.set(a.predicate,[]),l.get(a.predicate).push(a.object.value)}function n(a){let l=i.get(a);if(!l)return{};let h=l.get(Kr);if(h!=null&&h.length)return{icon:h[0]};let c=l.get(Ur);return c!=null&&c.length?{image:c[0]}:{}}function r(a){var c,f,u,m;let l=n(a);if(l.icon||l.image)return l;let h=(f=(c=i.get(a))==null?void 0:c.get(Hr))!=null?f:[];for(let E of h){let w=n(E);if(w.icon||w.image)return w}for(let E of h){let w=(m=(u=i.get(E))==null?void 0:u.get(lc))!=null?m:[];for(let O of w){let R=n(O);if(R.icon||R.image)return R}}return{}}t!=null&&t.compactMode&&new Set(I.map(l=>l.subject)).forEach(l=>{let h=A.get(l);h&&(h.title=hc(l,I,e))}),A.forEach(a=>{var c,f;if(!a.uri||a.type==="literal")return;let l=t!=null&&t.compactMode?r(a.uri):n(a.uri),h=(f=(c=i.get(a.uri))==null?void 0:c.get(Qr))==null?void 0:f[0];if(l.icon)a.shape="text",a.label=h?`${l.icon}
2
- ${h}`:l.icon,a.font={size:14*C},t!=null&&t.compactMode||(a.title=fC(a.title,pC("Icon",l.icon)));else if(l.image){let u=!1;try{let m=new URL(l.image);u=m.protocol==="http:"||m.protocol==="https:"}catch(m){}u&&(a.shape="circularImage",a.image=l.image),h&&(a.label=h,a.font={size:14*C}),t!=null&&t.compactMode||(a.title=fC(a.title,pC("Image",l.image)))}else h&&(a.label=h);h&&!(t!=null&&t.compactMode)&&(a.title=fC(a.title,pC("rdfs:label",h)))});let s=new Set;A.forEach(a=>{(!t||pc(a,I,t))&&s.add(a.id)});let o=fc(I,A,e,t).filter(a=>s.has(a.from)&&s.has(a.to));return{nodes:Array.from(A.values()).filter(a=>s.has(a.id)),edges:o}}var mC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function P(I){return I&&I.__esModule&&Object.prototype.hasOwnProperty.call(I,"default")?I.default:I}var ZA=function(I){return I&&I.Math===Math&&I},X=ZA(typeof globalThis=="object"&&globalThis)||ZA(typeof window=="object"&&window)||ZA(typeof self=="object"&&self)||ZA(typeof mC=="object"&&mC)||(function(){return this})()||mC||Function("return this")(),B=function(I){try{return!!I()}catch(e){return!0}},mc=B,tA=!mc(function(){var I=(function(){}).bind();return typeof I!="function"||I.hasOwnProperty("prototype")}),vc=tA,Wa=Function.prototype,Jr=Wa.apply,$r=Wa.call,WI=typeof Reflect=="object"&&Reflect.apply||(vc?$r.bind(Jr):function(){return $r.apply(Jr,arguments)}),_a=tA,Ha=Function.prototype,Ei=Ha.call,bc=_a&&Ha.bind.bind(Ei,Ei),Z=_a?bc:function(I){return function(){return Ei.apply(I,arguments)}},Ua=Z,yc=Ua({}.toString),wc=Ua("".slice),ag=function(I){return wc(yc(I),8,-1)},Ec=ag,Tc=Z,er=function(I){if(Ec(I)==="Function")return Tc(I)},Ti=typeof document=="object"&&document.all,xc=typeof Ti=="undefined"&&Ti!==void 0,Ka={all:Ti,IS_HTMLDDA:xc},Qa=Ka,Oc=Qa.all,le=Qa.IS_HTMLDDA?function(I){return typeof I=="function"||I===Oc}:function(I){return typeof I=="function"},AA={},Dc=B,ie=!Dc(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Pc=tA,LA=Function.prototype.call,Ye=Pc?LA.bind(LA):function(){return LA.apply(LA,arguments)},IA={},Xa={}.propertyIsEnumerable,Ja=Object.getOwnPropertyDescriptor,Sc=Ja&&!Xa.call({1:2},1);IA.f=Sc?function(e){var g=Ja(this,e);return!!g&&g.enumerable}:Xa;var CA=function(I,e){return{enumerable:!(I&1),configurable:!(I&2),writable:!(I&4),value:e}},Nc=Z,Rc=B,kc=ag,vC=Object,Mc=Nc("".split),_I=Rc(function(){return!vC("z").propertyIsEnumerable(0)})?function(I){return kc(I)==="String"?Mc(I,""):vC(I)}:vC,mt=function(I){return I==null},Fc=mt,zc=TypeError,iA=function(I){if(Fc(I))throw new zc("Can't call method on "+I);return I},Bc=_I,Zc=iA,We=function(I){return Bc(Zc(I))},qr=le,$a=Ka,Lc=$a.all,ce=$a.IS_HTMLDDA?function(I){return typeof I=="object"?I!==null:qr(I)||I===Lc}:function(I){return typeof I=="object"?I!==null:qr(I)},L={},bC=L,yC=X,Gc=le,es=function(I){return Gc(I)?I:void 0},_e=function(I,e){return arguments.length<2?es(bC[I])||es(yC[I]):bC[I]&&bC[I][e]||yC[I]&&yC[I][e]},jc=Z,J=jc({}.isPrototypeOf),nA=typeof navigator!="undefined"&&String(navigator.userAgent)||"",qa=X,wC=nA,gs=qa.process,ts=qa.Deno,As=gs&&gs.versions||ts&&ts.version,Is=As&&As.v8,Be,uI;Is&&(Be=Is.split("."),uI=Be[0]>0&&Be[0]<4?1:+(Be[0]+Be[1]));!uI&&wC&&(Be=wC.match(/Edge\/(\d+)/),(!Be||Be[1]>=74)&&(Be=wC.match(/Chrome\/(\d+)/),Be&&(uI=+Be[1])));var rA=uI,Cs=rA,Vc=B,Yc=X,Wc=Yc.String,vt=!!Object.getOwnPropertySymbols&&!Vc(function(){var I=Symbol("symbol detection");return!Wc(I)||!(Object(I)instanceof Symbol)||!Symbol.sham&&Cs&&Cs<41}),_c=vt,ed=_c&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Hc=_e,Uc=le,Kc=J,Qc=ed,Xc=Object,sA=Qc?function(I){return typeof I=="symbol"}:function(I){var e=Hc("Symbol");return Uc(e)&&Kc(e.prototype,Xc(I))},Jc=String,oA=function(I){try{return Jc(I)}catch(e){return"Object"}},$c=le,qc=oA,eu=TypeError,_g=function(I){if($c(I))return I;throw new eu(qc(I)+" is not a function")},gu=_g,tu=mt,gr=function(I,e){var g=I[e];return tu(g)?void 0:gu(g)},EC=Ye,TC=le,xC=ce,Au=TypeError,Iu=function(I,e){var g,t;if(e==="string"&&TC(g=I.toString)&&!xC(t=EC(g,I))||TC(g=I.valueOf)&&!xC(t=EC(g,I))||e!=="string"&&TC(g=I.toString)&&!xC(t=EC(g,I)))return t;throw new Au("Can't convert object to primitive value")},gd={exports:{}},is=X,Cu=Object.defineProperty,iu=function(I,e){try{Cu(is,I,{value:e,configurable:!0,writable:!0})}catch(g){is[I]=e}return e},nu=X,ru=iu,ns="__core-js_shared__",su=nu[ns]||ru(ns,{}),tr=su,rs=tr;(gd.exports=function(I,e){return rs[I]||(rs[I]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var bt=gd.exports,ou=iA,au=Object,xe=function(I){return au(ou(I))},du=Z,lu=xe,hu=du({}.hasOwnProperty),ne=Object.hasOwn||function(e,g){return hu(lu(e),g)},cu=Z,uu=0,fu=Math.random(),pu=cu(1 .toString),HI=function(I){return"Symbol("+(I===void 0?"":I)+")_"+pu(++uu+fu,36)},mu=X,vu=bt,ss=ne,bu=HI,yu=vt,wu=ed,it=mu.Symbol,OC=vu("wks"),Eu=wu?it.for||it:it&&it.withoutSetter||bu,ee=function(I){return ss(OC,I)||(OC[I]=yu&&ss(it,I)?it[I]:Eu("Symbol."+I)),OC[I]},Tu=Ye,os=ce,as=sA,xu=gr,Ou=Iu,Du=ee,Pu=TypeError,Su=Du("toPrimitive"),Nu=function(I,e){if(!os(I)||as(I))return I;var g=xu(I,Su),t;if(g){if(e===void 0&&(e="default"),t=Tu(g,I,e),!os(t)||as(t))return t;throw new Pu("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ou(I,e)},Ru=Nu,ku=sA,UI=function(I){var e=Ru(I,"string");return ku(e)?e:e+""},Mu=X,ds=ce,xi=Mu.document,Fu=ds(xi)&&ds(xi.createElement),td=function(I){return Fu?xi.createElement(I):{}},zu=ie,Bu=B,Zu=td,Ad=!zu&&!Bu(function(){return Object.defineProperty(Zu("div"),"a",{get:function(){return 7}}).a!==7}),Lu=ie,Gu=Ye,ju=IA,Vu=CA,Yu=We,Wu=UI,_u=ne,Hu=Ad,ls=Object.getOwnPropertyDescriptor;AA.f=Lu?ls:function(e,g){if(e=Yu(e),g=Wu(g),Hu)try{return ls(e,g)}catch(t){}if(_u(e,g))return Vu(!Gu(ju.f,e,g),e[g])};var Uu=B,Ku=le,Qu=/#|\.prototype\./,aA=function(I,e){var g=Ju[Xu(I)];return g===qu?!0:g===$u?!1:Ku(e)?Uu(e):!!e},Xu=aA.normalize=function(I){return String(I).replace(Qu,".").toLowerCase()},Ju=aA.data={},$u=aA.NATIVE="N",qu=aA.POLYFILL="P",ef=aA,hs=er,gf=_g,tf=tA,Af=hs(hs.bind),dA=function(I,e){return gf(I),e===void 0?I:tf?Af(I,e):function(){return I.apply(e,arguments)}},Oe={},If=ie,Cf=B,Id=If&&Cf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),nf=ce,rf=String,sf=TypeError,dg=function(I){if(nf(I))return I;throw new sf(rf(I)+" is not an object")},of=ie,af=Ad,df=Id,GA=dg,cs=UI,lf=TypeError,DC=Object.defineProperty,hf=Object.getOwnPropertyDescriptor,PC="enumerable",SC="configurable",NC="writable";Oe.f=of?df?function(e,g,t){if(GA(e),g=cs(g),GA(t),typeof e=="function"&&g==="prototype"&&"value"in t&&NC in t&&!t[NC]){var A=hf(e,g);A&&A[NC]&&(e[g]=t.value,t={configurable:SC in t?t[SC]:A[SC],enumerable:PC in t?t[PC]:A[PC],writable:!1})}return DC(e,g,t)}:DC:function(e,g,t){if(GA(e),g=cs(g),GA(t),af)try{return DC(e,g,t)}catch(A){}if("get"in t||"set"in t)throw new lf("Accessors not supported");return"value"in t&&(e[g]=t.value),e};var cf=ie,uf=Oe,ff=CA,yt=cf?function(I,e,g){return uf.f(I,e,ff(1,g))}:function(I,e,g){return I[e]=g,I},jA=X,pf=WI,mf=er,vf=le,bf=AA.f,yf=ef,et=L,wf=dA,gt=yt,us=ne,Ef=function(I){var e=function(g,t,A){if(this instanceof e){switch(arguments.length){case 0:return new I;case 1:return new I(g);case 2:return new I(g,t)}return new I(g,t,A)}return pf(I,this,arguments)};return e.prototype=I.prototype,e},S=function(I,e){var g=I.target,t=I.global,A=I.stat,C=I.proto,i=t?jA:A?jA[g]:(jA[g]||{}).prototype,n=t?et:et[g]||gt(et,g,{})[g],r=n.prototype,s,o,d,a,l,h,c,f,u;for(a in e)s=yf(t?a:g+(A?".":"#")+a,I.forced),o=!s&&i&&us(i,a),h=n[a],o&&(I.dontCallGetSet?(u=bf(i,a),c=u&&u.value):c=i[a]),l=o&&c?c:e[a],!(o&&typeof h==typeof l)&&(I.bind&&o?f=wf(l,jA):I.wrap&&o?f=Ef(l):C&&vf(l)?f=mf(l):f=l,(I.sham||l&&l.sham||h&&h.sham)&&gt(f,"sham",!0),gt(n,a,f),C&&(d=g+"Prototype",us(et,d)||gt(et,d,{}),gt(et[d],a,l),I.real&&r&&(s||!r[a])&&gt(r,a,l)))},Tf=Math.ceil,xf=Math.floor,Of=Math.trunc||function(e){var g=+e;return(g>0?xf:Tf)(g)},Df=Of,KI=function(I){var e=+I;return e!==e||e===0?0:Df(e)},Pf=KI,Sf=Math.max,Nf=Math.min,lA=function(I,e){var g=Pf(I);return g<0?Sf(g+e,0):Nf(g,e)},Rf=KI,kf=Math.min,Mf=function(I){return I>0?kf(Rf(I),9007199254740991):0},Ff=Mf,ke=function(I){return Ff(I.length)},zf=We,Bf=lA,Zf=ke,fs=function(I){return function(e,g,t){var A=zf(e),C=Zf(A),i=Bf(t,C),n;if(I&&g!==g){for(;C>i;)if(n=A[i++],n!==n)return!0}else for(;C>i;i++)if((I||i in A)&&A[i]===g)return I||i||0;return!I&&-1}},Ar={includes:fs(!0),indexOf:fs(!1)},hA={},Lf=Z,RC=ne,Gf=We,jf=Ar.indexOf,Vf=hA,ps=Lf([].push),Cd=function(I,e){var g=Gf(I),t=0,A=[],C;for(C in g)!RC(Vf,C)&&RC(g,C)&&ps(A,C);for(;e.length>t;)RC(g,C=e[t++])&&(~jf(A,C)||ps(A,C));return A},Ir=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yf=Cd,Wf=Ir,cA=Object.keys||function(e){return Yf(e,Wf)},uA={};uA.f=Object.getOwnPropertySymbols;var ms=ie,_f=Z,Hf=Ye,Uf=B,kC=cA,Kf=uA,Qf=IA,Xf=xe,Jf=_I,tt=Object.assign,vs=Object.defineProperty,$f=_f([].concat),qf=!tt||Uf(function(){if(ms&&tt({b:1},tt(vs({},"a",{enumerable:!0,get:function(){vs(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var I={},e={},g=Symbol("assign detection"),t="abcdefghijklmnopqrst";return I[g]=7,t.split("").forEach(function(A){e[A]=A}),tt({},I)[g]!==7||kC(tt({},e)).join("")!==t})?function(e,g){for(var t=Xf(e),A=arguments.length,C=1,i=Kf.f,n=Qf.f;A>C;)for(var r=Jf(arguments[C++]),s=i?$f(kC(r),i(r)):kC(r),o=s.length,d=0,a;o>d;)a=s[d++],(!ms||Hf(n,r,a))&&(t[a]=r[a]);return t}:tt,ep=S,bs=qf;ep({target:"Object",stat:!0,arity:2,forced:Object.assign!==bs},{assign:bs});var gp=L,tp=gp.Object.assign,Ap=tp,Ip=Ap,Cp=Ip,q=P(Cp),ip=Z,QI=ip([].slice),id=Z,np=_g,rp=ce,sp=ne,ys=QI,op=tA,nd=Function,ap=id([].concat),dp=id([].join),MC={},lp=function(I,e,g){if(!sp(MC,e)){for(var t=[],A=0;A<e;A++)t[A]="a["+A+"]";MC[e]=nd("C,a","return new C("+dp(t,",")+")")}return MC[e](I,g)},hp=op?nd.bind:function(e){var g=np(this),t=g.prototype,A=ys(arguments,1),C=function(){var n=ap(A,ys(arguments));return this instanceof C?lp(g,n.length,n):g.apply(e,n)};return rp(t)&&(C.prototype=t),C},cp=S,ws=hp;cp({target:"Function",proto:!0,forced:Function.bind!==ws},{bind:ws});var up=L,Ie=function(I){return up[I+"Prototype"]},fp=Ie,pp=fp("Function").bind,mp=J,vp=pp,FC=Function.prototype,bp=function(I){var e=I.bind;return I===FC||mp(FC,I)&&e===FC.bind?vp:e},yp=bp,wp=yp,Ep=wp,b=P(Ep);function Cr(I,e,g,t){I.beginPath(),I.arc(e,g,t,0,2*Math.PI,!1),I.closePath()}function Tp(I,e,g,t){I.beginPath(),I.rect(e-t,g-t,t*2,t*2),I.closePath()}function xp(I,e,g,t){I.beginPath(),t*=1.15,g+=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g-(n-i)),I.lineTo(e+C,g+i),I.lineTo(e-C,g+i),I.lineTo(e,g-(n-i)),I.closePath()}function Op(I,e,g,t){I.beginPath(),t*=1.15,g-=.275*t;let A=t*2,C=A/2,i=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-C*C);I.moveTo(e,g+(n-i)),I.lineTo(e+C,g-i),I.lineTo(e-C,g-i),I.lineTo(e,g+(n-i)),I.closePath()}function Dp(I,e,g,t){I.beginPath(),t*=.82,g+=.1*t;for(let A=0;A<10;A++){let C=A%2===0?t*1.3:t*.5;I.lineTo(e+C*Math.sin(A*2*Math.PI/10),g-C*Math.cos(A*2*Math.PI/10))}I.closePath()}function Pp(I,e,g,t){I.beginPath(),I.lineTo(e,g+t),I.lineTo(e+t,g),I.lineTo(e,g-t),I.lineTo(e-t,g),I.closePath()}function rd(I,e,g,t,A,C){let i=Math.PI/180;t-2*C<0&&(C=t/2),A-2*C<0&&(C=A/2),I.beginPath(),I.moveTo(e+C,g),I.lineTo(e+t-C,g),I.arc(e+t-C,g+C,C,i*270,i*360,!1),I.lineTo(e+t,g+A-C),I.arc(e+t-C,g+A-C,C,0,i*90,!1),I.lineTo(e+C,g+A),I.arc(e+C,g+A-C,C,i*90,i*180,!1),I.lineTo(e,g+C),I.arc(e+C,g+C,C,i*180,i*270,!1),I.closePath()}function Oi(I,e,g,t,A){let C=.5522848,i=t/2*C,n=A/2*C,r=e+t,s=g+A,o=e+t/2,d=g+A/2;I.beginPath(),I.moveTo(e,d),I.bezierCurveTo(e,d-n,o-i,g,o,g),I.bezierCurveTo(o+i,g,r,d-n,r,d),I.bezierCurveTo(r,d+n,o+i,s,o,s),I.bezierCurveTo(o-i,s,e,d+n,e,d),I.closePath()}function sd(I,e,g,t,A){let C=.3333333333333333,i=t,n=A*C,r=.5522848,s=i/2*r,o=n/2*r,d=e+i,a=g+n,l=e+i/2,h=g+n/2,c=g+(A-n/2),f=g+A;I.beginPath(),I.moveTo(d,h),I.bezierCurveTo(d,h+o,l+s,a,l,a),I.bezierCurveTo(l-s,a,e,h+o,e,h),I.bezierCurveTo(e,h-o,l-s,g,l,g),I.bezierCurveTo(l+s,g,d,h-o,d,h),I.lineTo(d,c),I.bezierCurveTo(d,c+o,l+s,f,l,f),I.bezierCurveTo(l-s,f,e,c+o,e,c),I.lineTo(e,h)}function od(I,e,g,t,A,C){I.beginPath(),I.moveTo(e,g);let i=C.length,n=t-e,r=A-g,s=r/n,o=Math.sqrt(n*n+r*r),d=0,a=!0,l=0,h=+C[0];for(;o>=.1;)h=+C[d++%i],h>o&&(h=o),l=Math.sqrt(h*h/(1+s*s)),l=n<0?-l:l,e+=l,g+=s*l,a===!0?I.lineTo(e,g):I.moveTo(e,g),o-=h,a=!a}function Sp(I,e,g,t){I.beginPath();let A=6,C=Math.PI*2/A;I.moveTo(e+t,g);for(let i=1;i<A;i++)I.lineTo(e+t*Math.cos(C*i),g+t*Math.sin(C*i));I.closePath()}var Es={circle:Cr,dashedLine:od,database:sd,diamond:Pp,ellipse:Oi,ellipse_vis:Oi,hexagon:Sp,roundRect:rd,square:Tp,star:Dp,triangle:xp,triangleDown:Op};function Np(I){return Object.prototype.hasOwnProperty.call(Es,I)?Es[I]:function(e){for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];CanvasRenderingContext2D.prototype[I].call(e,t)}}function Hg(I,e){e===void 0&&(e={});var g=e.insertAt;if(!(!I||typeof document=="undefined")){var t=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",g==="top"&&t.firstChild?t.insertBefore(A,t.firstChild):t.appendChild(A),A.styleSheet?A.styleSheet.cssText=I:A.appendChild(document.createTextNode(I))}}var Rp=`.vis-overlay {
1
+ "use strict";var TablePlugin=(()=>{var _u=Object.create;var ri=Object.defineProperty;var ku=Object.getOwnPropertyDescriptor;var Mu=Object.getOwnPropertyNames;var Fu=Object.getPrototypeOf,Bu=Object.prototype.hasOwnProperty;var KI=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),zu=(i,e)=>{for(var t in e)ri(i,t,{get:e[t],enumerable:!0})},Fs=(i,e,t,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of Mu(e))!Bu.call(i,A)&&A!==t&&ri(i,A,{get:()=>e[A],enumerable:!(g=ku(e,A))||g.enumerable});return i};var Lu=(i,e,t)=>(t=i!=null?_u(Fu(i)):{},Fs(e||!i||!i.__esModule?ri(t,"default",{value:i,enumerable:!0}):t,i)),Zu=i=>Fs(ri({},"__esModule",{value:!0}),i);var Zs=KI(si=>{"use strict";si.byteLength=ju;si.toByteArray=Yu;si.fromByteArray=Hu;var $e=[],Ne=[],Gu=typeof Uint8Array!="undefined"?Uint8Array:Array,XI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Vt=0,zs=XI.length;Vt<zs;++Vt)$e[Vt]=XI[Vt],Ne[XI.charCodeAt(Vt)]=Vt;var Vt,zs;Ne[45]=62;Ne[95]=63;function Ls(i){var e=i.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=e);var g=t===e?0:4-t%4;return[t,g]}function ju(i){var e=Ls(i),t=e[0],g=e[1];return(t+g)*3/4-g}function Vu(i,e,t){return(e+t)*3/4-t}function Yu(i){var e,t=Ls(i),g=t[0],A=t[1],I=new Gu(Vu(i,g,A)),C=0,n=A>0?g-4:g,r;for(r=0;r<n;r+=4)e=Ne[i.charCodeAt(r)]<<18|Ne[i.charCodeAt(r+1)]<<12|Ne[i.charCodeAt(r+2)]<<6|Ne[i.charCodeAt(r+3)],I[C++]=e>>16&255,I[C++]=e>>8&255,I[C++]=e&255;return A===2&&(e=Ne[i.charCodeAt(r)]<<2|Ne[i.charCodeAt(r+1)]>>4,I[C++]=e&255),A===1&&(e=Ne[i.charCodeAt(r)]<<10|Ne[i.charCodeAt(r+1)]<<4|Ne[i.charCodeAt(r+2)]>>2,I[C++]=e>>8&255,I[C++]=e&255),I}function Wu(i){return $e[i>>18&63]+$e[i>>12&63]+$e[i>>6&63]+$e[i&63]}function Uu(i,e,t){for(var g,A=[],I=e;I<t;I+=3)g=(i[I]<<16&16711680)+(i[I+1]<<8&65280)+(i[I+2]&255),A.push(Wu(g));return A.join("")}function Hu(i){for(var e,t=i.length,g=t%3,A=[],I=16383,C=0,n=t-g;C<n;C+=I)A.push(Uu(i,C,C+I>n?n:C+I));return g===1?(e=i[t-1],A.push($e[e>>2]+$e[e<<4&63]+"==")):g===2&&(e=(i[t-2]<<8)+i[t-1],A.push($e[e>>10]+$e[e>>4&63]+$e[e<<2&63]+"=")),A.join("")}});var Gs=KI($I=>{$I.read=function(i,e,t,g,A){var I,C,n=A*8-g-1,r=(1<<n)-1,s=r>>1,o=-7,a=t?A-1:0,l=t?-1:1,d=i[e+a];for(a+=l,I=d&(1<<-o)-1,d>>=-o,o+=n;o>0;I=I*256+i[e+a],a+=l,o-=8);for(C=I&(1<<-o)-1,I>>=-o,o+=g;o>0;C=C*256+i[e+a],a+=l,o-=8);if(I===0)I=1-s;else{if(I===r)return C?NaN:(d?-1:1)*(1/0);C=C+Math.pow(2,g),I=I-s}return(d?-1:1)*C*Math.pow(2,I-g)};$I.write=function(i,e,t,g,A,I){var C,n,r,s=I*8-A-1,o=(1<<s)-1,a=o>>1,l=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=g?0:I-1,h=g?1:-1,c=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(n=isNaN(e)?1:0,C=o):(C=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-C))<1&&(C--,r*=2),C+a>=1?e+=l/r:e+=l*Math.pow(2,1-a),e*r>=2&&(C++,r/=2),C+a>=o?(n=0,C=o):C+a>=1?(n=(e*r-1)*Math.pow(2,A),C=C+a):(n=e*Math.pow(2,a-1)*Math.pow(2,A),C=0));A>=8;i[t+d]=n&255,d+=h,n/=256,A-=8);for(C=C<<A|n,s+=A;s>0;i[t+d]=C&255,d+=h,C/=256,s-=8);i[t+d-h]|=c*128}});var io=KI(fg=>{"use strict";var JI=Zs(),cg=Gs(),js=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fg.Buffer=v;fg.SlowBuffer=qu;fg.INSPECT_MAX_BYTES=50;var oi=2147483647;fg.kMaxLength=oi;v.TYPED_ARRAY_SUPPORT=Ku();!v.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ku(){try{let i=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(i,e),i.foo()===42}catch(i){return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}});Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function st(i){if(i>oi)throw new RangeError('The value "'+i+'" is invalid for option "size"');let e=new Uint8Array(i);return Object.setPrototypeOf(e,v.prototype),e}function v(i,e,t){if(typeof i=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return gC(i)}return Us(i,e,t)}v.poolSize=8192;function Us(i,e,t){if(typeof i=="string")return Xu(i,e);if(ArrayBuffer.isView(i))return $u(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(Je(i,ArrayBuffer)||i&&Je(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Je(i,SharedArrayBuffer)||i&&Je(i.buffer,SharedArrayBuffer)))return eC(i,e,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return v.from(g,e,t);let A=Ju(i);if(A)return A;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return v.from(i[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}v.from=function(i,e,t){return Us(i,e,t)};Object.setPrototypeOf(v.prototype,Uint8Array.prototype);Object.setPrototypeOf(v,Uint8Array);function Hs(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function Qu(i,e,t){return Hs(i),i<=0?st(i):e!==void 0?typeof t=="string"?st(i).fill(e,t):st(i).fill(e):st(i)}v.alloc=function(i,e,t){return Qu(i,e,t)};function gC(i){return Hs(i),st(i<0?0:AC(i)|0)}v.allocUnsafe=function(i){return gC(i)};v.allocUnsafeSlow=function(i){return gC(i)};function Xu(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!v.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Ks(i,e)|0,g=st(t),A=g.write(i,e);return A!==t&&(g=g.slice(0,A)),g}function qI(i){let e=i.length<0?0:AC(i.length)|0,t=st(e);for(let g=0;g<e;g+=1)t[g]=i[g]&255;return t}function $u(i){if(Je(i,Uint8Array)){let e=new Uint8Array(i);return eC(e.buffer,e.byteOffset,e.byteLength)}return qI(i)}function eC(i,e,t){if(e<0||i.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let g;return e===void 0&&t===void 0?g=new Uint8Array(i):t===void 0?g=new Uint8Array(i,e):g=new Uint8Array(i,e,t),Object.setPrototypeOf(g,v.prototype),g}function Ju(i){if(v.isBuffer(i)){let e=AC(i.length)|0,t=st(e);return t.length===0||i.copy(t,0,0,e),t}if(i.length!==void 0)return typeof i.length!="number"||IC(i.length)?st(0):qI(i);if(i.type==="Buffer"&&Array.isArray(i.data))return qI(i.data)}function AC(i){if(i>=oi)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oi.toString(16)+" bytes");return i|0}function qu(i){return+i!=i&&(i=0),v.alloc(+i)}v.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==v.prototype};v.compare=function(e,t){if(Je(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),Je(t,Uint8Array)&&(t=v.from(t,t.offset,t.byteLength)),!v.isBuffer(e)||!v.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let g=e.length,A=t.length;for(let I=0,C=Math.min(g,A);I<C;++I)if(e[I]!==t[I]){g=e[I],A=t[I];break}return g<A?-1:A<g?1:0};v.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};v.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return v.alloc(0);let g;if(t===void 0)for(t=0,g=0;g<e.length;++g)t+=e[g].length;let A=v.allocUnsafe(t),I=0;for(g=0;g<e.length;++g){let C=e[g];if(Je(C,Uint8Array))I+C.length>A.length?(v.isBuffer(C)||(C=v.from(C)),C.copy(A,I)):Uint8Array.prototype.set.call(A,C,I);else if(v.isBuffer(C))C.copy(A,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=C.length}return A};function Ks(i,e){if(v.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||Je(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);let t=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&t===0)return 0;let A=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return tC(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ao(i).length;default:if(A)return g?-1:tC(i).length;e=(""+e).toLowerCase(),A=!0}}v.byteLength=Ks;function ef(i,e,t){let g=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(i||(i="utf8");;)switch(i){case"hex":return af(this,e,t);case"utf8":case"utf-8":return Xs(this,e,t);case"ascii":return sf(this,e,t);case"latin1":case"binary":return of(this,e,t);case"base64":return nf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lf(this,e,t);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}v.prototype._isBuffer=!0;function Yt(i,e,t){let g=i[e];i[e]=i[t],i[t]=g}v.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)Yt(this,t,t+1);return this};v.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)Yt(this,t,t+3),Yt(this,t+1,t+2);return this};v.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)Yt(this,t,t+7),Yt(this,t+1,t+6),Yt(this,t+2,t+5),Yt(this,t+3,t+4);return this};v.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Xs(this,0,e):ef.apply(this,arguments)};v.prototype.toLocaleString=v.prototype.toString;v.prototype.equals=function(e){if(!v.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:v.compare(this,e)===0};v.prototype.inspect=function(){let e="",t=fg.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};js&&(v.prototype[js]=v.prototype.inspect);v.prototype.compare=function(e,t,g,A,I){if(Je(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),!v.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),g===void 0&&(g=e?e.length:0),A===void 0&&(A=0),I===void 0&&(I=this.length),t<0||g>e.length||A<0||I>this.length)throw new RangeError("out of range index");if(A>=I&&t>=g)return 0;if(A>=I)return-1;if(t>=g)return 1;if(t>>>=0,g>>>=0,A>>>=0,I>>>=0,this===e)return 0;let C=I-A,n=g-t,r=Math.min(C,n),s=this.slice(A,I),o=e.slice(t,g);for(let a=0;a<r;++a)if(s[a]!==o[a]){C=s[a],n=o[a];break}return C<n?-1:n<C?1:0};function Qs(i,e,t,g,A){if(i.length===0)return-1;if(typeof t=="string"?(g=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,IC(t)&&(t=A?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(A)return-1;t=i.length-1}else if(t<0)if(A)t=0;else return-1;if(typeof e=="string"&&(e=v.from(e,g)),v.isBuffer(e))return e.length===0?-1:Vs(i,e,t,g,A);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(i,e,t):Uint8Array.prototype.lastIndexOf.call(i,e,t):Vs(i,[e],t,g,A);throw new TypeError("val must be string, number or Buffer")}function Vs(i,e,t,g,A){let I=1,C=i.length,n=e.length;if(g!==void 0&&(g=String(g).toLowerCase(),g==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||e.length<2)return-1;I=2,C/=2,n/=2,t/=2}function r(o,a){return I===1?o[a]:o.readUInt16BE(a*I)}let s;if(A){let o=-1;for(s=t;s<C;s++)if(r(i,s)===r(e,o===-1?0:s-o)){if(o===-1&&(o=s),s-o+1===n)return o*I}else o!==-1&&(s-=s-o),o=-1}else for(t+n>C&&(t=C-n),s=t;s>=0;s--){let o=!0;for(let a=0;a<n;a++)if(r(i,s+a)!==r(e,a)){o=!1;break}if(o)return s}return-1}v.prototype.includes=function(e,t,g){return this.indexOf(e,t,g)!==-1};v.prototype.indexOf=function(e,t,g){return Qs(this,e,t,g,!0)};v.prototype.lastIndexOf=function(e,t,g){return Qs(this,e,t,g,!1)};function tf(i,e,t,g){t=Number(t)||0;let A=i.length-t;g?(g=Number(g),g>A&&(g=A)):g=A;let I=e.length;g>I/2&&(g=I/2);let C;for(C=0;C<g;++C){let n=parseInt(e.substr(C*2,2),16);if(IC(n))return C;i[t+C]=n}return C}function gf(i,e,t,g){return ai(tC(e,i.length-t),i,t,g)}function Af(i,e,t,g){return ai(uf(e),i,t,g)}function If(i,e,t,g){return ai(Ao(e),i,t,g)}function Cf(i,e,t,g){return ai(ff(e,i.length-t),i,t,g)}v.prototype.write=function(e,t,g,A){if(t===void 0)A="utf8",g=this.length,t=0;else if(g===void 0&&typeof t=="string")A=t,g=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(g)?(g=g>>>0,A===void 0&&(A="utf8")):(A=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let I=this.length-t;if((g===void 0||g>I)&&(g=I),e.length>0&&(g<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let C=!1;for(;;)switch(A){case"hex":return tf(this,e,t,g);case"utf8":case"utf-8":return gf(this,e,t,g);case"ascii":case"latin1":case"binary":return Af(this,e,t,g);case"base64":return If(this,e,t,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cf(this,e,t,g);default:if(C)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),C=!0}};v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nf(i,e,t){return e===0&&t===i.length?JI.fromByteArray(i):JI.fromByteArray(i.slice(e,t))}function Xs(i,e,t){t=Math.min(i.length,t);let g=[],A=e;for(;A<t;){let I=i[A],C=null,n=I>239?4:I>223?3:I>191?2:1;if(A+n<=t){let r,s,o,a;switch(n){case 1:I<128&&(C=I);break;case 2:r=i[A+1],(r&192)===128&&(a=(I&31)<<6|r&63,a>127&&(C=a));break;case 3:r=i[A+1],s=i[A+2],(r&192)===128&&(s&192)===128&&(a=(I&15)<<12|(r&63)<<6|s&63,a>2047&&(a<55296||a>57343)&&(C=a));break;case 4:r=i[A+1],s=i[A+2],o=i[A+3],(r&192)===128&&(s&192)===128&&(o&192)===128&&(a=(I&15)<<18|(r&63)<<12|(s&63)<<6|o&63,a>65535&&a<1114112&&(C=a))}}C===null?(C=65533,n=1):C>65535&&(C-=65536,g.push(C>>>10&1023|55296),C=56320|C&1023),g.push(C),A+=n}return rf(g)}var Ys=4096;function rf(i){let e=i.length;if(e<=Ys)return String.fromCharCode.apply(String,i);let t="",g=0;for(;g<e;)t+=String.fromCharCode.apply(String,i.slice(g,g+=Ys));return t}function sf(i,e,t){let g="";t=Math.min(i.length,t);for(let A=e;A<t;++A)g+=String.fromCharCode(i[A]&127);return g}function of(i,e,t){let g="";t=Math.min(i.length,t);for(let A=e;A<t;++A)g+=String.fromCharCode(i[A]);return g}function af(i,e,t){let g=i.length;(!e||e<0)&&(e=0),(!t||t<0||t>g)&&(t=g);let A="";for(let I=e;I<t;++I)A+=pf[i[I]];return A}function lf(i,e,t){let g=i.slice(e,t),A="";for(let I=0;I<g.length-1;I+=2)A+=String.fromCharCode(g[I]+g[I+1]*256);return A}v.prototype.slice=function(e,t){let g=this.length;e=~~e,t=t===void 0?g:~~t,e<0?(e+=g,e<0&&(e=0)):e>g&&(e=g),t<0?(t+=g,t<0&&(t=0)):t>g&&(t=g),t<e&&(t=e);let A=this.subarray(e,t);return Object.setPrototypeOf(A,v.prototype),A};function se(i,e,t){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+e>t)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(e,t,g){e=e>>>0,t=t>>>0,g||se(e,t,this.length);let A=this[e],I=1,C=0;for(;++C<t&&(I*=256);)A+=this[e+C]*I;return A};v.prototype.readUintBE=v.prototype.readUIntBE=function(e,t,g){e=e>>>0,t=t>>>0,g||se(e,t,this.length);let A=this[e+--t],I=1;for(;t>0&&(I*=256);)A+=this[e+--t]*I;return A};v.prototype.readUint8=v.prototype.readUInt8=function(e,t){return e=e>>>0,t||se(e,1,this.length),this[e]};v.prototype.readUint16LE=v.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||se(e,2,this.length),this[e]|this[e+1]<<8};v.prototype.readUint16BE=v.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||se(e,2,this.length),this[e]<<8|this[e+1]};v.prototype.readUint32LE=v.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||se(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};v.prototype.readUint32BE=v.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};v.prototype.readBigUInt64LE=xt(function(e){e=e>>>0,ug(e,"offset");let t=this[e],g=this[e+7];(t===void 0||g===void 0)&&Xg(e,this.length-8);let A=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,I=this[++e]+this[++e]*2**8+this[++e]*2**16+g*2**24;return BigInt(A)+(BigInt(I)<<BigInt(32))});v.prototype.readBigUInt64BE=xt(function(e){e=e>>>0,ug(e,"offset");let t=this[e],g=this[e+7];(t===void 0||g===void 0)&&Xg(e,this.length-8);let A=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],I=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+g;return(BigInt(A)<<BigInt(32))+BigInt(I)});v.prototype.readIntLE=function(e,t,g){e=e>>>0,t=t>>>0,g||se(e,t,this.length);let A=this[e],I=1,C=0;for(;++C<t&&(I*=256);)A+=this[e+C]*I;return I*=128,A>=I&&(A-=Math.pow(2,8*t)),A};v.prototype.readIntBE=function(e,t,g){e=e>>>0,t=t>>>0,g||se(e,t,this.length);let A=t,I=1,C=this[e+--A];for(;A>0&&(I*=256);)C+=this[e+--A]*I;return I*=128,C>=I&&(C-=Math.pow(2,8*t)),C};v.prototype.readInt8=function(e,t){return e=e>>>0,t||se(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};v.prototype.readInt16LE=function(e,t){e=e>>>0,t||se(e,2,this.length);let g=this[e]|this[e+1]<<8;return g&32768?g|4294901760:g};v.prototype.readInt16BE=function(e,t){e=e>>>0,t||se(e,2,this.length);let g=this[e+1]|this[e]<<8;return g&32768?g|4294901760:g};v.prototype.readInt32LE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};v.prototype.readInt32BE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};v.prototype.readBigInt64LE=xt(function(e){e=e>>>0,ug(e,"offset");let t=this[e],g=this[e+7];(t===void 0||g===void 0)&&Xg(e,this.length-8);let A=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(g<<24);return(BigInt(A)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});v.prototype.readBigInt64BE=xt(function(e){e=e>>>0,ug(e,"offset");let t=this[e],g=this[e+7];(t===void 0||g===void 0)&&Xg(e,this.length-8);let A=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(A)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+g)});v.prototype.readFloatLE=function(e,t){return e=e>>>0,t||se(e,4,this.length),cg.read(this,e,!0,23,4)};v.prototype.readFloatBE=function(e,t){return e=e>>>0,t||se(e,4,this.length),cg.read(this,e,!1,23,4)};v.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||se(e,8,this.length),cg.read(this,e,!0,52,8)};v.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||se(e,8,this.length),cg.read(this,e,!1,52,8)};function Te(i,e,t,g,A,I){if(!v.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>A||e<I)throw new RangeError('"value" argument is out of bounds');if(t+g>i.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(e,t,g,A){if(e=+e,t=t>>>0,g=g>>>0,!A){let n=Math.pow(2,8*g)-1;Te(this,e,t,g,n,0)}let I=1,C=0;for(this[t]=e&255;++C<g&&(I*=256);)this[t+C]=e/I&255;return t+g};v.prototype.writeUintBE=v.prototype.writeUIntBE=function(e,t,g,A){if(e=+e,t=t>>>0,g=g>>>0,!A){let n=Math.pow(2,8*g)-1;Te(this,e,t,g,n,0)}let I=g-1,C=1;for(this[t+I]=e&255;--I>=0&&(C*=256);)this[t+I]=e/C&255;return t+g};v.prototype.writeUint8=v.prototype.writeUInt8=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,1,255,0),this[t]=e&255,t+1};v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function $s(i,e,t,g,A){go(e,g,A,i,t,7);let I=Number(e&BigInt(4294967295));i[t++]=I,I=I>>8,i[t++]=I,I=I>>8,i[t++]=I,I=I>>8,i[t++]=I;let C=Number(e>>BigInt(32)&BigInt(4294967295));return i[t++]=C,C=C>>8,i[t++]=C,C=C>>8,i[t++]=C,C=C>>8,i[t++]=C,t}function Js(i,e,t,g,A){go(e,g,A,i,t,7);let I=Number(e&BigInt(4294967295));i[t+7]=I,I=I>>8,i[t+6]=I,I=I>>8,i[t+5]=I,I=I>>8,i[t+4]=I;let C=Number(e>>BigInt(32)&BigInt(4294967295));return i[t+3]=C,C=C>>8,i[t+2]=C,C=C>>8,i[t+1]=C,C=C>>8,i[t]=C,t+8}v.prototype.writeBigUInt64LE=xt(function(e,t=0){return $s(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});v.prototype.writeBigUInt64BE=xt(function(e,t=0){return Js(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});v.prototype.writeIntLE=function(e,t,g,A){if(e=+e,t=t>>>0,!A){let r=Math.pow(2,8*g-1);Te(this,e,t,g,r-1,-r)}let I=0,C=1,n=0;for(this[t]=e&255;++I<g&&(C*=256);)e<0&&n===0&&this[t+I-1]!==0&&(n=1),this[t+I]=(e/C>>0)-n&255;return t+g};v.prototype.writeIntBE=function(e,t,g,A){if(e=+e,t=t>>>0,!A){let r=Math.pow(2,8*g-1);Te(this,e,t,g,r-1,-r)}let I=g-1,C=1,n=0;for(this[t+I]=e&255;--I>=0&&(C*=256);)e<0&&n===0&&this[t+I+1]!==0&&(n=1),this[t+I]=(e/C>>0)-n&255;return t+g};v.prototype.writeInt8=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};v.prototype.writeInt16LE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};v.prototype.writeInt16BE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};v.prototype.writeInt32LE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};v.prototype.writeInt32BE=function(e,t,g){return e=+e,t=t>>>0,g||Te(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};v.prototype.writeBigInt64LE=xt(function(e,t=0){return $s(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});v.prototype.writeBigInt64BE=xt(function(e,t=0){return Js(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function qs(i,e,t,g,A,I){if(t+g>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function eo(i,e,t,g,A){return e=+e,t=t>>>0,A||qs(i,e,t,4,34028234663852886e22,-34028234663852886e22),cg.write(i,e,t,g,23,4),t+4}v.prototype.writeFloatLE=function(e,t,g){return eo(this,e,t,!0,g)};v.prototype.writeFloatBE=function(e,t,g){return eo(this,e,t,!1,g)};function to(i,e,t,g,A){return e=+e,t=t>>>0,A||qs(i,e,t,8,17976931348623157e292,-17976931348623157e292),cg.write(i,e,t,g,52,8),t+8}v.prototype.writeDoubleLE=function(e,t,g){return to(this,e,t,!0,g)};v.prototype.writeDoubleBE=function(e,t,g){return to(this,e,t,!1,g)};v.prototype.copy=function(e,t,g,A){if(!v.isBuffer(e))throw new TypeError("argument should be a Buffer");if(g||(g=0),!A&&A!==0&&(A=this.length),t>=e.length&&(t=e.length),t||(t=0),A>0&&A<g&&(A=g),A===g||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),e.length-t<A-g&&(A=e.length-t+g);let I=A-g;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,g,A):Uint8Array.prototype.set.call(e,this.subarray(g,A),t),I};v.prototype.fill=function(e,t,g,A){if(typeof e=="string"){if(typeof t=="string"?(A=t,t=0,g=this.length):typeof g=="string"&&(A=g,g=this.length),A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!v.isEncoding(A))throw new TypeError("Unknown encoding: "+A);if(e.length===1){let C=e.charCodeAt(0);(A==="utf8"&&C<128||A==="latin1")&&(e=C)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<g)throw new RangeError("Out of range index");if(g<=t)return this;t=t>>>0,g=g===void 0?this.length:g>>>0,e||(e=0);let I;if(typeof e=="number")for(I=t;I<g;++I)this[I]=e;else{let C=v.isBuffer(e)?e:v.from(e,A),n=C.length;if(n===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(I=0;I<g-t;++I)this[I+t]=C[I%n]}return this};var hg={};function iC(i,e,t){hg[i]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}iC("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);iC("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError);iC("ERR_OUT_OF_RANGE",function(i,e,t){let g=`The value of "${i}" is out of range.`,A=t;return Number.isInteger(t)&&Math.abs(t)>2**32?A=Ws(String(t)):typeof t=="bigint"&&(A=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(A=Ws(A)),A+="n"),g+=` It must be ${e}. Received ${A}`,g},RangeError);function Ws(i){let e="",t=i.length,g=i[0]==="-"?1:0;for(;t>=g+4;t-=3)e=`_${i.slice(t-3,t)}${e}`;return`${i.slice(0,t)}${e}`}function df(i,e,t){ug(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&Xg(e,i.length-(t+1))}function go(i,e,t,g,A,I){if(i>t||i<e){let C=typeof e=="bigint"?"n":"",n;throw I>3?e===0||e===BigInt(0)?n=`>= 0${C} and < 2${C} ** ${(I+1)*8}${C}`:n=`>= -(2${C} ** ${(I+1)*8-1}${C}) and < 2 ** ${(I+1)*8-1}${C}`:n=`>= ${e}${C} and <= ${t}${C}`,new hg.ERR_OUT_OF_RANGE("value",n,i)}df(g,A,I)}function ug(i,e){if(typeof i!="number")throw new hg.ERR_INVALID_ARG_TYPE(e,"number",i)}function Xg(i,e,t){throw Math.floor(i)!==i?(ug(i,t),new hg.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):e<0?new hg.ERR_BUFFER_OUT_OF_BOUNDS:new hg.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,i)}var hf=/[^+/0-9A-Za-z-_]/g;function cf(i){if(i=i.split("=")[0],i=i.trim().replace(hf,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function tC(i,e){e=e||1/0;let t,g=i.length,A=null,I=[];for(let C=0;C<g;++C){if(t=i.charCodeAt(C),t>55295&&t<57344){if(!A){if(t>56319){(e-=3)>-1&&I.push(239,191,189);continue}else if(C+1===g){(e-=3)>-1&&I.push(239,191,189);continue}A=t;continue}if(t<56320){(e-=3)>-1&&I.push(239,191,189),A=t;continue}t=(A-55296<<10|t-56320)+65536}else A&&(e-=3)>-1&&I.push(239,191,189);if(A=null,t<128){if((e-=1)<0)break;I.push(t)}else if(t<2048){if((e-=2)<0)break;I.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;I.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;I.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return I}function uf(i){let e=[];for(let t=0;t<i.length;++t)e.push(i.charCodeAt(t)&255);return e}function ff(i,e){let t,g,A,I=[];for(let C=0;C<i.length&&!((e-=2)<0);++C)t=i.charCodeAt(C),g=t>>8,A=t%256,I.push(A),I.push(g);return I}function Ao(i){return JI.toByteArray(cf(i))}function ai(i,e,t,g){let A;for(A=0;A<g&&!(A+t>=e.length||A>=i.length);++A)e[A+t]=i[A];return A}function Je(i,e){return i instanceof e||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===e.name}function IC(i){return i!==i}var pf=(function(){let i="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let g=t*16;for(let A=0;A<16;++A)e[g+A]=i[t]+i[A]}return e})();function xt(i){return typeof BigInt=="undefined"?mf:i}function mf(){throw new Error("BigInt not supported")}});var T3={};zu(T3,{default:()=>E3});function Bs(i){let e=new Map;if(i&&i.getPrefixes){let g=i.getPrefixes();g&&typeof g=="object"&&Object.entries(g).forEach(([A,I])=>{I&&A&&e.set(I,A)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([g,A])=>{e.has(g)||e.set(g,A)}),e}function wt(i,e){if(!i||typeof i!="string")return i;for(let[t,g]of e.entries())if(i.startsWith(t)){let A=i.substring(t.length);return`${g}:${A}`}return i}function dg(i,e=50){return!i||typeof i!="string"||i.length<=e?i:i.substring(0,e-3)+"..."}function QI(i,e){let t=!e||e.edgeStyle!=="straight",g={small:6,medium:10,large:16},A=e!=null&&e.nodeSize?g[e.nodeSize]:10,I=(e==null?void 0:e.showNodeLabels)!==!1;return{configure:{enabled:!1},physics:{enabled:(e==null?void 0:e.physicsEnabled)!==!1,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1},nodes:{shape:"dot",size:A,font:{size:I?12:0,color:i.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:t,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:i.edgeLabel,background:i.edgeLabelBackground,strokeWidth:0},color:{color:i.edge}}}}var Co=Lu(io());var Wt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",$g="http://www.w3.org/2001/XMLSchema#",li="http://www.w3.org/2000/10/swap/",le={xsd:{decimal:`${$g}decimal`,boolean:`${$g}boolean`,double:`${$g}double`,integer:`${$g}integer`,string:`${$g}string`},rdf:{type:`${Wt}type`,nil:`${Wt}nil`,first:`${Wt}first`,rest:`${Wt}rest`,langString:`${Wt}langString`,dirLangString:`${Wt}dirLangString`,reifies:`${Wt}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${li}reify#forSome`,forAll:`${li}reify#forAll`},log:{implies:`${li}log#implies`,isImpliedBy:`${li}log#isImpliedBy`}};var{xsd:di}=le,vf=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Io={"\\":"\\","'":"'",'"':'"',n:`
2
+ `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},bf=/[\x00-\x20<>\\"\{\}\|\^\`]/,yf={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_dircode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},wf=/$0^/,Jg=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i,this._dircode=/^--(ltr)|(rtl)/,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let t in this)!(t in yf)&&this[t]instanceof RegExp&&(this[t]=wf)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let g=this._input,A=g.length;for(;;){let n,r;for(;n=this._newline.exec(g);)this.comments&&(r=this._comment.exec(n[0]))&&I("comment",r[1],"",this._line,n[0].length),g=g.substr(n[0].length,g.length),A=g.length,this._line++;if(!n&&(n=this._whitespace.exec(g))&&(g=g.substr(n[0].length,g.length)),this._endOfFile.test(g))return t&&(this.comments&&(r=this._comment.exec(g))&&I("comment",r[1],"",this._line,g.length),g=null,I("eof","","",this._line,0)),this._input=g;let s=this._line,o=g[0],a="",l="",d="",h=null,c=0,u=!1;switch(o){case"^":if(g.length<3)break;if(g[1]==="^"){if(this._previousMarker="^^",g=g.substr(2),g[0]!=="<"){u=!0;break}}else{this._n3Mode&&(c=1,a="^");break}case"<":if(h=this._unescapedIri.exec(g))a="IRI",l=h[1];else if(h=this._iri.exec(g)){if(l=this._unescape(h[1]),l===null||bf.test(l))return C(this);a="IRI"}else g.length>2&&g[1]==="<"&&g[2]==="("?(a="<<(",c=3):!this._lineMode&&g.length>(t?1:2)&&g[1]==="<"?(a="<<",c=2):this._n3Mode&&g.length>1&&g[1]==="="&&(c=2,this._isImpliedBy?(a="abbreviation",l="<"):(a="inverse",l=">"));break;case">":g.length>1&&g[1]===">"&&(a=">>",c=2);break;case"_":((h=this._blank.exec(g))||t&&(h=this._blank.exec(`${g} `)))&&(a="blank",d="_",l=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(g))l=h[1];else if({value:l,matchLength:c}=this._parseLiteral(g),l===null)return C(this);(h!==null||c!==0)&&(a="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(g))l=h[1];else if({value:l,matchLength:c}=this._parseLiteral(g),l===null)return C(this);(h!==null||c!==0)&&(a="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(g))&&(a="var",l=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(g))&&h[1]!=="version"?(a="langcode",l=h[1]):(h=this._atKeyword.exec(g))&&(a=h[0]);break;case".":if(g.length===1?t:g[1]<"0"||g[1]>"9"){a=".",c=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if(g[1]==="-"){this._previousMarker==="langcode"&&(h=this._dircode.exec(g))&&(a="dircode",c=2,l=h[1]||h[2],c=l.length+2);break}(h=this._number.exec(g)||t&&(h=this._number.exec(`${g} `)))&&(a="literal",l=h[0],d=typeof h[1]=="string"?di.double:typeof h[2]=="string"?di.decimal:di.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(h=this._keyword.exec(g))?a=h[0].toUpperCase():u=!0;break;case"f":case"t":(h=this._boolean.exec(g))?(a="literal",l=h[0],d=di.boolean):u=!0;break;case"a":(h=this._shortPredicates.exec(g))?(a="abbreviation",l="a"):u=!0;break;case"=":this._n3Mode&&g.length>1&&(a="abbreviation",g[1]!==">"?(c=1,l="="):(c=2,l=">"));break;case"!":if(!this._n3Mode)break;case")":if(!t&&(g.length===1||g.length===2&&g[1]===">"))break;if(g.length>2&&g[1]===">"&&g[2]===">"){a=")>>",c=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(c=1,a=o);break;case"{":!this._lineMode&&g.length>=2&&(g[1]==="|"?(a="{|",c=2):(a=o,c=1));break;case"|":g.length>=2&&g[1]==="}"&&(a="|}",c=2);break;default:u=!0}if(u&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(h=this._prefix.exec(g))?(a="prefix",l=h[1]||""):((h=this._prefixed.exec(g))||t&&(h=this._prefixed.exec(`${g} `)))&&(a="prefixed",d=h[1]||"",l=this._unescape(h[2]))),this._previousMarker==="^^")switch(a){case"prefixed":a="type";break;case"IRI":a="typeIRI";break;default:a=""}if(!a)return t||!/^'''|^"""/.test(g)&&/\n|\r/.test(g)?C(this):this._input=g;let f=c||h[0].length,p=I(a,l,d,s,f);this.previousToken=p,this._previousMarker=a,g=g.substr(f,g.length)}function I(n,r,s,o,a){let l=g?A-g.length:A,d=l+a,h={type:n,value:r,prefix:s,line:o,start:l,end:d};return e(null,h),h}function C(n){e(n._syntaxError(/^\S*/.exec(g)[0]))}}_unescape(e){let t=!1,g=e.replace(vf,(A,I,C,n)=>{if(typeof I=="string")return String.fromCharCode(Number.parseInt(I,16));if(typeof C=="string"){let r=Number.parseInt(C,16);return r<=65535?String.fromCharCode(Number.parseInt(C,16)):String.fromCharCode(55296+((r-=65536)>>10),56320+(r&1023))}return n in Io?Io[n]:(t=!0,"")});return t?null:g}_parseLiteral(e){if(e.length>=3){let t=e.match(/^(?:"""|"|'''|'|)/)[0],g=t.length,A=Math.max(this._literalClosingPos,g);for(;(A=e.indexOf(t,A))>0;){let I=0;for(;e[A-I-1]==="\\";)I++;if(I%2===0){let C=e.substring(g,A),n=C.split(/\r\n|\r|\n/).length-1,r=A+g;if(g===1&&n!==0||g===3&&this._lineMode)break;return this._line+=n,{value:this._unescape(C),matchLength:r}}A++}this._literalClosingPos=e.length-g+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{let g=[],A;if(this._tokenizeToEnd((I,C)=>I?A=I:g.push(C),!0),A)throw A;return g}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",g=>{this._input!==null&&g.length!==0&&(this._pendingBuffer&&(g=Co.Buffer.concat([this._pendingBuffer,g]),this._pendingBuffer=null),g[g.length-1]&128?this._pendingBuffer=g:(typeof this._input=="undefined"?this._input=this._readStartingBom(typeof g=="string"?g:g.toString()):this._input+=g,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}};var{rdf:no,xsd:pg}=le,eA,xf=0;var Ef={namedNode:so,blankNode:oo,variable:lo,literal:ao,defaultGraph:Tf,quad:sC,triple:sC,fromTerm:qg,fromQuad:ho},ro=Ef,ot=class i{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof i?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},hi=class extends ot{get termType(){return"NamedNode"}},mg=class i extends ot{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,t=e.lastIndexOf('"')+1,g=e.lastIndexOf("--");return t<e.length&&e[t++]==="@"?(g>t?e.substr(0,g):e).substr(t).toLowerCase():""}get direction(){let e=this.id,t=e.lastIndexOf("--")+2;return t>1&&t<e.length?e.substr(t).toLowerCase():""}get datatype(){return new hi(this.datatypeString)}get datatypeString(){let e=this.id,t=e.lastIndexOf('"')+1,g=t<e.length?e[t]:"";return g==="^"?e.substr(t+2):g!=="@"?pg.string:e.indexOf("--",t)>0?no.dirLangString:no.langString}equals(e){return e instanceof i?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},CC=class extends ot{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},nC=class extends ot{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},rC=class extends ot{constructor(){return super(""),eA||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};eA=new rC;var ci=class extends ot{constructor(e,t,g,A){super(""),this._subject=e,this._predicate=t,this._object=g,this._graph=A||eA}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function so(i){return new hi(i)}function oo(i){return new CC(i||`n3-${xf++}`)}function ao(i,e){if(typeof e=="string")return new mg(`"${i}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new mg(`"${i}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let t=e?e.value:"";return t===""&&(typeof i=="boolean"?t=pg.boolean:typeof i=="number"&&(Number.isFinite(i)?t=Number.isInteger(i)?pg.integer:pg.double:(t=pg.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),t===""||t===pg.string?new mg(`"${i}"`):new mg(`"${i}"^^${t}`)}function lo(i){return new nC(i)}function Tf(){return eA}function sC(i,e,t,g){return new ci(i,e,t,g)}function qg(i){if(i instanceof ot)return i;switch(i.termType){case"NamedNode":return so(i.value);case"BlankNode":return oo(i.value);case"Variable":return lo(i.value);case"DefaultGraph":return eA;case"Literal":return ao(i.value,i.language||i.datatype);case"Quad":return ho(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function ho(i){if(i instanceof ci)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return sC(qg(i.subject),qg(i.predicate),qg(i.object),qg(i.graph))}var co=0,Et=class i{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&uo(this,e.factory);let t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",g=/turtle/.test(t),A=/trig/.test(t),I=/triple/.test(t),C=/quad/.test(t),n=this._n3Mode=/n3/.test(t),r=I||C;(this._supportsNamedGraphs=!(g||n))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(g||A||I||n),this._isImpliedBy=e.isImpliedBy,r&&(this._resolveRelativeIRI=s=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Jg({lineMode:r,n3:n,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){co=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,g,A,I){let C=this._n3Mode;this._contextStack.push({type:e,subject:g,predicate:A,object:I,graph:t,inverse:C?this._inversePredicate:!1,blankPrefix:C?this._prefixes._:"",quantified:C?this._quantified:null}),C&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){let g=this._contextStack.pop();if(!g||g.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=g.subject,this._predicate=g.predicate,this._object=g.object,this._graph=g.graph,this._n3Mode&&(this._inversePredicate=g.inverse,this._prefixes._=g.blankPrefix,this._quantified=g.quantified)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let g;switch(e.type){case"IRI":case"typeIRI":let A=this._resolveIRI(e.value);if(A===null)return this._error("Invalid IRI",e);g=this._factory.namedNode(A);break;case"type":case"prefixed":let I=this._prefixes[e.prefix];if(I===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);g=this._factory.namedNode(I+e.value);break;case"blank":g=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":g=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&g.id in this._quantified&&(g=this._quantified[g.id]),g}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":let t=this._contextStack;return(t.length&&t[t.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<(":return this._n3Mode?(this._saveContext("<<(",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Disallowed triple term as subject",e);case"<<":return this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":case"|}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._validAnnotation=!0,this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":let t=this._contextStack;return(t.length&&t[t.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<(":return this._saveContext("<<(",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case"<<":return this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let t=this._contextStack;return(t.length>1&&t[t.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):(this._predicate=null,this._readPredicate(e))}}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,g=null,A=this._readListItem,I=this._subject,C=this._contextStack,n=C[C.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,g=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),A=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,g=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),C.length!==0&&C[C.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(A=this._readPredicate,this._subject===this.RDF_NIL)return A}else if(A=this._getContextEndReader(),this._object===this.RDF_NIL)return A;g=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,A=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),A=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":this._saveContext("<<",this._graph,null,null,null),this._graph=null,A=this._readSubject;break;default:if((t=this._readEntity(e))===void 0)return}if(g===null&&(this._subject=g=this._factory.blankNode()),e.type==="<<"&&(C[C.length-1].subject=this._subject),I===null?n.predicate===null?n.subject=g:n.object=g:this._emit(I,this.RDF_REST,g,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,g,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(g,this.RDF_FIRST,t,this._graph)}return A}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,t){let g=this._factory.literal(this._literalValue),A;switch(e.type){case"type":case"typeIRI":let I=this._readEntity(e);if(I===void 0)return;if(I.value===le.rdf.langString||I.value===le.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);g=this._factory.literal(this._literalValue,I),e=null;break;case"langcode":if(e.value.length>8)return this._error("Detected language tag of length larger than 8",e);g=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,A=this._readDirCode.bind(this,t);break}return{token:e,literal:g,readCb:A}}_readDirCode(e,t,g){if(g.type==="dircode"){let A=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:g.value});e==="subject"?this._subject=A:this._object=A,this._literalLanguage=void 0,g=null}return e==="subject"?g===null?this._readPredicateOrNamedGraph:this._readPredicateOrNamedGraph(g):this._completeObjectLiteralPost(g,t)}_completeSubjectLiteral(e){let t=this._completeLiteral(e,"subject");return this._subject=t.literal,t.readCb?t.readCb.bind(this,!1):this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){let g=this._completeLiteral(e,"object");if(g)return this._object=g.literal,g.readCb?g.readCb.bind(this,t):this._completeObjectLiteralPost(g.token,t)}_completeObjectLiteralPost(e,t){return t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,g=this._graph,A=!1,I=this._subject,C=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,this._tripleTerm=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,C&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"~":t=this._readReifierInAnnotation,A=!0;break;case"{|":this._subject=this._readTripleTerm(),this._validAnnotation=!1,A=!0,t=this._readPredicate;break;case"|}":if(!this._annotation)return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject=null,this._annotation=!1,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(g=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(I!==null&&(!A||A&&!this._annotation)){let n=this._predicate,r=this._object;C?this._emit(r,n,I,g):this._emit(I,n,r,g)}return A&&(this._annotation=!0),t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){let t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||i.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.end-e.start!==e.value.length+2?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,e))}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let t=this._contextStack,g=t.length&&t[t.length-1];if(g&&g.type==="item"){let A=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,A,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,g,A=this._factory.blankNode();if((g=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=A):(t=this._object,this._object=A),this._emit(t,g,A,this._graph),this._readPath}_readBackwardPath(e){let t=this._factory.blankNode(),g,A;if((g=this._readEntity(e))!==void 0)return this._predicate===null?(A=this._subject,this._subject=t):(A=this._object,this._object=t),this._emit(t,g,A,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<(",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let t=this._readTripleTerm();this._restoreContext("<<",e);let g=this._contextStack,A=g.length&&g[g.length-1];return A&&A.type==="list"?(this._emit(this._subject,this.RDF_FIRST,t,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=t,this._readPredicateOrReifierTripleEnd):(this._object=t,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return e.type==="IRI"||e.type==="typeIRI"||e.type==="type"||e.type==="prefixed"||e.type==="blank"||e.type==="var"?(this._reifier=this._readEntity(e),this._readPunctuation):(this._readTripleTerm(),this._subject=null,this._readPunctuation(e))}_readTripleTerm(){let e=this._contextStack,t=e.length&&e[e.length-1],g=t?t.graph:void 0,A=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._factory.quad(this._subject,this._predicate,this._object),this._emit(A,this.RDF_REIFIES,this._tripleTerm,g||this.DEFAULTGRAPH),A}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<(":return this._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier}}_emit(e,t,g,A){this._callback(null,this._factory.quad(e,t,g,A||this.DEFAULTGRAPH))}_error(e,t){let g=new Error(`${e} on line ${t.line}.`);g.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(g),this._callback=tA}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let t=e.length,g="",A=-1,I=-1,C=0,n="/";for(;A<t;){switch(n){case":":if(I<0&&e[++A]==="/"&&e[++A]==="/")for(;(I=A+1)<t&&e[I]!=="/";)A=I;break;case"?":case"#":A=t;break;case"/":if(e[A+1]===".")switch(n=e[++A+1],n){case"/":g+=e.substring(C,A-1),C=A+1;break;case void 0:case"?":case"#":return g+e.substring(C,A)+e.substr(A+1);case".":if(n=e[++A+1],n===void 0||n==="/"||n==="?"||n==="#"){if(g+=e.substring(C,A-2),(C=g.lastIndexOf("/"))>=I&&(g=g.substr(0,C)),n!=="/")return`${g}/${e.substr(A+1)}`;C=A+1}}}n=e[++A]}return g+e.substring(C)}parse(e,t,g,A){let I,C,n,r;if(t&&(t.onQuad||t.onPrefix||t.onComment||t.onVersion)?(I=t.onQuad,C=t.onPrefix,n=t.onComment,r=t.onVersion):(I=t,C=g,r=A),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${co++}_`,this._prefixCallback=C||tA,this._versionCallback=r||tA,this._inversePredicate=!1,this._quantified=Object.create(null),!I){let o=[],a;if(this._callback=(l,d)=>{l?a=l:d&&o.push(d)},this._lexer.tokenize(e).every(l=>this._readCallback=this._readCallback(l)),a)throw a;return o}let s=(o,a)=>{o!==null?(this._callback(o),this._callback=tA):this._readCallback&&(this._readCallback=this._readCallback(a))};n&&(this._lexer.comments=!0,s=(o,a)=>{o!==null?(this._callback(o),this._callback=tA):this._readCallback&&(a.type==="comment"?n(a.value):this._readCallback=this._readCallback(a))}),this._callback=I,this._lexer.tokenize(e,s)}};function tA(){}function uo(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(le.rdf.first),i.RDF_REST=e.namedNode(le.rdf.rest),i.RDF_NIL=e.namedNode(le.rdf.nil),i.RDF_REIFIES=e.namedNode(le.rdf.reifies),i.N3_FORALL=e.namedNode(le.r.forAll),i.N3_FORSOME=e.namedNode(le.r.forSome),i.ABBREVIATIONS={a:e.namedNode(le.rdf.type),"=":e.namedNode(le.owl.sameAs),">":e.namedNode(le.log.implies),"<":e.namedNode(le.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Et.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];uo(Et.prototype,ro);async function fo(i){var e;if(!i)return[];try{let t;if(typeof i.text=="function")t=await i.text();else if(typeof i.data=="string")t=i.data;else if(typeof i=="string")t=i;else return[];let A=new Et().parse(t),I=[];for(let C of A){let n=C.subject.value,r=C.predicate.value,s,o,a,l;C.object.termType==="Literal"?(s="literal",o=C.object.value,a=(e=C.object.datatype)==null?void 0:e.value,l=C.object.language||void 0):C.object.termType==="BlankNode"?(s="bnode",o=C.object.value):(s="uri",o=C.object.value),I.push({subject:n,predicate:r,object:{value:o,type:s,datatype:a,lang:l}})}return I}catch(t){return console.error("Failed to parse RDF response:",t),[]}}function po(i){let e=[];return!i||!i.getBindings||i.getBindings().forEach(g=>{if(!g.subject||!g.predicate||!g.object)return;let A={subject:g.subject.value,predicate:g.predicate.value,object:{value:g.object.value,type:g.object.type||"uri",datatype:g.object.datatype,lang:g.object["xml:lang"]}};e.push(A)}),e}function oC(i,e,t){return i.uri&&i.uri.startsWith("_:")?t.blankNode:i.type==="literal"?t.literal:e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===i.uri)?t.typeObject:t.uri}var Of={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"a","http://www.w3.org/1999/02/22-rdf-syntax-ns#value":"val","http://www.w3.org/2000/01/rdf-schema#label":"lbl","http://www.w3.org/2000/01/rdf-schema#comment":"cmt","http://www.w3.org/2000/01/rdf-schema#subClassOf":"\u2282","http://www.w3.org/2000/01/rdf-schema#subPropertyOf":"\u2286","http://www.w3.org/2000/01/rdf-schema#domain":"dom","http://www.w3.org/2000/01/rdf-schema#range":"rng","http://www.w3.org/2000/01/rdf-schema#seeAlso":"see","http://www.w3.org/2000/01/rdf-schema#isDefinedBy":"idb","http://www.w3.org/2002/07/owl#sameAs":"\u2261","http://www.w3.org/2002/07/owl#equivalentClass":"\u2245","http://www.w3.org/2002/07/owl#inverseOf":"\u21C4","http://www.w3.org/2002/07/owl#disjointWith":"\u2260","http://www.w3.org/2004/02/skos/core#prefLabel":"\u2605","http://www.w3.org/2004/02/skos/core#altLabel":"\u2606","http://www.w3.org/2004/02/skos/core#definition":"def","http://www.w3.org/2004/02/skos/core#broader":"\u2191","http://www.w3.org/2004/02/skos/core#narrower":"\u2193","http://www.w3.org/2004/02/skos/core#related":"\u2194","http://www.w3.org/2004/02/skos/core#note":"note","http://www.w3.org/2004/02/skos/core#exactMatch":"\u2261","http://www.w3.org/2004/02/skos/core#closeMatch":"\u2248","http://purl.org/dc/terms/title":"ttl","http://purl.org/dc/terms/description":"dsc","http://purl.org/dc/terms/created":"crt","http://purl.org/dc/terms/modified":"mod","http://purl.org/dc/terms/creator":"by","http://purl.org/dc/terms/subject":"sbj","http://xmlns.com/foaf/0.1/name":"nm","http://xmlns.com/foaf/0.1/knows":"\u27F7","http://xmlns.com/foaf/0.1/member":"mbr","http://schema.org/name":"nm","http://schema.org/description":"dsc"};function mo(i){return Of[i]}var vo="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",bo="https://schema.org/image",yo="https://schema.org/icon",wo="http://www.w3.org/2000/01/rdf-schema#label",Pf="http://www.w3.org/2000/01/rdf-schema#subClassOf",xo=new Set([bo,yo,wo]);function aC(i,e){let t="</div>",g=i.lastIndexOf(t);return g===-1?i+e:i.slice(0,g)+e+t}function lC(i,e){return`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${_e(i)}</span><span class="yasgui-tooltip-val">${_e(e)}</span></div>`}function _e(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Sf(i,e,t){let g=i.startsWith("_:"),A=`<div class="yasgui-tooltip-type">${g?"Blank Node":"URI"}</div>`;return A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${g?"Identifier":"Full URI"}</span><span class="yasgui-tooltip-val">${_e(i)}</span></div>`,e.filter(I=>I.subject===i&&I.predicate===vo).forEach(I=>{let C=wt(I.object.value,t);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">rdf:type</span><span class="yasgui-tooltip-val">${_e(C)}</span></div>`}),e.filter(I=>I.subject===i&&I.object.type==="literal").forEach(I=>{let C=wt(I.predicate,t);A+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">${_e(C)}</span><span class="yasgui-tooltip-val">${_e(I.object.value)}</span></div>`}),`<div class="yasgui-graph-tooltip">${A}</div>`}function ui(i,e,t,g,A){let C=`<div class="yasgui-tooltip-type">${i==="uri"?"URI":i==="literal"?"Literal":"Blank Node"}</div>`;if(i==="literal"){if(C+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Value</span><span class="yasgui-tooltip-val">${_e(e)}</span></div>`,t){let n=A?wt(t,A):t;C+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Datatype</span><span class="yasgui-tooltip-val">${_e(n)}</span></div>`}g&&(C+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Language</span><span class="yasgui-tooltip-val">${_e(g)}</span></div>`)}else i==="uri"?C+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${_e(e)}</span></div>`:i==="bnode"&&(C+=`<div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Identifier</span><span class="yasgui-tooltip-val">${_e(e)}</span></div>`);return`<div class="yasgui-graph-tooltip">${C}</div>`}function Rf(i){return`<div class="yasgui-graph-tooltip">${`<div class="yasgui-tooltip-type">Predicate</div><div class="yasgui-tooltip-row"><span class="yasgui-tooltip-key">Full URI</span><span class="yasgui-tooltip-val">${_e(i)}</span></div>`}</div>`}function Df(i,e,t,g){let A=new Map,I=1,C=(g==null?void 0:g.nodeSize)==="small"?.5:(g==null?void 0:g.nodeSize)==="large"?2:1;return i.forEach(n=>{if(!A.has(n.subject)){let s=n.subject.startsWith("_:"),o=s?n.subject:dg(wt(n.subject,e));A.set(n.subject,{id:I++,uri:n.subject,label:o,color:oC({uri:n.subject,type:"uri"},i,t),type:"uri",fullValue:n.subject,size:10*C,title:ui(s?"bnode":"uri",n.subject,void 0,void 0,e)})}let r=n.object.value;if(!A.has(r)&&!xo.has(n.predicate)){let s=n.object.type==="literal",o=!s&&r.startsWith("_:"),a,l,d;s?(a=dg(r),l=r,d=ui("literal",r,n.object.datatype,n.object.lang,e)):o?(a=r,l=r,d=ui("bnode",r)):(a=dg(wt(r,e)),l=r,d=ui("uri",r,void 0,void 0,e)),A.set(r,{id:I++,uri:s?null:r,label:a,color:oC({uri:r,type:s?"literal":"uri"},i,t),type:s?"literal":"uri",fullValue:l,size:(s?5:10)*C,title:d})}}),A}function Nf(i,e,t,g){let A=[],I=new Set;return i.forEach(C=>{var o,a;if(xo.has(C.predicate))return;let n=e.get(C.subject),r=e.get(C.object.value);if(!n||!r)return;let s=`${n.id}-${C.predicate}-${r.id}`;if(!I.has(s)){I.add(s);let l,d=(o=g==null?void 0:g.predicateDisplay)!=null?o:"label";d==="none"?l="":d==="icon"?l=(a=mo(C.predicate))!=null?a:dg(wt(C.predicate,t)):l=dg(wt(C.predicate,t)),A.push({id:`edge_${n.id}_${r.id}_${A.length}`,from:n.id,to:r.id,label:l,predicate:C.predicate,title:Rf(C.predicate),arrows:"to"})}}),A}function _f(i,e,t){return i.uri&&i.uri.startsWith("_:")||!t.compactMode?!0:!(i.type==="literal"||e.some(A=>A.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&A.object.value===i.uri))}function fi(i,e,t,g){let A=Df(i,e,t,g),I=(g==null?void 0:g.nodeSize)==="small"?.5:(g==null?void 0:g.nodeSize)==="large"?2:1,C=new Map;for(let l of i){C.has(l.subject)||C.set(l.subject,new Map);let d=C.get(l.subject);d.has(l.predicate)||d.set(l.predicate,[]),d.get(l.predicate).push(l.object.value)}function n(l){let d=C.get(l);if(!d)return{};let h=d.get(yo);if(h!=null&&h.length)return{icon:h[0]};let c=d.get(bo);return c!=null&&c.length?{image:c[0]}:{}}function r(l){var c,u,f,p;let d=n(l);if(d.icon||d.image)return d;let h=(u=(c=C.get(l))==null?void 0:c.get(vo))!=null?u:[];for(let E of h){let x=n(E);if(x.icon||x.image)return x}for(let E of h){let x=(p=(f=C.get(E))==null?void 0:f.get(Pf))!=null?p:[];for(let P of x){let _=n(P);if(_.icon||_.image)return _}}return{}}g!=null&&g.compactMode&&new Set(i.map(d=>d.subject)).forEach(d=>{let h=A.get(d);h&&(h.title=Sf(d,i,e))}),A.forEach(l=>{var c,u;if(!l.uri||l.type==="literal")return;let d=g!=null&&g.compactMode?r(l.uri):n(l.uri),h=(u=(c=C.get(l.uri))==null?void 0:c.get(wo))==null?void 0:u[0];if(d.icon)l.shape="text",l.label=h?`${d.icon}
3
+ ${h}`:d.icon,l.font={size:14*I},g!=null&&g.compactMode||(l.title=aC(l.title,lC("Icon",d.icon)));else if(d.image){let f=!1;try{let p=new URL(d.image);f=p.protocol==="http:"||p.protocol==="https:"}catch(p){}f&&(l.shape="circularImage",l.image=d.image),h&&(l.label=h,l.font={size:14*I}),g!=null&&g.compactMode||(l.title=aC(l.title,lC("Image",d.image)))}else h&&(l.label=h);h&&!(g!=null&&g.compactMode)&&(l.title=aC(l.title,lC("rdfs:label",h)))});let s=new Set;A.forEach(l=>{(!g||_f(l,i,g))&&s.add(l.id)});let o=Nf(i,A,e,g).filter(l=>s.has(l.from)&&s.has(l.to));return{nodes:Array.from(A.values()).filter(l=>s.has(l.id)),edges:o}}var dC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function R(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var pi=function(i){return i&&i.Math===Math&&i},$=pi(typeof globalThis=="object"&&globalThis)||pi(typeof window=="object"&&window)||pi(typeof self=="object"&&self)||pi(typeof dC=="object"&&dC)||(function(){return this})()||dC||Function("return this")(),z=function(i){try{return!!i()}catch(e){return!0}},kf=z,PA=!kf(function(){var i=(function(){}).bind();return typeof i!="function"||i.hasOwnProperty("prototype")}),Mf=PA,fd=Function.prototype,Eo=fd.apply,To=fd.call,xI=typeof Reflect=="object"&&Reflect.apply||(Mf?To.bind(Eo):function(){return To.apply(Eo,arguments)}),pd=PA,md=Function.prototype,mn=md.call,Ff=pd&&md.bind.bind(mn,mn),L=pd?Ff:function(i){return function(){return mn.apply(i,arguments)}},vd=L,Bf=vd({}.toString),zf=vd("".slice),vt=function(i){return zf(Bf(i),8,-1)},Lf=vt,Zf=L,Kr=function(i){if(Lf(i)==="Function")return Zf(i)},vn=typeof document=="object"&&document.all,Gf=typeof vn=="undefined"&&vn!==void 0,bd={all:vn,IS_HTMLDDA:Gf},yd=bd,jf=yd.all,ue=yd.IS_HTMLDDA?function(i){return typeof i=="function"||i===jf}:function(i){return typeof i=="function"},SA={},Vf=z,ne=!Vf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Yf=PA,mi=Function.prototype.call,Ke=Yf?mi.bind(mi):function(){return mi.apply(mi,arguments)},RA={},wd={}.propertyIsEnumerable,xd=Object.getOwnPropertyDescriptor,Wf=xd&&!wd.call({1:2},1);RA.f=Wf?function(e){var t=xd(this,e);return!!t&&t.enumerable}:wd;var DA=function(i,e){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:e}},Uf=L,Hf=z,Kf=vt,hC=Object,Qf=Uf("".split),EI=Hf(function(){return!hC("z").propertyIsEnumerable(0)})?function(i){return Kf(i)==="String"?Qf(i,""):hC(i)}:hC,Lg=function(i){return i==null},Xf=Lg,$f=TypeError,NA=function(i){if(Xf(i))throw new $f("Can't call method on "+i);return i},Jf=EI,qf=NA,Qe=function(i){return Jf(qf(i))},Oo=ue,Ed=bd,ep=Ed.all,pe=Ed.IS_HTMLDDA?function(i){return typeof i=="object"?i!==null:Oo(i)||i===ep}:function(i){return typeof i=="object"?i!==null:Oo(i)},Z={},cC=Z,uC=$,tp=ue,Po=function(i){return tp(i)?i:void 0},Xe=function(i,e){return arguments.length<2?Po(cC[i])||Po(uC[i]):cC[i]&&cC[i][e]||uC[i]&&uC[i][e]},gp=L,J=gp({}.isPrototypeOf),_A=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Td=$,fC=_A,So=Td.process,Ro=Td.Deno,Do=So&&So.versions||Ro&&Ro.version,No=Do&&Do.v8,je,Xi;No&&(je=No.split("."),Xi=je[0]>0&&je[0]<4?1:+(je[0]+je[1]));!Xi&&fC&&(je=fC.match(/Edge\/(\d+)/),(!je||je[1]>=74)&&(je=fC.match(/Chrome\/(\d+)/),je&&(Xi=+je[1])));var kA=Xi,_o=kA,Ap=z,ip=$,Ip=ip.String,Zg=!!Object.getOwnPropertySymbols&&!Ap(function(){var i=Symbol("symbol detection");return!Ip(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&_o&&_o<41}),Cp=Zg,Od=Cp&&!Symbol.sham&&typeof Symbol.iterator=="symbol",np=Xe,rp=ue,sp=J,op=Od,ap=Object,MA=op?function(i){return typeof i=="symbol"}:function(i){var e=np("Symbol");return rp(e)&&sp(e.prototype,ap(i))},lp=String,FA=function(i){try{return lp(i)}catch(e){return"Object"}},dp=ue,hp=FA,cp=TypeError,Ig=function(i){if(dp(i))return i;throw new cp(hp(i)+" is not a function")},up=Ig,fp=Lg,Qr=function(i,e){var t=i[e];return fp(t)?void 0:up(t)},pC=Ke,mC=ue,vC=pe,pp=TypeError,mp=function(i,e){var t,g;if(e==="string"&&mC(t=i.toString)&&!vC(g=pC(t,i))||mC(t=i.valueOf)&&!vC(g=pC(t,i))||e!=="string"&&mC(t=i.toString)&&!vC(g=pC(t,i)))return g;throw new pp("Can't convert object to primitive value")},Pd={exports:{}},ko=$,vp=Object.defineProperty,bp=function(i,e){try{vp(ko,i,{value:e,configurable:!0,writable:!0})}catch(t){ko[i]=e}return e},yp=$,wp=bp,Mo="__core-js_shared__",xp=yp[Mo]||wp(Mo,{}),Xr=xp,Fo=Xr;(Pd.exports=function(i,e){return Fo[i]||(Fo[i]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Gg=Pd.exports,Ep=NA,Tp=Object,Re=function(i){return Tp(Ep(i))},Op=L,Pp=Re,Sp=Op({}.hasOwnProperty),re=Object.hasOwn||function(e,t){return Sp(Pp(e),t)},Rp=L,Dp=0,Np=Math.random(),_p=Rp(1 .toString),TI=function(i){return"Symbol("+(i===void 0?"":i)+")_"+_p(++Dp+Np,36)},kp=$,Mp=Gg,Bo=re,Fp=TI,Bp=Zg,zp=Od,Tg=kp.Symbol,bC=Mp("wks"),Lp=zp?Tg.for||Tg:Tg&&Tg.withoutSetter||Fp,te=function(i){return Bo(bC,i)||(bC[i]=Bp&&Bo(Tg,i)?Tg[i]:Lp("Symbol."+i)),bC[i]},Zp=Ke,zo=pe,Lo=MA,Gp=Qr,jp=mp,Vp=te,Yp=TypeError,Wp=Vp("toPrimitive"),Up=function(i,e){if(!zo(i)||Lo(i))return i;var t=Gp(i,Wp),g;if(t){if(e===void 0&&(e="default"),g=Zp(t,i,e),!zo(g)||Lo(g))return g;throw new Yp("Can't convert object to primitive value")}return e===void 0&&(e="number"),jp(i,e)},Hp=Up,Kp=MA,OI=function(i){var e=Hp(i,"string");return Kp(e)?e:e+""},Qp=$,Zo=pe,bn=Qp.document,Xp=Zo(bn)&&Zo(bn.createElement),Sd=function(i){return Xp?bn.createElement(i):{}},$p=ne,Jp=z,qp=Sd,Rd=!$p&&!Jp(function(){return Object.defineProperty(qp("div"),"a",{get:function(){return 7}}).a!==7}),em=ne,tm=Ke,gm=RA,Am=DA,im=Qe,Im=OI,Cm=re,nm=Rd,Go=Object.getOwnPropertyDescriptor;SA.f=em?Go:function(e,t){if(e=im(e),t=Im(t),nm)try{return Go(e,t)}catch(g){}if(Cm(e,t))return Am(!tm(gm.f,e,t),e[t])};var rm=z,sm=ue,om=/#|\.prototype\./,BA=function(i,e){var t=lm[am(i)];return t===hm?!0:t===dm?!1:sm(e)?rm(e):!!e},am=BA.normalize=function(i){return String(i).replace(om,".").toLowerCase()},lm=BA.data={},dm=BA.NATIVE="N",hm=BA.POLYFILL="P",cm=BA,jo=Kr,um=Ig,fm=PA,pm=jo(jo.bind),zA=function(i,e){return um(i),e===void 0?i:fm?pm(i,e):function(){return i.apply(e,arguments)}},De={},mm=ne,vm=z,Dd=mm&&vm(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),bm=pe,ym=String,wm=TypeError,bt=function(i){if(bm(i))return i;throw new wm(ym(i)+" is not an object")},xm=ne,Em=Rd,Tm=Dd,vi=bt,Vo=OI,Om=TypeError,yC=Object.defineProperty,Pm=Object.getOwnPropertyDescriptor,wC="enumerable",xC="configurable",EC="writable";De.f=xm?Tm?function(e,t,g){if(vi(e),t=Vo(t),vi(g),typeof e=="function"&&t==="prototype"&&"value"in g&&EC in g&&!g[EC]){var A=Pm(e,t);A&&A[EC]&&(e[t]=g.value,g={configurable:xC in g?g[xC]:A[xC],enumerable:wC in g?g[wC]:A[wC],writable:!1})}return yC(e,t,g)}:yC:function(e,t,g){if(vi(e),t=Vo(t),vi(g),Em)try{return yC(e,t,g)}catch(A){}if("get"in g||"set"in g)throw new Om("Accessors not supported");return"value"in g&&(e[t]=g.value),e};var Sm=ne,Rm=De,Dm=DA,jg=Sm?function(i,e,t){return Rm.f(i,e,Dm(1,t))}:function(i,e,t){return i[e]=t,i},bi=$,Nm=xI,_m=Kr,km=ue,Mm=SA.f,Fm=cm,vg=Z,Bm=zA,bg=jg,Yo=re,zm=function(i){var e=function(t,g,A){if(this instanceof e){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,g)}return new i(t,g,A)}return Nm(i,this,arguments)};return e.prototype=i.prototype,e},D=function(i,e){var t=i.target,g=i.global,A=i.stat,I=i.proto,C=g?bi:A?bi[t]:(bi[t]||{}).prototype,n=g?vg:vg[t]||bg(vg,t,{})[t],r=n.prototype,s,o,a,l,d,h,c,u,f;for(l in e)s=Fm(g?l:t+(A?".":"#")+l,i.forced),o=!s&&C&&Yo(C,l),h=n[l],o&&(i.dontCallGetSet?(f=Mm(C,l),c=f&&f.value):c=C[l]),d=o&&c?c:e[l],!(o&&typeof h==typeof d)&&(i.bind&&o?u=Bm(d,bi):i.wrap&&o?u=zm(d):I&&km(d)?u=_m(d):u=d,(i.sham||d&&d.sham||h&&h.sham)&&bg(u,"sham",!0),bg(n,l,u),I&&(a=t+"Prototype",Yo(vg,a)||bg(vg,a,{}),bg(vg[a],l,d),i.real&&r&&(s||!r[l])&&bg(r,l,d)))},Lm=Math.ceil,Zm=Math.floor,Gm=Math.trunc||function(e){var t=+e;return(t>0?Zm:Lm)(t)},jm=Gm,PI=function(i){var e=+i;return e!==e||e===0?0:jm(e)},Vm=PI,Ym=Math.max,Wm=Math.min,LA=function(i,e){var t=Vm(i);return t<0?Ym(t+e,0):Wm(t,e)},Um=PI,Hm=Math.min,Km=function(i){return i>0?Hm(Um(i),9007199254740991):0},Qm=Km,ze=function(i){return Qm(i.length)},Xm=Qe,$m=LA,Jm=ze,Wo=function(i){return function(e,t,g){var A=Xm(e),I=Jm(A),C=$m(g,I),n;if(i&&t!==t){for(;I>C;)if(n=A[C++],n!==n)return!0}else for(;I>C;C++)if((i||C in A)&&A[C]===t)return i||C||0;return!i&&-1}},$r={includes:Wo(!0),indexOf:Wo(!1)},ZA={},qm=L,TC=re,ev=Qe,tv=$r.indexOf,gv=ZA,Uo=qm([].push),Nd=function(i,e){var t=ev(i),g=0,A=[],I;for(I in t)!TC(gv,I)&&TC(t,I)&&Uo(A,I);for(;e.length>g;)TC(t,I=e[g++])&&(~tv(A,I)||Uo(A,I));return A},Jr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Av=Nd,iv=Jr,GA=Object.keys||function(e){return Av(e,iv)},jA={};jA.f=Object.getOwnPropertySymbols;var Ho=ne,Iv=L,Cv=Ke,nv=z,OC=GA,rv=jA,sv=RA,ov=Re,av=EI,yg=Object.assign,Ko=Object.defineProperty,lv=Iv([].concat),dv=!yg||nv(function(){if(Ho&&yg({b:1},yg(Ko({},"a",{enumerable:!0,get:function(){Ko(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},e={},t=Symbol("assign detection"),g="abcdefghijklmnopqrst";return i[t]=7,g.split("").forEach(function(A){e[A]=A}),yg({},i)[t]!==7||OC(yg({},e)).join("")!==g})?function(e,t){for(var g=ov(e),A=arguments.length,I=1,C=rv.f,n=sv.f;A>I;)for(var r=av(arguments[I++]),s=C?lv(OC(r),C(r)):OC(r),o=s.length,a=0,l;o>a;)l=s[a++],(!Ho||Cv(n,r,l))&&(g[l]=r[l]);return g}:yg,hv=D,Qo=dv;hv({target:"Object",stat:!0,arity:2,forced:Object.assign!==Qo},{assign:Qo});var cv=Z,uv=cv.Object.assign,fv=uv,pv=fv,mv=pv,ee=R(mv),vv=L,SI=vv([].slice),_d=L,bv=Ig,yv=pe,wv=re,Xo=SI,xv=PA,kd=Function,Ev=_d([].concat),Tv=_d([].join),PC={},Ov=function(i,e,t){if(!wv(PC,e)){for(var g=[],A=0;A<e;A++)g[A]="a["+A+"]";PC[e]=kd("C,a","return new C("+Tv(g,",")+")")}return PC[e](i,t)},Pv=xv?kd.bind:function(e){var t=bv(this),g=t.prototype,A=Xo(arguments,1),I=function(){var n=Ev(A,Xo(arguments));return this instanceof I?Ov(t,n.length,n):t.apply(e,n)};return yv(g)&&(I.prototype=g),I},Sv=D,$o=Pv;Sv({target:"Function",proto:!0,forced:Function.bind!==$o},{bind:$o});var Rv=Z,Ie=function(i){return Rv[i+"Prototype"]},Dv=Ie,Nv=Dv("Function").bind,_v=J,kv=Nv,SC=Function.prototype,Mv=function(i){var e=i.bind;return i===SC||_v(SC,i)&&e===SC.bind?kv:e},Fv=Mv,Bv=Fv,zv=Bv,y=R(zv);function qr(i,e,t,g){i.beginPath(),i.arc(e,t,g,0,2*Math.PI,!1),i.closePath()}function Lv(i,e,t,g){i.beginPath(),i.rect(e-g,t-g,g*2,g*2),i.closePath()}function Zv(i,e,t,g){i.beginPath(),g*=1.15,t+=.275*g;let A=g*2,I=A/2,C=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-I*I);i.moveTo(e,t-(n-C)),i.lineTo(e+I,t+C),i.lineTo(e-I,t+C),i.lineTo(e,t-(n-C)),i.closePath()}function Gv(i,e,t,g){i.beginPath(),g*=1.15,t-=.275*g;let A=g*2,I=A/2,C=Math.sqrt(3)/6*A,n=Math.sqrt(A*A-I*I);i.moveTo(e,t+(n-C)),i.lineTo(e+I,t-C),i.lineTo(e-I,t-C),i.lineTo(e,t+(n-C)),i.closePath()}function jv(i,e,t,g){i.beginPath(),g*=.82,t+=.1*g;for(let A=0;A<10;A++){let I=A%2===0?g*1.3:g*.5;i.lineTo(e+I*Math.sin(A*2*Math.PI/10),t-I*Math.cos(A*2*Math.PI/10))}i.closePath()}function Vv(i,e,t,g){i.beginPath(),i.lineTo(e,t+g),i.lineTo(e+g,t),i.lineTo(e,t-g),i.lineTo(e-g,t),i.closePath()}function Md(i,e,t,g,A,I){let C=Math.PI/180;g-2*I<0&&(I=g/2),A-2*I<0&&(I=A/2),i.beginPath(),i.moveTo(e+I,t),i.lineTo(e+g-I,t),i.arc(e+g-I,t+I,I,C*270,C*360,!1),i.lineTo(e+g,t+A-I),i.arc(e+g-I,t+A-I,I,0,C*90,!1),i.lineTo(e+I,t+A),i.arc(e+I,t+A-I,I,C*90,C*180,!1),i.lineTo(e,t+I),i.arc(e+I,t+I,I,C*180,C*270,!1),i.closePath()}function yn(i,e,t,g,A){let I=.5522848,C=g/2*I,n=A/2*I,r=e+g,s=t+A,o=e+g/2,a=t+A/2;i.beginPath(),i.moveTo(e,a),i.bezierCurveTo(e,a-n,o-C,t,o,t),i.bezierCurveTo(o+C,t,r,a-n,r,a),i.bezierCurveTo(r,a+n,o+C,s,o,s),i.bezierCurveTo(o-C,s,e,a+n,e,a),i.closePath()}function Fd(i,e,t,g,A){let I=.3333333333333333,C=g,n=A*I,r=.5522848,s=C/2*r,o=n/2*r,a=e+C,l=t+n,d=e+C/2,h=t+n/2,c=t+(A-n/2),u=t+A;i.beginPath(),i.moveTo(a,h),i.bezierCurveTo(a,h+o,d+s,l,d,l),i.bezierCurveTo(d-s,l,e,h+o,e,h),i.bezierCurveTo(e,h-o,d-s,t,d,t),i.bezierCurveTo(d+s,t,a,h-o,a,h),i.lineTo(a,c),i.bezierCurveTo(a,c+o,d+s,u,d,u),i.bezierCurveTo(d-s,u,e,c+o,e,c),i.lineTo(e,h)}function Bd(i,e,t,g,A,I){i.beginPath(),i.moveTo(e,t);let C=I.length,n=g-e,r=A-t,s=r/n,o=Math.sqrt(n*n+r*r),a=0,l=!0,d=0,h=+I[0];for(;o>=.1;)h=+I[a++%C],h>o&&(h=o),d=Math.sqrt(h*h/(1+s*s)),d=n<0?-d:d,e+=d,t+=s*d,l===!0?i.lineTo(e,t):i.moveTo(e,t),o-=h,l=!l}function Yv(i,e,t,g){i.beginPath();let A=6,I=Math.PI*2/A;i.moveTo(e+g,t);for(let C=1;C<A;C++)i.lineTo(e+g*Math.cos(I*C),t+g*Math.sin(I*C));i.closePath()}var Jo={circle:qr,dashedLine:Bd,database:Fd,diamond:Vv,ellipse:yn,ellipse_vis:yn,hexagon:Yv,roundRect:Md,square:Lv,star:jv,triangle:Zv,triangleDown:Gv};function Wv(i){return Object.prototype.hasOwnProperty.call(Jo,i)?Jo[i]:function(e){for(var t=arguments.length,g=new Array(t>1?t-1:0),A=1;A<t;A++)g[A-1]=arguments[A];CanvasRenderingContext2D.prototype[i].call(e,g)}}function Cg(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(!i||typeof document=="undefined")){var g=document.head||document.getElementsByTagName("head")[0],A=document.createElement("style");A.type="text/css",t==="top"&&g.firstChild?g.insertBefore(A,g.firstChild):g.appendChild(A),A.styleSheet?A.styleSheet.cssText=i:A.appendChild(document.createTextNode(i))}}var Uv=`.vis-overlay {
3
4
  position: absolute;
4
5
  top: 0px;
5
6
  right: 0px;
@@ -13,13 +14,13 @@ ${h}`:l.icon,a.font={size:14*C},t!=null&&t.compactMode||(a.title=fC(a.title,pC("
13
14
  .vis-active {
14
15
  box-shadow: 0 0 10px #86d5f8;
15
16
  }
16
- `;Hg(Rp);var kp=`/* override some bootstrap styles screwing up the timelines css */
17
+ `;Cg(Uv);var Hv=`/* override some bootstrap styles screwing up the timelines css */
17
18
 
18
19
  .vis [class*="span"] {
19
20
  min-height: 0;
20
21
  width: auto;
21
22
  }
22
- `;Hg(kp);var Mp=`div.vis-color-picker {
23
+ `;Cg(Hv);var Kv=`div.vis-color-picker {
23
24
  position: absolute;
24
25
  top: 0px;
25
26
  left: 30px;
@@ -264,7 +265,7 @@ div.vis-color-picker input.vis-range-brightness {
264
265
  div.vis-color-picker input.vis-saturation-range {
265
266
  width: 289px !important;
266
267
  }*/
267
- `;Hg(Mp);var Fp=`div.vis-configuration {
268
+ `;Cg(Kv);var Qv=`div.vis-configuration {
268
269
  position: relative;
269
270
  display: block;
270
271
  float: left;
@@ -607,7 +608,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
607
608
  border-width: 12px;
608
609
  margin-top: -12px;
609
610
  }
610
- `;Hg(Fp);var zp=`div.vis-tooltip {
611
+ `;Cg(Qv);var Xv=`div.vis-tooltip {
611
612
  position: absolute;
612
613
  visibility: hidden;
613
614
  padding: 5px;
@@ -628,30 +629,30 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
628
629
 
629
630
  z-index: 5;
630
631
  }
631
- `;Hg(zp);var ad={exports:{}};(function(I){I.exports=e;function e(t){if(t)return g(t)}function g(t){for(var A in e.prototype)t[A]=e.prototype[A];return t}e.prototype.on=e.prototype.addEventListener=function(t,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(A),this},e.prototype.once=function(t,A){function C(){this.off(t,C),A.apply(this,arguments)}return C.fn=A,this.on(t,C),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var C=this._callbacks["$"+t];if(!C)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,n=0;n<C.length;n++)if(i=C[n],i===A||i.fn===A){C.splice(n,1);break}return C.length===0&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),C=this._callbacks["$"+t],i=1;i<arguments.length;i++)A[i-1]=arguments[i];if(C){C=C.slice(0);for(var i=0,n=C.length;i<n;++i)C[i].apply(this,A)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(ad);var Bp=ad.exports,dd=P(Bp),Zp=ag,Sg=Array.isArray||function(e){return Zp(e)==="Array"},Lp=TypeError,Gp=9007199254740991,ir=function(I){if(I>Gp)throw Lp("Maximum allowed index exceeded");return I},jp=UI,Vp=Oe,Yp=CA,fA=function(I,e,g){var t=jp(e);t in I?Vp.f(I,t,Yp(0,g)):I[t]=g},Wp=ee,_p=Wp("toStringTag"),ld={};ld[_p]="z";var nr=String(ld)==="[object z]",Hp=nr,Up=le,nI=ag,Kp=ee,Qp=Kp("toStringTag"),Xp=Object,Jp=nI((function(){return arguments})())==="Arguments",$p=function(I,e){try{return I[e]}catch(g){}},lg=Hp?nI:function(I){var e,g,t;return I===void 0?"Undefined":I===null?"Null":typeof(g=$p(e=Xp(I),Qp))=="string"?g:Jp?nI(e):(t=nI(e))==="Object"&&Up(e.callee)?"Arguments":t},qp=Z,em=le,Di=tr,gm=qp(Function.toString);em(Di.inspectSource)||(Di.inspectSource=function(I){return gm(I)});var tm=Di.inspectSource,Am=Z,Im=B,hd=le,Cm=lg,im=_e,nm=tm,cd=function(){},rm=[],ud=im("Reflect","construct"),rr=/^\s*(?:class|function)\b/,sm=Am(rr.exec),om=!rr.test(cd),St=function(e){if(!hd(e))return!1;try{return ud(cd,rm,e),!0}catch(g){return!1}},fd=function(e){if(!hd(e))return!1;switch(Cm(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return om||!!sm(rr,nm(e))}catch(g){return!0}};fd.sham=!0;var pd=!ud||Im(function(){var I;return St(St.call)||!St(Object)||!St(function(){I=!0})||I})?fd:St,Ts=Sg,am=pd,dm=ce,lm=ee,hm=lm("species"),xs=Array,cm=function(I){var e;return Ts(I)&&(e=I.constructor,am(e)&&(e===xs||Ts(e.prototype))?e=void 0:dm(e)&&(e=e[hm],e===null&&(e=void 0))),e===void 0?xs:e},um=cm,XI=function(I,e){return new(um(I))(e===0?0:e)},fm=B,pm=ee,mm=rA,vm=pm("species"),pA=function(I){return mm>=51||!fm(function(){var e=[],g=e.constructor={};return g[vm]=function(){return{foo:1}},e[I](Boolean).foo!==1})},bm=S,ym=B,wm=Sg,Em=ce,Tm=xe,xm=ke,Os=ir,Ds=fA,Om=XI,Dm=pA,Pm=ee,Sm=rA,md=Pm("isConcatSpreadable"),Nm=Sm>=51||!ym(function(){var I=[];return I[md]=!1,I.concat()[0]!==I}),Rm=function(I){if(!Em(I))return!1;var e=I[md];return e!==void 0?!!e:wm(I)},km=!Nm||!Dm("concat");bm({target:"Array",proto:!0,arity:1,forced:km},{concat:function(e){var g=Tm(this),t=Om(g,0),A=0,C,i,n,r,s;for(C=-1,n=arguments.length;C<n;C++)if(s=C===-1?g:arguments[C],Rm(s))for(r=xm(s),Os(A+r),i=0;i<r;i++,A++)i in s&&Ds(t,A,s[i]);else Os(A+1),Ds(t,A++,s);return t.length=A,t}});var Mm=lg,Fm=String,eg=function(I){if(Mm(I)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Fm(I)},JI={},zm=ie,Bm=Id,Zm=Oe,Lm=dg,Gm=We,jm=cA;JI.f=zm&&!Bm?Object.defineProperties:function(e,g){Lm(e);for(var t=Gm(g),A=jm(g),C=A.length,i=0,n;C>i;)Zm.f(e,n=A[i++],t[n]);return e};var Vm=_e,Ym=Vm("document","documentElement"),Wm=bt,_m=HI,Ps=Wm("keys"),$I=function(I){return Ps[I]||(Ps[I]=_m(I))},Hm=dg,Um=JI,Ss=Ir,Km=hA,Qm=Ym,Xm=td,Jm=$I,Ns=">",Rs="<",Pi="prototype",Si="script",vd=Jm("IE_PROTO"),zC=function(){},bd=function(I){return Rs+Si+Ns+I+Rs+"/"+Si+Ns},ks=function(I){I.write(bd("")),I.close();var e=I.parentWindow.Object;return I=null,e},$m=function(){var I=Xm("iframe"),e="java"+Si+":",g;return I.style.display="none",Qm.appendChild(I),I.src=String(e),g=I.contentWindow.document,g.open(),g.write(bd("document.F=Object")),g.close(),g.F},VA,rI=function(){try{VA=new ActiveXObject("htmlfile")}catch(e){}rI=typeof document!="undefined"?document.domain&&VA?ks(VA):$m():ks(VA);for(var I=Ss.length;I--;)delete rI[Pi][Ss[I]];return rI()};Km[vd]=!0;var mA=Object.create||function(e,g){var t;return e!==null?(zC[Pi]=Hm(e),t=new zC,zC[Pi]=null,t[vd]=e):t=rI(),g===void 0?t:Um.f(t,g)},vA={},qm=Cd,ev=Ir,gv=ev.concat("length","prototype");vA.f=Object.getOwnPropertyNames||function(e){return qm(e,gv)};var qI={},Ms=lA,tv=ke,Av=fA,Iv=Array,Cv=Math.max,yd=function(I,e,g){for(var t=tv(I),A=Ms(e,t),C=Ms(g===void 0?t:g,t),i=Iv(Cv(C-A,0)),n=0;A<C;A++,n++)Av(i,n,I[A]);return i.length=n,i},iv=ag,nv=We,wd=vA.f,rv=yd,Ed=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],sv=function(I){try{return wd(I)}catch(e){return rv(Ed)}};qI.f=function(e){return Ed&&iv(e)==="Window"?sv(e):wd(nv(e))};var ov=yt,bA=function(I,e,g,t){return t&&t.enumerable?I[e]=g:ov(I,e,g),I},av=Oe,sr=function(I,e,g){return av.f(I,e,g)},yA={},dv=ee;yA.f=dv;var Fs=L,lv=ne,hv=yA,cv=Oe.f,$=function(I){var e=Fs.Symbol||(Fs.Symbol={});lv(e,I)||cv(e,I,{value:hv.f(I)})},uv=Ye,fv=_e,pv=ee,mv=bA,Td=function(){var I=fv("Symbol"),e=I&&I.prototype,g=e&&e.valueOf,t=pv("toPrimitive");e&&!e[t]&&mv(e,t,function(A){return uv(g,this)},{arity:1})},vv=nr,bv=lg,yv=vv?{}.toString:function(){return"[object "+bv(this)+"]"},wv=nr,Ev=Oe.f,Tv=yt,xv=ne,Ov=yv,Dv=ee,zs=Dv("toStringTag"),wt=function(I,e,g,t){if(I){var A=g?I:I.prototype;xv(A,zs)||Ev(A,zs,{configurable:!0,value:e}),t&&!wv&&Tv(A,"toString",Ov)}},Pv=X,Sv=le,Bs=Pv.WeakMap,xd=Sv(Bs)&&/native code/.test(String(Bs)),Nv=xd,Od=X,Rv=ce,kv=yt,BC=ne,ZC=tr,Mv=$I,Fv=hA,Zs="Object already initialized",Ni=Od.TypeError,zv=Od.WeakMap,fI,_t,pI,Bv=function(I){return pI(I)?_t(I):fI(I,{})},Zv=function(I){return function(e){var g;if(!Rv(e)||(g=_t(e)).type!==I)throw new Ni("Incompatible receiver, "+I+" required");return g}};Nv||ZC.state?(ze=ZC.state||(ZC.state=new zv),ze.get=ze.get,ze.has=ze.has,ze.set=ze.set,fI=function(I,e){if(ze.has(I))throw new Ni(Zs);return e.facade=I,ze.set(I,e),e},_t=function(I){return ze.get(I)||{}},pI=function(I){return ze.has(I)}):(Rg=Mv("state"),Fv[Rg]=!0,fI=function(I,e){if(BC(I,Rg))throw new Ni(Zs);return e.facade=I,kv(I,Rg,e),e},_t=function(I){return BC(I,Rg)?I[Rg]:{}},pI=function(I){return BC(I,Rg)});var ze,Rg,Ug={set:fI,get:_t,has:pI,enforce:Bv,getterFor:Zv},Lv=dA,Gv=Z,jv=_I,Vv=xe,Yv=ke,Wv=XI,Ls=Gv([].push),cg=function(I){var e=I===1,g=I===2,t=I===3,A=I===4,C=I===6,i=I===7,n=I===5||C;return function(r,s,o,d){for(var a=Vv(r),l=jv(a),h=Lv(s,o),c=Yv(l),f=0,u=d||Wv,m=e?u(r,c):g||i?u(r,0):void 0,E,w;c>f;f++)if((n||f in l)&&(E=l[f],w=h(E,f,a),I))if(e)m[f]=w;else if(w)switch(I){case 3:return!0;case 5:return E;case 6:return f;case 2:Ls(m,E)}else switch(I){case 4:return!1;case 7:Ls(m,E)}return C?-1:t||A?A:m}},Ng={forEach:cg(0),map:cg(1),filter:cg(2),some:cg(3),every:cg(4),find:cg(5),findIndex:cg(6),filterReject:cg(7)},eC=S,gC=X,or=Ye,_v=Z,lt=ie,ht=vt,Hv=B,se=ne,Uv=J,Ri=dg,tC=We,ar=UI,Kv=eg,ki=CA,Ht=mA,Dd=cA,Qv=vA,Pd=qI,Xv=uA,Sd=AA,Nd=Oe,Jv=JI,Rd=IA,Gs=bA,$v=sr,dr=bt,qv=$I,kd=hA,js=HI,eb=ee,gb=yA,tb=$,Ab=Td,Ib=wt,Md=Ug,AC=Ng.forEach,Ee=qv("hidden"),IC="Symbol",Ut="prototype",Cb=Md.set,Vs=Md.getterFor(IC),je=Object[Ut],zg=gC.Symbol,zt=zg&&zg[Ut],ib=gC.RangeError,nb=gC.TypeError,LC=gC.QObject,Fd=Sd.f,Bg=Nd.f,zd=Pd.f,rb=Rd.f,Bd=_v([].push),ng=dr("symbols"),wA=dr("op-symbols"),sb=dr("wks"),Mi=!LC||!LC[Ut]||!LC[Ut].findChild,Zd=function(I,e,g){var t=Fd(je,e);t&&delete je[e],Bg(I,e,g),t&&I!==je&&Bg(je,e,t)},Fi=lt&&Hv(function(){return Ht(Bg({},"a",{get:function(){return Bg(this,"a",{value:7}).a}})).a!==7})?Zd:Bg,GC=function(I,e){var g=ng[I]=Ht(zt);return Cb(g,{type:IC,tag:I,description:e}),lt||(g.description=e),g},CC=function(e,g,t){e===je&&CC(wA,g,t),Ri(e);var A=ar(g);return Ri(t),se(ng,A)?(t.enumerable?(se(e,Ee)&&e[Ee][A]&&(e[Ee][A]=!1),t=Ht(t,{enumerable:ki(0,!1)})):(se(e,Ee)||Bg(e,Ee,ki(1,{})),e[Ee][A]=!0),Fi(e,A,t)):Bg(e,A,t)},lr=function(e,g){Ri(e);var t=tC(g),A=Dd(t).concat(Vd(t));return AC(A,function(C){(!lt||or(Ld,t,C))&&CC(e,C,t[C])}),e},ob=function(e,g){return g===void 0?Ht(e):lr(Ht(e),g)},Ld=function(e){var g=ar(e),t=or(rb,this,g);return this===je&&se(ng,g)&&!se(wA,g)?!1:t||!se(this,g)||!se(ng,g)||se(this,Ee)&&this[Ee][g]?t:!0},Gd=function(e,g){var t=tC(e),A=ar(g);if(!(t===je&&se(ng,A)&&!se(wA,A))){var C=Fd(t,A);return C&&se(ng,A)&&!(se(t,Ee)&&t[Ee][A])&&(C.enumerable=!0),C}},jd=function(e){var g=zd(tC(e)),t=[];return AC(g,function(A){!se(ng,A)&&!se(kd,A)&&Bd(t,A)}),t},Vd=function(I){var e=I===je,g=zd(e?wA:tC(I)),t=[];return AC(g,function(A){se(ng,A)&&(!e||se(je,A))&&Bd(t,ng[A])}),t};ht||(zg=function(){if(Uv(zt,this))throw new nb("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:Kv(arguments[0]),g=js(e),t=function(A){this===je&&or(t,wA,A),se(this,Ee)&&se(this[Ee],g)&&(this[Ee][g]=!1);var C=ki(1,A);try{Fi(this,g,C)}catch(i){if(!(i instanceof ib))throw i;Zd(this,g,C)}};return lt&&Mi&&Fi(je,g,{configurable:!0,set:t}),GC(g,e)},zt=zg[Ut],Gs(zt,"toString",function(){return Vs(this).tag}),Gs(zg,"withoutSetter",function(I){return GC(js(I),I)}),Rd.f=Ld,Nd.f=CC,Jv.f=lr,Sd.f=Gd,Qv.f=Pd.f=jd,Xv.f=Vd,gb.f=function(I){return GC(eb(I),I)},lt&&$v(zt,"description",{configurable:!0,get:function(){return Vs(this).description}}));eC({global:!0,constructor:!0,wrap:!0,forced:!ht,sham:!ht},{Symbol:zg});AC(Dd(sb),function(I){tb(I)});eC({target:IC,stat:!0,forced:!ht},{useSetter:function(){Mi=!0},useSimple:function(){Mi=!1}});eC({target:"Object",stat:!0,forced:!ht,sham:!lt},{create:ob,defineProperty:CC,defineProperties:lr,getOwnPropertyDescriptor:Gd});eC({target:"Object",stat:!0,forced:!ht},{getOwnPropertyNames:jd});Ab();Ib(zg,IC);kd[Ee]=!0;var ab=vt,Yd=ab&&!!Symbol.for&&!!Symbol.keyFor,db=S,lb=_e,hb=ne,cb=eg,Wd=bt,ub=Yd,jC=Wd("string-to-symbol-registry"),fb=Wd("symbol-to-string-registry");db({target:"Symbol",stat:!0,forced:!ub},{for:function(I){var e=cb(I);if(hb(jC,e))return jC[e];var g=lb("Symbol")(e);return jC[e]=g,fb[g]=e,g}});var pb=S,mb=ne,vb=sA,bb=oA,yb=bt,wb=Yd,Ys=yb("symbol-to-string-registry");pb({target:"Symbol",stat:!0,forced:!wb},{keyFor:function(e){if(!vb(e))throw new TypeError(bb(e)+" is not a symbol");if(mb(Ys,e))return Ys[e]}});var Eb=Z,Ws=Sg,Tb=le,_s=ag,xb=eg,Hs=Eb([].push),Ob=function(I){if(Tb(I))return I;if(Ws(I)){for(var e=I.length,g=[],t=0;t<e;t++){var A=I[t];typeof A=="string"?Hs(g,A):(typeof A=="number"||_s(A)==="Number"||_s(A)==="String")&&Hs(g,xb(A))}var C=g.length,i=!0;return function(n,r){if(i)return i=!1,r;if(Ws(this))return r;for(var s=0;s<C;s++)if(g[s]===n)return r}}},Db=S,_d=_e,Hd=WI,Pb=Ye,EA=Z,Ud=B,Us=le,Ks=sA,Kd=QI,Sb=Ob,Nb=vt,Rb=String,wg=_d("JSON","stringify"),YA=EA(/./.exec),Qs=EA("".charAt),kb=EA("".charCodeAt),Mb=EA("".replace),Fb=EA(1 .toString),zb=/[\uD800-\uDFFF]/g,Xs=/^[\uD800-\uDBFF]$/,Js=/^[\uDC00-\uDFFF]$/,$s=!Nb||Ud(function(){var I=_d("Symbol")("stringify detection");return wg([I])!=="[null]"||wg({a:I})!=="{}"||wg(Object(I))!=="{}"}),qs=Ud(function(){return wg("\uDF06\uD834")!=='"\\udf06\\ud834"'||wg("\uDEAD")!=='"\\udead"'}),Bb=function(I,e){var g=Kd(arguments),t=Sb(e);if(!(!Us(t)&&(I===void 0||Ks(I))))return g[1]=function(A,C){if(Us(t)&&(C=Pb(t,this,Rb(A),C)),!Ks(C))return C},Hd(wg,null,g)},Zb=function(I,e,g){var t=Qs(g,e-1),A=Qs(g,e+1);return YA(Xs,I)&&!YA(Js,A)||YA(Js,I)&&!YA(Xs,t)?"\\u"+Fb(kb(I,0),16):I};wg&&Db({target:"JSON",stat:!0,arity:3,forced:$s||qs},{stringify:function(e,g,t){var A=Kd(arguments),C=Hd($s?Bb:wg,null,A);return qs&&typeof C=="string"?Mb(C,zb,Zb):C}});var Lb=S,Gb=vt,jb=B,Qd=uA,Vb=xe,Yb=!Gb||jb(function(){Qd.f(1)});Lb({target:"Object",stat:!0,forced:Yb},{getOwnPropertySymbols:function(e){var g=Qd.f;return g?g(Vb(e)):[]}});var Wb=$;Wb("asyncIterator");var _b=$;_b("hasInstance");var Hb=$;Hb("isConcatSpreadable");var Ub=$;Ub("iterator");var Kb=$;Kb("match");var Qb=$;Qb("matchAll");var Xb=$;Xb("replace");var Jb=$;Jb("search");var $b=$;$b("species");var qb=$;qb("split");var ey=$,gy=Td;ey("toPrimitive");gy();var ty=_e,Ay=$,Iy=wt;Ay("toStringTag");Iy(ty("Symbol"),"Symbol");var Cy=$;Cy("unscopables");var iy=X,ny=wt;ny(iy.JSON,"JSON",!0);var ry=L,sy=ry.Symbol,Et={},zi=ie,oy=ne,Xd=Function.prototype,ay=zi&&Object.getOwnPropertyDescriptor,hr=oy(Xd,"name"),dy=hr&&(function(){}).name==="something",ly=hr&&(!zi||zi&&ay(Xd,"name").configurable),hy={EXISTS:hr,PROPER:dy,CONFIGURABLE:ly},cy=B,Jd=!cy(function(){function I(){}return I.prototype.constructor=null,Object.getPrototypeOf(new I)!==I.prototype}),uy=ne,fy=le,py=xe,my=$I,vy=Jd,eo=my("IE_PROTO"),Bi=Object,by=Bi.prototype,iC=vy?Bi.getPrototypeOf:function(I){var e=py(I);if(uy(e,eo))return e[eo];var g=e.constructor;return fy(g)&&e instanceof g?g.prototype:e instanceof Bi?by:null},yy=B,wy=le,Ey=ce,Ty=mA,go=iC,xy=bA,Oy=ee,Zi=Oy("iterator"),$d=!1,tg,VC,YC;[].keys&&(YC=[].keys(),"next"in YC?(VC=go(go(YC)),VC!==Object.prototype&&(tg=VC)):$d=!0);var Dy=!Ey(tg)||yy(function(){var I={};return tg[Zi].call(I)!==I});Dy?tg={}:tg=Ty(tg);wy(tg[Zi])||xy(tg,Zi,function(){return this});var qd={IteratorPrototype:tg,BUGGY_SAFARI_ITERATORS:$d},Py=qd.IteratorPrototype,Sy=mA,Ny=CA,Ry=wt,ky=Et,My=function(){return this},Fy=function(I,e,g,t){var A=e+" Iterator";return I.prototype=Sy(Py,{next:Ny(+!t,g)}),Ry(I,A,!1,!0),ky[A]=My,I},zy=S,By=Ye,el=hy,Zy=Fy,Ly=iC,Gy=wt,to=bA,jy=ee,Ao=Et,gl=qd,Vy=el.PROPER;el.CONFIGURABLE;gl.IteratorPrototype;var WA=gl.BUGGY_SAFARI_ITERATORS,WC=jy("iterator"),Io="keys",_A="values",Co="entries",Yy=function(){return this},cr=function(I,e,g,t,A,C,i){Zy(g,e,t);var n=function(u){if(u===A&&a)return a;if(!WA&&u&&u in o)return o[u];switch(u){case Io:return function(){return new g(this,u)};case _A:return function(){return new g(this,u)};case Co:return function(){return new g(this,u)}}return function(){return new g(this)}},r=e+" Iterator",s=!1,o=I.prototype,d=o[WC]||o["@@iterator"]||A&&o[A],a=!WA&&d||n(A),l=e==="Array"&&o.entries||d,h,c,f;if(l&&(h=Ly(l.call(new I)),h!==Object.prototype&&h.next&&(Gy(h,r,!0,!0),Ao[r]=Yy)),Vy&&A===_A&&d&&d.name!==_A&&(s=!0,a=function(){return By(d,this)}),A)if(c={values:n(_A),keys:C?a:n(Io),entries:n(Co)},i)for(f in c)(WA||s||!(f in o))&&to(o,f,c[f]);else zy({target:e,proto:!0,forced:WA||s},c);return i&&o[WC]!==a&&to(o,WC,a,{name:A}),Ao[e]=a,c},ur=function(I,e){return{value:I,done:e}},Wy=We,io=Et,tl=Ug;Oe.f;var _y=cr,HA=ur,Al="Array Iterator",Hy=tl.set,Uy=tl.getterFor(Al);_y(Array,"Array",function(I,e){Hy(this,{type:Al,target:Wy(I),index:0,kind:e})},function(){var I=Uy(this),e=I.target,g=I.kind,t=I.index++;if(!e||t>=e.length)return I.target=void 0,HA(void 0,!0);switch(g){case"keys":return HA(t,!1);case"values":return HA(e[t],!1)}return HA([t,e[t]],!1)},"values");io.Arguments=io.Array;var Ky={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Qy=Ky,Xy=X,Jy=lg,$y=yt,no=Et,qy=ee,ro=qy("toStringTag");for(UA in Qy)_C=Xy[UA],KA=_C&&_C.prototype,KA&&Jy(KA)!==ro&&$y(KA,ro,UA),no[UA]=no.Array;var _C,KA,UA,e0=sy,Il=e0,g0=Il,t0=P(g0),A0=S,so=Sg,I0=pd,C0=ce,oo=lA,i0=ke,n0=We,r0=fA,s0=ee,o0=pA,a0=QI,d0=o0("slice"),l0=s0("species"),HC=Array,h0=Math.max;A0({target:"Array",proto:!0,forced:!d0},{slice:function(e,g){var t=n0(this),A=i0(t),C=oo(e,A),i=oo(g===void 0?A:g,A),n,r,s;if(so(t)&&(n=t.constructor,I0(n)&&(n===HC||so(n.prototype))?n=void 0:C0(n)&&(n=n[l0],n===null&&(n=void 0)),n===HC||n===void 0))return a0(t,C,i);for(r=new(n===void 0?HC:n)(h0(i-C,0)),s=0;C<i;C++,s++)C in t&&r0(r,s,t[C]);return r.length=s,r}});var c0=Ie,u0=c0("Array").slice,f0=J,p0=u0,UC=Array.prototype,m0=function(I){var e=I.slice;return I===UC||f0(UC,I)&&e===UC.slice?p0:e},v0=m0,b0=v0,y0=b0,Le=P(y0),w0=_e,E0=Z,T0=vA,x0=uA,O0=dg,D0=E0([].concat),Cl=w0("Reflect","ownKeys")||function(e){var g=T0.f(O0(e)),t=x0.f;return t?D0(g,t(e)):g},P0=S,S0=Cl;P0({target:"Reflect",stat:!0},{ownKeys:S0});var N0=L,R0=N0.Reflect.ownKeys,k0=R0,M0=k0,F0=M0,z0=P(F0),B0=S,Z0=Sg;B0({target:"Array",stat:!0},{isArray:Z0});var L0=L,G0=L0.Array.isArray,j0=G0,V0=j0,Y0=V0,z=P(Y0),W0=S,_0=Ng.map,H0=pA,U0=H0("map");W0({target:"Array",proto:!0,forced:!U0},{map:function(e){return _0(this,e,arguments.length>1?arguments[1]:void 0)}});var K0=Ie,Q0=K0("Array").map,X0=J,J0=Q0,KC=Array.prototype,$0=function(I){var e=I.map;return I===KC||X0(KC,I)&&e===KC.map?J0:e},q0=$0,ew=q0,gw=ew,ae=P(gw),tw=S,Aw=xe,il=cA,Iw=B,Cw=Iw(function(){il(1)});tw({target:"Object",stat:!0,forced:Cw},{keys:function(e){return il(Aw(e))}});var iw=L,nw=iw.Object.keys,rw=nw,sw=rw,ow=sw,U=P(ow),aw=S,dw=Z,nl=Date,lw=dw(nl.prototype.getTime);aw({target:"Date",stat:!0},{now:function(){return lw(new nl)}});var hw=L,cw=hw.Date.now,uw=cw,fw=uw,pw=fw,mI=P(pw),mw=B,Tt=function(I,e){var g=[][I];return!!g&&mw(function(){g.call(null,e||function(){return 1},1)})},vw=Ng.forEach,bw=Tt,yw=bw("forEach"),ww=yw?[].forEach:function(e){return vw(this,e,arguments.length>1?arguments[1]:void 0)},Ew=S,ao=ww;Ew({target:"Array",proto:!0,forced:[].forEach!==ao},{forEach:ao});var Tw=Ie,xw=Tw("Array").forEach,Ow=xw,Dw=Ow,Pw=lg,Sw=ne,Nw=J,Rw=Dw,QC=Array.prototype,kw={DOMTokenList:!0,NodeList:!0},Mw=function(I){var e=I.forEach;return I===QC||Nw(QC,I)&&e===QC.forEach||Sw(kw,Pw(I))?Rw:e},Fw=Mw,F=P(Fw),zw=S,Bw=Z,Zw=Sg,Lw=Bw([].reverse),lo=[1,2];zw({target:"Array",proto:!0,forced:String(lo)===String(lo.reverse())},{reverse:function(){return Zw(this)&&(this.length=this.length),Lw(this)}});var Gw=Ie,jw=Gw("Array").reverse,Vw=J,Yw=jw,XC=Array.prototype,Ww=function(I){var e=I.reverse;return I===XC||Vw(XC,I)&&e===XC.reverse?Yw:e},_w=Ww,Hw=_w,Uw=Hw,Zg=P(Uw),Kw=ie,Qw=Sg,Xw=TypeError,Jw=Object.getOwnPropertyDescriptor,$w=Kw&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(I){return I instanceof TypeError}})(),qw=$w?function(I,e){if(Qw(I)&&!Jw(I,"length").writable)throw new Xw("Cannot set read only .length");return I.length=e}:function(I,e){return I.length=e},ho=oA,eE=TypeError,rl=function(I,e){if(!delete I[e])throw new eE("Cannot delete property "+ho(e)+" of "+ho(I))},gE=S,tE=xe,AE=lA,IE=KI,CE=ke,iE=qw,nE=ir,rE=XI,sE=fA,JC=rl,oE=pA,aE=oE("splice"),dE=Math.max,lE=Math.min;gE({target:"Array",proto:!0,forced:!aE},{splice:function(e,g){var t=tE(this),A=CE(t),C=AE(e,A),i=arguments.length,n,r,s,o,d,a;for(i===0?n=r=0:i===1?(n=0,r=A-C):(n=i-2,r=lE(dE(IE(g),0),A-C)),nE(A+n-r),s=rE(t,r),o=0;o<r;o++)d=C+o,d in t&&sE(s,o,t[d]);if(s.length=r,n<r){for(o=C;o<A-r;o++)d=o+r,a=o+n,d in t?t[a]=t[d]:JC(t,a);for(o=A;o>A-r+n;o--)JC(t,o-1)}else if(n>r)for(o=A-r;o>C;o--)d=o+r-1,a=o+n-1,d in t?t[a]=t[d]:JC(t,a);for(o=0;o<n;o++)t[o+C]=arguments[o+2];return iE(t,A-r+n),s}});var hE=Ie,cE=hE("Array").splice,uE=J,fE=cE,$C=Array.prototype,pE=function(I){var e=I.splice;return I===$C||uE($C,I)&&e===$C.splice?fE:e},mE=pE,vE=mE,bE=vE,Ke=P(bE),yE=S,wE=Ar.includes,EE=B,TE=EE(function(){return!Array(1).includes()});yE({target:"Array",proto:!0,forced:TE},{includes:function(e){return wE(this,e,arguments.length>1?arguments[1]:void 0)}});var xE=Ie,OE=xE("Array").includes,DE=ce,PE=ag,SE=ee,NE=SE("match"),RE=function(I){var e;return DE(I)&&((e=I[NE])!==void 0?!!e:PE(I)==="RegExp")},kE=RE,ME=TypeError,FE=function(I){if(kE(I))throw new ME("The method doesn't accept regular expressions");return I},zE=ee,BE=zE("match"),ZE=function(I){var e=/./;try{"/./"[I](e)}catch(g){try{return e[BE]=!1,"/./"[I](e)}catch(t){}}return!1},LE=S,GE=Z,jE=FE,VE=iA,co=eg,YE=ZE,WE=GE("".indexOf);LE({target:"String",proto:!0,forced:!YE("includes")},{includes:function(e){return!!~WE(co(VE(this)),co(jE(e)),arguments.length>1?arguments[1]:void 0)}});var _E=Ie,HE=_E("String").includes,uo=J,UE=OE,KE=HE,qC=Array.prototype,ei=String.prototype,QE=function(I){var e=I.includes;return I===qC||uo(qC,I)&&e===qC.includes?UE:typeof I=="string"||I===ei||uo(ei,I)&&e===ei.includes?KE:e},XE=QE,JE=XE,$E=JE,Eg=P($E),qE=S,eT=B,gT=xe,sl=iC,tT=Jd,AT=eT(function(){sl(1)});qE({target:"Object",stat:!0,forced:AT,sham:!tT},{getPrototypeOf:function(e){return sl(gT(e))}});var IT=L,CT=IT.Object.getPrototypeOf,iT=CT,nT=iT,rT=nT,fo=P(rT),sT=Ie,oT=sT("Array").concat,aT=J,dT=oT,gi=Array.prototype,lT=function(I){var e=I.concat;return I===gi||aT(gi,I)&&e===gi.concat?dT:e},hT=lT,cT=hT,uT=cT,ol=P(uT),fT=S,pT=Ng.filter,mT=pA,vT=mT("filter");fT({target:"Array",proto:!0,forced:!vT},{filter:function(e){return pT(this,e,arguments.length>1?arguments[1]:void 0)}});var bT=Ie,yT=bT("Array").filter,wT=J,ET=yT,ti=Array.prototype,TT=function(I){var e=I.filter;return I===ti||wT(ti,I)&&e===ti.filter?ET:e},xT=TT,OT=xT,DT=OT,te=P(DT),al=ie,PT=B,dl=Z,ST=iC,NT=cA,RT=We,kT=IA.f,ll=dl(kT),MT=dl([].push),FT=al&&PT(function(){var I=Object.create(null);return I[2]=2,!ll(I,2)}),po=function(I){return function(e){for(var g=RT(e),t=NT(g),A=FT&&ST(g)===null,C=t.length,i=0,n=[],r;C>i;)r=t[i++],(!al||(A?r in g:ll(g,r)))&&MT(n,I?[r,g[r]]:g[r]);return n}},zT={entries:po(!0),values:po(!1)},BT=S,ZT=zT.values;BT({target:"Object",stat:!0},{values:function(e){return ZT(e)}});var LT=L,GT=LT.Object.values,jT=GT,VT=jT,YT=VT,WT=P(YT),fr=`
632
- \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,_T=Z,HT=iA,UT=eg,Li=fr,mo=_T("".replace),KT=RegExp("^["+Li+"]+"),QT=RegExp("(^|[^"+Li+"])["+Li+"]+$"),Ai=function(I){return function(e){var g=UT(HT(e));return I&1&&(g=mo(g,KT,"")),I&2&&(g=mo(g,QT,"$1")),g}},hl={start:Ai(1),end:Ai(2),trim:Ai(3)},cl=X,XT=B,JT=Z,$T=eg,qT=hl.trim,vo=fr,Lt=cl.parseInt,bo=cl.Symbol,yo=bo&&bo.iterator,ul=/^[+-]?0x/i,ex=JT(ul.exec),gx=Lt(vo+"08")!==8||Lt(vo+"0x16")!==22||yo&&!XT(function(){Lt(Object(yo))}),tx=gx?function(e,g){var t=qT($T(e));return Lt(t,g>>>0||(ex(ul,t)?16:10))}:Lt,Ax=S,wo=tx;Ax({global:!0,forced:parseInt!==wo},{parseInt:wo});var Ix=L,Cx=Ix.parseInt,ix=Cx,nx=ix,rx=nx,Ze=P(rx),sx=S,ox=er,ax=Ar.indexOf,dx=Tt,Gi=ox([].indexOf),fl=!!Gi&&1/Gi([1],1,-0)<0,lx=fl||!dx("indexOf");sx({target:"Array",proto:!0,forced:lx},{indexOf:function(e){var g=arguments.length>1?arguments[1]:void 0;return fl?Gi(this,e,g)||0:ax(this,e,g)}});var hx=Ie,cx=hx("Array").indexOf,ux=J,fx=cx,Ii=Array.prototype,px=function(I){var e=I.indexOf;return I===Ii||ux(Ii,I)&&e===Ii.indexOf?fx:e},mx=px,vx=mx,bx=vx,G=P(bx),yx=S,wx=ie,Ex=mA;yx({target:"Object",stat:!0,sham:!wx},{create:Ex});var Tx=L,xx=Tx.Object,Ox=function(e,g){return xx.create(e,g)},Dx=Ox,Px=Dx,Sx=Px,Tg=P(Sx),ji=L,Nx=WI;ji.JSON||(ji.JSON={stringify:JSON.stringify});var Rx=function(e,g,t){return Nx(ji.JSON.stringify,null,arguments)},kx=Rx,Mx=kx,Fx=Mx,xt=P(Fx),zx=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",Bx=TypeError,Zx=function(I,e){if(I<e)throw new Bx("Not enough arguments");return I},pl=X,Lx=WI,Gx=le,jx=zx,Vx=nA,Yx=QI,Wx=Zx,_x=pl.Function,Hx=/MSIE .\./.test(Vx)||jx&&(function(){var I=pl.Bun.version.split(".");return I.length<3||I[0]==="0"&&(I[1]<3||I[1]==="3"&&I[2]==="0")})(),ml=function(I,e){var g=e?2:1;return Hx?function(t,A){var C=Wx(arguments.length,1)>g,i=Gx(t)?t:_x(t),n=C?Yx(arguments,g):[],r=C?function(){Lx(i,this,n)}:i;return e?I(r,A):I(r)}:I},Ux=S,vl=X,Kx=ml,Eo=Kx(vl.setInterval,!0);Ux({global:!0,bind:!0,forced:vl.setInterval!==Eo},{setInterval:Eo});var Qx=S,bl=X,Xx=ml,To=Xx(bl.setTimeout,!0);Qx({global:!0,bind:!0,forced:bl.setTimeout!==To},{setTimeout:To});var Jx=L,$x=Jx.setTimeout,qx=$x,Qe=P(qx),e1=xe,xo=lA,g1=ke,t1=function(e){for(var g=e1(this),t=g1(g),A=arguments.length,C=xo(A>1?arguments[1]:void 0,t),i=A>2?arguments[2]:void 0,n=i===void 0?t:xo(i,t);n>C;)g[C++]=e;return g},A1=S,I1=t1;A1({target:"Array",proto:!0},{fill:I1});var C1=Ie,i1=C1("Array").fill,n1=J,r1=i1,Ci=Array.prototype,s1=function(I){var e=I.fill;return I===Ci||n1(Ci,I)&&e===Ci.fill?r1:e},o1=s1,a1=o1,d1=a1,TA=P(d1);function Ve(){return Ve=Object.assign||function(I){for(var e=1;e<arguments.length;e++){var g=arguments[e];for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&(I[t]=g[t])}return I},Ve.apply(this,arguments)}function Me(I,e){I.prototype=Object.create(e.prototype),I.prototype.constructor=I,I.__proto__=e}function QA(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}var Vi;typeof Object.assign!="function"?Vi=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(e),t=1;t<arguments.length;t++){var A=arguments[t];if(A!=null)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C])}return g}:Vi=Object.assign;var jg=Vi,Oo=["","webkit","Moz","MS","ms","o"],l1=typeof document=="undefined"?{style:{}}:document.createElement("div"),h1="function",nt=Math.round,Vg=Math.abs,pr=Date.now;function nC(I,e){for(var g,t,A=e[0].toUpperCase()+e.slice(1),C=0;C<Oo.length;){if(g=Oo[C],t=g?g+A:e,t in I)return t;C++}}var Ag;typeof window=="undefined"?Ag={}:Ag=window;var yl=nC(l1.style,"touchAction"),wl=yl!==void 0;function c1(){if(!wl)return!1;var I={},e=Ag.CSS&&Ag.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){return I[g]=e?Ag.CSS.supports("touch-action",g):!0}),I}var El="compute",Tl="auto",Yi="manipulation",Lg="none",Kt="pan-x",Qt="pan-y",XA=c1(),u1=/mobile|tablet|ip(ad|hone|od)|android/i,xl="ontouchstart"in Ag,f1=nC(Ag,"PointerEvent")!==void 0,p1=xl&&u1.test(navigator.userAgent),xA="touch",m1="pen",mr="mouse",v1="kinect",b1=25,be=1,Kg=2,Ae=4,Te=8,vI=1,OA=2,DA=4,PA=8,ct=16,Xe=OA|DA,Gg=PA|ct,Ol=Xe|Gg,Dl=["x","y"],bI=["clientX","clientY"];function Ig(I,e,g){var t;if(I)if(I.forEach)I.forEach(e,g);else if(I.length!==void 0)for(t=0;t<I.length;)e.call(g,I[t],t,I),t++;else for(t in I)I.hasOwnProperty(t)&&e.call(g,I[t],t,I)}function rC(I,e){return typeof I===h1?I.apply(e&&e[0]||void 0,e):I}function Mg(I,e){return I.indexOf(e)>-1}function y1(I){if(Mg(I,Lg))return Lg;var e=Mg(I,Kt),g=Mg(I,Qt);return e&&g?Lg:e||g?e?Kt:Qt:Mg(I,Yi)?Yi:Tl}var Pl=(function(){function I(g,t){this.manager=g,this.set(t)}var e=I.prototype;return e.set=function(t){t===El&&(t=this.compute()),wl&&this.manager.element.style&&XA[t]&&(this.manager.element.style[yl]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ig(this.manager.recognizers,function(A){rC(A.options.enable,[A])&&(t=t.concat(A.getTouchAction()))}),y1(t.join(" "))},e.preventDefaults=function(t){var A=t.srcEvent,C=t.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var i=this.actions,n=Mg(i,Lg)&&!XA[Lg],r=Mg(i,Qt)&&!XA[Qt],s=Mg(i,Kt)&&!XA[Kt];if(n){var o=t.pointers.length===1,d=t.distance<2,a=t.deltaTime<250;if(o&&d&&a)return}if(!(s&&r)&&(n||r&&C&Xe||s&&C&Gg))return this.preventSrc(A)},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},I})();function vr(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}function Sl(I){var e=I.length;if(e===1)return{x:nt(I[0].clientX),y:nt(I[0].clientY)};for(var g=0,t=0,A=0;A<e;)g+=I[A].clientX,t+=I[A].clientY,A++;return{x:nt(g/e),y:nt(t/e)}}function Do(I){for(var e=[],g=0;g<I.pointers.length;)e[g]={clientX:nt(I.pointers[g].clientX),clientY:nt(I.pointers[g].clientY)},g++;return{timeStamp:pr(),pointers:e,center:Sl(e),deltaX:I.deltaX,deltaY:I.deltaY}}function yI(I,e,g){g||(g=Dl);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.sqrt(t*t+A*A)}function Wi(I,e,g){g||(g=Dl);var t=e[g[0]]-I[g[0]],A=e[g[1]]-I[g[1]];return Math.atan2(A,t)*180/Math.PI}function Nl(I,e){return I===e?vI:Vg(I)>=Vg(e)?I<0?OA:DA:e<0?PA:ct}function w1(I,e){var g=e.center,t=I.offsetDelta||{},A=I.prevDelta||{},C=I.prevInput||{};(e.eventType===be||C.eventType===Ae)&&(A=I.prevDelta={x:C.deltaX||0,y:C.deltaY||0},t=I.offsetDelta={x:g.x,y:g.y}),e.deltaX=A.x+(g.x-t.x),e.deltaY=A.y+(g.y-t.y)}function Rl(I,e,g){return{x:e/I||0,y:g/I||0}}function E1(I,e){return yI(e[0],e[1],bI)/yI(I[0],I[1],bI)}function T1(I,e){return Wi(e[1],e[0],bI)+Wi(I[1],I[0],bI)}function x1(I,e){var g=I.lastInterval||e,t=e.timeStamp-g.timeStamp,A,C,i,n;if(e.eventType!==Te&&(t>b1||g.velocity===void 0)){var r=e.deltaX-g.deltaX,s=e.deltaY-g.deltaY,o=Rl(t,r,s);C=o.x,i=o.y,A=Vg(o.x)>Vg(o.y)?o.x:o.y,n=Nl(r,s),I.lastInterval=e}else A=g.velocity,C=g.velocityX,i=g.velocityY,n=g.direction;e.velocity=A,e.velocityX=C,e.velocityY=i,e.direction=n}function O1(I,e){var g=I.session,t=e.pointers,A=t.length;g.firstInput||(g.firstInput=Do(e)),A>1&&!g.firstMultiple?g.firstMultiple=Do(e):A===1&&(g.firstMultiple=!1);var C=g.firstInput,i=g.firstMultiple,n=i?i.center:C.center,r=e.center=Sl(t);e.timeStamp=pr(),e.deltaTime=e.timeStamp-C.timeStamp,e.angle=Wi(n,r),e.distance=yI(n,r),w1(g,e),e.offsetDirection=Nl(e.deltaX,e.deltaY);var s=Rl(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=Vg(s.x)>Vg(s.y)?s.x:s.y,e.scale=i?E1(i.pointers,t):1,e.rotation=i?T1(i.pointers,t):0,e.maxPointers=g.prevInput?e.pointers.length>g.prevInput.maxPointers?e.pointers.length:g.prevInput.maxPointers:e.pointers.length,x1(g,e);var o=I.element,d=e.srcEvent,a;d.composedPath?a=d.composedPath()[0]:d.path?a=d.path[0]:a=d.target,vr(a,o)&&(o=a),e.target=o}function D1(I,e,g){var t=g.pointers.length,A=g.changedPointers.length,C=e&be&&t-A===0,i=e&(Ae|Te)&&t-A===0;g.isFirst=!!C,g.isFinal=!!i,C&&(I.session={}),g.eventType=e,O1(I,g),I.emit("hammer.input",g),I.recognize(g),I.session.prevInput=g}function Xt(I){return I.trim().split(/\s+/g)}function Gt(I,e,g){Ig(Xt(e),function(t){I.addEventListener(t,g,!1)})}function jt(I,e,g){Ig(Xt(e),function(t){I.removeEventListener(t,g,!1)})}function Po(I){var e=I.ownerDocument||I;return e.defaultView||e.parentWindow||window}var Ot=(function(){function I(g,t){var A=this;this.manager=g,this.callback=t,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(C){rC(g.options.enable,[g])&&A.handler(C)},this.init()}var e=I.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Gt(this.element,this.evEl,this.domHandler),this.evTarget&&Gt(this.target,this.evTarget,this.domHandler),this.evWin&&Gt(Po(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&jt(this.element,this.evEl,this.domHandler),this.evTarget&&jt(this.target,this.evTarget,this.domHandler),this.evWin&&jt(Po(this.element),this.evWin,this.domHandler)},I})();function Yg(I,e,g){if(I.indexOf&&!g)return I.indexOf(e);for(var t=0;t<I.length;){if(g&&I[t][g]==e||!g&&I[t]===e)return t;t++}return-1}var P1={pointerdown:be,pointermove:Kg,pointerup:Ae,pointercancel:Te,pointerout:Te},S1={2:xA,3:m1,4:mr,5:v1},kl="pointerdown",Ml="pointermove pointerup pointercancel";Ag.MSPointerEvent&&!Ag.PointerEvent&&(kl="MSPointerDown",Ml="MSPointerMove MSPointerUp MSPointerCancel");var Fl=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evEl=kl,A.evWin=Ml,t=I.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var g=e.prototype;return g.handler=function(A){var C=this.store,i=!1,n=A.type.toLowerCase().replace("ms",""),r=P1[n],s=S1[A.pointerType]||A.pointerType,o=s===xA,d=Yg(C,A.pointerId,"pointerId");r&be&&(A.button===0||o)?d<0&&(C.push(A),d=C.length-1):r&(Ae|Te)&&(i=!0),!(d<0)&&(C[d]=A,this.callback(this.manager,r,{pointers:C,changedPointers:[A],pointerType:s,srcEvent:A}),i&&C.splice(d,1))},e})(Ot);function Jt(I){return Array.prototype.slice.call(I,0)}function br(I,e,g){for(var t=[],A=[],C=0;C<I.length;){var i=e?I[C][e]:I[C];Yg(A,i)<0&&t.push(I[C]),A[C]=i,C++}return g&&(e?t=t.sort(function(n,r){return n[e]>r[e]}):t=t.sort()),t}var N1={touchstart:be,touchmove:Kg,touchend:Ae,touchcancel:Te},R1="touchstart touchmove touchend touchcancel",yr=(function(I){Me(e,I);function e(){var t;return e.prototype.evTarget=R1,t=I.apply(this,arguments)||this,t.targetIds={},t}var g=e.prototype;return g.handler=function(A){var C=N1[A.type],i=k1.call(this,A,C);i&&this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:xA,srcEvent:A})},e})(Ot);function k1(I,e){var g=Jt(I.touches),t=this.targetIds;if(e&(be|Kg)&&g.length===1)return t[g[0].identifier]=!0,[g,g];var A,C,i=Jt(I.changedTouches),n=[],r=this.target;if(C=g.filter(function(s){return vr(s.target,r)}),e===be)for(A=0;A<C.length;)t[C[A].identifier]=!0,A++;for(A=0;A<i.length;)t[i[A].identifier]&&n.push(i[A]),e&(Ae|Te)&&delete t[i[A].identifier],A++;if(n.length)return[br(C.concat(n),"identifier",!0),n]}var M1={mousedown:be,mousemove:Kg,mouseup:Ae},F1="mousedown",z1="mousemove mouseup",wr=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evEl=F1,A.evWin=z1,t=I.apply(this,arguments)||this,t.pressed=!1,t}var g=e.prototype;return g.handler=function(A){var C=M1[A.type];C&be&&A.button===0&&(this.pressed=!0),C&Kg&&A.which!==1&&(C=Ae),this.pressed&&(C&Ae&&(this.pressed=!1),this.callback(this.manager,C,{pointers:[A],changedPointers:[A],pointerType:mr,srcEvent:A}))},e})(Ot),B1=2500,So=25;function No(I){var e=I.changedPointers,g=e[0];if(g.identifier===this.primaryTouch){var t={x:g.clientX,y:g.clientY},A=this.lastTouches;this.lastTouches.push(t);var C=function(){var n=A.indexOf(t);n>-1&&A.splice(n,1)};setTimeout(C,B1)}}function Z1(I,e){I&be?(this.primaryTouch=e.changedPointers[0].identifier,No.call(this,e)):I&(Ae|Te)&&No.call(this,e)}function L1(I){for(var e=I.srcEvent.clientX,g=I.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var A=this.lastTouches[t],C=Math.abs(e-A.x),i=Math.abs(g-A.y);if(C<=So&&i<=So)return!0}return!1}var zl=(function(){var I=(function(e){Me(g,e);function g(A,C){var i;return i=e.call(this,A,C)||this,i.handler=function(n,r,s){var o=s.pointerType===xA,d=s.pointerType===mr;if(!(d&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(o)Z1.call(QA(QA(i)),r,s);else if(d&&L1.call(QA(QA(i)),s))return;i.callback(n,r,s)}},i.touch=new yr(i.manager,i.handler),i.mouse=new wr(i.manager,i.handler),i.primaryTouch=null,i.lastTouches=[],i}var t=g.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},g})(Ot);return I})();function G1(I){var e,g=I.options.inputClass;return g?e=g:f1?e=Fl:p1?e=yr:xl?e=zl:e=wr,new e(I,D1)}function rt(I,e,g){return Array.isArray(I)?(Ig(I,g[e],g),!0):!1}var sI=1,Re=2,ut=4,xg=8,Cg=xg,$t=16,He=32,j1=1;function V1(){return j1++}function JA(I,e){var g=e.manager;return g?g.get(I):I}function Ro(I){return I&$t?"cancel":I&xg?"end":I&ut?"move":I&Re?"start":""}var SA=(function(){function I(g){g===void 0&&(g={}),this.options=Ve({enable:!0},g),this.id=V1(),this.manager=null,this.state=sI,this.simultaneous={},this.requireFail=[]}var e=I.prototype;return e.set=function(t){return jg(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(rt(t,"recognizeWith",this))return this;var A=this.simultaneous;return t=JA(t,this),A[t.id]||(A[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return rt(t,"dropRecognizeWith",this)?this:(t=JA(t,this),delete this.simultaneous[t.id],this)},e.requireFailure=function(t){if(rt(t,"requireFailure",this))return this;var A=this.requireFail;return t=JA(t,this),Yg(A,t)===-1&&(A.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(rt(t,"dropRequireFailure",this))return this;t=JA(t,this);var A=Yg(this.requireFail,t);return A>-1&&this.requireFail.splice(A,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var A=this,C=this.state;function i(n){A.manager.emit(n,t)}C<xg&&i(A.options.event+Ro(C)),i(A.options.event),t.additionalEvent&&i(t.additionalEvent),C>=xg&&i(A.options.event+Ro(C))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=He},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(He|sI)))return!1;t++}return!0},e.recognize=function(t){var A=jg({},t);if(!rC(this.options.enable,[this,A])){this.reset(),this.state=He;return}this.state&(Cg|$t|He)&&(this.state=sI),this.state=this.process(A),this.state&(Re|ut|xg|$t)&&this.tryEmit(A)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},I})(),_i=(function(I){Me(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var g=e.prototype;return g.getTouchAction=function(){return[Yi]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,s=A.deltaTime<i.time;if(this.reset(),A.eventType&be&&this.count===0)return this.failTimeout();if(r&&s&&n){if(A.eventType!==Ae)return this.failTimeout();var o=this.pTime?A.timeStamp-this.pTime<i.interval:!0,d=!this.pCenter||yI(this.pCenter,A.center)<i.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!d||!o?this.count=1:this.count+=1,this._input=A;var a=this.count%i.taps;if(a===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){C.state=Cg,C.tryEmit()},i.interval),Re):Cg}return He},g.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=He},this.options.interval),He},g.reset=function(){clearTimeout(this._timer)},g.emit=function(){this.state===Cg&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e})(SA),ft=(function(I){Me(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({pointers:1},t))||this}var g=e.prototype;return g.attrTest=function(A){var C=this.options.pointers;return C===0||A.pointers.length===C},g.process=function(A){var C=this.state,i=A.eventType,n=C&(Re|ut),r=this.attrTest(A);return n&&(i&Te||!r)?C|$t:n||r?i&Ae?C|xg:C&Re?C|ut:Re:He},e})(SA);function Bl(I){return I===ct?"down":I===PA?"up":I===OA?"left":I===DA?"right":""}var Er=(function(I){Me(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"pan",threshold:10,pointers:1,direction:Ol},t))||this,A.pX=null,A.pY=null,A}var g=e.prototype;return g.getTouchAction=function(){var A=this.options.direction,C=[];return A&Xe&&C.push(Qt),A&Gg&&C.push(Kt),C},g.directionTest=function(A){var C=this.options,i=!0,n=A.distance,r=A.direction,s=A.deltaX,o=A.deltaY;return r&C.direction||(C.direction&Xe?(r=s===0?vI:s<0?OA:DA,i=s!==this.pX,n=Math.abs(A.deltaX)):(r=o===0?vI:o<0?PA:ct,i=o!==this.pY,n=Math.abs(A.deltaY))),A.direction=r,i&&n>C.threshold&&r&C.direction},g.attrTest=function(A){return ft.prototype.attrTest.call(this,A)&&(this.state&Re||!(this.state&Re)&&this.directionTest(A))},g.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Bl(A.direction);C&&(A.additionalEvent=this.options.event+C),I.prototype.emit.call(this,A)},e})(ft),Zl=(function(I){Me(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"swipe",threshold:10,velocity:.3,direction:Xe|Gg,pointers:1},t))||this}var g=e.prototype;return g.getTouchAction=function(){return Er.prototype.getTouchAction.call(this)},g.attrTest=function(A){var C=this.options.direction,i;return C&(Xe|Gg)?i=A.overallVelocity:C&Xe?i=A.overallVelocityX:C&Gg&&(i=A.overallVelocityY),I.prototype.attrTest.call(this,A)&&C&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&Vg(i)>this.options.velocity&&A.eventType&Ae},g.emit=function(A){var C=Bl(A.offsetDirection);C&&this.manager.emit(this.options.event+C,A),this.manager.emit(this.options.event,A)},e})(ft),Ll=(function(I){Me(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"pinch",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Lg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Re)},g.emit=function(A){if(A.scale!==1){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}I.prototype.emit.call(this,A)},e})(ft),Gl=(function(I){Me(e,I);function e(t){return t===void 0&&(t={}),I.call(this,Ve({event:"rotate",threshold:0,pointers:2},t))||this}var g=e.prototype;return g.getTouchAction=function(){return[Lg]},g.attrTest=function(A){return I.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Re)},e})(ft),jl=(function(I){Me(e,I);function e(t){var A;return t===void 0&&(t={}),A=I.call(this,Ve({event:"press",pointers:1,time:251,threshold:9},t))||this,A._timer=null,A._input=null,A}var g=e.prototype;return g.getTouchAction=function(){return[Tl]},g.process=function(A){var C=this,i=this.options,n=A.pointers.length===i.pointers,r=A.distance<i.threshold,s=A.deltaTime>i.time;if(this._input=A,!r||!n||A.eventType&(Ae|Te)&&!s)this.reset();else if(A.eventType&be)this.reset(),this._timer=setTimeout(function(){C.state=Cg,C.tryEmit()},i.time);else if(A.eventType&Ae)return Cg;return He},g.reset=function(){clearTimeout(this._timer)},g.emit=function(A){this.state===Cg&&(A&&A.eventType&Ae?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=pr(),this.manager.emit(this.options.event,this._input)))},e})(SA),Vl={domEvents:!1,touchAction:El,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ko=[[Gl,{enable:!1}],[Ll,{enable:!1},["rotate"]],[Zl,{direction:Xe}],[Er,{direction:Xe},["swipe"]],[_i],[_i,{event:"doubletap",taps:2},["tap"]],[jl]],Y1=1,Mo=2;function Fo(I,e){var g=I.element;if(g.style){var t;Ig(I.options.cssProps,function(A,C){t=nC(g.style,C),e?(I.oldCssProps[t]=g.style[t],g.style[t]=A):g.style[t]=I.oldCssProps[t]||""}),e||(I.oldCssProps={})}}function W1(I,e){var g=document.createEvent("Event");g.initEvent(I,!0,!0),g.gesture=e,e.target.dispatchEvent(g)}var zo=(function(){function I(g,t){var A=this;this.options=jg({},Vl,t||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=G1(this),this.touchAction=new Pl(this,this.options.touchAction),Fo(this,!0),Ig(this.options.recognizers,function(C){var i=A.add(new C[0](C[1]));C[2]&&i.recognizeWith(C[2]),C[3]&&i.requireFailure(C[3])},this)}var e=I.prototype;return e.set=function(t){return jg(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?Mo:Y1},e.recognize=function(t){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(t);var C,i=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&Cg)&&(A.curRecognizer=null,n=null);for(var r=0;r<i.length;)C=i[r],A.stopped!==Mo&&(!n||C===n||C.canRecognizeWith(n))?C.recognize(t):C.reset(),!n&&C.state&(Re|ut|xg)&&(A.curRecognizer=C,n=C),r++}},e.get=function(t){if(t instanceof SA)return t;for(var A=this.recognizers,C=0;C<A.length;C++)if(A[C].options.event===t)return A[C];return null},e.add=function(t){if(rt(t,"add",this))return this;var A=this.get(t.options.event);return A&&this.remove(A),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(rt(t,"remove",this))return this;var A=this.get(t);if(t){var C=this.recognizers,i=Yg(C,A);i!==-1&&(C.splice(i,1),this.touchAction.update())}return this},e.on=function(t,A){if(t===void 0||A===void 0)return this;var C=this.handlers;return Ig(Xt(t),function(i){C[i]=C[i]||[],C[i].push(A)}),this},e.off=function(t,A){if(t===void 0)return this;var C=this.handlers;return Ig(Xt(t),function(i){A?C[i]&&C[i].splice(Yg(C[i],A),1):delete C[i]}),this},e.emit=function(t,A){this.options.domEvents&&W1(t,A);var C=this.handlers[t]&&this.handlers[t].slice();if(!(!C||!C.length)){A.type=t,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var i=0;i<C.length;)C[i](A),i++}},e.destroy=function(){this.element&&Fo(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},I})(),_1={touchstart:be,touchmove:Kg,touchend:Ae,touchcancel:Te},H1="touchstart",U1="touchstart touchmove touchend touchcancel",K1=(function(I){Me(e,I);function e(){var t,A=e.prototype;return A.evTarget=H1,A.evWin=U1,t=I.apply(this,arguments)||this,t.started=!1,t}var g=e.prototype;return g.handler=function(A){var C=_1[A.type];if(C===be&&(this.started=!0),!!this.started){var i=Q1.call(this,A,C);C&(Ae|Te)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,C,{pointers:i[0],changedPointers:i[1],pointerType:xA,srcEvent:A})}},e})(Ot);function Q1(I,e){var g=Jt(I.touches),t=Jt(I.changedTouches);return e&(Ae|Te)&&(g=br(g.concat(t),"identifier",!0)),[g,t]}function Yl(I,e,g){var t="DEPRECATED METHOD: "+e+`
633
- `+g+` AT
634
- `;return function(){var A=new Error("get-stack-trace"),C=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,t,C),I.apply(this,arguments)}}var Wl=Yl(function(I,e,g){for(var t=Object.keys(e),A=0;A<t.length;)(!g||g&&I[t[A]]===void 0)&&(I[t[A]]=e[t[A]]),A++;return I},"extend","Use `assign`."),X1=Yl(function(I,e){return Wl(I,e,!0)},"merge","Use `assign`.");function J1(I,e,g){var t=e.prototype,A;A=I.prototype=Object.create(t),A.constructor=I,A._super=t,g&&jg(A,g)}function Bo(I,e){return function(){return I.apply(e,arguments)}}var _l=(function(){var I=function(g,t){return t===void 0&&(t={}),new zo(g,Ve({recognizers:ko.concat()},t))};return I.VERSION="2.0.17-rc",I.DIRECTION_ALL=Ol,I.DIRECTION_DOWN=ct,I.DIRECTION_LEFT=OA,I.DIRECTION_RIGHT=DA,I.DIRECTION_UP=PA,I.DIRECTION_HORIZONTAL=Xe,I.DIRECTION_VERTICAL=Gg,I.DIRECTION_NONE=vI,I.DIRECTION_DOWN=ct,I.INPUT_START=be,I.INPUT_MOVE=Kg,I.INPUT_END=Ae,I.INPUT_CANCEL=Te,I.STATE_POSSIBLE=sI,I.STATE_BEGAN=Re,I.STATE_CHANGED=ut,I.STATE_ENDED=xg,I.STATE_RECOGNIZED=Cg,I.STATE_CANCELLED=$t,I.STATE_FAILED=He,I.Manager=zo,I.Input=Ot,I.TouchAction=Pl,I.TouchInput=yr,I.MouseInput=wr,I.PointerEventInput=Fl,I.TouchMouseInput=zl,I.SingleTouchInput=K1,I.Recognizer=SA,I.AttrRecognizer=ft,I.Tap=_i,I.Pan=Er,I.Swipe=Zl,I.Pinch=Ll,I.Rotate=Gl,I.Press=jl,I.on=Gt,I.off=jt,I.each=Ig,I.merge=X1,I.extend=Wl,I.bindFn=Bo,I.assign=jg,I.inherit=J1,I.bindFn=Bo,I.prefixed=nC,I.toArray=Jt,I.inArray=Yg,I.uniqueArray=br,I.splitStr=Xt,I.boolOrFn=rC,I.hasParent=vr,I.addEventListeners=Gt,I.removeEventListeners=jt,I.defaults=jg({},Vl,{preset:ko}),I})();_l.defaults;var $1=_l,Hl=t0("DELETE");function q1(I){for(var e=arguments.length,g=new Array(e>1?e-1:0),t=1;t<e;t++)g[t-1]=arguments[t];return Ul({},I,...g)}function Ul(){let I=wI(...arguments);return Ql(I),I}function wI(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<2)return e[0];if(e.length>2)return wI(Ul(e[0],e[1]),...Le(e).call(e,2));let t=e[0],A=e[1];if(t instanceof Date&&A instanceof Date)return t.setTime(A.getTime()),t;for(let C of z0(A))Object.prototype.propertyIsEnumerable.call(A,C)&&(A[C]===Hl?delete t[C]:t[C]!==null&&A[C]!==null&&typeof t[C]=="object"&&typeof A[C]=="object"&&!z(t[C])&&!z(A[C])?t[C]=wI(t[C],A[C]):t[C]=Kl(A[C]));return t}function Kl(I){return z(I)?ae(I).call(I,e=>Kl(e)):typeof I=="object"&&I!==null?I instanceof Date?new Date(I.getTime()):wI({},I):I}function Ql(I){for(let e of U(I))I[e]===Hl?delete I[e]:typeof I[e]=="object"&&I[e]!==null&&Ql(I[e])}function sC(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];return eO(e.length?e:[mI()])}function eO(I){let[e,g,t]=gO(I),A=1,C=()=>{let i=2091639*e+A*23283064365386963e-26;return e=g,g=t,t=i-(A=i|0)};return C.uint32=()=>C()*4294967296,C.fract53=()=>C()+(C()*2097152|0)*11102230246251565e-32,C.algorithm="Alea",C.seed=I,C.version="0.9",C}function gO(){let I=tO(),e=I(" "),g=I(" "),t=I(" ");for(let A=0;A<arguments.length;A++)e-=I(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),g-=I(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1),t-=I(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1);return[e,g,t]}function tO(){let I=4022871197;return function(e){let g=e.toString();for(let t=0;t<g.length;t++){I+=g.charCodeAt(t);let A=.02519603282416938*I;I=A>>>0,A-=I,A*=I,I=A>>>0,A-=I,I+=A*4294967296}return(I>>>0)*23283064365386963e-26}}function AO(){let I=()=>{};return{on:I,off:I,destroy:I,emit:I,get(){return{set:I}}}}var Tr=typeof window!="undefined"?window.Hammer||$1:function(){return AO()};function Ue(I){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:I,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let g=Tr(this._dom.overlay);g.on("tap",b(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{g.destroy()});let t=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(t).call(t,A=>{g.on(A,C=>{C.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{IO(A.target,I)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}dd(Ue.prototype);Ue.current=null;Ue.prototype.destroy=function(){this.deactivate();for(let g of Zg(I=Ke(e=this._cleanupQueue).call(e,0)).call(I)){var I,e;g()}};Ue.prototype.activate=function(){Ue.current&&Ue.current.deactivate(),Ue.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};Ue.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};Ue.prototype._onTapOverlay=function(I){this.activate(),I.srcEvent.stopPropagation()};function IO(I,e){for(;I;){if(I===e)return!0;I=I.parentNode}return!1}var CO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,iO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,nO=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,rO=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function pg(I){if(I)for(;I.hasChildNodes()===!0;){let e=I.firstChild;e&&(pg(e),I.removeChild(e))}}function vg(I){return I instanceof String||typeof I=="string"}function Zo(I){return typeof I=="object"&&I!==null}function Wg(I,e,g,t){let A=!1;t===!0&&(A=e[g]===null&&I[g]!==void 0),A?delete I[g]:I[g]=e[g]}function Xl(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let t in I)if(e[t]!==void 0)if(e[t]===null||typeof e[t]!="object")Wg(I,e,t,g);else{let A=I[t],C=e[t];Zo(A)&&Zo(C)&&Xl(A,C,g)}}function Dt(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(z(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<I.length;A++){let C=I[A];if(Object.prototype.hasOwnProperty.call(g,C))if(g[C]&&g[C].constructor===Object)e[C]===void 0&&(e[C]={}),e[C].constructor===Object?_(e[C],g[C],!1,t):Wg(e,g,C,t);else{if(z(g[C]))throw new TypeError("Arrays are not supported by deepExtend");Wg(e,g,C,t)}}return e}function EI(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(z(g))throw new TypeError("Arrays are not supported by deepExtend");for(let A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&!Eg(I).call(I,A))if(g[A]&&g[A].constructor===Object)e[A]===void 0&&(e[A]={}),e[A].constructor===Object?_(e[A],g[A]):Wg(e,g,A,t);else if(z(g[A])){e[A]=[];for(let C=0;C<g[A].length;C++)e[A].push(g[A][C])}else Wg(e,g,A,t);return e}function _(I,e){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let C in e)if(Object.prototype.hasOwnProperty.call(e,C)||g===!0)if(typeof e[C]=="object"&&e[C]!==null&&fo(e[C])===Object.prototype)I[C]===void 0?I[C]=_({},e[C],g):typeof I[C]=="object"&&I[C]!==null&&fo(I[C])===Object.prototype?_(I[C],e[C],g):Wg(I,e,C,t);else if(z(e[C])){var A;I[C]=Le(A=e[C]).call(A)}else Wg(I,e,C,t);return I}function TI(I,e){return[...I,e]}function sO(I){return Le(I).call(I)}function oO(I){return I.getBoundingClientRect().left}function aO(I){return I.getBoundingClientRect().top}function k(I,e){if(z(I)){let g=I.length;for(let t=0;t<g;t++)e(I[t],t,I)}else for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&e(I[g],g,I)}function xr(I){let e;switch(I.length){case 3:case 4:return e=iO.exec(I),e?{r:Ze(e[1]+e[1],16),g:Ze(e[2]+e[2],16),b:Ze(e[3]+e[3],16)}:null;case 6:case 7:return e=CO.exec(I),e?{r:Ze(e[1],16),g:Ze(e[2],16),b:Ze(e[3],16)}:null;default:return null}}function Ne(I,e){if(Eg(I).call(I,"rgba"))return I;if(Eg(I).call(I,"rgb")){let g=I.substr(G(I).call(I,"(")+1).replace(")","").split(",");return"rgba("+g[0]+","+g[1]+","+g[2]+","+e+")"}else{let g=xr(I);return g==null?I:"rgba("+g.r+","+g.g+","+g.b+","+e+")"}}function Jl(I,e,g){var t;return"#"+Le(t=((1<<24)+(I<<16)+(e<<8)+g).toString(16)).call(t,1)}function Hi(I,e){if(vg(I)){let t=I;if(ql(t)){var g;let A=ae(g=t.substr(4).substr(0,t.length-5).split(",")).call(g,function(C){return Ze(C)});t=Jl(A[0],A[1],A[2])}if($l(t)===!0){let A=dO(t),C={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},i={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=Ui(i.h,i.s,i.v),r=Ui(C.h,C.s,C.v);return{background:t,border:n,highlight:{background:r,border:n},hover:{background:r,border:n}}}else return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else return e?{background:I.background||e.background,border:I.border||e.border,highlight:vg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||e.highlight.background,border:I.highlight&&I.highlight.border||e.highlight.border},hover:vg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||e.hover.border,background:I.hover&&I.hover.background||e.hover.background}}:{background:I.background||void 0,border:I.border||void 0,highlight:vg(I.highlight)?{border:I.highlight,background:I.highlight}:{background:I.highlight&&I.highlight.background||void 0,border:I.highlight&&I.highlight.border||void 0},hover:vg(I.hover)?{border:I.hover,background:I.hover}:{border:I.hover&&I.hover.border||void 0,background:I.hover&&I.hover.background||void 0}}}function Bt(I,e,g){I=I/255,e=e/255,g=g/255;let t=Math.min(I,Math.min(e,g)),A=Math.max(I,Math.max(e,g));if(t===A)return{h:0,s:0,v:t};let C=I===t?e-g:g===t?I-e:g-I,n=60*((I===t?3:g===t?1:5)-C/(A-t))/360,r=(A-t)/A;return{h:n,s:r,v:A}}function oI(I,e,g){let t,A,C,i=Math.floor(I*6),n=I*6-i,r=g*(1-e),s=g*(1-n*e),o=g*(1-(1-n)*e);switch(i%6){case 0:t=g,A=o,C=r;break;case 1:t=s,A=g,C=r;break;case 2:t=r,A=g,C=o;break;case 3:t=r,A=s,C=g;break;case 4:t=o,A=r,C=g;break;case 5:t=g,A=r,C=s;break}return{r:Math.floor(t*255),g:Math.floor(A*255),b:Math.floor(C*255)}}function Ui(I,e,g){let t=oI(I,e,g);return Jl(t.r,t.g,t.b)}function dO(I){let e=xr(I);if(!e)throw new TypeError("'".concat(I,"' is not a valid color."));return Bt(e.r,e.g,e.b)}function $l(I){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(I)}function ql(I){return nO.test(I)}function lO(I){return rO.test(I)}function Og(I){if(I===null||typeof I!="object")return null;if(I instanceof Element)return I;let e=Tg(I);for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&typeof I[g]=="object"&&(e[g]=Og(I[g]));return e}function Se(I,e,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(l){return l!=null},C=function(l){return l!==null&&typeof l=="object"},i=function(l){for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))return!1;return!0};if(!C(I))throw new Error("Parameter mergeTarget must be an object");if(!C(e))throw new Error("Parameter options must be an object");if(!A(g))throw new Error("Parameter option must have a value");if(!C(t))throw new Error("Parameter globalOptions must be an object");let n=function(l,h,c){C(l[c])||(l[c]={});let f=h[c],u=l[c];for(let m in f)Object.prototype.hasOwnProperty.call(f,m)&&(u[m]=f[m])},r=e[g],o=C(t)&&!i(t)?t[g]:void 0,d=o?o.enabled:void 0;if(r===void 0)return;if(typeof r=="boolean"){C(I[g])||(I[g]={}),I[g].enabled=r;return}if(r===null&&!C(I[g]))if(A(o))I[g]=Tg(o);else return;if(!C(r))return;let a=!0;r.enabled!==void 0?a=r.enabled:d!==void 0&&(a=o.enabled),n(I,e,g),I[g].enabled=a}var hO={linear(I){return I},easeInQuad(I){return I*I},easeOutQuad(I){return I*(2-I)},easeInOutQuad(I){return I<.5?2*I*I:-1+(4-2*I)*I},easeInCubic(I){return I*I*I},easeOutCubic(I){return--I*I*I+1},easeInOutCubic(I){return I<.5?4*I*I*I:(I-1)*(2*I-2)*(2*I-2)+1},easeInQuart(I){return I*I*I*I},easeOutQuart(I){return 1- --I*I*I*I},easeInOutQuart(I){return I<.5?8*I*I*I*I:1-8*--I*I*I*I},easeInQuint(I){return I*I*I*I*I},easeOutQuint(I){return 1+--I*I*I*I*I},easeInOutQuint(I){return I<.5?16*I*I*I*I*I:1+16*--I*I*I*I*I}};function mg(I,e){let g;z(e)||(e=[e]);for(let t of I)if(t){g=t[e[0]];for(let A=1;A<e.length;A++)g&&(g=g[e[A]]);if(typeof g!="undefined")break}return g}var cO={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},uO=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return cO[e]}setColor(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let t,A=this._isColorString(e);if(A!==void 0&&(e=A),vg(e)===!0){if(ql(e)===!0){let C=e.substr(4).substr(0,e.length-5).split(",");t={r:C[0],g:C[1],b:C[2],a:1}}else if(lO(e)===!0){let C=e.substr(5).substr(0,e.length-6).split(",");t={r:C[0],g:C[1],b:C[2],a:C[3]}}else if($l(e)===!0){let C=xr(e);t={r:C.r,g:C.g,b:C.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){let C=e.a!==void 0?e.a:"1.0";t={r:e.r,g:e.g,b:e.b,a:C}}if(t===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+xt(e));this._setColor(t,g)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=q({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",Qe(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=q({},e)),this.color=e;let t=Bt(e.r,e.g,e.b),A=2*Math.PI,C=this.r*t.s,i=this.centerCoordinates.x+C*Math.sin(A*t.h),n=this.centerCoordinates.y+C*Math.cos(A*t.h);this.colorPickerSelector.style.left=i-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){let g=Bt(this.color.r,this.color.g,this.color.b);g.v=e/100;let t=oI(g.h,g.s,g.v);t.a=this.color.a,this.color=t,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,g=Bt(e.r,e.g,e.b),t=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,A,C),t.putImageData(this.hueCircle,0,0),t.fillStyle="rgba(0,0,0,"+(1-g.v)+")",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),TA(t).call(t),this.brightnessRange.value=100*g.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,g,t,A;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){let i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let i=document.createElement("DIV");i.style.color="red",i.style.fontWeight="bold",i.style.padding="10px",i.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(i)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(i){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(i){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let C=this;this.opacityRange.onchange=function(){C._setOpacity(this.value)},this.opacityRange.oninput=function(){C._setOpacity(this.value)},this.brightnessRange.onchange=function(){C._setBrightness(this.value)},this.brightnessRange.oninput=function(){C._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=b(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=b(g=this._apply).call(g,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=b(t=this._save).call(t,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=b(A=this._loadLast).call(A,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new Tr(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){let e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let g=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,g,t);let A,C,i,n;this.centerCoordinates={x:g*.5,y:t*.5},this.r=.49*g;let r=2*Math.PI/360,s=1/360,o=1/this.r,d;for(i=0;i<360;i++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(r*i),C=this.centerCoordinates.y+n*Math.cos(r*i),d=oI(i*s,n*o,1),e.fillStyle="rgb("+d.r+","+d.g+","+d.b+")",e.fillRect(A-.5,C-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,g,t)}this.generated=!0}_moveSelector(e){let g=this.colorPickerDiv.getBoundingClientRect(),t=e.center.x-g.left,A=e.center.y-g.top,C=.5*this.colorPickerDiv.clientHeight,i=.5*this.colorPickerDiv.clientWidth,n=t-i,r=A-C,s=Math.atan2(n,r),o=.98*Math.min(Math.sqrt(n*n+r*r),i),d=Math.cos(s)*o+C,a=Math.sin(s)*o+i;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=a-.5*this.colorPickerSelector.clientWidth+"px";let l=s/(2*Math.PI);l=l<0?l+1:l;let h=o/this.r,c=Bt(this.color.r,this.color.g,this.color.b);c.h=l,c.s=h;let f=oI(c.h,c.s,c.v);f.a=this.color.a,this.color=f,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function Ki(){for(var I=arguments.length,e=new Array(I),g=0;g<I;g++)e[g]=arguments[g];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{let t=document.createElement(e[0]);return t.appendChild(Ki(...Le(e).call(e,1))),t}}var fO=class{constructor(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=g,this.allowCreation=!1,this.hideOption=C,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},q(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new uO(A),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let g=!0;if(typeof e=="string")this.options.filter=e;else if(z(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),te(e)!==void 0&&(this.options.filter=te(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(g=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,g=e):typeof e=="function"&&(this.options.filter=e,g=!0);te(this.options)===!1&&(g=!1),this.options.enabled=g}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let e=te(this.options),g=0,t=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,t=!1,typeof e=="function"?(t=e(A,[]),t=t||this._handleObject(this.configureOptions[A],[A],!0)):(e===!0||G(e).call(e,A)!==-1)&&(t=!0),t!==!1&&(this.allowCreation=!0,g>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),g++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let g=this.moduleOptions;for(let t=0;t<e.length;t++)if(g[e[t]]!==void 0)g=g[e[t]];else{g=void 0;break}return g}_makeItem(e){if(this.allowCreation===!0){let C=document.createElement("div");C.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var g=arguments.length,t=new Array(g>1?g-1:0),A=1;A<g;A++)t[A-1]=arguments[A];return F(t).call(t,i=>{C.appendChild(i)}),this.domElements.push(C),this.domElements.length}return 0}_makeHeader(e){let g=document.createElement("div");g.className="vis-configuration vis-config-header",g.innerText=e,this._makeItem([],g)}_makeLabel(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+g.length,t===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(Ki("i","b",e))}else A.innerText=e+":";return A}_makeDropdown(e,g,t){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let C=0;g!==void 0&&G(e).call(e,g)!==-1&&(C=G(e).call(e,g));for(let r=0;r<e.length;r++){let s=document.createElement("option");s.value=e[r],r===C&&(s.selected="selected"),s.innerText=e[r],A.appendChild(s)}let i=this;A.onchange=function(){i._update(this.value,t)};let n=this._makeLabel(t[t.length-1],t);this._makeItem(t,n,A)}_makeRange(e,g,t){let A=e[0],C=e[1],i=e[2],n=e[3],r=document.createElement("input");r.className="vis-configuration vis-config-range";try{r.type="range",r.min=C,r.max=i}catch(c){}r.step=n;let s="",o=0;g!==void 0?(g<0&&g*1.2<C?(r.min=Math.ceil(g*1.2),o=r.min,s="range increased"):g/1.2<C&&(r.min=Math.ceil(g/1.2),o=r.min,s="range increased"),g*1.2>i&&i!==1&&(r.max=Math.ceil(g*1.2),o=r.max,s="range increased"),r.value=g):r.value=A;let d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=r.value;let a=this;r.onchange=function(){d.value=this.value,a._update(Number(this.value),t)},r.oninput=function(){d.value=this.value};let l=this._makeLabel(t[t.length-1],t),h=this._makeItem(t,l,r,d);s!==""&&this.popupHistory[h]!==o&&(this.popupHistory[h]=o,this._setupPopup(s,h))}_makeButton(){if(this.options.showButton===!0){let e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,g){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let t=document.createElement("div");t.id="vis-configuration-popup",t.className="vis-configuration-popup",t.innerText=e,t.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:t,index:g}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){let g=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=g.left+"px",this.popupDiv.html.style.top=g.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Qe(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Qe(()=>{this._removePopup()},1800)}}_makeCheckbox(e,g,t){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=e,g!==void 0&&(A.checked=g,g!==e&&(typeof e=="object"?g!==e.enabled&&this.changedOptions.push({path:t,value:g}):this.changedOptions.push({path:t,value:g})));let C=this;A.onchange=function(){C._update(this.checked,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeTextInput(e,g,t){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=g,g!==e&&this.changedOptions.push({path:t,value:g});let C=this;A.onchange=function(){C._update(this.value,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,A)}_makeColorField(e,g,t){let A=e[1],C=document.createElement("div");g=g===void 0?A:g,g!=="none"?(C.className="vis-configuration vis-config-colorBlock",C.style.backgroundColor=g):C.className="vis-configuration vis-config-colorBlock none",g=g===void 0?A:g,C.onclick=()=>{this._showColorPicker(g,C,t)};let i=this._makeLabel(t[t.length-1],t);this._makeItem(t,i,C)}_showColorPicker(e,g,t){g.onclick=function(){},this.colorPicker.insertTo(g),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(A=>{let C="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";g.style.backgroundColor=C,this._update(C,t)}),this.colorPicker.setCloseCallback(()=>{g.onclick=()=>{this._showColorPicker(e,g,t)}})}_handleObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,C=te(this.options),i=!1;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){A=!0;let r=e[n],s=TI(g,n);if(typeof C=="function"&&(A=C(n,g),A===!1&&!z(r)&&typeof r!="string"&&typeof r!="boolean"&&r instanceof Object&&(this.allowCreation=!1,A=this._handleObject(r,s,!0),this.allowCreation=t===!1)),A!==!1){i=!0;let o=this._getValue(s);if(z(r))this._handleArray(r,o,s);else if(typeof r=="string")this._makeTextInput(r,o,s);else if(typeof r=="boolean")this._makeCheckbox(r,o,s);else if(r instanceof Object){if(!this.hideOption(g,n,this.moduleOptions))if(r.enabled!==void 0){let d=TI(s,"enabled"),a=this._getValue(d);if(a===!0){let l=this._makeLabel(n,s,!0);this._makeItem(s,l),i=this._handleObject(r,s)||i}else this._makeCheckbox(r,a,s)}else{let d=this._makeLabel(n,s,!0);this._makeItem(s,d),i=this._handleObject(r,s)||i}}else console.error("dont know how to handle",r,n,s)}}return i}_handleArray(e,g,t){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,g,t),e[1]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="string"?(this._makeDropdown(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:g})):typeof e[0]=="number"&&(this._makeRange(e,g,t),e[0]!==g&&this.changedOptions.push({path:t,value:Number(g)}))}_update(e,g){let t=this._constructOptions(e,g);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",t),this.initialized=!0,this.parent.setOptions(t)}_constructOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=t;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let C=0;C<g.length;C++)g[C]!=="global"&&(A[g[C]]===void 0&&(A[g[C]]={}),C!==g.length-1?A=A[g[C]]:A[g[C]]=e);return t}_printOptions(){let e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Ki("pre","const options = "+xt(e,null,2)))}getOptions(){let e={};for(let g=0;g<this.changedOptions.length;g++)this._constructOptions(this.changedOptions[g].value,this.changedOptions[g].path,e);return e}},pO=class{constructor(e,g){this.container=e,this.overflowMethod=g||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(e,g){this.x=Ze(e),this.y=Ze(g)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){let g=this.frame.clientHeight,t=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,C=this.frame.parentNode.clientWidth,i=0,n=0;if(this.overflowMethod=="flip"){let r=!1,s=!0;this.y-g<this.padding&&(s=!1),this.x+t>C-this.padding&&(r=!0),r?i=this.x-t:i=this.x,s?n=this.y-g:n=this.y}else n=this.y-g,n+g+this.padding>A&&(n=A-g-this.padding),n<this.padding&&(n=this.padding),i=this.x,i+t+this.padding>C&&(i=C-t-this.padding),i<this.padding&&(i=this.padding);this.frame.style.left=i+"px",this.frame.style.top=n+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Nt=!1,Lo,Qi="background: #FFeeee; color: #dd0000",mO=class Q{static validate(e,g,t){Nt=!1,Lo=g;let A=g;return t!==void 0&&(A=g[t]),Q.parse(e,A,[]),Nt}static parse(e,g,t){for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&Q.check(A,e,g,t)}static check(e,g,t,A){if(t[e]===void 0&&t.__any__===void 0){Q.getSuggestion(e,t,A);return}let C=e,i=!0;t[e]===void 0&&t.__any__!==void 0&&(C="__any__",i=Q.getType(g[e])==="object");let n=t[C];i&&n.__type__!==void 0&&(n=n.__type__),Q.checkFields(e,g,t,C,n,A)}static checkFields(e,g,t,A,C,i){let n=function(o){console.error("%c"+o+Q.printLocation(i,e),Qi)},r=Q.getType(g[e]),s=C[r];s!==void 0?Q.getType(s)==="array"&&G(s).call(s,g[e])===-1?(n('Invalid option detected in "'+e+'". Allowed values are:'+Q.print(s)+' not "'+g[e]+'". '),Nt=!0):r==="object"&&A!=="__any__"&&(i=TI(i,e),Q.parse(g[e],t[A],i)):C.any===void 0&&(n('Invalid type received for "'+e+'". Expected: '+Q.print(U(C))+". Received ["+r+'] "'+g[e]+'"'),Nt=!0)}static getType(e){let g=typeof e;return g==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":z(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":g==="number"?"number":g==="boolean"?"boolean":g==="string"?"string":g===void 0?"undefined":g}static getSuggestion(e,g,t){let A=Q.findInOptions(e,g,t,!1),C=Q.findInOptions(e,Lo,[],!0),i=8,n=4,r;A.indexMatch!==void 0?r=" in "+Q.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
632
+ `;Cg(Xv);var zd={exports:{}};(function(i){i.exports=e;function e(g){if(g)return t(g)}function t(g){for(var A in e.prototype)g[A]=e.prototype[A];return g}e.prototype.on=e.prototype.addEventListener=function(g,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(A),this},e.prototype.once=function(g,A){function I(){this.off(g,I),A.apply(this,arguments)}return I.fn=A,this.on(g,I),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(g,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var I=this._callbacks["$"+g];if(!I)return this;if(arguments.length==1)return delete this._callbacks["$"+g],this;for(var C,n=0;n<I.length;n++)if(C=I[n],C===A||C.fn===A){I.splice(n,1);break}return I.length===0&&delete this._callbacks["$"+g],this},e.prototype.emit=function(g){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),I=this._callbacks["$"+g],C=1;C<arguments.length;C++)A[C-1]=arguments[C];if(I){I=I.slice(0);for(var C=0,n=I.length;C<n;++C)I[C].apply(this,A)}return this},e.prototype.listeners=function(g){return this._callbacks=this._callbacks||{},this._callbacks["$"+g]||[]},e.prototype.hasListeners=function(g){return!!this.listeners(g).length}})(zd);var $v=zd.exports,Ld=R($v),Jv=vt,Gt=Array.isArray||function(e){return Jv(e)==="Array"},qv=TypeError,eb=9007199254740991,es=function(i){if(i>eb)throw qv("Maximum allowed index exceeded");return i},tb=OI,gb=De,Ab=DA,VA=function(i,e,t){var g=tb(e);g in i?gb.f(i,g,Ab(0,t)):i[g]=t},ib=te,Ib=ib("toStringTag"),Zd={};Zd[Ib]="z";var ts=String(Zd)==="[object z]",Cb=ts,nb=ue,Gi=vt,rb=te,sb=rb("toStringTag"),ob=Object,ab=Gi((function(){return arguments})())==="Arguments",lb=function(i,e){try{return i[e]}catch(t){}},yt=Cb?Gi:function(i){var e,t,g;return i===void 0?"Undefined":i===null?"Null":typeof(t=lb(e=ob(i),sb))=="string"?t:ab?Gi(e):(g=Gi(e))==="Object"&&nb(e.callee)?"Arguments":g},db=L,hb=ue,wn=Xr,cb=db(Function.toString);hb(wn.inspectSource)||(wn.inspectSource=function(i){return cb(i)});var ub=wn.inspectSource,fb=L,pb=z,Gd=ue,mb=yt,vb=Xe,bb=ub,jd=function(){},yb=[],Vd=vb("Reflect","construct"),gs=/^\s*(?:class|function)\b/,wb=fb(gs.exec),xb=!gs.test(jd),gA=function(e){if(!Gd(e))return!1;try{return Vd(jd,yb,e),!0}catch(t){return!1}},Yd=function(e){if(!Gd(e))return!1;switch(mb(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xb||!!wb(gs,bb(e))}catch(t){return!0}};Yd.sham=!0;var Wd=!Vd||pb(function(){var i;return gA(gA.call)||!gA(Object)||!gA(function(){i=!0})||i})?Yd:gA,qo=Gt,Eb=Wd,Tb=pe,Ob=te,Pb=Ob("species"),ea=Array,Sb=function(i){var e;return qo(i)&&(e=i.constructor,Eb(e)&&(e===ea||qo(e.prototype))?e=void 0:Tb(e)&&(e=e[Pb],e===null&&(e=void 0))),e===void 0?ea:e},Rb=Sb,RI=function(i,e){return new(Rb(i))(e===0?0:e)},Db=z,Nb=te,_b=kA,kb=Nb("species"),YA=function(i){return _b>=51||!Db(function(){var e=[],t=e.constructor={};return t[kb]=function(){return{foo:1}},e[i](Boolean).foo!==1})},Mb=D,Fb=z,Bb=Gt,zb=pe,Lb=Re,Zb=ze,ta=es,ga=VA,Gb=RI,jb=YA,Vb=te,Yb=kA,Ud=Vb("isConcatSpreadable"),Wb=Yb>=51||!Fb(function(){var i=[];return i[Ud]=!1,i.concat()[0]!==i}),Ub=function(i){if(!zb(i))return!1;var e=i[Ud];return e!==void 0?!!e:Bb(i)},Hb=!Wb||!jb("concat");Mb({target:"Array",proto:!0,arity:1,forced:Hb},{concat:function(e){var t=Lb(this),g=Gb(t,0),A=0,I,C,n,r,s;for(I=-1,n=arguments.length;I<n;I++)if(s=I===-1?t:arguments[I],Ub(s))for(r=Zb(s),ta(A+r),C=0;C<r;C++,A++)C in s&&ga(g,A,s[C]);else ta(A+1),ga(g,A++,s);return g.length=A,g}});var Kb=yt,Qb=String,nt=function(i){if(Kb(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Qb(i)},DI={},Xb=ne,$b=Dd,Jb=De,qb=bt,ey=Qe,ty=GA;DI.f=Xb&&!$b?Object.defineProperties:function(e,t){qb(e);for(var g=ey(t),A=ty(t),I=A.length,C=0,n;I>C;)Jb.f(e,n=A[C++],g[n]);return e};var gy=Xe,Ay=gy("document","documentElement"),iy=Gg,Iy=TI,Aa=iy("keys"),NI=function(i){return Aa[i]||(Aa[i]=Iy(i))},Cy=bt,ny=DI,ia=Jr,ry=ZA,sy=Ay,oy=Sd,ay=NI,Ia=">",Ca="<",xn="prototype",En="script",Hd=ay("IE_PROTO"),RC=function(){},Kd=function(i){return Ca+En+Ia+i+Ca+"/"+En+Ia},na=function(i){i.write(Kd("")),i.close();var e=i.parentWindow.Object;return i=null,e},ly=function(){var i=oy("iframe"),e="java"+En+":",t;return i.style.display="none",sy.appendChild(i),i.src=String(e),t=i.contentWindow.document,t.open(),t.write(Kd("document.F=Object")),t.close(),t.F},yi,ji=function(){try{yi=new ActiveXObject("htmlfile")}catch(e){}ji=typeof document!="undefined"?document.domain&&yi?na(yi):ly():na(yi);for(var i=ia.length;i--;)delete ji[xn][ia[i]];return ji()};ry[Hd]=!0;var WA=Object.create||function(e,t){var g;return e!==null?(RC[xn]=Cy(e),g=new RC,RC[xn]=null,g[Hd]=e):g=ji(),t===void 0?g:ny.f(g,t)},UA={},dy=Nd,hy=Jr,cy=hy.concat("length","prototype");UA.f=Object.getOwnPropertyNames||function(e){return dy(e,cy)};var _I={},ra=LA,uy=ze,fy=VA,py=Array,my=Math.max,Qd=function(i,e,t){for(var g=uy(i),A=ra(e,g),I=ra(t===void 0?g:t,g),C=py(my(I-A,0)),n=0;A<I;A++,n++)fy(C,n,i[A]);return C.length=n,C},vy=vt,by=Qe,Xd=UA.f,yy=Qd,$d=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],wy=function(i){try{return Xd(i)}catch(e){return yy($d)}};_I.f=function(e){return $d&&vy(e)==="Window"?wy(e):Xd(by(e))};var xy=jg,HA=function(i,e,t,g){return g&&g.enumerable?i[e]=t:xy(i,e,t),i},Ey=De,As=function(i,e,t){return Ey.f(i,e,t)},KA={},Ty=te;KA.f=Ty;var sa=Z,Oy=re,Py=KA,Sy=De.f,q=function(i){var e=sa.Symbol||(sa.Symbol={});Oy(e,i)||Sy(e,i,{value:Py.f(i)})},Ry=Ke,Dy=Xe,Ny=te,_y=HA,Jd=function(){var i=Dy("Symbol"),e=i&&i.prototype,t=e&&e.valueOf,g=Ny("toPrimitive");e&&!e[g]&&_y(e,g,function(A){return Ry(t,this)},{arity:1})},ky=ts,My=yt,Fy=ky?{}.toString:function(){return"[object "+My(this)+"]"},By=ts,zy=De.f,Ly=jg,Zy=re,Gy=Fy,jy=te,oa=jy("toStringTag"),Vg=function(i,e,t,g){if(i){var A=t?i:i.prototype;Zy(A,oa)||zy(A,oa,{configurable:!0,value:e}),g&&!By&&Ly(A,"toString",Gy)}},Vy=$,Yy=ue,aa=Vy.WeakMap,qd=Yy(aa)&&/native code/.test(String(aa)),Wy=qd,eh=$,Uy=pe,Hy=jg,DC=re,NC=Xr,Ky=NI,Qy=ZA,la="Object already initialized",Tn=eh.TypeError,Xy=eh.WeakMap,$i,fA,Ji,$y=function(i){return Ji(i)?fA(i):$i(i,{})},Jy=function(i){return function(e){var t;if(!Uy(e)||(t=fA(e)).type!==i)throw new Tn("Incompatible receiver, "+i+" required");return t}};Wy||NC.state?(Ge=NC.state||(NC.state=new Xy),Ge.get=Ge.get,Ge.has=Ge.has,Ge.set=Ge.set,$i=function(i,e){if(Ge.has(i))throw new Tn(la);return e.facade=i,Ge.set(i,e),e},fA=function(i){return Ge.get(i)||{}},Ji=function(i){return Ge.has(i)}):(Ut=Ky("state"),Qy[Ut]=!0,$i=function(i,e){if(DC(i,Ut))throw new Tn(la);return e.facade=i,Hy(i,Ut,e),e},fA=function(i){return DC(i,Ut)?i[Ut]:{}},Ji=function(i){return DC(i,Ut)});var Ge,Ut,ng={set:$i,get:fA,has:Ji,enforce:$y,getterFor:Jy},qy=zA,e0=L,t0=EI,g0=Re,A0=ze,i0=RI,da=e0([].push),Tt=function(i){var e=i===1,t=i===2,g=i===3,A=i===4,I=i===6,C=i===7,n=i===5||I;return function(r,s,o,a){for(var l=g0(r),d=t0(l),h=qy(s,o),c=A0(d),u=0,f=a||i0,p=e?f(r,c):t||C?f(r,0):void 0,E,x;c>u;u++)if((n||u in d)&&(E=d[u],x=h(E,u,l),i))if(e)p[u]=x;else if(x)switch(i){case 3:return!0;case 5:return E;case 6:return u;case 2:da(p,E)}else switch(i){case 4:return!1;case 7:da(p,E)}return I?-1:g||A?A:p}},jt={forEach:Tt(0),map:Tt(1),filter:Tt(2),some:Tt(3),every:Tt(4),find:Tt(5),findIndex:Tt(6),filterReject:Tt(7)},kI=D,MI=$,is=Ke,I0=L,_g=ne,kg=Zg,C0=z,ae=re,n0=J,On=bt,FI=Qe,Is=OI,r0=nt,Pn=DA,pA=WA,th=GA,s0=UA,gh=_I,o0=jA,Ah=SA,ih=De,a0=DI,Ih=RA,ha=HA,l0=As,Cs=Gg,d0=NI,Ch=ZA,ca=TI,h0=te,c0=KA,u0=q,f0=Jd,p0=Vg,nh=ng,BI=jt.forEach,Pe=d0("hidden"),zI="Symbol",mA="prototype",m0=nh.set,ua=nh.getterFor(zI),Ue=Object[mA],Xt=MI.Symbol,rA=Xt&&Xt[mA],v0=MI.RangeError,b0=MI.TypeError,_C=MI.QObject,rh=Ah.f,$t=ih.f,sh=gh.f,y0=Ih.f,oh=I0([].push),ut=Cs("symbols"),QA=Cs("op-symbols"),w0=Cs("wks"),Sn=!_C||!_C[mA]||!_C[mA].findChild,ah=function(i,e,t){var g=rh(Ue,e);g&&delete Ue[e],$t(i,e,t),g&&i!==Ue&&$t(Ue,e,g)},Rn=_g&&C0(function(){return pA($t({},"a",{get:function(){return $t(this,"a",{value:7}).a}})).a!==7})?ah:$t,kC=function(i,e){var t=ut[i]=pA(rA);return m0(t,{type:zI,tag:i,description:e}),_g||(t.description=e),t},LI=function(e,t,g){e===Ue&&LI(QA,t,g),On(e);var A=Is(t);return On(g),ae(ut,A)?(g.enumerable?(ae(e,Pe)&&e[Pe][A]&&(e[Pe][A]=!1),g=pA(g,{enumerable:Pn(0,!1)})):(ae(e,Pe)||$t(e,Pe,Pn(1,{})),e[Pe][A]=!0),Rn(e,A,g)):$t(e,A,g)},ns=function(e,t){On(e);var g=FI(t),A=th(g).concat(ch(g));return BI(A,function(I){(!_g||is(lh,g,I))&&LI(e,I,g[I])}),e},x0=function(e,t){return t===void 0?pA(e):ns(pA(e),t)},lh=function(e){var t=Is(e),g=is(y0,this,t);return this===Ue&&ae(ut,t)&&!ae(QA,t)?!1:g||!ae(this,t)||!ae(ut,t)||ae(this,Pe)&&this[Pe][t]?g:!0},dh=function(e,t){var g=FI(e),A=Is(t);if(!(g===Ue&&ae(ut,A)&&!ae(QA,A))){var I=rh(g,A);return I&&ae(ut,A)&&!(ae(g,Pe)&&g[Pe][A])&&(I.enumerable=!0),I}},hh=function(e){var t=sh(FI(e)),g=[];return BI(t,function(A){!ae(ut,A)&&!ae(Ch,A)&&oh(g,A)}),g},ch=function(i){var e=i===Ue,t=sh(e?QA:FI(i)),g=[];return BI(t,function(A){ae(ut,A)&&(!e||ae(Ue,A))&&oh(g,ut[A])}),g};kg||(Xt=function(){if(n0(rA,this))throw new b0("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:r0(arguments[0]),t=ca(e),g=function(A){this===Ue&&is(g,QA,A),ae(this,Pe)&&ae(this[Pe],t)&&(this[Pe][t]=!1);var I=Pn(1,A);try{Rn(this,t,I)}catch(C){if(!(C instanceof v0))throw C;ah(this,t,I)}};return _g&&Sn&&Rn(Ue,t,{configurable:!0,set:g}),kC(t,e)},rA=Xt[mA],ha(rA,"toString",function(){return ua(this).tag}),ha(Xt,"withoutSetter",function(i){return kC(ca(i),i)}),Ih.f=lh,ih.f=LI,a0.f=ns,Ah.f=dh,s0.f=gh.f=hh,o0.f=ch,c0.f=function(i){return kC(h0(i),i)},_g&&l0(rA,"description",{configurable:!0,get:function(){return ua(this).description}}));kI({global:!0,constructor:!0,wrap:!0,forced:!kg,sham:!kg},{Symbol:Xt});BI(th(w0),function(i){u0(i)});kI({target:zI,stat:!0,forced:!kg},{useSetter:function(){Sn=!0},useSimple:function(){Sn=!1}});kI({target:"Object",stat:!0,forced:!kg,sham:!_g},{create:x0,defineProperty:LI,defineProperties:ns,getOwnPropertyDescriptor:dh});kI({target:"Object",stat:!0,forced:!kg},{getOwnPropertyNames:hh});f0();p0(Xt,zI);Ch[Pe]=!0;var E0=Zg,uh=E0&&!!Symbol.for&&!!Symbol.keyFor,T0=D,O0=Xe,P0=re,S0=nt,fh=Gg,R0=uh,MC=fh("string-to-symbol-registry"),D0=fh("symbol-to-string-registry");T0({target:"Symbol",stat:!0,forced:!R0},{for:function(i){var e=S0(i);if(P0(MC,e))return MC[e];var t=O0("Symbol")(e);return MC[e]=t,D0[t]=e,t}});var N0=D,_0=re,k0=MA,M0=FA,F0=Gg,B0=uh,fa=F0("symbol-to-string-registry");N0({target:"Symbol",stat:!0,forced:!B0},{keyFor:function(e){if(!k0(e))throw new TypeError(M0(e)+" is not a symbol");if(_0(fa,e))return fa[e]}});var z0=L,pa=Gt,L0=ue,ma=vt,Z0=nt,va=z0([].push),G0=function(i){if(L0(i))return i;if(pa(i)){for(var e=i.length,t=[],g=0;g<e;g++){var A=i[g];typeof A=="string"?va(t,A):(typeof A=="number"||ma(A)==="Number"||ma(A)==="String")&&va(t,Z0(A))}var I=t.length,C=!0;return function(n,r){if(C)return C=!1,r;if(pa(this))return r;for(var s=0;s<I;s++)if(t[s]===n)return r}}},j0=D,ph=Xe,mh=xI,V0=Ke,XA=L,vh=z,ba=ue,ya=MA,bh=SI,Y0=G0,W0=Zg,U0=String,kt=ph("JSON","stringify"),wi=XA(/./.exec),wa=XA("".charAt),H0=XA("".charCodeAt),K0=XA("".replace),Q0=XA(1 .toString),X0=/[\uD800-\uDFFF]/g,xa=/^[\uD800-\uDBFF]$/,Ea=/^[\uDC00-\uDFFF]$/,Ta=!W0||vh(function(){var i=ph("Symbol")("stringify detection");return kt([i])!=="[null]"||kt({a:i})!=="{}"||kt(Object(i))!=="{}"}),Oa=vh(function(){return kt("\uDF06\uD834")!=='"\\udf06\\ud834"'||kt("\uDEAD")!=='"\\udead"'}),$0=function(i,e){var t=bh(arguments),g=Y0(e);if(!(!ba(g)&&(i===void 0||ya(i))))return t[1]=function(A,I){if(ba(g)&&(I=V0(g,this,U0(A),I)),!ya(I))return I},mh(kt,null,t)},J0=function(i,e,t){var g=wa(t,e-1),A=wa(t,e+1);return wi(xa,i)&&!wi(Ea,A)||wi(Ea,i)&&!wi(xa,g)?"\\u"+Q0(H0(i,0),16):i};kt&&j0({target:"JSON",stat:!0,arity:3,forced:Ta||Oa},{stringify:function(e,t,g){var A=bh(arguments),I=mh(Ta?$0:kt,null,A);return Oa&&typeof I=="string"?K0(I,X0,J0):I}});var q0=D,ew=Zg,tw=z,yh=jA,gw=Re,Aw=!ew||tw(function(){yh.f(1)});q0({target:"Object",stat:!0,forced:Aw},{getOwnPropertySymbols:function(e){var t=yh.f;return t?t(gw(e)):[]}});var iw=q;iw("asyncIterator");var Iw=q;Iw("hasInstance");var Cw=q;Cw("isConcatSpreadable");var nw=q;nw("iterator");var rw=q;rw("match");var sw=q;sw("matchAll");var ow=q;ow("replace");var aw=q;aw("search");var lw=q;lw("species");var dw=q;dw("split");var hw=q,cw=Jd;hw("toPrimitive");cw();var uw=Xe,fw=q,pw=Vg;fw("toStringTag");pw(uw("Symbol"),"Symbol");var mw=q;mw("unscopables");var vw=$,bw=Vg;bw(vw.JSON,"JSON",!0);var yw=Z,ww=yw.Symbol,Yg={},Dn=ne,xw=re,wh=Function.prototype,Ew=Dn&&Object.getOwnPropertyDescriptor,rs=xw(wh,"name"),Tw=rs&&(function(){}).name==="something",Ow=rs&&(!Dn||Dn&&Ew(wh,"name").configurable),Pw={EXISTS:rs,PROPER:Tw,CONFIGURABLE:Ow},Sw=z,xh=!Sw(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}),Rw=re,Dw=ue,Nw=Re,_w=NI,kw=xh,Pa=_w("IE_PROTO"),Nn=Object,Mw=Nn.prototype,ZI=kw?Nn.getPrototypeOf:function(i){var e=Nw(i);if(Rw(e,Pa))return e[Pa];var t=e.constructor;return Dw(t)&&e instanceof t?t.prototype:e instanceof Nn?Mw:null},Fw=z,Bw=ue,zw=pe,Lw=WA,Sa=ZI,Zw=HA,Gw=te,_n=Gw("iterator"),Eh=!1,at,FC,BC;[].keys&&(BC=[].keys(),"next"in BC?(FC=Sa(Sa(BC)),FC!==Object.prototype&&(at=FC)):Eh=!0);var jw=!zw(at)||Fw(function(){var i={};return at[_n].call(i)!==i});jw?at={}:at=Lw(at);Bw(at[_n])||Zw(at,_n,function(){return this});var Th={IteratorPrototype:at,BUGGY_SAFARI_ITERATORS:Eh},Vw=Th.IteratorPrototype,Yw=WA,Ww=DA,Uw=Vg,Hw=Yg,Kw=function(){return this},Qw=function(i,e,t,g){var A=e+" Iterator";return i.prototype=Yw(Vw,{next:Ww(+!g,t)}),Uw(i,A,!1,!0),Hw[A]=Kw,i},Xw=D,$w=Ke,Oh=Pw,Jw=Qw,qw=ZI,ex=Vg,Ra=HA,tx=te,Da=Yg,Ph=Th,gx=Oh.PROPER;Oh.CONFIGURABLE;Ph.IteratorPrototype;var xi=Ph.BUGGY_SAFARI_ITERATORS,zC=tx("iterator"),Na="keys",Ei="values",_a="entries",Ax=function(){return this},ss=function(i,e,t,g,A,I,C){Jw(t,e,g);var n=function(f){if(f===A&&l)return l;if(!xi&&f&&f in o)return o[f];switch(f){case Na:return function(){return new t(this,f)};case Ei:return function(){return new t(this,f)};case _a:return function(){return new t(this,f)}}return function(){return new t(this)}},r=e+" Iterator",s=!1,o=i.prototype,a=o[zC]||o["@@iterator"]||A&&o[A],l=!xi&&a||n(A),d=e==="Array"&&o.entries||a,h,c,u;if(d&&(h=qw(d.call(new i)),h!==Object.prototype&&h.next&&(ex(h,r,!0,!0),Da[r]=Ax)),gx&&A===Ei&&a&&a.name!==Ei&&(s=!0,l=function(){return $w(a,this)}),A)if(c={values:n(Ei),keys:I?l:n(Na),entries:n(_a)},C)for(u in c)(xi||s||!(u in o))&&Ra(o,u,c[u]);else Xw({target:e,proto:!0,forced:xi||s},c);return C&&o[zC]!==l&&Ra(o,zC,l,{name:A}),Da[e]=l,c},os=function(i,e){return{value:i,done:e}},ix=Qe,ka=Yg,Sh=ng;De.f;var Ix=ss,Ti=os,Rh="Array Iterator",Cx=Sh.set,nx=Sh.getterFor(Rh);Ix(Array,"Array",function(i,e){Cx(this,{type:Rh,target:ix(i),index:0,kind:e})},function(){var i=nx(this),e=i.target,t=i.kind,g=i.index++;if(!e||g>=e.length)return i.target=void 0,Ti(void 0,!0);switch(t){case"keys":return Ti(g,!1);case"values":return Ti(e[g],!1)}return Ti([g,e[g]],!1)},"values");ka.Arguments=ka.Array;var rx={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},sx=rx,ox=$,ax=yt,lx=jg,Ma=Yg,dx=te,Fa=dx("toStringTag");for(Oi in sx)LC=ox[Oi],Pi=LC&&LC.prototype,Pi&&ax(Pi)!==Fa&&lx(Pi,Fa,Oi),Ma[Oi]=Ma.Array;var LC,Pi,Oi,hx=ww,Dh=hx,cx=Dh,ux=R(cx),fx=D,Ba=Gt,px=Wd,mx=pe,za=LA,vx=ze,bx=Qe,yx=VA,wx=te,xx=YA,Ex=SI,Tx=xx("slice"),Ox=wx("species"),ZC=Array,Px=Math.max;fx({target:"Array",proto:!0,forced:!Tx},{slice:function(e,t){var g=bx(this),A=vx(g),I=za(e,A),C=za(t===void 0?A:t,A),n,r,s;if(Ba(g)&&(n=g.constructor,px(n)&&(n===ZC||Ba(n.prototype))?n=void 0:mx(n)&&(n=n[Ox],n===null&&(n=void 0)),n===ZC||n===void 0))return Ex(g,I,C);for(r=new(n===void 0?ZC:n)(Px(C-I,0)),s=0;I<C;I++,s++)I in g&&yx(r,s,g[I]);return r.length=s,r}});var Sx=Ie,Rx=Sx("Array").slice,Dx=J,Nx=Rx,GC=Array.prototype,_x=function(i){var e=i.slice;return i===GC||Dx(GC,i)&&e===GC.slice?Nx:e},kx=_x,Mx=kx,Fx=Mx,Ye=R(Fx),Bx=Xe,zx=L,Lx=UA,Zx=jA,Gx=bt,jx=zx([].concat),Nh=Bx("Reflect","ownKeys")||function(e){var t=Lx.f(Gx(e)),g=Zx.f;return g?jx(t,g(e)):t},Vx=D,Yx=Nh;Vx({target:"Reflect",stat:!0},{ownKeys:Yx});var Wx=Z,Ux=Wx.Reflect.ownKeys,Hx=Ux,Kx=Hx,Qx=Kx,Xx=R(Qx),$x=D,Jx=Gt;$x({target:"Array",stat:!0},{isArray:Jx});var qx=Z,e1=qx.Array.isArray,t1=e1,g1=t1,A1=g1,B=R(A1),i1=D,I1=jt.map,C1=YA,n1=C1("map");i1({target:"Array",proto:!0,forced:!n1},{map:function(e){return I1(this,e,arguments.length>1?arguments[1]:void 0)}});var r1=Ie,s1=r1("Array").map,o1=J,a1=s1,jC=Array.prototype,l1=function(i){var e=i.map;return i===jC||o1(jC,i)&&e===jC.map?a1:e},d1=l1,h1=d1,c1=h1,he=R(c1),u1=D,f1=Re,_h=GA,p1=z,m1=p1(function(){_h(1)});u1({target:"Object",stat:!0,forced:m1},{keys:function(e){return _h(f1(e))}});var v1=Z,b1=v1.Object.keys,y1=b1,w1=y1,x1=w1,K=R(x1),E1=D,T1=L,kh=Date,O1=T1(kh.prototype.getTime);E1({target:"Date",stat:!0},{now:function(){return O1(new kh)}});var P1=Z,S1=P1.Date.now,R1=S1,D1=R1,N1=D1,qi=R(N1),_1=z,Wg=function(i,e){var t=[][i];return!!t&&_1(function(){t.call(null,e||function(){return 1},1)})},k1=jt.forEach,M1=Wg,F1=M1("forEach"),B1=F1?[].forEach:function(e){return k1(this,e,arguments.length>1?arguments[1]:void 0)},z1=D,La=B1;z1({target:"Array",proto:!0,forced:[].forEach!==La},{forEach:La});var L1=Ie,Z1=L1("Array").forEach,G1=Z1,j1=G1,V1=yt,Y1=re,W1=J,U1=j1,VC=Array.prototype,H1={DOMTokenList:!0,NodeList:!0},K1=function(i){var e=i.forEach;return i===VC||W1(VC,i)&&e===VC.forEach||Y1(H1,V1(i))?U1:e},Q1=K1,F=R(Q1),X1=D,$1=L,J1=Gt,q1=$1([].reverse),Za=[1,2];X1({target:"Array",proto:!0,forced:String(Za)===String(Za.reverse())},{reverse:function(){return J1(this)&&(this.length=this.length),q1(this)}});var eE=Ie,tE=eE("Array").reverse,gE=J,AE=tE,YC=Array.prototype,iE=function(i){var e=i.reverse;return i===YC||gE(YC,i)&&e===YC.reverse?AE:e},IE=iE,CE=IE,nE=CE,Jt=R(nE),rE=ne,sE=Gt,oE=TypeError,aE=Object.getOwnPropertyDescriptor,lE=rE&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}})(),dE=lE?function(i,e){if(sE(i)&&!aE(i,"length").writable)throw new oE("Cannot set read only .length");return i.length=e}:function(i,e){return i.length=e},Ga=FA,hE=TypeError,Mh=function(i,e){if(!delete i[e])throw new hE("Cannot delete property "+Ga(e)+" of "+Ga(i))},cE=D,uE=Re,fE=LA,pE=PI,mE=ze,vE=dE,bE=es,yE=RI,wE=VA,WC=Mh,xE=YA,EE=xE("splice"),TE=Math.max,OE=Math.min;cE({target:"Array",proto:!0,forced:!EE},{splice:function(e,t){var g=uE(this),A=mE(g),I=fE(e,A),C=arguments.length,n,r,s,o,a,l;for(C===0?n=r=0:C===1?(n=0,r=A-I):(n=C-2,r=OE(TE(pE(t),0),A-I)),bE(A+n-r),s=yE(g,r),o=0;o<r;o++)a=I+o,a in g&&wE(s,o,g[a]);if(s.length=r,n<r){for(o=I;o<A-r;o++)a=o+r,l=o+n,a in g?g[l]=g[a]:WC(g,l);for(o=A;o>A-r+n;o--)WC(g,o-1)}else if(n>r)for(o=A-r;o>I;o--)a=o+r-1,l=o+n-1,a in g?g[l]=g[a]:WC(g,l);for(o=0;o<n;o++)g[o+I]=arguments[o+2];return vE(g,A-r+n),s}});var PE=Ie,SE=PE("Array").splice,RE=J,DE=SE,UC=Array.prototype,NE=function(i){var e=i.splice;return i===UC||RE(UC,i)&&e===UC.splice?DE:e},_E=NE,kE=_E,ME=kE,tt=R(ME),FE=D,BE=$r.includes,zE=z,LE=zE(function(){return!Array(1).includes()});FE({target:"Array",proto:!0,forced:LE},{includes:function(e){return BE(this,e,arguments.length>1?arguments[1]:void 0)}});var ZE=Ie,GE=ZE("Array").includes,jE=pe,VE=vt,YE=te,WE=YE("match"),UE=function(i){var e;return jE(i)&&((e=i[WE])!==void 0?!!e:VE(i)==="RegExp")},HE=UE,KE=TypeError,QE=function(i){if(HE(i))throw new KE("The method doesn't accept regular expressions");return i},XE=te,$E=XE("match"),JE=function(i){var e=/./;try{"/./"[i](e)}catch(t){try{return e[$E]=!1,"/./"[i](e)}catch(g){}}return!1},qE=D,eT=L,tT=QE,gT=NA,ja=nt,AT=JE,iT=eT("".indexOf);qE({target:"String",proto:!0,forced:!AT("includes")},{includes:function(e){return!!~iT(ja(gT(this)),ja(tT(e)),arguments.length>1?arguments[1]:void 0)}});var IT=Ie,CT=IT("String").includes,Va=J,nT=GE,rT=CT,HC=Array.prototype,KC=String.prototype,sT=function(i){var e=i.includes;return i===HC||Va(HC,i)&&e===HC.includes?nT:typeof i=="string"||i===KC||Va(KC,i)&&e===KC.includes?rT:e},oT=sT,aT=oT,lT=aT,Mt=R(lT),dT=D,hT=z,cT=Re,Fh=ZI,uT=xh,fT=hT(function(){Fh(1)});dT({target:"Object",stat:!0,forced:fT,sham:!uT},{getPrototypeOf:function(e){return Fh(cT(e))}});var pT=Z,mT=pT.Object.getPrototypeOf,vT=mT,bT=vT,yT=bT,Ya=R(yT),wT=Ie,xT=wT("Array").concat,ET=J,TT=xT,QC=Array.prototype,OT=function(i){var e=i.concat;return i===QC||ET(QC,i)&&e===QC.concat?TT:e},PT=OT,ST=PT,RT=ST,Bh=R(RT),DT=D,NT=jt.filter,_T=YA,kT=_T("filter");DT({target:"Array",proto:!0,forced:!kT},{filter:function(e){return NT(this,e,arguments.length>1?arguments[1]:void 0)}});var MT=Ie,FT=MT("Array").filter,BT=J,zT=FT,XC=Array.prototype,LT=function(i){var e=i.filter;return i===XC||BT(XC,i)&&e===XC.filter?zT:e},ZT=LT,GT=ZT,jT=GT,Ae=R(jT),zh=ne,VT=z,Lh=L,YT=ZI,WT=GA,UT=Qe,HT=RA.f,Zh=Lh(HT),KT=Lh([].push),QT=zh&&VT(function(){var i=Object.create(null);return i[2]=2,!Zh(i,2)}),Wa=function(i){return function(e){for(var t=UT(e),g=WT(t),A=QT&&YT(t)===null,I=g.length,C=0,n=[],r;I>C;)r=g[C++],(!zh||(A?r in t:Zh(t,r)))&&KT(n,i?[r,t[r]]:t[r]);return n}},XT={entries:Wa(!0),values:Wa(!1)},$T=D,JT=XT.values;$T({target:"Object",stat:!0},{values:function(e){return JT(e)}});var qT=Z,e2=qT.Object.values,t2=e2,g2=t2,A2=g2,i2=R(A2),as=`
633
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,I2=L,C2=NA,n2=nt,kn=as,Ua=I2("".replace),r2=RegExp("^["+kn+"]+"),s2=RegExp("(^|[^"+kn+"])["+kn+"]+$"),$C=function(i){return function(e){var t=n2(C2(e));return i&1&&(t=Ua(t,r2,"")),i&2&&(t=Ua(t,s2,"$1")),t}},Gh={start:$C(1),end:$C(2),trim:$C(3)},jh=$,o2=z,a2=L,l2=nt,d2=Gh.trim,Ha=as,aA=jh.parseInt,Ka=jh.Symbol,Qa=Ka&&Ka.iterator,Vh=/^[+-]?0x/i,h2=a2(Vh.exec),c2=aA(Ha+"08")!==8||aA(Ha+"0x16")!==22||Qa&&!o2(function(){aA(Object(Qa))}),u2=c2?function(e,t){var g=d2(l2(e));return aA(g,t>>>0||(h2(Vh,g)?16:10))}:aA,f2=D,Xa=u2;f2({global:!0,forced:parseInt!==Xa},{parseInt:Xa});var p2=Z,m2=p2.parseInt,v2=m2,b2=v2,y2=b2,Ve=R(y2),w2=D,x2=Kr,E2=$r.indexOf,T2=Wg,Mn=x2([].indexOf),Yh=!!Mn&&1/Mn([1],1,-0)<0,O2=Yh||!T2("indexOf");w2({target:"Array",proto:!0,forced:O2},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return Yh?Mn(this,e,t)||0:E2(this,e,t)}});var P2=Ie,S2=P2("Array").indexOf,R2=J,D2=S2,JC=Array.prototype,N2=function(i){var e=i.indexOf;return i===JC||R2(JC,i)&&e===JC.indexOf?D2:e},_2=N2,k2=_2,M2=k2,G=R(M2),F2=D,B2=ne,z2=WA;F2({target:"Object",stat:!0,sham:!B2},{create:z2});var L2=Z,Z2=L2.Object,G2=function(e,t){return Z2.create(e,t)},j2=G2,V2=j2,Y2=V2,Ft=R(Y2),Fn=Z,W2=xI;Fn.JSON||(Fn.JSON={stringify:JSON.stringify});var U2=function(e,t,g){return W2(Fn.JSON.stringify,null,arguments)},H2=U2,K2=H2,Q2=K2,Ug=R(Q2),X2=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",$2=TypeError,J2=function(i,e){if(i<e)throw new $2("Not enough arguments");return i},Wh=$,q2=xI,eO=ue,tO=X2,gO=_A,AO=SI,iO=J2,IO=Wh.Function,CO=/MSIE .\./.test(gO)||tO&&(function(){var i=Wh.Bun.version.split(".");return i.length<3||i[0]==="0"&&(i[1]<3||i[1]==="3"&&i[2]==="0")})(),Uh=function(i,e){var t=e?2:1;return CO?function(g,A){var I=iO(arguments.length,1)>t,C=eO(g)?g:IO(g),n=I?AO(arguments,t):[],r=I?function(){q2(C,this,n)}:C;return e?i(r,A):i(r)}:i},nO=D,Hh=$,rO=Uh,$a=rO(Hh.setInterval,!0);nO({global:!0,bind:!0,forced:Hh.setInterval!==$a},{setInterval:$a});var sO=D,Kh=$,oO=Uh,Ja=oO(Kh.setTimeout,!0);sO({global:!0,bind:!0,forced:Kh.setTimeout!==Ja},{setTimeout:Ja});var aO=Z,lO=aO.setTimeout,dO=lO,gt=R(dO),hO=Re,qa=LA,cO=ze,uO=function(e){for(var t=hO(this),g=cO(t),A=arguments.length,I=qa(A>1?arguments[1]:void 0,g),C=A>2?arguments[2]:void 0,n=C===void 0?g:qa(C,g);n>I;)t[I++]=e;return t},fO=D,pO=uO;fO({target:"Array",proto:!0},{fill:pO});var mO=Ie,vO=mO("Array").fill,bO=J,yO=vO,qC=Array.prototype,wO=function(i){var e=i.fill;return i===qC||bO(qC,i)&&e===qC.fill?yO:e},xO=wO,EO=xO,TO=EO,$A=R(TO);function He(){return He=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var g in t)Object.prototype.hasOwnProperty.call(t,g)&&(i[g]=t[g])}return i},He.apply(this,arguments)}function Le(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}function Si(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}var Bn;typeof Object.assign!="function"?Bn=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),g=1;g<arguments.length;g++){var A=arguments[g];if(A!=null)for(var I in A)A.hasOwnProperty(I)&&(t[I]=A[I])}return t}:Bn=Object.assign;var tg=Bn,el=["","webkit","Moz","MS","ms","o"],OO=typeof document=="undefined"?{style:{}}:document.createElement("div"),PO="function",Og=Math.round,gg=Math.abs,ls=Date.now;function GI(i,e){for(var t,g,A=e[0].toUpperCase()+e.slice(1),I=0;I<el.length;){if(t=el[I],g=t?t+A:e,g in i)return g;I++}}var lt;typeof window=="undefined"?lt={}:lt=window;var Qh=GI(OO.style,"touchAction"),Xh=Qh!==void 0;function SO(){if(!Xh)return!1;var i={},e=lt.CSS&&lt.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return i[t]=e?lt.CSS.supports("touch-action",t):!0}),i}var $h="compute",Jh="auto",zn="manipulation",qt="none",vA="pan-x",bA="pan-y",Ri=SO(),RO=/mobile|tablet|ip(ad|hone|od)|android/i,qh="ontouchstart"in lt,DO=GI(lt,"PointerEvent")!==void 0,NO=qh&&RO.test(navigator.userAgent),JA="touch",_O="pen",ds="mouse",kO="kinect",MO=25,xe=1,rg=2,ie=4,Se=8,eI=1,qA=2,ei=4,ti=8,Mg=16,At=qA|ei,eg=ti|Mg,ec=At|eg,tc=["x","y"],tI=["clientX","clientY"];function dt(i,e,t){var g;if(i)if(i.forEach)i.forEach(e,t);else if(i.length!==void 0)for(g=0;g<i.length;)e.call(t,i[g],g,i),g++;else for(g in i)i.hasOwnProperty(g)&&e.call(t,i[g],g,i)}function jI(i,e){return typeof i===PO?i.apply(e&&e[0]||void 0,e):i}function Kt(i,e){return i.indexOf(e)>-1}function FO(i){if(Kt(i,qt))return qt;var e=Kt(i,vA),t=Kt(i,bA);return e&&t?qt:e||t?e?vA:bA:Kt(i,zn)?zn:Jh}var gc=(function(){function i(t,g){this.manager=t,this.set(g)}var e=i.prototype;return e.set=function(g){g===$h&&(g=this.compute()),Xh&&this.manager.element.style&&Ri[g]&&(this.manager.element.style[Qh]=g),this.actions=g.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var g=[];return dt(this.manager.recognizers,function(A){jI(A.options.enable,[A])&&(g=g.concat(A.getTouchAction()))}),FO(g.join(" "))},e.preventDefaults=function(g){var A=g.srcEvent,I=g.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var C=this.actions,n=Kt(C,qt)&&!Ri[qt],r=Kt(C,bA)&&!Ri[bA],s=Kt(C,vA)&&!Ri[vA];if(n){var o=g.pointers.length===1,a=g.distance<2,l=g.deltaTime<250;if(o&&a&&l)return}if(!(s&&r)&&(n||r&&I&At||s&&I&eg))return this.preventSrc(A)},e.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},i})();function hs(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function Ac(i){var e=i.length;if(e===1)return{x:Og(i[0].clientX),y:Og(i[0].clientY)};for(var t=0,g=0,A=0;A<e;)t+=i[A].clientX,g+=i[A].clientY,A++;return{x:Og(t/e),y:Og(g/e)}}function tl(i){for(var e=[],t=0;t<i.pointers.length;)e[t]={clientX:Og(i.pointers[t].clientX),clientY:Og(i.pointers[t].clientY)},t++;return{timeStamp:ls(),pointers:e,center:Ac(e),deltaX:i.deltaX,deltaY:i.deltaY}}function gI(i,e,t){t||(t=tc);var g=e[t[0]]-i[t[0]],A=e[t[1]]-i[t[1]];return Math.sqrt(g*g+A*A)}function Ln(i,e,t){t||(t=tc);var g=e[t[0]]-i[t[0]],A=e[t[1]]-i[t[1]];return Math.atan2(A,g)*180/Math.PI}function ic(i,e){return i===e?eI:gg(i)>=gg(e)?i<0?qA:ei:e<0?ti:Mg}function BO(i,e){var t=e.center,g=i.offsetDelta||{},A=i.prevDelta||{},I=i.prevInput||{};(e.eventType===xe||I.eventType===ie)&&(A=i.prevDelta={x:I.deltaX||0,y:I.deltaY||0},g=i.offsetDelta={x:t.x,y:t.y}),e.deltaX=A.x+(t.x-g.x),e.deltaY=A.y+(t.y-g.y)}function Ic(i,e,t){return{x:e/i||0,y:t/i||0}}function zO(i,e){return gI(e[0],e[1],tI)/gI(i[0],i[1],tI)}function LO(i,e){return Ln(e[1],e[0],tI)+Ln(i[1],i[0],tI)}function ZO(i,e){var t=i.lastInterval||e,g=e.timeStamp-t.timeStamp,A,I,C,n;if(e.eventType!==Se&&(g>MO||t.velocity===void 0)){var r=e.deltaX-t.deltaX,s=e.deltaY-t.deltaY,o=Ic(g,r,s);I=o.x,C=o.y,A=gg(o.x)>gg(o.y)?o.x:o.y,n=ic(r,s),i.lastInterval=e}else A=t.velocity,I=t.velocityX,C=t.velocityY,n=t.direction;e.velocity=A,e.velocityX=I,e.velocityY=C,e.direction=n}function GO(i,e){var t=i.session,g=e.pointers,A=g.length;t.firstInput||(t.firstInput=tl(e)),A>1&&!t.firstMultiple?t.firstMultiple=tl(e):A===1&&(t.firstMultiple=!1);var I=t.firstInput,C=t.firstMultiple,n=C?C.center:I.center,r=e.center=Ac(g);e.timeStamp=ls(),e.deltaTime=e.timeStamp-I.timeStamp,e.angle=Ln(n,r),e.distance=gI(n,r),BO(t,e),e.offsetDirection=ic(e.deltaX,e.deltaY);var s=Ic(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=gg(s.x)>gg(s.y)?s.x:s.y,e.scale=C?zO(C.pointers,g):1,e.rotation=C?LO(C.pointers,g):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,ZO(t,e);var o=i.element,a=e.srcEvent,l;a.composedPath?l=a.composedPath()[0]:a.path?l=a.path[0]:l=a.target,hs(l,o)&&(o=l),e.target=o}function jO(i,e,t){var g=t.pointers.length,A=t.changedPointers.length,I=e&xe&&g-A===0,C=e&(ie|Se)&&g-A===0;t.isFirst=!!I,t.isFinal=!!C,I&&(i.session={}),t.eventType=e,GO(i,t),i.emit("hammer.input",t),i.recognize(t),i.session.prevInput=t}function yA(i){return i.trim().split(/\s+/g)}function lA(i,e,t){dt(yA(e),function(g){i.addEventListener(g,t,!1)})}function dA(i,e,t){dt(yA(e),function(g){i.removeEventListener(g,t,!1)})}function gl(i){var e=i.ownerDocument||i;return e.defaultView||e.parentWindow||window}var Hg=(function(){function i(t,g){var A=this;this.manager=t,this.callback=g,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(I){jI(t.options.enable,[t])&&A.handler(I)},this.init()}var e=i.prototype;return e.handler=function(){},e.init=function(){this.evEl&&lA(this.element,this.evEl,this.domHandler),this.evTarget&&lA(this.target,this.evTarget,this.domHandler),this.evWin&&lA(gl(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&dA(this.element,this.evEl,this.domHandler),this.evTarget&&dA(this.target,this.evTarget,this.domHandler),this.evWin&&dA(gl(this.element),this.evWin,this.domHandler)},i})();function Ag(i,e,t){if(i.indexOf&&!t)return i.indexOf(e);for(var g=0;g<i.length;){if(t&&i[g][t]==e||!t&&i[g]===e)return g;g++}return-1}var VO={pointerdown:xe,pointermove:rg,pointerup:ie,pointercancel:Se,pointerout:Se},YO={2:JA,3:_O,4:ds,5:kO},Cc="pointerdown",nc="pointermove pointerup pointercancel";lt.MSPointerEvent&&!lt.PointerEvent&&(Cc="MSPointerDown",nc="MSPointerMove MSPointerUp MSPointerCancel");var rc=(function(i){Le(e,i);function e(){var g,A=e.prototype;return A.evEl=Cc,A.evWin=nc,g=i.apply(this,arguments)||this,g.store=g.manager.session.pointerEvents=[],g}var t=e.prototype;return t.handler=function(A){var I=this.store,C=!1,n=A.type.toLowerCase().replace("ms",""),r=VO[n],s=YO[A.pointerType]||A.pointerType,o=s===JA,a=Ag(I,A.pointerId,"pointerId");r&xe&&(A.button===0||o)?a<0&&(I.push(A),a=I.length-1):r&(ie|Se)&&(C=!0),!(a<0)&&(I[a]=A,this.callback(this.manager,r,{pointers:I,changedPointers:[A],pointerType:s,srcEvent:A}),C&&I.splice(a,1))},e})(Hg);function wA(i){return Array.prototype.slice.call(i,0)}function cs(i,e,t){for(var g=[],A=[],I=0;I<i.length;){var C=e?i[I][e]:i[I];Ag(A,C)<0&&g.push(i[I]),A[I]=C,I++}return t&&(e?g=g.sort(function(n,r){return n[e]>r[e]}):g=g.sort()),g}var WO={touchstart:xe,touchmove:rg,touchend:ie,touchcancel:Se},UO="touchstart touchmove touchend touchcancel",us=(function(i){Le(e,i);function e(){var g;return e.prototype.evTarget=UO,g=i.apply(this,arguments)||this,g.targetIds={},g}var t=e.prototype;return t.handler=function(A){var I=WO[A.type],C=HO.call(this,A,I);C&&this.callback(this.manager,I,{pointers:C[0],changedPointers:C[1],pointerType:JA,srcEvent:A})},e})(Hg);function HO(i,e){var t=wA(i.touches),g=this.targetIds;if(e&(xe|rg)&&t.length===1)return g[t[0].identifier]=!0,[t,t];var A,I,C=wA(i.changedTouches),n=[],r=this.target;if(I=t.filter(function(s){return hs(s.target,r)}),e===xe)for(A=0;A<I.length;)g[I[A].identifier]=!0,A++;for(A=0;A<C.length;)g[C[A].identifier]&&n.push(C[A]),e&(ie|Se)&&delete g[C[A].identifier],A++;if(n.length)return[cs(I.concat(n),"identifier",!0),n]}var KO={mousedown:xe,mousemove:rg,mouseup:ie},QO="mousedown",XO="mousemove mouseup",fs=(function(i){Le(e,i);function e(){var g,A=e.prototype;return A.evEl=QO,A.evWin=XO,g=i.apply(this,arguments)||this,g.pressed=!1,g}var t=e.prototype;return t.handler=function(A){var I=KO[A.type];I&xe&&A.button===0&&(this.pressed=!0),I&rg&&A.which!==1&&(I=ie),this.pressed&&(I&ie&&(this.pressed=!1),this.callback(this.manager,I,{pointers:[A],changedPointers:[A],pointerType:ds,srcEvent:A}))},e})(Hg),$O=2500,Al=25;function il(i){var e=i.changedPointers,t=e[0];if(t.identifier===this.primaryTouch){var g={x:t.clientX,y:t.clientY},A=this.lastTouches;this.lastTouches.push(g);var I=function(){var n=A.indexOf(g);n>-1&&A.splice(n,1)};setTimeout(I,$O)}}function JO(i,e){i&xe?(this.primaryTouch=e.changedPointers[0].identifier,il.call(this,e)):i&(ie|Se)&&il.call(this,e)}function qO(i){for(var e=i.srcEvent.clientX,t=i.srcEvent.clientY,g=0;g<this.lastTouches.length;g++){var A=this.lastTouches[g],I=Math.abs(e-A.x),C=Math.abs(t-A.y);if(I<=Al&&C<=Al)return!0}return!1}var sc=(function(){var i=(function(e){Le(t,e);function t(A,I){var C;return C=e.call(this,A,I)||this,C.handler=function(n,r,s){var o=s.pointerType===JA,a=s.pointerType===ds;if(!(a&&s.sourceCapabilities&&s.sourceCapabilities.firesTouchEvents)){if(o)JO.call(Si(Si(C)),r,s);else if(a&&qO.call(Si(Si(C)),s))return;C.callback(n,r,s)}},C.touch=new us(C.manager,C.handler),C.mouse=new fs(C.manager,C.handler),C.primaryTouch=null,C.lastTouches=[],C}var g=t.prototype;return g.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t})(Hg);return i})();function eP(i){var e,t=i.options.inputClass;return t?e=t:DO?e=rc:NO?e=us:qh?e=sc:e=fs,new e(i,jO)}function Pg(i,e,t){return Array.isArray(i)?(dt(i,t[e],t),!0):!1}var Vi=1,Be=2,Fg=4,Bt=8,ht=Bt,xA=16,qe=32,tP=1;function gP(){return tP++}function Di(i,e){var t=e.manager;return t?t.get(i):i}function Il(i){return i&xA?"cancel":i&Bt?"end":i&Fg?"move":i&Be?"start":""}var gi=(function(){function i(t){t===void 0&&(t={}),this.options=He({enable:!0},t),this.id=gP(),this.manager=null,this.state=Vi,this.simultaneous={},this.requireFail=[]}var e=i.prototype;return e.set=function(g){return tg(this.options,g),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(g){if(Pg(g,"recognizeWith",this))return this;var A=this.simultaneous;return g=Di(g,this),A[g.id]||(A[g.id]=g,g.recognizeWith(this)),this},e.dropRecognizeWith=function(g){return Pg(g,"dropRecognizeWith",this)?this:(g=Di(g,this),delete this.simultaneous[g.id],this)},e.requireFailure=function(g){if(Pg(g,"requireFailure",this))return this;var A=this.requireFail;return g=Di(g,this),Ag(A,g)===-1&&(A.push(g),g.requireFailure(this)),this},e.dropRequireFailure=function(g){if(Pg(g,"dropRequireFailure",this))return this;g=Di(g,this);var A=Ag(this.requireFail,g);return A>-1&&this.requireFail.splice(A,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},e.emit=function(g){var A=this,I=this.state;function C(n){A.manager.emit(n,g)}I<Bt&&C(A.options.event+Il(I)),C(A.options.event),g.additionalEvent&&C(g.additionalEvent),I>=Bt&&C(A.options.event+Il(I))},e.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=qe},e.canEmit=function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(qe|Vi)))return!1;g++}return!0},e.recognize=function(g){var A=tg({},g);if(!jI(this.options.enable,[this,A])){this.reset(),this.state=qe;return}this.state&(ht|xA|qe)&&(this.state=Vi),this.state=this.process(A),this.state&(Be|Fg|Bt|xA)&&this.tryEmit(A)},e.process=function(g){},e.getTouchAction=function(){},e.reset=function(){},i})(),Zn=(function(i){Le(e,i);function e(g){var A;return g===void 0&&(g={}),A=i.call(this,He({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},g))||this,A.pTime=!1,A.pCenter=!1,A._timer=null,A._input=null,A.count=0,A}var t=e.prototype;return t.getTouchAction=function(){return[zn]},t.process=function(A){var I=this,C=this.options,n=A.pointers.length===C.pointers,r=A.distance<C.threshold,s=A.deltaTime<C.time;if(this.reset(),A.eventType&xe&&this.count===0)return this.failTimeout();if(r&&s&&n){if(A.eventType!==ie)return this.failTimeout();var o=this.pTime?A.timeStamp-this.pTime<C.interval:!0,a=!this.pCenter||gI(this.pCenter,A.center)<C.posThreshold;this.pTime=A.timeStamp,this.pCenter=A.center,!a||!o?this.count=1:this.count+=1,this._input=A;var l=this.count%C.taps;if(l===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){I.state=ht,I.tryEmit()},C.interval),Be):ht}return qe},t.failTimeout=function(){var A=this;return this._timer=setTimeout(function(){A.state=qe},this.options.interval),qe},t.reset=function(){clearTimeout(this._timer)},t.emit=function(){this.state===ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e})(gi),Bg=(function(i){Le(e,i);function e(g){return g===void 0&&(g={}),i.call(this,He({pointers:1},g))||this}var t=e.prototype;return t.attrTest=function(A){var I=this.options.pointers;return I===0||A.pointers.length===I},t.process=function(A){var I=this.state,C=A.eventType,n=I&(Be|Fg),r=this.attrTest(A);return n&&(C&Se||!r)?I|xA:n||r?C&ie?I|Bt:I&Be?I|Fg:Be:qe},e})(gi);function oc(i){return i===Mg?"down":i===ti?"up":i===qA?"left":i===ei?"right":""}var ps=(function(i){Le(e,i);function e(g){var A;return g===void 0&&(g={}),A=i.call(this,He({event:"pan",threshold:10,pointers:1,direction:ec},g))||this,A.pX=null,A.pY=null,A}var t=e.prototype;return t.getTouchAction=function(){var A=this.options.direction,I=[];return A&At&&I.push(bA),A&eg&&I.push(vA),I},t.directionTest=function(A){var I=this.options,C=!0,n=A.distance,r=A.direction,s=A.deltaX,o=A.deltaY;return r&I.direction||(I.direction&At?(r=s===0?eI:s<0?qA:ei,C=s!==this.pX,n=Math.abs(A.deltaX)):(r=o===0?eI:o<0?ti:Mg,C=o!==this.pY,n=Math.abs(A.deltaY))),A.direction=r,C&&n>I.threshold&&r&I.direction},t.attrTest=function(A){return Bg.prototype.attrTest.call(this,A)&&(this.state&Be||!(this.state&Be)&&this.directionTest(A))},t.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var I=oc(A.direction);I&&(A.additionalEvent=this.options.event+I),i.prototype.emit.call(this,A)},e})(Bg),ac=(function(i){Le(e,i);function e(g){return g===void 0&&(g={}),i.call(this,He({event:"swipe",threshold:10,velocity:.3,direction:At|eg,pointers:1},g))||this}var t=e.prototype;return t.getTouchAction=function(){return ps.prototype.getTouchAction.call(this)},t.attrTest=function(A){var I=this.options.direction,C;return I&(At|eg)?C=A.overallVelocity:I&At?C=A.overallVelocityX:I&eg&&(C=A.overallVelocityY),i.prototype.attrTest.call(this,A)&&I&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&gg(C)>this.options.velocity&&A.eventType&ie},t.emit=function(A){var I=oc(A.offsetDirection);I&&this.manager.emit(this.options.event+I,A),this.manager.emit(this.options.event,A)},e})(Bg),lc=(function(i){Le(e,i);function e(g){return g===void 0&&(g={}),i.call(this,He({event:"pinch",threshold:0,pointers:2},g))||this}var t=e.prototype;return t.getTouchAction=function(){return[qt]},t.attrTest=function(A){return i.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||this.state&Be)},t.emit=function(A){if(A.scale!==1){var I=A.scale<1?"in":"out";A.additionalEvent=this.options.event+I}i.prototype.emit.call(this,A)},e})(Bg),dc=(function(i){Le(e,i);function e(g){return g===void 0&&(g={}),i.call(this,He({event:"rotate",threshold:0,pointers:2},g))||this}var t=e.prototype;return t.getTouchAction=function(){return[qt]},t.attrTest=function(A){return i.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||this.state&Be)},e})(Bg),hc=(function(i){Le(e,i);function e(g){var A;return g===void 0&&(g={}),A=i.call(this,He({event:"press",pointers:1,time:251,threshold:9},g))||this,A._timer=null,A._input=null,A}var t=e.prototype;return t.getTouchAction=function(){return[Jh]},t.process=function(A){var I=this,C=this.options,n=A.pointers.length===C.pointers,r=A.distance<C.threshold,s=A.deltaTime>C.time;if(this._input=A,!r||!n||A.eventType&(ie|Se)&&!s)this.reset();else if(A.eventType&xe)this.reset(),this._timer=setTimeout(function(){I.state=ht,I.tryEmit()},C.time);else if(A.eventType&ie)return ht;return qe},t.reset=function(){clearTimeout(this._timer)},t.emit=function(A){this.state===ht&&(A&&A.eventType&ie?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=ls(),this.manager.emit(this.options.event,this._input)))},e})(gi),cc={domEvents:!1,touchAction:$h,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Cl=[[dc,{enable:!1}],[lc,{enable:!1},["rotate"]],[ac,{direction:At}],[ps,{direction:At},["swipe"]],[Zn],[Zn,{event:"doubletap",taps:2},["tap"]],[hc]],AP=1,nl=2;function rl(i,e){var t=i.element;if(t.style){var g;dt(i.options.cssProps,function(A,I){g=GI(t.style,I),e?(i.oldCssProps[g]=t.style[g],t.style[g]=A):t.style[g]=i.oldCssProps[g]||""}),e||(i.oldCssProps={})}}function iP(i,e){var t=document.createEvent("Event");t.initEvent(i,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var sl=(function(){function i(t,g){var A=this;this.options=tg({},cc,g||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=eP(this),this.touchAction=new gc(this,this.options.touchAction),rl(this,!0),dt(this.options.recognizers,function(I){var C=A.add(new I[0](I[1]));I[2]&&C.recognizeWith(I[2]),I[3]&&C.requireFailure(I[3])},this)}var e=i.prototype;return e.set=function(g){return tg(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},e.stop=function(g){this.session.stopped=g?nl:AP},e.recognize=function(g){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(g);var I,C=this.recognizers,n=A.curRecognizer;(!n||n&&n.state&ht)&&(A.curRecognizer=null,n=null);for(var r=0;r<C.length;)I=C[r],A.stopped!==nl&&(!n||I===n||I.canRecognizeWith(n))?I.recognize(g):I.reset(),!n&&I.state&(Be|Fg|Bt)&&(A.curRecognizer=I,n=I),r++}},e.get=function(g){if(g instanceof gi)return g;for(var A=this.recognizers,I=0;I<A.length;I++)if(A[I].options.event===g)return A[I];return null},e.add=function(g){if(Pg(g,"add",this))return this;var A=this.get(g.options.event);return A&&this.remove(A),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},e.remove=function(g){if(Pg(g,"remove",this))return this;var A=this.get(g);if(g){var I=this.recognizers,C=Ag(I,A);C!==-1&&(I.splice(C,1),this.touchAction.update())}return this},e.on=function(g,A){if(g===void 0||A===void 0)return this;var I=this.handlers;return dt(yA(g),function(C){I[C]=I[C]||[],I[C].push(A)}),this},e.off=function(g,A){if(g===void 0)return this;var I=this.handlers;return dt(yA(g),function(C){A?I[C]&&I[C].splice(Ag(I[C],A),1):delete I[C]}),this},e.emit=function(g,A){this.options.domEvents&&iP(g,A);var I=this.handlers[g]&&this.handlers[g].slice();if(!(!I||!I.length)){A.type=g,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var C=0;C<I.length;)I[C](A),C++}},e.destroy=function(){this.element&&rl(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},i})(),IP={touchstart:xe,touchmove:rg,touchend:ie,touchcancel:Se},CP="touchstart",nP="touchstart touchmove touchend touchcancel",rP=(function(i){Le(e,i);function e(){var g,A=e.prototype;return A.evTarget=CP,A.evWin=nP,g=i.apply(this,arguments)||this,g.started=!1,g}var t=e.prototype;return t.handler=function(A){var I=IP[A.type];if(I===xe&&(this.started=!0),!!this.started){var C=sP.call(this,A,I);I&(ie|Se)&&C[0].length-C[1].length===0&&(this.started=!1),this.callback(this.manager,I,{pointers:C[0],changedPointers:C[1],pointerType:JA,srcEvent:A})}},e})(Hg);function sP(i,e){var t=wA(i.touches),g=wA(i.changedTouches);return e&(ie|Se)&&(t=cs(t.concat(g),"identifier",!0)),[t,g]}function uc(i,e,t){var g="DEPRECATED METHOD: "+e+`
634
+ `+t+` AT
635
+ `;return function(){var A=new Error("get-stack-trace"),I=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",C=window.console&&(window.console.warn||window.console.log);return C&&C.call(window.console,g,I),i.apply(this,arguments)}}var fc=uc(function(i,e,t){for(var g=Object.keys(e),A=0;A<g.length;)(!t||t&&i[g[A]]===void 0)&&(i[g[A]]=e[g[A]]),A++;return i},"extend","Use `assign`."),oP=uc(function(i,e){return fc(i,e,!0)},"merge","Use `assign`.");function aP(i,e,t){var g=e.prototype,A;A=i.prototype=Object.create(g),A.constructor=i,A._super=g,t&&tg(A,t)}function ol(i,e){return function(){return i.apply(e,arguments)}}var pc=(function(){var i=function(t,g){return g===void 0&&(g={}),new sl(t,He({recognizers:Cl.concat()},g))};return i.VERSION="2.0.17-rc",i.DIRECTION_ALL=ec,i.DIRECTION_DOWN=Mg,i.DIRECTION_LEFT=qA,i.DIRECTION_RIGHT=ei,i.DIRECTION_UP=ti,i.DIRECTION_HORIZONTAL=At,i.DIRECTION_VERTICAL=eg,i.DIRECTION_NONE=eI,i.DIRECTION_DOWN=Mg,i.INPUT_START=xe,i.INPUT_MOVE=rg,i.INPUT_END=ie,i.INPUT_CANCEL=Se,i.STATE_POSSIBLE=Vi,i.STATE_BEGAN=Be,i.STATE_CHANGED=Fg,i.STATE_ENDED=Bt,i.STATE_RECOGNIZED=ht,i.STATE_CANCELLED=xA,i.STATE_FAILED=qe,i.Manager=sl,i.Input=Hg,i.TouchAction=gc,i.TouchInput=us,i.MouseInput=fs,i.PointerEventInput=rc,i.TouchMouseInput=sc,i.SingleTouchInput=rP,i.Recognizer=gi,i.AttrRecognizer=Bg,i.Tap=Zn,i.Pan=ps,i.Swipe=ac,i.Pinch=lc,i.Rotate=dc,i.Press=hc,i.on=lA,i.off=dA,i.each=dt,i.merge=oP,i.extend=fc,i.bindFn=ol,i.assign=tg,i.inherit=aP,i.bindFn=ol,i.prefixed=GI,i.toArray=wA,i.inArray=Ag,i.uniqueArray=cs,i.splitStr=yA,i.boolOrFn=jI,i.hasParent=hs,i.addEventListeners=lA,i.removeEventListeners=dA,i.defaults=tg({},cc,{preset:Cl}),i})();pc.defaults;var lP=pc,mc=ux("DELETE");function dP(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),g=1;g<e;g++)t[g-1]=arguments[g];return vc({},i,...t)}function vc(){let i=AI(...arguments);return yc(i),i}function AI(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<2)return e[0];if(e.length>2)return AI(vc(e[0],e[1]),...Ye(e).call(e,2));let g=e[0],A=e[1];if(g instanceof Date&&A instanceof Date)return g.setTime(A.getTime()),g;for(let I of Xx(A))Object.prototype.propertyIsEnumerable.call(A,I)&&(A[I]===mc?delete g[I]:g[I]!==null&&A[I]!==null&&typeof g[I]=="object"&&typeof A[I]=="object"&&!B(g[I])&&!B(A[I])?g[I]=AI(g[I],A[I]):g[I]=bc(A[I]));return g}function bc(i){return B(i)?he(i).call(i,e=>bc(e)):typeof i=="object"&&i!==null?i instanceof Date?new Date(i.getTime()):AI({},i):i}function yc(i){for(let e of K(i))i[e]===mc?delete i[e]:typeof i[e]=="object"&&i[e]!==null&&yc(i[e])}function VI(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return hP(e.length?e:[qi()])}function hP(i){let[e,t,g]=cP(i),A=1,I=()=>{let C=2091639*e+A*23283064365386963e-26;return e=t,t=g,g=C-(A=C|0)};return I.uint32=()=>I()*4294967296,I.fract53=()=>I()+(I()*2097152|0)*11102230246251565e-32,I.algorithm="Alea",I.seed=i,I.version="0.9",I}function cP(){let i=uP(),e=i(" "),t=i(" "),g=i(" ");for(let A=0;A<arguments.length;A++)e-=i(A<0||arguments.length<=A?void 0:arguments[A]),e<0&&(e+=1),t-=i(A<0||arguments.length<=A?void 0:arguments[A]),t<0&&(t+=1),g-=i(A<0||arguments.length<=A?void 0:arguments[A]),g<0&&(g+=1);return[e,t,g]}function uP(){let i=4022871197;return function(e){let t=e.toString();for(let g=0;g<t.length;g++){i+=t.charCodeAt(g);let A=.02519603282416938*i;i=A>>>0,A-=i,A*=i,i=A>>>0,A-=i,i+=A*4294967296}return(i>>>0)*23283064365386963e-26}}function fP(){let i=()=>{};return{on:i,off:i,destroy:i,emit:i,get(){return{set:i}}}}var ms=typeof window!="undefined"?window.Hammer||lP:function(){return fP()};function et(i){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:i,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let t=ms(this._dom.overlay);t.on("tap",y(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});let g=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];F(g).call(g,A=>{t.on(A,I=>{I.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=A=>{pP(A.target,i)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=A=>{("key"in A?A.key==="Escape":A.keyCode===27)&&this.deactivate()}}Ld(et.prototype);et.current=null;et.prototype.destroy=function(){this.deactivate();for(let t of Jt(i=tt(e=this._cleanupQueue).call(e,0)).call(i)){var i,e;t()}};et.prototype.activate=function(){et.current&&et.current.deactivate(),et.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};et.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};et.prototype._onTapOverlay=function(i){this.activate(),i.srcEvent.stopPropagation()};function pP(i,e){for(;i;){if(i===e)return!0;i=i.parentNode}return!1}var mP=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,vP=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,bP=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,yP=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function St(i){if(i)for(;i.hasChildNodes()===!0;){let e=i.firstChild;e&&(St(e),i.removeChild(e))}}function Dt(i){return i instanceof String||typeof i=="string"}function al(i){return typeof i=="object"&&i!==null}function ig(i,e,t,g){let A=!1;g===!0&&(A=e[t]===null&&i[t]!==void 0),A?delete i[t]:i[t]=e[t]}function wc(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(let g in i)if(e[g]!==void 0)if(e[g]===null||typeof e[g]!="object")ig(i,e,g,t);else{let A=i[g],I=e[g];al(A)&&al(I)&&wc(A,I,t)}}function Kg(i,e,t){let g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(t))throw new TypeError("Arrays are not supported by deepExtend");for(let A=0;A<i.length;A++){let I=i[A];if(Object.prototype.hasOwnProperty.call(t,I))if(t[I]&&t[I].constructor===Object)e[I]===void 0&&(e[I]={}),e[I].constructor===Object?U(e[I],t[I],!1,g):ig(e,t,I,g);else{if(B(t[I]))throw new TypeError("Arrays are not supported by deepExtend");ig(e,t,I,g)}}return e}function iI(i,e,t){let g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(B(t))throw new TypeError("Arrays are not supported by deepExtend");for(let A in t)if(Object.prototype.hasOwnProperty.call(t,A)&&!Mt(i).call(i,A))if(t[A]&&t[A].constructor===Object)e[A]===void 0&&(e[A]={}),e[A].constructor===Object?U(e[A],t[A]):ig(e,t,A,g);else if(B(t[A])){e[A]=[];for(let I=0;I<t[A].length;I++)e[A].push(t[A][I])}else ig(e,t,A,g);return e}function U(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(let I in e)if(Object.prototype.hasOwnProperty.call(e,I)||t===!0)if(typeof e[I]=="object"&&e[I]!==null&&Ya(e[I])===Object.prototype)i[I]===void 0?i[I]=U({},e[I],t):typeof i[I]=="object"&&i[I]!==null&&Ya(i[I])===Object.prototype?U(i[I],e[I],t):ig(i,e,I,g);else if(B(e[I])){var A;i[I]=Ye(A=e[I]).call(A)}else ig(i,e,I,g);return i}function II(i,e){return[...i,e]}function wP(i){return Ye(i).call(i)}function xP(i){return i.getBoundingClientRect().left}function EP(i){return i.getBoundingClientRect().top}function k(i,e){if(B(i)){let t=i.length;for(let g=0;g<t;g++)e(i[g],g,i)}else for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&e(i[t],t,i)}function vs(i){let e;switch(i.length){case 3:case 4:return e=vP.exec(i),e?{r:Ve(e[1]+e[1],16),g:Ve(e[2]+e[2],16),b:Ve(e[3]+e[3],16)}:null;case 6:case 7:return e=mP.exec(i),e?{r:Ve(e[1],16),g:Ve(e[2],16),b:Ve(e[3],16)}:null;default:return null}}function Fe(i,e){if(Mt(i).call(i,"rgba"))return i;if(Mt(i).call(i,"rgb")){let t=i.substr(G(i).call(i,"(")+1).replace(")","").split(",");return"rgba("+t[0]+","+t[1]+","+t[2]+","+e+")"}else{let t=vs(i);return t==null?i:"rgba("+t.r+","+t.g+","+t.b+","+e+")"}}function xc(i,e,t){var g;return"#"+Ye(g=((1<<24)+(i<<16)+(e<<8)+t).toString(16)).call(g,1)}function Gn(i,e){if(Dt(i)){let g=i;if(Tc(g)){var t;let A=he(t=g.substr(4).substr(0,g.length-5).split(",")).call(t,function(I){return Ve(I)});g=xc(A[0],A[1],A[2])}if(Ec(g)===!0){let A=TP(g),I={h:A.h,s:A.s*.8,v:Math.min(1,A.v*1.02)},C={h:A.h,s:Math.min(1,A.s*1.25),v:A.v*.8},n=jn(C.h,C.s,C.v),r=jn(I.h,I.s,I.v);return{background:g,border:n,highlight:{background:r,border:n},hover:{background:r,border:n}}}else return{background:g,border:g,highlight:{background:g,border:g},hover:{background:g,border:g}}}else return e?{background:i.background||e.background,border:i.border||e.border,highlight:Dt(i.highlight)?{border:i.highlight,background:i.highlight}:{background:i.highlight&&i.highlight.background||e.highlight.background,border:i.highlight&&i.highlight.border||e.highlight.border},hover:Dt(i.hover)?{border:i.hover,background:i.hover}:{border:i.hover&&i.hover.border||e.hover.border,background:i.hover&&i.hover.background||e.hover.background}}:{background:i.background||void 0,border:i.border||void 0,highlight:Dt(i.highlight)?{border:i.highlight,background:i.highlight}:{background:i.highlight&&i.highlight.background||void 0,border:i.highlight&&i.highlight.border||void 0},hover:Dt(i.hover)?{border:i.hover,background:i.hover}:{border:i.hover&&i.hover.border||void 0,background:i.hover&&i.hover.background||void 0}}}function sA(i,e,t){i=i/255,e=e/255,t=t/255;let g=Math.min(i,Math.min(e,t)),A=Math.max(i,Math.max(e,t));if(g===A)return{h:0,s:0,v:g};let I=i===g?e-t:t===g?i-e:t-i,n=60*((i===g?3:t===g?1:5)-I/(A-g))/360,r=(A-g)/A;return{h:n,s:r,v:A}}function Yi(i,e,t){let g,A,I,C=Math.floor(i*6),n=i*6-C,r=t*(1-e),s=t*(1-n*e),o=t*(1-(1-n)*e);switch(C%6){case 0:g=t,A=o,I=r;break;case 1:g=s,A=t,I=r;break;case 2:g=r,A=t,I=o;break;case 3:g=r,A=s,I=t;break;case 4:g=o,A=r,I=t;break;case 5:g=t,A=r,I=s;break}return{r:Math.floor(g*255),g:Math.floor(A*255),b:Math.floor(I*255)}}function jn(i,e,t){let g=Yi(i,e,t);return xc(g.r,g.g,g.b)}function TP(i){let e=vs(i);if(!e)throw new TypeError("'".concat(i,"' is not a valid color."));return sA(e.r,e.g,e.b)}function Ec(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)}function Tc(i){return bP.test(i)}function OP(i){return yP.test(i)}function zt(i){if(i===null||typeof i!="object")return null;if(i instanceof Element)return i;let e=Ft(i);for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&typeof i[t]=="object"&&(e[t]=zt(i[t]));return e}function Me(i,e,t){let g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},A=function(d){return d!=null},I=function(d){return d!==null&&typeof d=="object"},C=function(d){for(let h in d)if(Object.prototype.hasOwnProperty.call(d,h))return!1;return!0};if(!I(i))throw new Error("Parameter mergeTarget must be an object");if(!I(e))throw new Error("Parameter options must be an object");if(!A(t))throw new Error("Parameter option must have a value");if(!I(g))throw new Error("Parameter globalOptions must be an object");let n=function(d,h,c){I(d[c])||(d[c]={});let u=h[c],f=d[c];for(let p in u)Object.prototype.hasOwnProperty.call(u,p)&&(f[p]=u[p])},r=e[t],o=I(g)&&!C(g)?g[t]:void 0,a=o?o.enabled:void 0;if(r===void 0)return;if(typeof r=="boolean"){I(i[t])||(i[t]={}),i[t].enabled=r;return}if(r===null&&!I(i[t]))if(A(o))i[t]=Ft(o);else return;if(!I(r))return;let l=!0;r.enabled!==void 0?l=r.enabled:a!==void 0&&(l=o.enabled),n(i,e,t),i[t].enabled=l}var PP={linear(i){return i},easeInQuad(i){return i*i},easeOutQuad(i){return i*(2-i)},easeInOutQuad(i){return i<.5?2*i*i:-1+(4-2*i)*i},easeInCubic(i){return i*i*i},easeOutCubic(i){return--i*i*i+1},easeInOutCubic(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},easeInQuart(i){return i*i*i*i},easeOutQuart(i){return 1- --i*i*i*i},easeInOutQuart(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},easeInQuint(i){return i*i*i*i*i},easeOutQuint(i){return 1+--i*i*i*i*i},easeInOutQuint(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i}};function Rt(i,e){let t;B(e)||(e=[e]);for(let g of i)if(g){t=g[e[0]];for(let A=1;A<e.length;A++)t&&(t=t[e[A]]);if(typeof t!="undefined")break}return t}var SP={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},RP=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return SP[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let g,A=this._isColorString(e);if(A!==void 0&&(e=A),Dt(e)===!0){if(Tc(e)===!0){let I=e.substr(4).substr(0,e.length-5).split(",");g={r:I[0],g:I[1],b:I[2],a:1}}else if(OP(e)===!0){let I=e.substr(5).substr(0,e.length-6).split(",");g={r:I[0],g:I[1],b:I[2],a:I[3]}}else if(Ec(e)===!0){let I=vs(e);g={r:I.r,g:I.g,b:I.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){let I=e.a!==void 0?e.a:"1.0";g={r:e.r,g:e.g,b:e.b,a:I}}if(g===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Ug(e));this._setColor(g,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=ee({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",gt(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=ee({},e)),this.color=e;let g=sA(e.r,e.g,e.b),A=2*Math.PI,I=this.r*g.s,C=this.centerCoordinates.x+I*Math.sin(A*g.h),n=this.centerCoordinates.y+I*Math.cos(A*g.h);this.colorPickerSelector.style.left=C-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=n-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){let t=sA(this.color.r,this.color.g,this.color.b);t.v=e/100;let g=Yi(t.h,t.s,t.v);g.a=this.color.a,this.color=g,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,t=sA(e.r,e.g,e.b),g=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let A=this.colorPickerCanvas.clientWidth,I=this.colorPickerCanvas.clientHeight;g.clearRect(0,0,A,I),g.putImageData(this.hueCircle,0,0),g.fillStyle="rgba(0,0,0,"+(1-t.v)+")",g.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),$A(g).call(g),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,g,A;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){let C=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let C=document.createElement("DIV");C.style.color="red",C.style.fontWeight="bold",C.style.padding="10px",C.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(C)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(C){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(C){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);let I=this;this.opacityRange.onchange=function(){I._setOpacity(this.value)},this.opacityRange.oninput=function(){I._setOpacity(this.value)},this.brightnessRange.onchange=function(){I._setBrightness(this.value)},this.brightnessRange.oninput=function(){I._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=y(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=y(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=y(g=this._save).call(g,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=y(A=this._loadLast).call(A,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new ms(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){let e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let t=this.colorPickerCanvas.clientWidth,g=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,g);let A,I,C,n;this.centerCoordinates={x:t*.5,y:g*.5},this.r=.49*t;let r=2*Math.PI/360,s=1/360,o=1/this.r,a;for(C=0;C<360;C++)for(n=0;n<this.r;n++)A=this.centerCoordinates.x+n*Math.sin(r*C),I=this.centerCoordinates.y+n*Math.cos(r*C),a=Yi(C*s,n*o,1),e.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",e.fillRect(A-.5,I-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,g)}this.generated=!0}_moveSelector(e){let t=this.colorPickerDiv.getBoundingClientRect(),g=e.center.x-t.left,A=e.center.y-t.top,I=.5*this.colorPickerDiv.clientHeight,C=.5*this.colorPickerDiv.clientWidth,n=g-C,r=A-I,s=Math.atan2(n,r),o=.98*Math.min(Math.sqrt(n*n+r*r),C),a=Math.cos(s)*o+I,l=Math.sin(s)*o+C;this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=l-.5*this.colorPickerSelector.clientWidth+"px";let d=s/(2*Math.PI);d=d<0?d+1:d;let h=o/this.r,c=sA(this.color.r,this.color.g,this.color.b);c.h=d,c.s=h;let u=Yi(c.h,c.s,c.v);u.a=this.color.a,this.color=u,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}};function Vn(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];if(e.length<1)throw new TypeError("Invalid arguments.");if(e.length===1)return document.createTextNode(e[0]);{let g=document.createElement(e[0]);return g.appendChild(Vn(...Ye(e).call(e,1))),g}}var DP=class{constructor(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=I,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},ee(this.options,this.defaultOptions),this.configureOptions=g,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new RP(A),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(B(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),Ae(e)!==void 0&&(this.options.filter=Ae(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);Ae(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let e=Ae(this.options),t=0,g=!1;for(let A in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,A)&&(this.allowCreation=!1,g=!1,typeof e=="function"?(g=e(A,[]),g=g||this._handleObject(this.configureOptions[A],[A],!0)):(e===!0||G(e).call(e,A)!==-1)&&(g=!0),g!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(A),this._handleObject(this.configureOptions[A],[A])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}_clean(){for(let e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);this.wrapper!==void 0&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(e){let t=this.moduleOptions;for(let g=0;g<e.length;g++)if(t[e[g]]!==void 0)t=t[e[g]];else{t=void 0;break}return t}_makeItem(e){if(this.allowCreation===!0){let I=document.createElement("div");I.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var t=arguments.length,g=new Array(t>1?t-1:0),A=1;A<t;A++)g[A-1]=arguments[A];return F(g).call(g,C=>{I.appendChild(C)}),this.domElements.push(I),this.domElements.length}return 0}_makeHeader(e){let t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=document.createElement("div");if(A.className="vis-configuration vis-config-label vis-config-s"+t.length,g===!0){for(;A.firstChild;)A.removeChild(A.firstChild);A.appendChild(Vn("i","b",e))}else A.innerText=e+":";return A}_makeDropdown(e,t,g){let A=document.createElement("select");A.className="vis-configuration vis-config-select";let I=0;t!==void 0&&G(e).call(e,t)!==-1&&(I=G(e).call(e,t));for(let r=0;r<e.length;r++){let s=document.createElement("option");s.value=e[r],r===I&&(s.selected="selected"),s.innerText=e[r],A.appendChild(s)}let C=this;A.onchange=function(){C._update(this.value,g)};let n=this._makeLabel(g[g.length-1],g);this._makeItem(g,n,A)}_makeRange(e,t,g){let A=e[0],I=e[1],C=e[2],n=e[3],r=document.createElement("input");r.className="vis-configuration vis-config-range";try{r.type="range",r.min=I,r.max=C}catch(c){}r.step=n;let s="",o=0;t!==void 0?(t<0&&t*1.2<I?(r.min=Math.ceil(t*1.2),o=r.min,s="range increased"):t/1.2<I&&(r.min=Math.ceil(t/1.2),o=r.min,s="range increased"),t*1.2>C&&C!==1&&(r.max=Math.ceil(t*1.2),o=r.max,s="range increased"),r.value=t):r.value=A;let a=document.createElement("input");a.className="vis-configuration vis-config-rangeinput",a.value=r.value;let l=this;r.onchange=function(){a.value=this.value,l._update(Number(this.value),g)},r.oninput=function(){a.value=this.value};let d=this._makeLabel(g[g.length-1],g),h=this._makeItem(g,d,r,a);s!==""&&this.popupHistory[h]!==o&&(this.popupHistory[h]=o,this._setupPopup(s,h))}_makeButton(){if(this.options.showButton===!0){let e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){let g=document.createElement("div");g.id="vis-configuration-popup",g.className="vis-configuration-popup",g.innerText=e,g.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:g,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){let t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=gt(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=gt(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,g){let A=document.createElement("input");A.type="checkbox",A.className="vis-configuration vis-config-checkbox",A.checked=e,t!==void 0&&(A.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:g,value:t}):this.changedOptions.push({path:g,value:t})));let I=this;A.onchange=function(){I._update(this.checked,g)};let C=this._makeLabel(g[g.length-1],g);this._makeItem(g,C,A)}_makeTextInput(e,t,g){let A=document.createElement("input");A.type="text",A.className="vis-configuration vis-config-text",A.value=t,t!==e&&this.changedOptions.push({path:g,value:t});let I=this;A.onchange=function(){I._update(this.value,g)};let C=this._makeLabel(g[g.length-1],g);this._makeItem(g,C,A)}_makeColorField(e,t,g){let A=e[1],I=document.createElement("div");t=t===void 0?A:t,t!=="none"?(I.className="vis-configuration vis-config-colorBlock",I.style.backgroundColor=t):I.className="vis-configuration vis-config-colorBlock none",t=t===void 0?A:t,I.onclick=()=>{this._showColorPicker(t,I,g)};let C=this._makeLabel(g[g.length-1],g);this._makeItem(g,C,I)}_showColorPicker(e,t,g){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(A=>{let I="rgba("+A.r+","+A.g+","+A.b+","+A.a+")";t.style.backgroundColor=I,this._update(I,g)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,g)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=!1,I=Ae(this.options),C=!1;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){A=!0;let r=e[n],s=II(t,n);if(typeof I=="function"&&(A=I(n,t),A===!1&&!B(r)&&typeof r!="string"&&typeof r!="boolean"&&r instanceof Object&&(this.allowCreation=!1,A=this._handleObject(r,s,!0),this.allowCreation=g===!1)),A!==!1){C=!0;let o=this._getValue(s);if(B(r))this._handleArray(r,o,s);else if(typeof r=="string")this._makeTextInput(r,o,s);else if(typeof r=="boolean")this._makeCheckbox(r,o,s);else if(r instanceof Object){if(!this.hideOption(t,n,this.moduleOptions))if(r.enabled!==void 0){let a=II(s,"enabled"),l=this._getValue(a);if(l===!0){let d=this._makeLabel(n,s,!0);this._makeItem(s,d),C=this._handleObject(r,s)||C}else this._makeCheckbox(r,l,s)}else{let a=this._makeLabel(n,s,!0);this._makeItem(s,a),C=this._handleObject(r,s)||C}}else console.error("dont know how to handle",r,n,s)}}return C}_handleArray(e,t,g){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,g),e[1]!==t&&this.changedOptions.push({path:g,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,g),e[0]!==t&&this.changedOptions.push({path:g,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,g),e[0]!==t&&this.changedOptions.push({path:g,value:Number(t)}))}_update(e,t){let g=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",g),this.initialized=!0,this.parent.setOptions(g)}_constructOptions(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=g;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let I=0;I<t.length;I++)t[I]!=="global"&&(A[t[I]]===void 0&&(A[t[I]]={}),I!==t.length-1?A=A[t[I]]:A[t[I]]=e);return g}_printOptions(){let e=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Vn("pre","const options = "+Ug(e,null,2)))}getOptions(){let e={};for(let t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}},NP=class{constructor(e,t){this.container=e,this.overflowMethod=t||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(e,t){this.x=Ve(e),this.y=Ve(t)}setText(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}show(e){if(e===void 0&&(e=!0),e===!0){let t=this.frame.clientHeight,g=this.frame.clientWidth,A=this.frame.parentNode.clientHeight,I=this.frame.parentNode.clientWidth,C=0,n=0;if(this.overflowMethod=="flip"){let r=!1,s=!0;this.y-t<this.padding&&(s=!1),this.x+g>I-this.padding&&(r=!0),r?C=this.x-g:C=this.x,s?n=this.y-t:n=this.y}else n=this.y-t,n+t+this.padding>A&&(n=A-t-this.padding),n<this.padding&&(n=this.padding),C=this.x,C+g+this.padding>I&&(C=I-g-this.padding),C<this.padding&&(C=this.padding);this.frame.style.left=C+"px",this.frame.style.top=n+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},AA=!1,ll,Yn="background: #FFeeee; color: #dd0000",_P=class X{static validate(e,t,g){AA=!1,ll=t;let A=t;return g!==void 0&&(A=t[g]),X.parse(e,A,[]),AA}static parse(e,t,g){for(let A in e)Object.prototype.hasOwnProperty.call(e,A)&&X.check(A,e,t,g)}static check(e,t,g,A){if(g[e]===void 0&&g.__any__===void 0){X.getSuggestion(e,g,A);return}let I=e,C=!0;g[e]===void 0&&g.__any__!==void 0&&(I="__any__",C=X.getType(t[e])==="object");let n=g[I];C&&n.__type__!==void 0&&(n=n.__type__),X.checkFields(e,t,g,I,n,A)}static checkFields(e,t,g,A,I,C){let n=function(o){console.error("%c"+o+X.printLocation(C,e),Yn)},r=X.getType(t[e]),s=I[r];s!==void 0?X.getType(s)==="array"&&G(s).call(s,t[e])===-1?(n('Invalid option detected in "'+e+'". Allowed values are:'+X.print(s)+' not "'+t[e]+'". '),AA=!0):r==="object"&&A!=="__any__"&&(C=II(C,e),X.parse(t[e],g[A],C)):I.any===void 0&&(n('Invalid type received for "'+e+'". Expected: '+X.print(K(I))+". Received ["+r+'] "'+t[e]+'"'),AA=!0)}static getType(e){let t=typeof e;return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":B(e)?"array":e instanceof Date?"date":e.nodeType!==void 0?"dom":e._isAMomentObject===!0?"moment":"object":t==="number"?"number":t==="boolean"?"boolean":t==="string"?"string":t===void 0?"undefined":t}static getSuggestion(e,t,g){let A=X.findInOptions(e,t,g,!1),I=X.findInOptions(e,ll,[],!0),C=8,n=4,r;A.indexMatch!==void 0?r=" in "+X.printLocation(A.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+A.indexMatch+`"?
635
636
 
636
- `:C.distance<=n&&A.distance>C.distance?r=" in "+Q.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Q.printLocation(C.path,C.closestMatch,""):A.distance<=i?r='. Did you mean "'+A.closestMatch+'"?'+Q.printLocation(A.path,e):r=". Did you mean one of these: "+Q.print(U(g))+Q.printLocation(t,e),console.error('%cUnknown option detected: "'+e+'"'+r,Qi),Nt=!0}static findInOptions(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,C=1e9,i="",n=[],r=e.toLowerCase(),s;for(let d in g){let a;if(g[d].__type__!==void 0&&A===!0){let l=Q.findInOptions(e,g[d],TI(t,d));C>l.distance&&(i=l.closestMatch,n=l.path,C=l.distance,s=l.indexMatch)}else{var o;G(o=d.toLowerCase()).call(o,r)!==-1&&(s=d),a=Q.levenshteinDistance(e,d),C>a&&(i=d,n=sO(t),C=a)}}return{closestMatch:i,path:n,distance:C,indexMatch:s}}static printLocation(e,g){let A=`
637
+ `:I.distance<=n&&A.distance>I.distance?r=" in "+X.printLocation(A.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+X.printLocation(I.path,I.closestMatch,""):A.distance<=C?r='. Did you mean "'+A.closestMatch+'"?'+X.printLocation(A.path,e):r=". Did you mean one of these: "+X.print(K(t))+X.printLocation(g,e),console.error('%cUnknown option detected: "'+e+'"'+r,Yn),AA=!0}static findInOptions(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,I=1e9,C="",n=[],r=e.toLowerCase(),s;for(let a in t){let l;if(t[a].__type__!==void 0&&A===!0){let d=X.findInOptions(e,t[a],II(g,a));I>d.distance&&(C=d.closestMatch,n=d.path,I=d.distance,s=d.indexMatch)}else{var o;G(o=a.toLowerCase()).call(o,r)!==-1&&(s=a),l=X.levenshteinDistance(e,a),I>l&&(C=a,n=wP(g),I=l)}}return{closestMatch:C,path:n,distance:I,indexMatch:s}}static printLocation(e,t){let A=`
637
638
 
638
639
  `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at:
639
640
  `)+`options = {
640
- `;for(let C=0;C<e.length;C++){for(let i=0;i<C+1;i++)A+=" ";A+=e[C]+`: {
641
- `}for(let C=0;C<e.length+1;C++)A+=" ";A+=g+`
642
- `;for(let C=0;C<e.length+1;C++){for(let i=0;i<e.length-C;i++)A+=" ";A+=`}
641
+ `;for(let I=0;I<e.length;I++){for(let C=0;C<I+1;C++)A+=" ";A+=e[I]+`: {
642
+ `}for(let I=0;I<e.length+1;I++)A+=" ";A+=t+`
643
+ `;for(let I=0;I<e.length+1;I++){for(let C=0;C<e.length-I;C++)A+=" ";A+=`}
643
644
  `}return A+`
644
645
 
645
- `}static print(e){return xt(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,g){if(e.length===0)return g.length;if(g.length===0)return e.length;let t=[],A;for(A=0;A<=g.length;A++)t[A]=[A];let C;for(C=0;C<=e.length;C++)t[0][C]=C;for(A=1;A<=g.length;A++)for(C=1;C<=e.length;C++)g.charAt(A-1)==e.charAt(C-1)?t[A][C]=t[A-1][C-1]:t[A][C]=Math.min(t[A-1][C-1]+1,Math.min(t[A][C-1]+1,t[A-1][C]+1));return t[g.length][e.length]}},vO=Ue,bO=fO,ot=Tr,yO=pO,eh=Qi,wO=mO;function EO(I){return bg=I,DO()}var gh={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Or=Tg(gh);Or.color="color.color";Or.style="dashes";var me={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},Go={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},bg="",pt=0,N="",D="",we=me.NULL;function TO(){pt=0,N=bg.charAt(0)}function re(){pt++,N=bg.charAt(pt)}function At(){return bg.charAt(pt+1)}function jo(I){var e=I.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Pg(I,e){if(I||(I={}),e)for(var g in e)e.hasOwnProperty(g)&&(I[g]=e[g]);return I}function xO(I,e,g){for(var t=e.split("."),A=I;t.length;){var C=t.shift();t.length?(A[C]||(A[C]={}),A=A[C]):A[C]=g}}function th(I,e){for(var g,t,A=null,C=[I],i=I;i.parent;)C.push(i.parent),i=i.parent;if(i.nodes){for(g=0,t=i.nodes.length;g<t;g++)if(e.id===i.nodes[g].id){A=i.nodes[g];break}}for(A||(A={id:e.id},I.node&&(A.attr=Pg(A.attr,I.node))),g=C.length-1;g>=0;g--){var n,r=C[g];r.nodes||(r.nodes=[]),G(n=r.nodes).call(n,A)===-1&&r.nodes.push(A)}e.attr&&(A.attr=Pg(A.attr,e.attr))}function OO(I,e){if(I.edges||(I.edges=[]),I.edges.push(e),I.edge){var g=Pg({},I.edge);e.attr=Pg(g,e.attr)}}function Ah(I,e,g,t,A){var C={from:e,to:g,type:t};return I.edge&&(C.attr=Pg({},I.edge)),C.attr=Pg(C.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(C.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),C}function H(){for(we=me.NULL,D="";N===" "||N===" "||N===`
646
- `||N==="\r";)re();do{var I=!1;if(N==="#"){for(var e=pt-1;bg.charAt(e)===" "||bg.charAt(e)===" ";)e--;if(bg.charAt(e)===`
647
- `||bg.charAt(e)===""){for(;N!=""&&N!=`
648
- `;)re();I=!0}}if(N==="/"&&At()==="/"){for(;N!=""&&N!=`
649
- `;)re();I=!0}if(N==="/"&&At()==="*"){for(;N!="";)if(N==="*"&&At()==="/"){re(),re();break}else re();I=!0}for(;N===" "||N===" "||N===`
650
- `||N==="\r";)re()}while(I);if(N===""){we=me.DELIMITER;return}var g=N+At();if(Go[g]){we=me.DELIMITER,D=g,re(),re();return}if(Go[N]){we=me.DELIMITER,D=N,re();return}if(jo(N)||N==="-"){for(D+=N,re();jo(N);)D+=N,re();D==="false"?D=!1:D==="true"?D=!0:isNaN(Number(D))||(D=Number(D)),we=me.IDENTIFIER;return}if(N==='"'){for(re();N!=""&&(N!='"'||N==='"'&&At()==='"');)N==='"'?(D+=N,re()):N==="\\"&&At()==="n"?(D+=`
651
- `,re()):D+=N,re();if(N!='"')throw ve('End of string " expected');re(),we=me.IDENTIFIER;return}for(we=me.UNKNOWN;N!="";)D+=N,re();throw new SyntaxError('Syntax error in part "'+nh(D,30)+'"')}function DO(){var I={};if(TO(),H(),D==="strict"&&(I.strict=!0,H()),(D==="graph"||D==="digraph")&&(I.type=D,H()),we===me.IDENTIFIER&&(I.id=D,H()),D!="{")throw ve("Angle bracket { expected");if(H(),Ih(I),D!="}")throw ve("Angle bracket } expected");if(H(),D!=="")throw ve("End of file expected");return H(),delete I.node,delete I.edge,delete I.graph,I}function Ih(I){for(;D!==""&&D!="}";)PO(I),D===";"&&H()}function PO(I){var e=Ch(I);if(e){ih(I,e);return}var g=SO(I);if(!g){if(we!=me.IDENTIFIER)throw ve("Identifier expected");var t=D;if(H(),D==="="){if(H(),we!=me.IDENTIFIER)throw ve("Identifier expected");I[t]=D,H()}else NO(I,t)}}function Ch(I){var e=null;if(D==="subgraph"&&(e={},e.type="subgraph",H(),we===me.IDENTIFIER&&(e.id=D,H())),D==="{"){if(H(),e||(e={}),e.parent=I,e.node=I.node,e.edge=I.edge,e.graph=I.graph,Ih(e),D!="}")throw ve("Angle bracket } expected");H(),delete e.node,delete e.edge,delete e.graph,delete e.parent,I.subgraphs||(I.subgraphs=[]),I.subgraphs.push(e)}return e}function SO(I){return D==="node"?(H(),I.node=Vt(),"node"):D==="edge"?(H(),I.edge=Vt(),"edge"):D==="graph"?(H(),I.graph=Vt(),"graph"):null}function NO(I,e){var g={id:e},t=Vt();t&&(g.attr=t),th(I,g),ih(I,e)}function ih(I,e){for(;D==="->"||D==="--";){var g,t=D;H();var A=Ch(I);if(A)g=A;else{if(we!=me.IDENTIFIER)throw ve("Identifier or subgraph expected");g=D,th(I,{id:g}),H()}var C=Vt(),i=Ah(I,e,g,t,C);OO(I,i),e=g}}function Vt(){for(var I,e=null,g={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},A=new Array,C=new Array;D==="[";){for(H(),e={};D!==""&&D!="]";){if(we!=me.IDENTIFIER)throw ve("Attribute name expected");var i=D;if(H(),D!="=")throw ve("Equal sign = expected");if(H(),we!=me.IDENTIFIER)throw ve("Attribute value expected");var n=D;i==="style"&&(n=g[n]);var r;i==="arrowhead"&&(r=t[n],i="arrows",n={to:{enabled:!0,type:r}}),i==="arrowtail"&&(r=t[n],i="arrows",n={from:{enabled:!0,type:r}}),A.push({attr:e,name:i,value:n}),C.push(i),H(),D==","&&H()}if(D!="]")throw ve("Bracket ] expected");H()}if(Eg(C).call(C,"dir")){var s={};for(s.arrows={},I=0;I<A.length;I++)if(A[I].name==="arrows")if(A[I].value.to!=null)s.arrows.to=I;else if(A[I].value.from!=null)s.arrows.from=I;else throw ve("Invalid value of arrows");else A[I].name==="dir"&&(s.dir=I);var o=A[s.dir].value;if(!Eg(C).call(C,"arrows"))if(o==="both")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1,A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(o==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw ve('Invalid dir type "'+o+'"');var d,a;if(o==="both")s.arrows.to&&s.arrows.from?(a=A[s.arrows.to].value.to.type,d=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}},Ke(A).call(A,s.arrows.from,1)):s.arrows.to?(a=A[s.arrows.to].value.to.type,d="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="arrow",d=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}});else if(o==="back")s.arrows.to&&s.arrows.from?(a="",d=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.to?(a="",d="arrow",s.arrows.from=s.arrows.to,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="",d=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}),A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{from:{enabled:!0,type:A[s.arrows.from].value.from.type}}};else if(o==="none"){var l;s.arrows.to?l=s.arrows.to:l=s.arrows.from,A[l]={attr:A[l].attr,name:A[l].name,value:""}}else if(o==="forward")s.arrows.to&&s.arrows.from?(a=A[s.arrows.to].value.to.type,d="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.to?(a=A[s.arrows.to].value.to.type,d="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}):s.arrows.from&&(a="arrow",d="",s.arrows.to=s.arrows.from,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:a},from:{enabled:!0,type:d}}}),A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:A[s.arrows.to].value.to.type}}};else throw ve('Invalid dir type "'+o+'"');Ke(A).call(A,s.dir,1)}var h;if(Eg(C).call(C,"penwidth")){var c=[];for(h=A.length,I=0;I<h;I++)A[I].name!=="width"&&(A[I].name==="penwidth"&&(A[I].name="width"),c.push(A[I]));A=c}for(h=A.length,I=0;I<h;I++)xO(A[I].attr,A[I].name,A[I].value);return e}function ve(I){return new SyntaxError(I+', got "'+nh(D,30)+'" (char '+pt+")")}function nh(I,e){return I.length<=e?I:I.substr(0,27)+"..."}function RO(I,e,g){z(I)?F(I).call(I,function(t){z(e)?F(e).call(e,function(A){g(t,A)}):g(t,e)}):z(e)?F(e).call(e,function(t){g(I,t)}):g(I,e)}function ii(I,e,g){for(var t=e.split("."),A=t.pop(),C=I,i=0;i<t.length;i++){var n=t[i];n in C||(C[n]={}),C=C[n]}return C[A]=g,I}function Vo(I,e){var g={};for(var t in I)if(I.hasOwnProperty(t)){var A=e[t];z(A)?F(A).call(A,function(C){ii(g,C,I[t])}):typeof A=="string"?ii(g,A,I[t]):ii(g,t,I[t])}return g}function kO(I){var e=EO(I),g={nodes:[],edges:[],options:{}};if(e.nodes){var t;F(t=e.nodes).call(t,function(i){var n={id:i.id,label:String(i.label||i.id)};Pg(n,Vo(i.attr,gh)),n.image&&(n.shape="image"),g.nodes.push(n)})}if(e.edges){var A,C=function(i){var n={from:i.from,to:i.to};return Pg(n,Vo(i.attr,Or)),n.arrows==null&&i.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(i){var n,r;if(i.from instanceof Object?n=i.from.nodes:n={id:i.from},i.to instanceof Object?r=i.to.nodes:r={id:i.to},i.from instanceof Object&&i.from.edges){var s;F(s=i.from.edges).call(s,function(d){var a=C(d);g.edges.push(a)})}if(RO(n,r,function(d,a){var l=Ah(g,d.id,a.id,i.type,i.attr),h=C(l);g.edges.push(h)}),i.to instanceof Object&&i.to.edges){var o;F(o=i.to.edges).call(o,function(d){var a=C(d);g.edges.push(a)})}})}return e.attr&&(g.options=e.attr),g}function MO(I,e){var g;let t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(t.nodes.fixed=e.fixed),e.parseColor!=null&&(t.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(t.edges.inheritColor=e.inheritColor));let A=I.edges,C=ae(A).call(A,n=>{let r={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.type==="Directed"&&(r.arrows="to"),n.color&&t.edges.inheritColor===!1&&(r.color=n.color),r});return{nodes:ae(g=I.nodes).call(g,n=>{let r={id:n.id,fixed:t.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.size!=null&&(r.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.title!=null&&(r.title=n.title),n.x!=null&&(r.x=n.x),n.y!=null&&(r.y=n.y),n.color!=null&&(t.nodes.parseColor===!0?r.color=n.color:r.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),r}),edges:C}}var FO={addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},zO={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},BO={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},ZO={addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},LO={addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},GO={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},jO={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},VO={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},YO={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},WO={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},_O={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},HO=Object.freeze({__proto__:null,cn:VO,cs:_O,de:zO,en:FO,es:BO,fr:WO,it:ZO,nl:LO,pt:GO,ru:jO,uk:YO});function UO(I,e){try{let[t,A]=e.split(/[-_ /]/,2),C=t!=null?t.toLowerCase():null,i=A!=null?A.toUpperCase():null;if(C&&i){let n=C+"-"+i;if(Object.prototype.hasOwnProperty.call(I,n))return n;var g;console.warn(ol(g="Unknown variant ".concat(i," of language ")).call(g,C,"."))}if(C){let n=C;if(Object.prototype.hasOwnProperty.call(I,n))return n;console.warn("Unknown language ".concat(C))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(t){return console.error(t),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}var Xi=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,g=this.image.height;this.width=e,this.height=g;let t=Math.floor(g/2),A=Math.floor(g/4),C=Math.floor(g/8),i=Math.floor(g/16),n=Math.floor(e/2),r=Math.floor(e/4),s=Math.floor(e/8),o=Math.floor(e/16);this.canvas.width=3*r,this.canvas.height=t,this.coordinates=[[0,0,n,t],[n,0,r,A],[n,A,s,C],[5*s,A,o,i]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext("2d"),g=this.coordinates[0];e.drawImage(this.image,g[0],g[1],g[2],g[3]);for(let t=1;t<this.NUM_ITERATIONS;t++){let A=this.coordinates[t-1],C=this.coordinates[t];e.drawImage(this.canvas,A[0],A[1],A[2],A[3],C[0],C[1],C[2],C[3])}}drawImageAtPosition(e,g,t,A,C,i){if(this.initialized())if(g>2){g*=.5;let n=0;for(;g>2&&n<this.NUM_ITERATIONS;)g*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let r=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],t,A,C,i)}else e.drawImage(this.image,t,A,C,i)}},Ji=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,g,t){if(!(e===void 0||t===void 0)){if(g===void 0){console.warn("No broken url image defined");return}t.image.onerror=()=>{console.error("Could not load brokenImage:",g)},t.image.src=g}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,g){let t=this.images[e];if(t)return t;let A=new Xi;return this.images[e]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,g,A)},A.image.src=e,A}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},rh={exports:{}},KO=B,QO=KO(function(){if(typeof ArrayBuffer=="function"){var I=new ArrayBuffer(8);Object.isExtensible(I)&&Object.defineProperty(I,"a",{value:8})}}),XO=B,JO=ce,$O=ag,Yo=QO,aI=Object.isExtensible,qO=XO(function(){aI(1)}),e2=qO||Yo?function(e){return!JO(e)||Yo&&$O(e)==="ArrayBuffer"?!1:aI?aI(e):!0}:aI,g2=B,sh=!g2(function(){return Object.isExtensible(Object.preventExtensions({}))}),t2=S,A2=Z,I2=hA,C2=ce,Dr=ne,i2=Oe.f,Wo=vA,n2=qI,Pr=e2,r2=HI,s2=sh,oh=!1,rg=r2("meta"),o2=0,Sr=function(I){i2(I,rg,{value:{objectID:"O"+o2++,weakData:{}}})},a2=function(I,e){if(!C2(I))return typeof I=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!Dr(I,rg)){if(!Pr(I))return"F";if(!e)return"E";Sr(I)}return I[rg].objectID},d2=function(I,e){if(!Dr(I,rg)){if(!Pr(I))return!0;if(!e)return!1;Sr(I)}return I[rg].weakData},l2=function(I){return s2&&oh&&Pr(I)&&!Dr(I,rg)&&Sr(I),I},h2=function(){c2.enable=function(){},oh=!0;var I=Wo.f,e=A2([].splice),g={};g[rg]=1,I(g).length&&(Wo.f=function(t){for(var A=I(t),C=0,i=A.length;C<i;C++)if(A[C]===rg){e(A,C,1);break}return A},t2({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:n2.f}))},c2=rh.exports={enable:h2,fastKey:a2,getWeakData:d2,onFreeze:l2};I2[rg]=!0;var oC=rh.exports,u2=ee,f2=Et,p2=u2("iterator"),m2=Array.prototype,v2=function(I){return I!==void 0&&(f2.Array===I||m2[p2]===I)},b2=lg,_o=gr,y2=mt,w2=Et,E2=ee,T2=E2("iterator"),ah=function(I){if(!y2(I))return _o(I,T2)||_o(I,"@@iterator")||w2[b2(I)]},x2=Ye,O2=_g,D2=dg,P2=oA,S2=ah,N2=TypeError,dh=function(I,e){var g=arguments.length<2?S2(I):e;if(O2(g))return D2(x2(g,I));throw new N2(P2(I)+" is not iterable")},R2=Ye,Ho=dg,k2=gr,M2=function(I,e,g){var t,A;Ho(I);try{if(t=k2(I,"return"),!t){if(e==="throw")throw g;return g}t=R2(t,I)}catch(C){A=!0,t=C}if(e==="throw")throw g;if(A)throw t;return Ho(t),g},F2=dA,z2=Ye,B2=dg,Z2=oA,L2=v2,G2=ke,Uo=J,j2=dh,V2=ah,Ko=M2,Y2=TypeError,dI=function(I,e){this.stopped=I,this.result=e},Qo=dI.prototype,Nr=function(I,e,g){var t=g&&g.that,A=!!(g&&g.AS_ENTRIES),C=!!(g&&g.IS_RECORD),i=!!(g&&g.IS_ITERATOR),n=!!(g&&g.INTERRUPTED),r=F2(e,t),s,o,d,a,l,h,c,f=function(m){return s&&Ko(s,"normal",m),new dI(!0,m)},u=function(m){return A?(B2(m),n?r(m[0],m[1],f):r(m[0],m[1])):n?r(m,f):r(m)};if(C)s=I.iterator;else if(i)s=I;else{if(o=V2(I),!o)throw new Y2(Z2(I)+" is not iterable");if(L2(o)){for(d=0,a=G2(I);a>d;d++)if(l=u(I[d]),l&&Uo(Qo,l))return l;return new dI(!1)}s=j2(I,o)}for(h=C?I.next:s.next;!(c=z2(h,s)).done;){try{l=u(c.value)}catch(m){Ko(s,"throw",m)}if(typeof l=="object"&&l&&Uo(Qo,l))return l}return new dI(!1)},W2=J,_2=TypeError,Rr=function(I,e){if(W2(e,I))return I;throw new _2("Incorrect invocation")},H2=S,U2=X,K2=oC,Q2=B,X2=yt,J2=Nr,$2=Rr,q2=le,eD=ce,gD=mt,tD=wt,AD=Oe.f,ID=Ng.forEach,CD=ie,lh=Ug,iD=lh.set,nD=lh.getterFor,kr=function(I,e,g){var t=I.indexOf("Map")!==-1,A=I.indexOf("Weak")!==-1,C=t?"set":"add",i=U2[I],n=i&&i.prototype,r={},s;if(!CD||!q2(i)||!(A||n.forEach&&!Q2(function(){new i().entries().next()})))s=g.getConstructor(e,I,t,C),K2.enable();else{s=e(function(a,l){iD($2(a,o),{type:I,collection:new i}),gD(l)||J2(l,a[C],{that:a,AS_ENTRIES:t})});var o=s.prototype,d=nD(I);ID(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(a){var l=a==="add"||a==="set";a in n&&!(A&&a==="clear")&&X2(o,a,function(h,c){var f=d(this).collection;if(!l&&A&&!eD(h))return a==="get"?void 0:!1;var u=f[a](h===0?0:h,c);return l?this:u})}),A||AD(o,"size",{configurable:!0,get:function(){return d(this).collection.size}})}return tD(s,I,!1,!0),r[I]=s,H2({global:!0,forced:!0},r),A||g.setStrong(s,I,t),s},rD=bA,Mr=function(I,e,g){for(var t in e)g&&g.unsafe&&I[t]?I[t]=e[t]:rD(I,t,e[t],g);return I},sD=_e,oD=sr,aD=ee,dD=ie,Xo=aD("species"),lD=function(I){var e=sD(I);dD&&e&&!e[Xo]&&oD(e,Xo,{configurable:!0,get:function(){return this}})},hD=mA,cD=sr,Jo=Mr,uD=dA,fD=Rr,pD=mt,mD=Nr,vD=cr,$A=ur,bD=lD,Rt=ie,$o=oC.fastKey,hh=Ug,qo=hh.set,ni=hh.getterFor,ch={getConstructor:function(I,e,g,t){var A=I(function(s,o){fD(s,C),qo(s,{type:e,index:hD(null),first:void 0,last:void 0,size:0}),Rt||(s.size=0),pD(o)||mD(o,s[t],{that:s,AS_ENTRIES:g})}),C=A.prototype,i=ni(e),n=function(s,o,d){var a=i(s),l=r(s,o),h,c;return l?l.value=d:(a.last=l={index:c=$o(o,!0),key:o,value:d,previous:h=a.last,next:void 0,removed:!1},a.first||(a.first=l),h&&(h.next=l),Rt?a.size++:s.size++,c!=="F"&&(a.index[c]=l)),s},r=function(s,o){var d=i(s),a=$o(o),l;if(a!=="F")return d.index[a];for(l=d.first;l;l=l.next)if(l.key===o)return l};return Jo(C,{clear:function(){for(var o=this,d=i(o),a=d.index,l=d.first;l;)l.removed=!0,l.previous&&(l.previous=l.previous.next=void 0),delete a[l.index],l=l.next;d.first=d.last=void 0,Rt?d.size=0:o.size=0},delete:function(s){var o=this,d=i(o),a=r(o,s);if(a){var l=a.next,h=a.previous;delete d.index[a.index],a.removed=!0,h&&(h.next=l),l&&(l.previous=h),d.first===a&&(d.first=l),d.last===a&&(d.last=h),Rt?d.size--:o.size--}return!!a},forEach:function(o){for(var d=i(this),a=uD(o,arguments.length>1?arguments[1]:void 0),l;l=l?l.next:d.first;)for(a(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(o){return!!r(this,o)}}),Jo(C,g?{get:function(o){var d=r(this,o);return d&&d.value},set:function(o,d){return n(this,o===0?0:o,d)}}:{add:function(o){return n(this,o=o===0?0:o,o)}}),Rt&&cD(C,"size",{configurable:!0,get:function(){return i(this).size}}),A},setStrong:function(I,e,g){var t=e+" Iterator",A=ni(e),C=ni(t);vD(I,e,function(i,n){qo(this,{type:t,target:i,state:A(i),kind:n,last:void 0})},function(){for(var i=C(this),n=i.kind,r=i.last;r&&r.removed;)r=r.previous;return!i.target||!(i.last=r=r?r.next:i.state.first)?(i.target=void 0,$A(void 0,!0)):$A(n==="keys"?r.key:n==="values"?r.value:[r.key,r.value],!1)},g?"entries":"values",!g,!0),bD(e)}},yD=kr,wD=ch;yD("Map",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},wD);var Fr=Z,ED=KI,TD=eg,xD=iA,OD=Fr("".charAt),ea=Fr("".charCodeAt),DD=Fr("".slice),ga=function(I){return function(e,g){var t=TD(xD(e)),A=ED(g),C=t.length,i,n;return A<0||A>=C?I?"":void 0:(i=ea(t,A),i<55296||i>56319||A+1===C||(n=ea(t,A+1))<56320||n>57343?I?OD(t,A):i:I?DD(t,A,A+2):(i-55296<<10)+(n-56320)+65536)}},PD={codeAt:ga(!1),charAt:ga(!0)},SD=PD.charAt,ND=eg,uh=Ug,RD=cr,ta=ur,fh="String Iterator",kD=uh.set,MD=uh.getterFor(fh);RD(String,"String",function(I){kD(this,{type:fh,string:ND(I),index:0})},function(){var e=MD(this),g=e.string,t=e.index,A;return t>=g.length?ta(void 0,!0):(A=SD(g,t),e.index+=A.length,ta(A,!1))});var FD=L,zD=FD.Map,BD=zD,ZD=BD,LD=ZD,NA=P(LD),$i=class{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},q(this.options,this.defaultOptions)}setOptions(e){let g=["useDefaultGroups"];if(e!==void 0){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&G(g).call(g,t)===-1){let A=e[t];this.add(t,A)}}}clear(){this._groups=new NA,this._groupNames=[]}get(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._groups.get(e);if(t===void 0&&g)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,t={},t.color=this._groups.get(this._groupNames[A]),this._groups.set(e,t)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,t={},t.color=this._defaultGroups[A],this._groups.set(e,t)}return t}add(e,g){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,g),g}},GD=S;GD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var jD=L,VD=jD.Number.isNaN,YD=VD,WD=YD,_D=WD,qi=P(_D),HD=X,UD=HD.isFinite,KD=Number.isFinite||function(e){return typeof e=="number"&&UD(e)},QD=S,XD=KD;QD({target:"Number",stat:!0},{isFinite:XD});var JD=L,$D=JD.Number.isFinite,qD=$D,eP=qD,gP=eP,Fg=P(gP),tP=S,AP=Ng.some,IP=Tt,CP=IP("some");tP({target:"Array",proto:!0,forced:!CP},{some:function(e){return AP(this,e,arguments.length>1?arguments[1]:void 0)}});var iP=Ie,nP=iP("Array").some,rP=J,sP=nP,ri=Array.prototype,oP=function(I){var e=I.some;return I===ri||rP(ri,I)&&e===ri.some?sP:e},aP=oP,dP=aP,lP=dP,ph=P(lP),hP=L,cP=hP.Object.getOwnPropertySymbols,uP=cP,fP=uP,pP=fP,Je=P(pP),mh={exports:{}},mP=S,vP=B,bP=We,vh=AA.f,bh=ie,yP=!bh||vP(function(){vh(1)});mP({target:"Object",stat:!0,forced:yP,sham:!bh},{getOwnPropertyDescriptor:function(e,g){return vh(bP(e),g)}});var wP=L,yh=wP.Object,EP=mh.exports=function(e,g){return yh.getOwnPropertyDescriptor(e,g)};yh.getOwnPropertyDescriptor.sham&&(EP.sham=!0);var TP=mh.exports,xP=TP,OP=xP,DP=OP,gg=P(DP),PP=S,SP=ie,NP=Cl,RP=We,kP=AA,MP=fA;PP({target:"Object",stat:!0,sham:!SP},{getOwnPropertyDescriptors:function(e){for(var g=RP(e),t=kP.f,A=NP(g),C={},i=0,n,r;A.length>i;)r=t(g,n=A[i++]),r!==void 0&&MP(C,n,r);return C}});var FP=L,zP=FP.Object.getOwnPropertyDescriptors,BP=zP,ZP=BP,LP=ZP,$e=P(LP),wh={exports:{}},GP=S,jP=ie,Aa=JI.f;GP({target:"Object",stat:!0,forced:Object.defineProperties!==Aa,sham:!jP},{defineProperties:Aa});var VP=L,Eh=VP.Object,YP=wh.exports=function(e,g){return Eh.defineProperties(e,g)};Eh.defineProperties.sham&&(YP.sham=!0);var WP=wh.exports,_P=WP,HP=_P,UP=HP,RA=P(UP),Th={exports:{}},KP=S,QP=ie,Ia=Oe.f;KP({target:"Object",stat:!0,forced:Object.defineProperty!==Ia,sham:!QP},{defineProperty:Ia});var XP=L,xh=XP.Object,JP=Th.exports=function(e,g,t){return xh.defineProperty(e,g,t)};xh.defineProperty.sham&&(JP.sham=!0);var $P=Th.exports,qP=$P,Oh=qP,eS=Oh,gS=eS,tS=gS,AS=tS,IS=AS,CS=P(IS),iS=ee,nS=Oe.f,Ca=iS("metadata"),ia=Function.prototype;ia[Ca]===void 0&&nS(ia,Ca,{value:null});var rS=$;rS("asyncDispose");var sS=$;sS("dispose");var oS=$;oS("metadata");var aS=Il,dS=aS,lS=_e,hS=Z,zr=lS("Symbol"),cS=zr.keyFor,uS=hS(zr.prototype.valueOf),Dh=zr.isRegisteredSymbol||function(e){try{return cS(uS(e))!==void 0}catch(g){return!1}},fS=S,pS=Dh;fS({target:"Symbol",stat:!0},{isRegisteredSymbol:pS});var mS=bt,Ph=_e,vS=Z,bS=sA,yS=ee,xI=Ph("Symbol"),na=xI.isWellKnownSymbol,Sh=Ph("Object","getOwnPropertyNames"),wS=vS(xI.prototype.valueOf),ra=mS("wks");for(qA=0,si=Sh(xI),sa=si.length;qA<sa;qA++)try{oi=si[qA],bS(xI[oi])&&yS(oi)}catch(I){}var oi,qA,si,sa,Nh=function(e){if(na&&na(e))return!0;try{for(var g=wS(e),t=0,A=Sh(ra),C=A.length;t<C;t++)if(ra[A[t]]==g)return!0}catch(i){}return!1},ES=S,TS=Nh;ES({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:TS});var xS=$;xS("matcher");var OS=$;OS("observable");var DS=S,PS=Dh;DS({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:PS});var SS=S,NS=Nh;SS({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:NS});var RS=$;RS("metadataKey");var kS=$;kS("patternMatch");var MS=$;MS("replaceAll");var FS=dS,zS=FS,BS=zS,eI=P(BS),ZS=yA,LS=ZS.f("iterator"),GS=LS,Rh=GS,jS=Rh,VS=jS,YS=VS,WS=YS,_S=WS,HS=P(_S);function qt(I){"@babel/helpers - typeof";return qt=typeof eI=="function"&&typeof HS=="symbol"?function(e){return typeof e}:function(e){return e&&typeof eI=="function"&&e.constructor===eI&&e!==eI.prototype?"symbol":typeof e},qt(I)}var US=yA,KS=US.f("toPrimitive"),QS=KS,XS=QS,JS=XS,$S=JS,qS=$S,eN=qS,gN=eN,tN=P(gN);function AN(I,e){if(qt(I)!=="object"||I===null)return I;var g=I[tN];if(g!==void 0){var t=g.call(I,e||"default");if(qt(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(I)}function IN(I){var e=AN(I,"string");return qt(e)==="symbol"?e:String(e)}function ge(I,e,g){return e=IN(e),e in I?CS(I,e,{value:g,enumerable:!0,configurable:!0,writable:!0}):I[e]=g,I}var CN=_g,iN=xe,nN=_I,rN=ke,sN=TypeError,oa=function(I){return function(e,g,t,A){CN(g);var C=iN(e),i=nN(C),n=rN(C),r=I?n-1:0,s=I?-1:1;if(t<2)for(;;){if(r in i){A=i[r],r+=s;break}if(r+=s,I?r<0:n<=r)throw new sN("Reduce of empty array with no initial value")}for(;I?r>=0:n>r;r+=s)r in i&&(A=g(A,i[r],r,C));return A}},oN={left:oa(!1),right:oa(!0)},aN=X,dN=ag,lN=dN(aN.process)==="process",hN=S,cN=oN.left,uN=Tt,aa=rA,fN=lN,pN=!fN&&aa>79&&aa<83,mN=pN||!uN("reduce");hN({target:"Array",proto:!0,forced:mN},{reduce:function(e){var g=arguments.length;return cN(this,e,g,g>1?arguments[1]:void 0)}});var vN=Ie,bN=vN("Array").reduce,yN=J,wN=bN,ai=Array.prototype,EN=function(I){var e=I.reduce;return I===ai||yN(ai,I)&&e===ai.reduce?wN:e},TN=EN,xN=TN,ON=xN,Br=P(ON),DN=Sg,PN=ke,SN=ir,NN=dA,kh=function(I,e,g,t,A,C,i,n){for(var r=A,s=0,o=i?NN(i,n):!1,d,a;s<t;)s in g&&(d=o?o(g[s],s,e):g[s],C>0&&DN(d)?(a=PN(d),r=kh(I,e,d,a,r,C-1)-1):(SN(r+1),I[r]=d),r++),s++;return r},RN=kh,kN=S,MN=RN,FN=_g,zN=xe,BN=ke,ZN=XI;kN({target:"Array",proto:!0},{flatMap:function(e){var g=zN(this),t=BN(g),A;return FN(e),A=ZN(g,0),A.length=MN(A,g,g,t,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var LN=Ie,x5=LN("Array").flatMap;var O5=Array.prototype;var GN=Rh,st=P(GN),jN=kr,VN=ch;jN("Set",function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},VN);var YN=L,WN=YN.Set,_N=WN,HN=_N,UN=HN,Ge=P(UN),KN=dh,QN=KN,XN=QN,JN=XN,$N=JN,qN=$N,eR=qN,gR=eR,tR=gR,AR=tR,di=P(AR),da=yd,IR=Math.floor,en=function(I,e){var g=I.length,t=IR(g/2);return g<8?CR(I,e):iR(I,en(da(I,0,t),e),en(da(I,t),e),e)},CR=function(I,e){for(var g=I.length,t=1,A,C;t<g;){for(C=t,A=I[t];C&&e(I[C-1],A)>0;)I[C]=I[--C];C!==t++&&(I[C]=A)}return I},iR=function(I,e,g,t){for(var A=e.length,C=g.length,i=0,n=0;i<A||n<C;)I[i+n]=i<A&&n<C?t(e[i],g[n])<=0?e[i++]:g[n++]:i<A?e[i++]:g[n++];return I},nR=en,rR=nA,la=rR.match(/firefox\/(\d+)/i),sR=!!la&&+la[1],oR=nA,aR=/MSIE|Trident/.test(oR),dR=nA,ha=dR.match(/AppleWebKit\/(\d+)\./),lR=!!ha&&+ha[1],hR=S,Mh=Z,cR=_g,uR=xe,ca=ke,fR=rl,ua=eg,Zr=B,pR=nR,mR=Tt,fa=sR,vR=aR,pa=rA,ma=lR,yg=[],va=Mh(yg.sort),bR=Mh(yg.push),yR=Zr(function(){yg.sort(void 0)}),wR=Zr(function(){yg.sort(null)}),ER=mR("sort"),Fh=!Zr(function(){if(pa)return pa<70;if(!(fa&&fa>3)){if(vR)return!0;if(ma)return ma<603;var I="",e,g,t,A;for(e=65;e<76;e++){switch(g=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(A=0;A<47;A++)yg.push({k:g+A,v:t})}for(yg.sort(function(C,i){return i.v-C.v}),A=0;A<yg.length;A++)g=yg[A].k.charAt(0),I.charAt(I.length-1)!==g&&(I+=g);return I!=="DGBEFHACIJK"}}),TR=yR||!wR||!ER||!Fh,xR=function(I){return function(e,g){return g===void 0?-1:e===void 0?1:I!==void 0?+I(e,g)||0:ua(e)>ua(g)?1:-1}};hR({target:"Array",proto:!0,forced:TR},{sort:function(e){e!==void 0&&cR(e);var g=uR(this);if(Fh)return e===void 0?va(g):va(g,e);var t=[],A=ca(g),C,i;for(i=0;i<A;i++)i in g&&bR(t,g[i]);for(pR(t,xR(e)),C=ca(t),i=0;i<C;)g[i]=t[i++];for(;i<A;)fR(g,i++);return g}});var OR=Ie,DR=OR("Array").sort,PR=J,SR=DR,li=Array.prototype,NR=function(I){var e=I.sort;return I===li||PR(li,I)&&e===li.sort?SR:e},RR=NR,kR=RR,MR=kR,ig=P(MR),FR=Ie,zR=FR("Array").keys,BR=zR,ZR=BR,LR=lg,GR=ne,jR=J,VR=ZR,hi=Array.prototype,YR={DOMTokenList:!0,NodeList:!0},WR=function(I){var e=I.keys;return I===hi||jR(hi,I)&&e===hi.keys||GR(YR,LR(I))?VR:e},_R=WR,It=P(_R),HR=Ie,UR=HR("Array").values,KR=UR,QR=KR,XR=lg,JR=ne,$R=J,qR=QR,ci=Array.prototype,ek={DOMTokenList:!0,NodeList:!0},gk=function(I){var e=I.values;return I===ci||$R(ci,I)&&e===ci.values||JR(ek,XR(I))?qR:e},tk=gk,OI=P(tk),Ak=Ie,Ik=Ak("Array").entries,Ck=Ik,ik=Ck,nk=lg,rk=ne,sk=J,ok=ik,ui=Array.prototype,ak={DOMTokenList:!0,NodeList:!0},dk=function(I){var e=I.entries;return I===ui||sk(ui,I)&&e===ui.entries||rk(ak,nk(I))?ok:e},lk=dk,hk=P(lk),ck=Oh,kA=P(ck),gI,uk=new Uint8Array(16);function fk(){if(!gI&&(gI=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gI))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gI(uk)}var oe=[];for(let I=0;I<256;++I)oe.push((I+256).toString(16).slice(1));function pk(I,e=0){return oe[I[e+0]]+oe[I[e+1]]+oe[I[e+2]]+oe[I[e+3]]+"-"+oe[I[e+4]]+oe[I[e+5]]+"-"+oe[I[e+6]]+oe[I[e+7]]+"-"+oe[I[e+8]]+oe[I[e+9]]+"-"+oe[I[e+10]]+oe[I[e+11]]+oe[I[e+12]]+oe[I[e+13]]+oe[I[e+14]]+oe[I[e+15]]}var mk=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ba={randomUUID:mk};function at(I,e,g){if(ba.randomUUID&&!e&&!I)return ba.randomUUID();I=I||{};let t=I.random||(I.rng||fk)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,e){g=g||0;for(let A=0;A<16;++A)e[g+A]=t[A];return e}return pk(t)}function ya(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function wa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=ya(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=ya(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}function Ea(I){return typeof I=="string"||typeof I=="number"}var gn=class I{constructor(e){ge(this,"delay",void 0),ge(this,"max",void 0),ge(this,"_queue",[]),ge(this,"_timeout",null),ge(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,g){let t=new I(g);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{t.flush()};let A=[{name:"flush",original:void 0}];if(g&&g.replace)for(let C=0;C<g.replace.length;C++){let i=g.replace[C];A.push({name:i,original:e[i]}),t.replace(e,i)}return t._extended={object:e,methods:A},t}destroy(){if(this.flush(),this._extended){let e=this._extended.object,g=this._extended.methods;for(let t=0;t<g.length;t++){let A=g[t];A.original?e[A.name]=A.original:delete e[A.name]}this._extended=null}}replace(e,g){let t=this,A=e[g];if(!A)throw new Error("Method "+g+" undefined");e[g]=function(){for(var C=arguments.length,i=new Array(C),n=0;n<C;n++)i[n]=arguments[n];t.queue({args:i,fn:A,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=Qe(()=>{this.flush()},this.delay))}flush(){var e,g;F(e=Ke(g=this._queue).call(g,0)).call(e,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}},tn=class I{constructor(){ge(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),ge(this,"subscribe",I.prototype.on),ge(this,"unsubscribe",I.prototype.off)}_trigger(e,g,t){var A;if(e==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[e],...this._subscribers["*"]]).call(A,C=>{C(e,g,t!=null?t:null)})}on(e,g){typeof g=="function"&&this._subscribers[e].push(g)}off(e,g){var t;this._subscribers[e]=te(t=this._subscribers[e]).call(t,A=>A!==g)}},DI=class I{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[st](){for(let[e,g]of this._pairs)yield[e,g]}*entries(){for(let[e,g]of this._pairs)yield[e,g]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[0])}toItemArray(){var e;return ae(e=[...this._pairs]).call(e,g=>g[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Tg(null);for(let[g,t]of this._pairs)e[g]=t;return e}toMap(){return new NA(this._pairs)}toIdSet(){return new Ge(this.toIdArray())}toItemSet(){return new Ge(this.toItemArray())}cache(){return new I([...this._pairs])}distinct(e){let g=new Ge;for(let[t,A]of this._pairs)g.add(e(A,t));return g}filter(e){let g=this._pairs;return new I({*[st](){for(let[t,A]of g)e(A,t)&&(yield[t,A])}})}forEach(e){for(let[g,t]of this._pairs)e(t,g)}map(e){let g=this._pairs;return new I({*[st](){for(let[t,A]of g)yield[t,e(A,t)]}})}max(e){let g=di(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,r=e(n,i);r>C&&(C=r,A=n)}return A}min(e){let g=di(this._pairs),t=g.next();if(t.done)return null;let A=t.value[1],C=e(t.value[1],t.value[0]);for(;!(t=g.next()).done;){let[i,n]=t.value,r=e(n,i);r<C&&(C=r,A=n)}return A}reduce(e,g){for(let[t,A]of this._pairs)g=e(g,A,t);return g}sort(e){return new I({[st]:()=>{var g;return di(ig(g=[...this._pairs]).call(g,(t,A)=>{let[C,i]=t,[n,r]=A;return e(i,r,C,n)}))}})}};function vk(I,e){return I[e]==null&&(I[e]=at()),I}var sg=class extends tn{get idProp(){return this._idProp}constructor(e,g){super(),ge(this,"flush",void 0),ge(this,"length",void 0),ge(this,"_options",void 0),ge(this,"_data",void 0),ge(this,"_idProp",void 0),ge(this,"_queue",null),e&&!z(e)&&(g=e,e=[]),this._options=g||{},this._data=new NA,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(g)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=gn.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,g){let t=[],A;if(z(e)){let C=ae(e).call(e,i=>i[this._idProp]);if(ph(C).call(C,i=>this._data.has(i)))throw new Error("A duplicate id was found in the parameter array.");for(let i=0,n=e.length;i<n;i++)A=this._addItem(e[i]),t.push(A)}else if(e&&typeof e=="object")A=this._addItem(e),t.push(A);else throw new Error("Unknown dataType");return t.length&&this._trigger("add",{items:t},g),t}update(e,g){let t=[],A=[],C=[],i=[],n=this._idProp,r=s=>{let o=s[n];if(o!=null&&this._data.has(o)){let d=s,a=q({},this._data.get(o)),l=this._updateItem(d);A.push(l),i.push(d),C.push(a)}else{let d=this._addItem(s);t.push(d)}};if(z(e))for(let s=0,o=e.length;s<o;s++)e[s]&&typeof e[s]=="object"?r(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")r(e);else throw new Error("Unknown dataType");if(t.length&&this._trigger("add",{items:t},g),A.length){let s={items:A,oldData:C,data:i};this._trigger("update",s,g)}return ol(t).call(t,A)}updateOnly(e,g){var t;z(e)||(e=[e]);let A=ae(t=ae(e).call(e,C=>{let i=this._data.get(C[this._idProp]);if(i==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:i,update:C}})).call(t,C=>{let{oldData:i,update:n}=C,r=i[this._idProp],s=q1(i,n);return this._data.set(r,s),{id:r,oldData:i,updatedData:s}});if(A.length){let C={items:ae(A).call(A,i=>i.id),oldData:ae(A).call(A,i=>i.oldData),data:ae(A).call(A,i=>i.updatedData)};return this._trigger("update",C,g),C.items}else return[]}get(e,g){let t,A,C;Ea(e)?(t=e,C=g):z(e)?(A=e,C=g):C=e;let i=C&&C.returnType==="Object"?"Object":"Array",n=C&&te(C),r=[],s,o,d;if(t!=null)s=this._data.get(t),s&&n&&!n(s)&&(s=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)s=this._data.get(A[h]),s!=null&&(!n||n(s))&&r.push(s);else{var a;o=[...It(a=this._data).call(a)];for(let h=0,c=o.length;h<c;h++)d=o[h],s=this._data.get(d),s!=null&&(!n||n(s))&&r.push(s)}if(C&&C.order&&t==null&&this._sort(r,C.order),C&&C.fields){let h=C.fields;if(t!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,f=r.length;c<f;c++)r[c]=this._filterFields(r[c],h)}if(i=="Object"){let h={};for(let c=0,f=r.length;c<f;c++){let u=r[c],m=u[this._idProp];h[m]=u}return h}else if(t!=null){var l;return(l=s)!==null&&l!==void 0?l:null}else return r}getIds(e){let g=this._data,t=e&&te(e),A=e&&e.order,C=[...It(g).call(g)],i=[];if(t)if(A){let n=[];for(let r=0,s=C.length;r<s;r++){let o=C[r],d=this._data.get(o);d!=null&&t(d)&&n.push(d)}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=this._data.get(s);o!=null&&t(o)&&i.push(o[this._idProp])}else if(A){let n=[];for(let r=0,s=C.length;r<s;r++){let o=C[r];n.push(g.get(o))}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)i.push(n[r][this._idProp])}else for(let n=0,r=C.length;n<r;n++){let s=C[n],o=g.get(s);o!=null&&i.push(o[this._idProp])}return i}getDataSet(){return this}forEach(e,g){let t=g&&te(g),A=this._data,C=[...It(A).call(A)];if(g&&g.order){let i=this.get(g);for(let n=0,r=i.length;n<r;n++){let s=i[n],o=s[this._idProp];e(s,o)}}else for(let i=0,n=C.length;i<n;i++){let r=C[i],s=this._data.get(r);s!=null&&(!t||t(s))&&e(s,r)}}map(e,g){let t=g&&te(g),A=[],C=this._data,i=[...It(C).call(C)];for(let n=0,r=i.length;n<r;n++){let s=i[n],o=this._data.get(s);o!=null&&(!t||t(o))&&A.push(e(o,s))}return g&&g.order&&this._sort(A,g.order),A}_filterFields(e,g){var t;return e&&Br(t=z(g)?g:U(g)).call(t,(A,C)=>(A[C]=e[C],A),{})}_sort(e,g){if(typeof g=="string"){let t=g;ig(e).call(e,(A,C)=>{let i=A[t],n=C[t];return i>n?1:i<n?-1:0})}else if(typeof g=="function")ig(e).call(e,g);else throw new TypeError("Order must be a function or a string")}remove(e,g){let t=[],A=[],C=z(e)?e:[e];for(let i=0,n=C.length;i<n;i++){let r=this._remove(C[i]);if(r){let s=r[this._idProp];s!=null&&(t.push(s),A.push(r))}}return t.length&&this._trigger("remove",{items:t,oldData:A},g),t}_remove(e){let g;if(Ea(e)?g=e:e&&typeof e=="object"&&(g=e[this._idProp]),g!=null&&this._data.has(g)){let t=this._data.get(g)||null;return this._data.delete(g),--this.length,t}return null}clear(e){var g;let t=[...It(g=this._data).call(g)],A=[];for(let C=0,i=t.length;C<i;C++)A.push(this._data.get(t[C]));return this._data.clear(),this.length=0,this._trigger("remove",{items:t,oldData:A},e),t}max(e){let g=null,t=null;for(let C of OI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i>t)&&(g=C,t=i)}return g||null}min(e){let g=null,t=null;for(let C of OI(A=this._data).call(A)){var A;let i=C[e];typeof i=="number"&&(t==null||i<t)&&(g=C,t=i)}return g||null}distinct(e){let g=this._data,t=[...It(g).call(g)],A=[],C=0;for(let i=0,n=t.length;i<n;i++){let r=t[i],o=g.get(r)[e],d=!1;for(let a=0;a<C;a++)if(A[a]==o){d=!0;break}!d&&o!==void 0&&(A[C]=o,C++)}return A}_addItem(e){let g=vk(e,this._idProp),t=g[this._idProp];if(this._data.has(t))throw new Error("Cannot add item: item with id "+t+" already exists");return this._data.set(t,g),++this.length,t}_updateItem(e){let g=e[this._idProp];if(g==null)throw new Error("Cannot update item: item has no id (item: "+xt(e)+")");let t=this._data.get(g);if(!t)throw new Error("Cannot update item: no item with id "+g+" found");return this._data.set(g,wa(wa({},t),e)),g}stream(e){if(e){let t=this._data;return new DI({*[st](){for(let A of e){let C=t.get(A);C!=null&&(yield[A,C])}}})}else{var g;return new DI({[st]:b(g=hk(this._data)).call(g,this._data)})}}};function bk(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function zh(I,e){return typeof e=="object"&&e!==null&&I===e.idProp&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof ae(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&bk(I,e.getDataSet())}var Bh=X,yk=B,wk=Z,Ek=eg,Tk=hl.trim,xk=fr,Ok=wk("".charAt),PI=Bh.parseFloat,Ta=Bh.Symbol,xa=Ta&&Ta.iterator,Dk=1/PI(xk+"-0")!==-1/0||xa&&!yk(function(){PI(Object(xa))}),Pk=Dk?function(e){var g=Tk(Ek(e)),t=PI(g);return t===0&&Ok(g,0)==="-"?-0:t}:PI,Sk=S,Oa=Pk;Sk({global:!0,forced:parseFloat!==Oa},{parseFloat:Oa});var Nk=L,Rk=Nk.parseFloat,kk=Rk,Mk=kk,Fk=Mk,Zh=P(Fk),zk=S,Bk=B,Zk=qI.f,Lk=Bk(function(){return!Object.getOwnPropertyNames(1)});zk({target:"Object",stat:!0,forced:Lk},{getOwnPropertyNames:Zk});var Gk=L,jk=Gk.Object,Vk=function(e){return jk.getOwnPropertyNames(e)},Yk=Vk,Wk=Yk,_k=Wk,Hk=P(_k);function Lr(I,e){let g=["node","edge","label"],t=!0,A=mg(e,"chosen");if(typeof A=="boolean")t=A;else if(typeof A=="object"){if(G(g).call(g,I)===-1)throw new Error("choosify: subOption '"+I+"' should be one of '"+g.join("', '")+"'");let C=mg(e,["chosen",I]);(typeof C=="boolean"||typeof C=="function")&&(t=C)}return t}function An(I,e,g){if(I.width<=0||I.height<=0)return!1;if(g!==void 0){let C={x:e.x-g.x,y:e.y-g.y};if(g.angle!==0){let i=-g.angle;e={x:Math.cos(i)*C.x-Math.sin(i)*C.y,y:Math.sin(i)*C.x+Math.cos(i)*C.y}}else e=C}let t=I.x+I.width,A=I.y+I.width;return I.left<e.x&&t>e.x&&I.top<e.y&&A>e.y}function SI(I){return typeof I=="string"&&I!==""}function Lh(I,e,g,t){let A=t.x,C=t.y;if(typeof t.distanceToBorder=="function"){let i=t.distanceToBorder(I,e),n=Math.sin(e)*i,r=Math.cos(e)*i;r===i?(A+=i,C=t.y):n===i?(A=t.x,C-=i):(A+=r,C-=n)}else t.shape.width>t.shape.height?(A=t.x+t.shape.width*.5,C=t.y-g):(A=t.x+g,C=t.y-t.shape.height*.5);return{x:A,y:C}}var In=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let A=g;(g===void 0||g==="")&&(A=" ");let C=this.measureText(A,t),i=q({},OI(C));i.text=g,i.width=C.width,i.mod=t,(g===void 0||g==="")&&(i.width=0),this.lines[e].blocks.push(i),this.lines[e].width+=i.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g)}newLine(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,g),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let g=this.lines[e],t=0;if(g.blocks!==void 0)for(let A=0;A<g.blocks.length;A++){let C=g.blocks[A];t<C.height&&(t=C.height)}g.height=t}}determineLabelSize(){let e=0,g=0;for(let t=0;t<this.lines.length;t++){let A=this.lines[t];A.width>e&&(e=A.width),g+=A.height}this.width=e,this.height=g}removeEmptyBlocks(){let e=[];for(let g=0;g<this.lines.length;g++){let t=this.lines[g];if(t.blocks.length===0||g===this.lines.length-1&&t.width===0)continue;let A={};q(A,t),A.blocks=[];let C,i=[];for(let n=0;n<t.blocks.length;n++){let r=t.blocks[n];r.width!==0?i.push(r):C===void 0&&(C=r)}i.length===0&&C!==void 0&&i.push(C),A.blocks=i,e.push(A)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},Uk={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},NI=class{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,g){return!this.mono&&!this[e]&&this.match(g)?(this.setTag(e),!0):!1}match(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[t,A]=this.prepareRegExp(e),C=t.test(this.text.substr(this.position,A));return C&&g&&(this.position+=A-1),C}parseEndTag(e,g,t){let A=this.mod()===e;return e==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(g)?(t!==void 0?(this.position===this.text.length-1||this.match(t,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,g){return this.match(e)?(this.add(g),this.position+=length-1,!0):!1}prepareRegExp(e){let g,t;if(e instanceof RegExp)t=e,g=1;else{let A=Uk[e];A!==void 0?t=A:t=new RegExp(e),g=e.length}return[t,g]}},Cn=class{constructor(e,g,t,A){this.ctx=e,this.parent=g,this.selected=t,this.hover=A;let C=(i,n)=>{if(i===void 0)return 0;let r=this.parent.getFormattingValues(e,t,A,n),s=0;return i!==""&&(s=this.ctx.measureText(i).width),{width:s,values:r}};this.lines=new In(C)}process(e){if(!SI(e))return this.lines.finalize();let g=this.parent.fontOptions;e=e.replace(/\r\n/g,`
646
+ `}static print(e){return Ug(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let g=[],A;for(A=0;A<=t.length;A++)g[A]=[A];let I;for(I=0;I<=e.length;I++)g[0][I]=I;for(A=1;A<=t.length;A++)for(I=1;I<=e.length;I++)t.charAt(A-1)==e.charAt(I-1)?g[A][I]=g[A-1][I-1]:g[A][I]=Math.min(g[A-1][I-1]+1,Math.min(g[A][I-1]+1,g[A-1][I]+1));return g[t.length][e.length]}},kP=et,MP=DP,Rg=ms,FP=NP,Oc=Yn,BP=_P;function zP(i){return Nt=i,jP()}var Pc={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},bs=Ft(Pc);bs.color="color.color";bs.style="dashes";var ye={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},dl={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Nt="",zg=0,N="",S="",Oe=ye.NULL;function LP(){zg=0,N=Nt.charAt(0)}function oe(){zg++,N=Nt.charAt(zg)}function wg(){return Nt.charAt(zg+1)}function hl(i){var e=i.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Zt(i,e){if(i||(i={}),e)for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function ZP(i,e,t){for(var g=e.split("."),A=i;g.length;){var I=g.shift();g.length?(A[I]||(A[I]={}),A=A[I]):A[I]=t}}function Sc(i,e){for(var t,g,A=null,I=[i],C=i;C.parent;)I.push(C.parent),C=C.parent;if(C.nodes){for(t=0,g=C.nodes.length;t<g;t++)if(e.id===C.nodes[t].id){A=C.nodes[t];break}}for(A||(A={id:e.id},i.node&&(A.attr=Zt(A.attr,i.node))),t=I.length-1;t>=0;t--){var n,r=I[t];r.nodes||(r.nodes=[]),G(n=r.nodes).call(n,A)===-1&&r.nodes.push(A)}e.attr&&(A.attr=Zt(A.attr,e.attr))}function GP(i,e){if(i.edges||(i.edges=[]),i.edges.push(e),i.edge){var t=Zt({},i.edge);e.attr=Zt(t,e.attr)}}function Rc(i,e,t,g,A){var I={from:e,to:t,type:g};return i.edge&&(I.attr=Zt({},i.edge)),I.attr=Zt(I.attr||{},A),A!=null&&A.hasOwnProperty("arrows")&&A.arrows!=null&&(I.arrows={to:{enabled:!0,type:A.arrows.type}},A.arrows=null),I}function H(){for(Oe=ye.NULL,S="";N===" "||N===" "||N===`
647
+ `||N==="\r";)oe();do{var i=!1;if(N==="#"){for(var e=zg-1;Nt.charAt(e)===" "||Nt.charAt(e)===" ";)e--;if(Nt.charAt(e)===`
648
+ `||Nt.charAt(e)===""){for(;N!=""&&N!=`
649
+ `;)oe();i=!0}}if(N==="/"&&wg()==="/"){for(;N!=""&&N!=`
650
+ `;)oe();i=!0}if(N==="/"&&wg()==="*"){for(;N!="";)if(N==="*"&&wg()==="/"){oe(),oe();break}else oe();i=!0}for(;N===" "||N===" "||N===`
651
+ `||N==="\r";)oe()}while(i);if(N===""){Oe=ye.DELIMITER;return}var t=N+wg();if(dl[t]){Oe=ye.DELIMITER,S=t,oe(),oe();return}if(dl[N]){Oe=ye.DELIMITER,S=N,oe();return}if(hl(N)||N==="-"){for(S+=N,oe();hl(N);)S+=N,oe();S==="false"?S=!1:S==="true"?S=!0:isNaN(Number(S))||(S=Number(S)),Oe=ye.IDENTIFIER;return}if(N==='"'){for(oe();N!=""&&(N!='"'||N==='"'&&wg()==='"');)N==='"'?(S+=N,oe()):N==="\\"&&wg()==="n"?(S+=`
652
+ `,oe()):S+=N,oe();if(N!='"')throw we('End of string " expected');oe(),Oe=ye.IDENTIFIER;return}for(Oe=ye.UNKNOWN;N!="";)S+=N,oe();throw new SyntaxError('Syntax error in part "'+kc(S,30)+'"')}function jP(){var i={};if(LP(),H(),S==="strict"&&(i.strict=!0,H()),(S==="graph"||S==="digraph")&&(i.type=S,H()),Oe===ye.IDENTIFIER&&(i.id=S,H()),S!="{")throw we("Angle bracket { expected");if(H(),Dc(i),S!="}")throw we("Angle bracket } expected");if(H(),S!=="")throw we("End of file expected");return H(),delete i.node,delete i.edge,delete i.graph,i}function Dc(i){for(;S!==""&&S!="}";)VP(i),S===";"&&H()}function VP(i){var e=Nc(i);if(e){_c(i,e);return}var t=YP(i);if(!t){if(Oe!=ye.IDENTIFIER)throw we("Identifier expected");var g=S;if(H(),S==="="){if(H(),Oe!=ye.IDENTIFIER)throw we("Identifier expected");i[g]=S,H()}else WP(i,g)}}function Nc(i){var e=null;if(S==="subgraph"&&(e={},e.type="subgraph",H(),Oe===ye.IDENTIFIER&&(e.id=S,H())),S==="{"){if(H(),e||(e={}),e.parent=i,e.node=i.node,e.edge=i.edge,e.graph=i.graph,Dc(e),S!="}")throw we("Angle bracket } expected");H(),delete e.node,delete e.edge,delete e.graph,delete e.parent,i.subgraphs||(i.subgraphs=[]),i.subgraphs.push(e)}return e}function YP(i){return S==="node"?(H(),i.node=hA(),"node"):S==="edge"?(H(),i.edge=hA(),"edge"):S==="graph"?(H(),i.graph=hA(),"graph"):null}function WP(i,e){var t={id:e},g=hA();g&&(t.attr=g),Sc(i,t),_c(i,e)}function _c(i,e){for(;S==="->"||S==="--";){var t,g=S;H();var A=Nc(i);if(A)t=A;else{if(Oe!=ye.IDENTIFIER)throw we("Identifier or subgraph expected");t=S,Sc(i,{id:t}),H()}var I=hA(),C=Rc(i,e,t,g,I);GP(i,C),e=t}}function hA(){for(var i,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},g={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},A=new Array,I=new Array;S==="[";){for(H(),e={};S!==""&&S!="]";){if(Oe!=ye.IDENTIFIER)throw we("Attribute name expected");var C=S;if(H(),S!="=")throw we("Equal sign = expected");if(H(),Oe!=ye.IDENTIFIER)throw we("Attribute value expected");var n=S;C==="style"&&(n=t[n]);var r;C==="arrowhead"&&(r=g[n],C="arrows",n={to:{enabled:!0,type:r}}),C==="arrowtail"&&(r=g[n],C="arrows",n={from:{enabled:!0,type:r}}),A.push({attr:e,name:C,value:n}),I.push(C),H(),S==","&&H()}if(S!="]")throw we("Bracket ] expected");H()}if(Mt(I).call(I,"dir")){var s={};for(s.arrows={},i=0;i<A.length;i++)if(A[i].name==="arrows")if(A[i].value.to!=null)s.arrows.to=i;else if(A[i].value.from!=null)s.arrows.from=i;else throw we("Invalid value of arrows");else A[i].name==="dir"&&(s.dir=i);var o=A[s.dir].value;if(!Mt(I).call(I,"arrows"))if(o==="both")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1,A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="forward")A.push({attr:A[s.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),s.arrows.to=A.length-1;else if(o==="back")A.push({attr:A[s.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),s.arrows.from=A.length-1;else if(o==="none")A.push({attr:A[s.dir].attr,name:"arrows",value:""}),s.arrows.to=A.length-1;else throw we('Invalid dir type "'+o+'"');var a,l;if(o==="both")s.arrows.to&&s.arrows.from?(l=A[s.arrows.to].value.to.type,a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}},tt(A).call(A,s.arrows.from,1)):s.arrows.to?(l=A[s.arrows.to].value.to.type,a="arrow",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}):s.arrows.from&&(l="arrow",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}});else if(o==="back")s.arrows.to&&s.arrows.from?(l="",a=A[s.arrows.from].value.from.type,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}):s.arrows.to?(l="",a="arrow",s.arrows.from=s.arrows.to,A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}):s.arrows.from&&(l="",a=A[s.arrows.from].value.from.type,A[s.arrows.to]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}),A[s.arrows.from]={attr:A[s.arrows.from].attr,name:A[s.arrows.from].name,value:{from:{enabled:!0,type:A[s.arrows.from].value.from.type}}};else if(o==="none"){var d;s.arrows.to?d=s.arrows.to:d=s.arrows.from,A[d]={attr:A[d].attr,name:A[d].name,value:""}}else if(o==="forward")s.arrows.to&&s.arrows.from?(l=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}):s.arrows.to?(l=A[s.arrows.to].value.to.type,a="",A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}):s.arrows.from&&(l="arrow",a="",s.arrows.to=s.arrows.from,A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:l},from:{enabled:!0,type:a}}}),A[s.arrows.to]={attr:A[s.arrows.to].attr,name:A[s.arrows.to].name,value:{to:{enabled:!0,type:A[s.arrows.to].value.to.type}}};else throw we('Invalid dir type "'+o+'"');tt(A).call(A,s.dir,1)}var h;if(Mt(I).call(I,"penwidth")){var c=[];for(h=A.length,i=0;i<h;i++)A[i].name!=="width"&&(A[i].name==="penwidth"&&(A[i].name="width"),c.push(A[i]));A=c}for(h=A.length,i=0;i<h;i++)ZP(A[i].attr,A[i].name,A[i].value);return e}function we(i){return new SyntaxError(i+', got "'+kc(S,30)+'" (char '+zg+")")}function kc(i,e){return i.length<=e?i:i.substr(0,27)+"..."}function UP(i,e,t){B(i)?F(i).call(i,function(g){B(e)?F(e).call(e,function(A){t(g,A)}):t(g,e)}):B(e)?F(e).call(e,function(g){t(i,g)}):t(i,e)}function en(i,e,t){for(var g=e.split("."),A=g.pop(),I=i,C=0;C<g.length;C++){var n=g[C];n in I||(I[n]={}),I=I[n]}return I[A]=t,i}function cl(i,e){var t={};for(var g in i)if(i.hasOwnProperty(g)){var A=e[g];B(A)?F(A).call(A,function(I){en(t,I,i[g])}):typeof A=="string"?en(t,A,i[g]):en(t,g,i[g])}return t}function HP(i){var e=zP(i),t={nodes:[],edges:[],options:{}};if(e.nodes){var g;F(g=e.nodes).call(g,function(C){var n={id:C.id,label:String(C.label||C.id)};Zt(n,cl(C.attr,Pc)),n.image&&(n.shape="image"),t.nodes.push(n)})}if(e.edges){var A,I=function(C){var n={from:C.from,to:C.to};return Zt(n,cl(C.attr,bs)),n.arrows==null&&C.type==="->"&&(n.arrows="to"),n};F(A=e.edges).call(A,function(C){var n,r;if(C.from instanceof Object?n=C.from.nodes:n={id:C.from},C.to instanceof Object?r=C.to.nodes:r={id:C.to},C.from instanceof Object&&C.from.edges){var s;F(s=C.from.edges).call(s,function(a){var l=I(a);t.edges.push(l)})}if(UP(n,r,function(a,l){var d=Rc(t,a.id,l.id,C.type,C.attr),h=I(d);t.edges.push(h)}),C.to instanceof Object&&C.to.edges){var o;F(o=C.to.edges).call(o,function(a){var l=I(a);t.edges.push(l)})}})}return e.attr&&(t.options=e.attr),t}function KP(i,e){var t;let g={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(g.nodes.fixed=e.fixed),e.parseColor!=null&&(g.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(g.edges.inheritColor=e.inheritColor));let A=i.edges,I=he(A).call(A,n=>{let r={from:n.source,id:n.id,to:n.target};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.type==="Directed"&&(r.arrows="to"),n.color&&g.edges.inheritColor===!1&&(r.color=n.color),r});return{nodes:he(t=i.nodes).call(t,n=>{let r={id:n.id,fixed:g.nodes.fixed&&n.x!=null&&n.y!=null};return n.attributes!=null&&(r.attributes=n.attributes),n.label!=null&&(r.label=n.label),n.size!=null&&(r.size=n.size),n.attributes!=null&&n.attributes.title!=null&&(r.title=n.attributes.title),n.title!=null&&(r.title=n.title),n.x!=null&&(r.x=n.x),n.y!=null&&(r.y=n.y),n.color!=null&&(g.nodes.parseColor===!0?r.color=n.color:r.color={background:n.color,border:n.color,highlight:{background:n.color,border:n.color},hover:{background:n.color,border:n.color}}),r}),edges:I}}var QP={addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},XP={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzuf\xFCgen",addNode:"Knoten hinzuf\xFCgen",back:"Zur\xFCck",close:"Schlie\xDFen",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",del:"L\xF6sche Auswahl",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster k\xF6nnen nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},$P={addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",addEdge:"A\xF1adir arista",addNode:"A\xF1adir nodo",back:"Atr\xE1s",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selecci\xF3n",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},JP={addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},qP={addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},eS={addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",addEdge:"Adicionar aresta",addNode:"Adicionar n\xF3",back:"Voltar",close:"Fechar",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",edit:"Editar",editClusterError:"Clusters n\xE3o puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",editNode:"Editar n\xF3"},tS={addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B"},gS={addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",addNode:"\u6DFB\u52A0\u8282\u70B9",back:"\u8FD4\u56DE",close:"\u95DC\u9589",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",del:"\u5220\u9664\u9009\u5B9A",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",edit:"\u7F16\u8F91",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",editNode:"\u7F16\u8F91\u8282\u70B9"},AS={addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",back:"\u041D\u0430\u0437\u0430\u0434",close:"\u0417\u0430\u043A\u0440\u0438\u0442\u0438",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F.",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B"},iS={addDescription:"Cliquez dans un endroit vide pour placer un n\u0153ud.",addEdge:"Ajouter un lien",addNode:"Ajouter un n\u0153ud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",del:"Effacer la s\xE9lection",deleteClusterError:"Les clusters ne peuvent pas \xEAtre effac\xE9s.",edgeDescription:"Cliquez sur un n\u0153ud et glissez le lien vers un autre n\u0153ud pour les connecter.",edit:"\xC9diter",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dit\xE9s.",editEdge:"\xC9diter le lien",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un n\u0153ud.",editNode:"\xC9diter le n\u0153ud"},IS={addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",addEdge:"P\u0159idat hranu",addNode:"P\u0159idat vrchol",back:"Zp\u011Bt",close:"Zav\u0159\xEDt",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",del:"Smazat v\xFDb\u011Br",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",editNode:"Upravit vrchol"},CS=Object.freeze({__proto__:null,cn:gS,cs:IS,de:XP,en:QP,es:$P,fr:iS,it:JP,nl:qP,pt:eS,ru:tS,uk:AS});function nS(i,e){try{let[g,A]=e.split(/[-_ /]/,2),I=g!=null?g.toLowerCase():null,C=A!=null?A.toUpperCase():null;if(I&&C){let n=I+"-"+C;if(Object.prototype.hasOwnProperty.call(i,n))return n;var t;console.warn(Bh(t="Unknown variant ".concat(C," of language ")).call(t,I,"."))}if(I){let n=I;if(Object.prototype.hasOwnProperty.call(i,n))return n;console.warn("Unknown language ".concat(I))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(g){return console.error(g),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}var Wn=class{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;let e=this.image.width,t=this.image.height;this.width=e,this.height=t;let g=Math.floor(t/2),A=Math.floor(t/4),I=Math.floor(t/8),C=Math.floor(t/16),n=Math.floor(e/2),r=Math.floor(e/4),s=Math.floor(e/8),o=Math.floor(e/16);this.canvas.width=3*r,this.canvas.height=g,this.coordinates=[[0,0,n,g],[n,0,r,A],[n,A,s,I],[5*s,A,o,C]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){let e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let g=1;g<this.NUM_ITERATIONS;g++){let A=this.coordinates[g-1],I=this.coordinates[g];e.drawImage(this.canvas,A[0],A[1],A[2],A[3],I[0],I[1],I[2],I[3])}}drawImageAtPosition(e,t,g,A,I,C){if(this.initialized())if(t>2){t*=.5;let n=0;for(;t>2&&n<this.NUM_ITERATIONS;)t*=.5,n+=1;n>=this.NUM_ITERATIONS&&(n=this.NUM_ITERATIONS-1);let r=this.coordinates[n];e.drawImage(this.canvas,r[0],r[1],r[2],r[3],g,A,I,C)}else e.drawImage(this.image,g,A,I,C)}},Un=class{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,g){if(!(e===void 0||g===void 0)){if(t===void 0){console.warn("No broken url image defined");return}g.image.onerror=()=>{console.error("Could not load brokenImage:",t)},g.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){let g=this.images[e];if(g)return g;let A=new Wn;return this.images[e]=A,A.image.onload=()=>{this._fixImageCoordinates(A.image),A.init(),this._redrawWithImage(A)},A.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,A)},A.image.src=e,A}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}},Mc={exports:{}},rS=z,sS=rS(function(){if(typeof ArrayBuffer=="function"){var i=new ArrayBuffer(8);Object.isExtensible(i)&&Object.defineProperty(i,"a",{value:8})}}),oS=z,aS=pe,lS=vt,ul=sS,Wi=Object.isExtensible,dS=oS(function(){Wi(1)}),hS=dS||ul?function(e){return!aS(e)||ul&&lS(e)==="ArrayBuffer"?!1:Wi?Wi(e):!0}:Wi,cS=z,Fc=!cS(function(){return Object.isExtensible(Object.preventExtensions({}))}),uS=D,fS=L,pS=ZA,mS=pe,ys=re,vS=De.f,fl=UA,bS=_I,ws=hS,yS=TI,wS=Fc,Bc=!1,ft=yS("meta"),xS=0,xs=function(i){vS(i,ft,{value:{objectID:"O"+xS++,weakData:{}}})},ES=function(i,e){if(!mS(i))return typeof i=="symbol"?i:(typeof i=="string"?"S":"P")+i;if(!ys(i,ft)){if(!ws(i))return"F";if(!e)return"E";xs(i)}return i[ft].objectID},TS=function(i,e){if(!ys(i,ft)){if(!ws(i))return!0;if(!e)return!1;xs(i)}return i[ft].weakData},OS=function(i){return wS&&Bc&&ws(i)&&!ys(i,ft)&&xs(i),i},PS=function(){SS.enable=function(){},Bc=!0;var i=fl.f,e=fS([].splice),t={};t[ft]=1,i(t).length&&(fl.f=function(g){for(var A=i(g),I=0,C=A.length;I<C;I++)if(A[I]===ft){e(A,I,1);break}return A},uS({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:bS.f}))},SS=Mc.exports={enable:PS,fastKey:ES,getWeakData:TS,onFreeze:OS};pS[ft]=!0;var YI=Mc.exports,RS=te,DS=Yg,NS=RS("iterator"),_S=Array.prototype,kS=function(i){return i!==void 0&&(DS.Array===i||_S[NS]===i)},MS=yt,pl=Qr,FS=Lg,BS=Yg,zS=te,LS=zS("iterator"),zc=function(i){if(!FS(i))return pl(i,LS)||pl(i,"@@iterator")||BS[MS(i)]},ZS=Ke,GS=Ig,jS=bt,VS=FA,YS=zc,WS=TypeError,Lc=function(i,e){var t=arguments.length<2?YS(i):e;if(GS(t))return jS(ZS(t,i));throw new WS(VS(i)+" is not iterable")},US=Ke,ml=bt,HS=Qr,KS=function(i,e,t){var g,A;ml(i);try{if(g=HS(i,"return"),!g){if(e==="throw")throw t;return t}g=US(g,i)}catch(I){A=!0,g=I}if(e==="throw")throw t;if(A)throw g;return ml(g),t},QS=zA,XS=Ke,$S=bt,JS=FA,qS=kS,eR=ze,vl=J,tR=Lc,gR=zc,bl=KS,AR=TypeError,Ui=function(i,e){this.stopped=i,this.result=e},yl=Ui.prototype,Es=function(i,e,t){var g=t&&t.that,A=!!(t&&t.AS_ENTRIES),I=!!(t&&t.IS_RECORD),C=!!(t&&t.IS_ITERATOR),n=!!(t&&t.INTERRUPTED),r=QS(e,g),s,o,a,l,d,h,c,u=function(p){return s&&bl(s,"normal",p),new Ui(!0,p)},f=function(p){return A?($S(p),n?r(p[0],p[1],u):r(p[0],p[1])):n?r(p,u):r(p)};if(I)s=i.iterator;else if(C)s=i;else{if(o=gR(i),!o)throw new AR(JS(i)+" is not iterable");if(qS(o)){for(a=0,l=eR(i);l>a;a++)if(d=f(i[a]),d&&vl(yl,d))return d;return new Ui(!1)}s=tR(i,o)}for(h=I?i.next:s.next;!(c=XS(h,s)).done;){try{d=f(c.value)}catch(p){bl(s,"throw",p)}if(typeof d=="object"&&d&&vl(yl,d))return d}return new Ui(!1)},iR=J,IR=TypeError,Ts=function(i,e){if(iR(e,i))return i;throw new IR("Incorrect invocation")},CR=D,nR=$,rR=YI,sR=z,oR=jg,aR=Es,lR=Ts,dR=ue,hR=pe,cR=Lg,uR=Vg,fR=De.f,pR=jt.forEach,mR=ne,Zc=ng,vR=Zc.set,bR=Zc.getterFor,Os=function(i,e,t){var g=i.indexOf("Map")!==-1,A=i.indexOf("Weak")!==-1,I=g?"set":"add",C=nR[i],n=C&&C.prototype,r={},s;if(!mR||!dR(C)||!(A||n.forEach&&!sR(function(){new C().entries().next()})))s=t.getConstructor(e,i,g,I),rR.enable();else{s=e(function(l,d){vR(lR(l,o),{type:i,collection:new C}),cR(d)||aR(d,l[I],{that:l,AS_ENTRIES:g})});var o=s.prototype,a=bR(i);pR(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(l){var d=l==="add"||l==="set";l in n&&!(A&&l==="clear")&&oR(o,l,function(h,c){var u=a(this).collection;if(!d&&A&&!hR(h))return l==="get"?void 0:!1;var f=u[l](h===0?0:h,c);return d?this:f})}),A||fR(o,"size",{configurable:!0,get:function(){return a(this).collection.size}})}return uR(s,i,!1,!0),r[i]=s,CR({global:!0,forced:!0},r),A||t.setStrong(s,i,g),s},yR=HA,Ps=function(i,e,t){for(var g in e)t&&t.unsafe&&i[g]?i[g]=e[g]:yR(i,g,e[g],t);return i},wR=Xe,xR=As,ER=te,TR=ne,wl=ER("species"),OR=function(i){var e=wR(i);TR&&e&&!e[wl]&&xR(e,wl,{configurable:!0,get:function(){return this}})},PR=WA,SR=As,xl=Ps,RR=zA,DR=Ts,NR=Lg,_R=Es,kR=ss,Ni=os,MR=OR,iA=ne,El=YI.fastKey,Gc=ng,Tl=Gc.set,tn=Gc.getterFor,jc={getConstructor:function(i,e,t,g){var A=i(function(s,o){DR(s,I),Tl(s,{type:e,index:PR(null),first:void 0,last:void 0,size:0}),iA||(s.size=0),NR(o)||_R(o,s[g],{that:s,AS_ENTRIES:t})}),I=A.prototype,C=tn(e),n=function(s,o,a){var l=C(s),d=r(s,o),h,c;return d?d.value=a:(l.last=d={index:c=El(o,!0),key:o,value:a,previous:h=l.last,next:void 0,removed:!1},l.first||(l.first=d),h&&(h.next=d),iA?l.size++:s.size++,c!=="F"&&(l.index[c]=d)),s},r=function(s,o){var a=C(s),l=El(o),d;if(l!=="F")return a.index[l];for(d=a.first;d;d=d.next)if(d.key===o)return d};return xl(I,{clear:function(){for(var o=this,a=C(o),l=a.index,d=a.first;d;)d.removed=!0,d.previous&&(d.previous=d.previous.next=void 0),delete l[d.index],d=d.next;a.first=a.last=void 0,iA?a.size=0:o.size=0},delete:function(s){var o=this,a=C(o),l=r(o,s);if(l){var d=l.next,h=l.previous;delete a.index[l.index],l.removed=!0,h&&(h.next=d),d&&(d.previous=h),a.first===l&&(a.first=d),a.last===l&&(a.last=h),iA?a.size--:o.size--}return!!l},forEach:function(o){for(var a=C(this),l=RR(o,arguments.length>1?arguments[1]:void 0),d;d=d?d.next:a.first;)for(l(d.value,d.key,this);d&&d.removed;)d=d.previous},has:function(o){return!!r(this,o)}}),xl(I,t?{get:function(o){var a=r(this,o);return a&&a.value},set:function(o,a){return n(this,o===0?0:o,a)}}:{add:function(o){return n(this,o=o===0?0:o,o)}}),iA&&SR(I,"size",{configurable:!0,get:function(){return C(this).size}}),A},setStrong:function(i,e,t){var g=e+" Iterator",A=tn(e),I=tn(g);kR(i,e,function(C,n){Tl(this,{type:g,target:C,state:A(C),kind:n,last:void 0})},function(){for(var C=I(this),n=C.kind,r=C.last;r&&r.removed;)r=r.previous;return!C.target||!(C.last=r=r?r.next:C.state.first)?(C.target=void 0,Ni(void 0,!0)):Ni(n==="keys"?r.key:n==="values"?r.value:[r.key,r.value],!1)},t?"entries":"values",!t,!0),MR(e)}},FR=Os,BR=jc;FR("Map",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},BR);var Ss=L,zR=PI,LR=nt,ZR=NA,GR=Ss("".charAt),Ol=Ss("".charCodeAt),jR=Ss("".slice),Pl=function(i){return function(e,t){var g=LR(ZR(e)),A=zR(t),I=g.length,C,n;return A<0||A>=I?i?"":void 0:(C=Ol(g,A),C<55296||C>56319||A+1===I||(n=Ol(g,A+1))<56320||n>57343?i?GR(g,A):C:i?jR(g,A,A+2):(C-55296<<10)+(n-56320)+65536)}},VR={codeAt:Pl(!1),charAt:Pl(!0)},YR=VR.charAt,WR=nt,Vc=ng,UR=ss,Sl=os,Yc="String Iterator",HR=Vc.set,KR=Vc.getterFor(Yc);UR(String,"String",function(i){HR(this,{type:Yc,string:WR(i),index:0})},function(){var e=KR(this),t=e.string,g=e.index,A;return g>=t.length?Sl(void 0,!0):(A=YR(t,g),e.index+=A.length,Sl(A,!1))});var QR=Z,XR=QR.Map,$R=XR,JR=$R,qR=JR,Ai=R(qR),Hn=class{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},ee(this.options,this.defaultOptions)}setOptions(e){let t=["useDefaultGroups"];if(e!==void 0){for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)&&G(t).call(t,g)===-1){let A=e[g];this.add(g,A)}}}clear(){this._groups=new Ai,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,g=this._groups.get(e);if(g===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){let A=this._groupIndex%this._groupNames.length;++this._groupIndex,g={},g.color=this._groups.get(this._groupNames[A]),this._groups.set(e,g)}else{let A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,g={},g.color=this._defaultGroups[A],this._groups.set(e,g)}return g}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}},eD=D;eD({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var tD=Z,gD=tD.Number.isNaN,AD=gD,iD=AD,ID=iD,Kn=R(ID),CD=$,nD=CD.isFinite,rD=Number.isFinite||function(e){return typeof e=="number"&&nD(e)},sD=D,oD=rD;sD({target:"Number",stat:!0},{isFinite:oD});var aD=Z,lD=aD.Number.isFinite,dD=lD,hD=dD,cD=hD,Qt=R(cD),uD=D,fD=jt.some,pD=Wg,mD=pD("some");uD({target:"Array",proto:!0,forced:!mD},{some:function(e){return fD(this,e,arguments.length>1?arguments[1]:void 0)}});var vD=Ie,bD=vD("Array").some,yD=J,wD=bD,gn=Array.prototype,xD=function(i){var e=i.some;return i===gn||yD(gn,i)&&e===gn.some?wD:e},ED=xD,TD=ED,OD=TD,Wc=R(OD),PD=Z,SD=PD.Object.getOwnPropertySymbols,RD=SD,DD=RD,ND=DD,it=R(ND),Uc={exports:{}},_D=D,kD=z,MD=Qe,Hc=SA.f,Kc=ne,FD=!Kc||kD(function(){Hc(1)});_D({target:"Object",stat:!0,forced:FD,sham:!Kc},{getOwnPropertyDescriptor:function(e,t){return Hc(MD(e),t)}});var BD=Z,Qc=BD.Object,zD=Uc.exports=function(e,t){return Qc.getOwnPropertyDescriptor(e,t)};Qc.getOwnPropertyDescriptor.sham&&(zD.sham=!0);var LD=Uc.exports,ZD=LD,GD=ZD,jD=GD,rt=R(jD),VD=D,YD=ne,WD=Nh,UD=Qe,HD=SA,KD=VA;VD({target:"Object",stat:!0,sham:!YD},{getOwnPropertyDescriptors:function(e){for(var t=UD(e),g=HD.f,A=WD(t),I={},C=0,n,r;A.length>C;)r=g(t,n=A[C++]),r!==void 0&&KD(I,n,r);return I}});var QD=Z,XD=QD.Object.getOwnPropertyDescriptors,$D=XD,JD=$D,qD=JD,It=R(qD),Xc={exports:{}},eN=D,tN=ne,Rl=DI.f;eN({target:"Object",stat:!0,forced:Object.defineProperties!==Rl,sham:!tN},{defineProperties:Rl});var gN=Z,$c=gN.Object,AN=Xc.exports=function(e,t){return $c.defineProperties(e,t)};$c.defineProperties.sham&&(AN.sham=!0);var iN=Xc.exports,IN=iN,CN=IN,nN=CN,ii=R(nN),Jc={exports:{}},rN=D,sN=ne,Dl=De.f;rN({target:"Object",stat:!0,forced:Object.defineProperty!==Dl,sham:!sN},{defineProperty:Dl});var oN=Z,qc=oN.Object,aN=Jc.exports=function(e,t,g){return qc.defineProperty(e,t,g)};qc.defineProperty.sham&&(aN.sham=!0);var lN=Jc.exports,dN=lN,eu=dN,hN=eu,cN=hN,uN=cN,fN=uN,pN=fN,mN=R(pN),vN=te,bN=De.f,Nl=vN("metadata"),_l=Function.prototype;_l[Nl]===void 0&&bN(_l,Nl,{value:null});var yN=q;yN("asyncDispose");var wN=q;wN("dispose");var xN=q;xN("metadata");var EN=Dh,TN=EN,ON=Xe,PN=L,Rs=ON("Symbol"),SN=Rs.keyFor,RN=PN(Rs.prototype.valueOf),tu=Rs.isRegisteredSymbol||function(e){try{return SN(RN(e))!==void 0}catch(t){return!1}},DN=D,NN=tu;DN({target:"Symbol",stat:!0},{isRegisteredSymbol:NN});var _N=Gg,gu=Xe,kN=L,MN=MA,FN=te,CI=gu("Symbol"),kl=CI.isWellKnownSymbol,Au=gu("Object","getOwnPropertyNames"),BN=kN(CI.prototype.valueOf),Ml=_N("wks");for(_i=0,An=Au(CI),Fl=An.length;_i<Fl;_i++)try{In=An[_i],MN(CI[In])&&FN(In)}catch(i){}var In,_i,An,Fl,iu=function(e){if(kl&&kl(e))return!0;try{for(var t=BN(e),g=0,A=Au(Ml),I=A.length;g<I;g++)if(Ml[A[g]]==t)return!0}catch(C){}return!1},zN=D,LN=iu;zN({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:LN});var ZN=q;ZN("matcher");var GN=q;GN("observable");var jN=D,VN=tu;jN({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:VN});var YN=D,WN=iu;YN({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:WN});var UN=q;UN("metadataKey");var HN=q;HN("patternMatch");var KN=q;KN("replaceAll");var QN=TN,XN=QN,$N=XN,ki=R($N),JN=KA,qN=JN.f("iterator"),e_=qN,Iu=e_,t_=Iu,g_=t_,A_=g_,i_=A_,I_=i_,C_=R(I_);function EA(i){"@babel/helpers - typeof";return EA=typeof ki=="function"&&typeof C_=="symbol"?function(e){return typeof e}:function(e){return e&&typeof ki=="function"&&e.constructor===ki&&e!==ki.prototype?"symbol":typeof e},EA(i)}var n_=KA,r_=n_.f("toPrimitive"),s_=r_,o_=s_,a_=o_,l_=a_,d_=l_,h_=d_,c_=h_,u_=R(c_);function f_(i,e){if(EA(i)!=="object"||i===null)return i;var t=i[u_];if(t!==void 0){var g=t.call(i,e||"default");if(EA(g)!=="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function p_(i){var e=f_(i,"string");return EA(e)==="symbol"?e:String(e)}function ge(i,e,t){return e=p_(e),e in i?mN(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var m_=Ig,v_=Re,b_=EI,y_=ze,w_=TypeError,Bl=function(i){return function(e,t,g,A){m_(t);var I=v_(e),C=b_(I),n=y_(I),r=i?n-1:0,s=i?-1:1;if(g<2)for(;;){if(r in C){A=C[r],r+=s;break}if(r+=s,i?r<0:n<=r)throw new w_("Reduce of empty array with no initial value")}for(;i?r>=0:n>r;r+=s)r in C&&(A=t(A,C[r],r,I));return A}},x_={left:Bl(!1),right:Bl(!0)},E_=$,T_=vt,O_=T_(E_.process)==="process",P_=D,S_=x_.left,R_=Wg,zl=kA,D_=O_,N_=!D_&&zl>79&&zl<83,__=N_||!R_("reduce");P_({target:"Array",proto:!0,forced:__},{reduce:function(e){var t=arguments.length;return S_(this,e,t,t>1?arguments[1]:void 0)}});var k_=Ie,M_=k_("Array").reduce,F_=J,B_=M_,Cn=Array.prototype,z_=function(i){var e=i.reduce;return i===Cn||F_(Cn,i)&&e===Cn.reduce?B_:e},L_=z_,Z_=L_,G_=Z_,Ds=R(G_),j_=Gt,V_=ze,Y_=es,W_=zA,Cu=function(i,e,t,g,A,I,C,n){for(var r=A,s=0,o=C?W_(C,n):!1,a,l;s<g;)s in t&&(a=o?o(t[s],s,e):t[s],I>0&&j_(a)?(l=V_(a),r=Cu(i,e,a,l,r,I-1)-1):(Y_(r+1),i[r]=a),r++),s++;return r},U_=Cu,H_=D,K_=U_,Q_=Ig,X_=Re,$_=ze,J_=RI;H_({target:"Array",proto:!0},{flatMap:function(e){var t=X_(this),g=$_(t),A;return Q_(e),A=J_(t,0),A.length=K_(A,t,t,g,0,1,e,arguments.length>1?arguments[1]:void 0),A}});var q_=Ie,gB=q_("Array").flatMap;var AB=Array.prototype;var ek=Iu,Sg=R(ek),tk=Os,gk=jc;tk("Set",function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},gk);var Ak=Z,ik=Ak.Set,Ik=ik,Ck=Ik,nk=Ck,We=R(nk),rk=Lc,sk=rk,ok=sk,ak=ok,lk=ak,dk=lk,hk=dk,ck=hk,uk=ck,fk=uk,nn=R(fk),Ll=Qd,pk=Math.floor,Qn=function(i,e){var t=i.length,g=pk(t/2);return t<8?mk(i,e):vk(i,Qn(Ll(i,0,g),e),Qn(Ll(i,g),e),e)},mk=function(i,e){for(var t=i.length,g=1,A,I;g<t;){for(I=g,A=i[g];I&&e(i[I-1],A)>0;)i[I]=i[--I];I!==g++&&(i[I]=A)}return i},vk=function(i,e,t,g){for(var A=e.length,I=t.length,C=0,n=0;C<A||n<I;)i[C+n]=C<A&&n<I?g(e[C],t[n])<=0?e[C++]:t[n++]:C<A?e[C++]:t[n++];return i},bk=Qn,yk=_A,Zl=yk.match(/firefox\/(\d+)/i),wk=!!Zl&&+Zl[1],xk=_A,Ek=/MSIE|Trident/.test(xk),Tk=_A,Gl=Tk.match(/AppleWebKit\/(\d+)\./),Ok=!!Gl&&+Gl[1],Pk=D,nu=L,Sk=Ig,Rk=Re,jl=ze,Dk=Mh,Vl=nt,Ns=z,Nk=bk,_k=Wg,Yl=wk,kk=Ek,Wl=kA,Ul=Ok,_t=[],Hl=nu(_t.sort),Mk=nu(_t.push),Fk=Ns(function(){_t.sort(void 0)}),Bk=Ns(function(){_t.sort(null)}),zk=_k("sort"),ru=!Ns(function(){if(Wl)return Wl<70;if(!(Yl&&Yl>3)){if(kk)return!0;if(Ul)return Ul<603;var i="",e,t,g,A;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:g=3;break;case 68:case 71:g=4;break;default:g=2}for(A=0;A<47;A++)_t.push({k:t+A,v:g})}for(_t.sort(function(I,C){return C.v-I.v}),A=0;A<_t.length;A++)t=_t[A].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!=="DGBEFHACIJK"}}),Lk=Fk||!Bk||!zk||!ru,Zk=function(i){return function(e,t){return t===void 0?-1:e===void 0?1:i!==void 0?+i(e,t)||0:Vl(e)>Vl(t)?1:-1}};Pk({target:"Array",proto:!0,forced:Lk},{sort:function(e){e!==void 0&&Sk(e);var t=Rk(this);if(ru)return e===void 0?Hl(t):Hl(t,e);var g=[],A=jl(t),I,C;for(C=0;C<A;C++)C in t&&Mk(g,t[C]);for(Nk(g,Zk(e)),I=jl(g),C=0;C<I;)t[C]=g[C++];for(;C<A;)Dk(t,C++);return t}});var Gk=Ie,jk=Gk("Array").sort,Vk=J,Yk=jk,rn=Array.prototype,Wk=function(i){var e=i.sort;return i===rn||Vk(rn,i)&&e===rn.sort?Yk:e},Uk=Wk,Hk=Uk,Kk=Hk,ct=R(Kk),Qk=Ie,Xk=Qk("Array").keys,$k=Xk,Jk=$k,qk=yt,eM=re,tM=J,gM=Jk,sn=Array.prototype,AM={DOMTokenList:!0,NodeList:!0},iM=function(i){var e=i.keys;return i===sn||tM(sn,i)&&e===sn.keys||eM(AM,qk(i))?gM:e},IM=iM,xg=R(IM),CM=Ie,nM=CM("Array").values,rM=nM,sM=rM,oM=yt,aM=re,lM=J,dM=sM,on=Array.prototype,hM={DOMTokenList:!0,NodeList:!0},cM=function(i){var e=i.values;return i===on||lM(on,i)&&e===on.values||aM(hM,oM(i))?dM:e},uM=cM,nI=R(uM),fM=Ie,pM=fM("Array").entries,mM=pM,vM=mM,bM=yt,yM=re,wM=J,xM=vM,an=Array.prototype,EM={DOMTokenList:!0,NodeList:!0},TM=function(i){var e=i.entries;return i===an||wM(an,i)&&e===an.entries||yM(EM,bM(i))?xM:e},OM=TM,PM=R(OM),SM=eu,Ii=R(SM),Mi,RM=new Uint8Array(16);function DM(){if(!Mi&&(Mi=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Mi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Mi(RM)}var de=[];for(let i=0;i<256;++i)de.push((i+256).toString(16).slice(1));function NM(i,e=0){return de[i[e+0]]+de[i[e+1]]+de[i[e+2]]+de[i[e+3]]+"-"+de[i[e+4]]+de[i[e+5]]+"-"+de[i[e+6]]+de[i[e+7]]+"-"+de[i[e+8]]+de[i[e+9]]+"-"+de[i[e+10]]+de[i[e+11]]+de[i[e+12]]+de[i[e+13]]+de[i[e+14]]+de[i[e+15]]}var _M=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Kl={randomUUID:_M};function Dg(i,e,t){if(Kl.randomUUID&&!e&&!i)return Kl.randomUUID();i=i||{};let g=i.random||(i.rng||DM)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,e){t=t||0;for(let A=0;A<16;++A)e[t+A]=g[A];return e}return NM(g)}function Ql(i,e){var t=K(i);if(it){var g=it(i);e&&(g=Ae(g).call(g,function(A){return rt(i,A).enumerable})),t.push.apply(t,g)}return t}function Xl(i){for(var e=1;e<arguments.length;e++){var t,g,A=arguments[e]!=null?arguments[e]:{};e%2?F(t=Ql(Object(A),!0)).call(t,function(I){ge(i,I,A[I])}):It?ii(i,It(A)):F(g=Ql(Object(A))).call(g,function(I){Ii(i,I,rt(A,I))})}return i}function $l(i){return typeof i=="string"||typeof i=="number"}var Xn=class i{constructor(e){ge(this,"delay",void 0),ge(this,"max",void 0),ge(this,"_queue",[]),ge(this,"_timeout",null),ge(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let g=new i(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{g.flush()};let A=[{name:"flush",original:void 0}];if(t&&t.replace)for(let I=0;I<t.replace.length;I++){let C=t.replace[I];A.push({name:C,original:e[C]}),g.replace(e,C)}return g._extended={object:e,methods:A},g}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let g=0;g<t.length;g++){let A=t[g];A.original?e[A.name]=A.original:delete e[A.name]}this._extended=null}}replace(e,t){let g=this,A=e[t];if(!A)throw new Error("Method "+t+" undefined");e[t]=function(){for(var I=arguments.length,C=new Array(I),n=0;n<I;n++)C[n]=arguments[n];g.queue({args:C,fn:A,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=gt(()=>{this.flush()},this.delay))}flush(){var e,t;F(e=tt(t=this._queue).call(t,0)).call(e,g=>{g.fn.apply(g.context||g.fn,g.args||[])})}},$n=class i{constructor(){ge(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),ge(this,"subscribe",i.prototype.on),ge(this,"unsubscribe",i.prototype.off)}_trigger(e,t,g){var A;if(e==="*")throw new Error("Cannot trigger event *");F(A=[...this._subscribers[e],...this._subscribers["*"]]).call(A,I=>{I(e,t,g!=null?g:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){var g;this._subscribers[e]=Ae(g=this._subscribers[e]).call(g,A=>A!==t)}},rI=class i{constructor(e){ge(this,"_pairs",void 0),this._pairs=e}*[Sg](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){var e;return he(e=[...this._pairs]).call(e,t=>t[0])}toItemArray(){var e;return he(e=[...this._pairs]).call(e,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Ft(null);for(let[t,g]of this._pairs)e[t]=g;return e}toMap(){return new Ai(this._pairs)}toIdSet(){return new We(this.toIdArray())}toItemSet(){return new We(this.toItemArray())}cache(){return new i([...this._pairs])}distinct(e){let t=new We;for(let[g,A]of this._pairs)t.add(e(A,g));return t}filter(e){let t=this._pairs;return new i({*[Sg](){for(let[g,A]of t)e(A,g)&&(yield[g,A])}})}forEach(e){for(let[t,g]of this._pairs)e(g,t)}map(e){let t=this._pairs;return new i({*[Sg](){for(let[g,A]of t)yield[g,e(A,g)]}})}max(e){let t=nn(this._pairs),g=t.next();if(g.done)return null;let A=g.value[1],I=e(g.value[1],g.value[0]);for(;!(g=t.next()).done;){let[C,n]=g.value,r=e(n,C);r>I&&(I=r,A=n)}return A}min(e){let t=nn(this._pairs),g=t.next();if(g.done)return null;let A=g.value[1],I=e(g.value[1],g.value[0]);for(;!(g=t.next()).done;){let[C,n]=g.value,r=e(n,C);r<I&&(I=r,A=n)}return A}reduce(e,t){for(let[g,A]of this._pairs)t=e(t,A,g);return t}sort(e){return new i({[Sg]:()=>{var t;return nn(ct(t=[...this._pairs]).call(t,(g,A)=>{let[I,C]=g,[n,r]=A;return e(C,r,I,n)}))}})}};function kM(i,e){return i[e]==null&&(i[e]=Dg()),i}var pt=class extends $n{get idProp(){return this._idProp}constructor(e,t){super(),ge(this,"flush",void 0),ge(this,"length",void 0),ge(this,"_options",void 0),ge(this,"_data",void 0),ge(this,"_idProp",void 0),ge(this,"_queue",null),e&&!B(e)&&(t=e,e=[]),this._options=t||{},this._data=new Ai,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Xn.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,t){let g=[],A;if(B(e)){let I=he(e).call(e,C=>C[this._idProp]);if(Wc(I).call(I,C=>this._data.has(C)))throw new Error("A duplicate id was found in the parameter array.");for(let C=0,n=e.length;C<n;C++)A=this._addItem(e[C]),g.push(A)}else if(e&&typeof e=="object")A=this._addItem(e),g.push(A);else throw new Error("Unknown dataType");return g.length&&this._trigger("add",{items:g},t),g}update(e,t){let g=[],A=[],I=[],C=[],n=this._idProp,r=s=>{let o=s[n];if(o!=null&&this._data.has(o)){let a=s,l=ee({},this._data.get(o)),d=this._updateItem(a);A.push(d),C.push(a),I.push(l)}else{let a=this._addItem(s);g.push(a)}};if(B(e))for(let s=0,o=e.length;s<o;s++)e[s]&&typeof e[s]=="object"?r(e[s]):console.warn("Ignoring input item, which is not an object at index "+s);else if(e&&typeof e=="object")r(e);else throw new Error("Unknown dataType");if(g.length&&this._trigger("add",{items:g},t),A.length){let s={items:A,oldData:I,data:C};this._trigger("update",s,t)}return Bh(g).call(g,A)}updateOnly(e,t){var g;B(e)||(e=[e]);let A=he(g=he(e).call(e,I=>{let C=this._data.get(I[this._idProp]);if(C==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:C,update:I}})).call(g,I=>{let{oldData:C,update:n}=I,r=C[this._idProp],s=dP(C,n);return this._data.set(r,s),{id:r,oldData:C,updatedData:s}});if(A.length){let I={items:he(A).call(A,C=>C.id),oldData:he(A).call(A,C=>C.oldData),data:he(A).call(A,C=>C.updatedData)};return this._trigger("update",I,t),I.items}else return[]}get(e,t){let g,A,I;$l(e)?(g=e,I=t):B(e)?(A=e,I=t):I=e;let C=I&&I.returnType==="Object"?"Object":"Array",n=I&&Ae(I),r=[],s,o,a;if(g!=null)s=this._data.get(g),s&&n&&!n(s)&&(s=void 0);else if(A!=null)for(let h=0,c=A.length;h<c;h++)s=this._data.get(A[h]),s!=null&&(!n||n(s))&&r.push(s);else{var l;o=[...xg(l=this._data).call(l)];for(let h=0,c=o.length;h<c;h++)a=o[h],s=this._data.get(a),s!=null&&(!n||n(s))&&r.push(s)}if(I&&I.order&&g==null&&this._sort(r,I.order),I&&I.fields){let h=I.fields;if(g!=null&&s!=null)s=this._filterFields(s,h);else for(let c=0,u=r.length;c<u;c++)r[c]=this._filterFields(r[c],h)}if(C=="Object"){let h={};for(let c=0,u=r.length;c<u;c++){let f=r[c],p=f[this._idProp];h[p]=f}return h}else if(g!=null){var d;return(d=s)!==null&&d!==void 0?d:null}else return r}getIds(e){let t=this._data,g=e&&Ae(e),A=e&&e.order,I=[...xg(t).call(t)],C=[];if(g)if(A){let n=[];for(let r=0,s=I.length;r<s;r++){let o=I[r],a=this._data.get(o);a!=null&&g(a)&&n.push(a)}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)C.push(n[r][this._idProp])}else for(let n=0,r=I.length;n<r;n++){let s=I[n],o=this._data.get(s);o!=null&&g(o)&&C.push(o[this._idProp])}else if(A){let n=[];for(let r=0,s=I.length;r<s;r++){let o=I[r];n.push(t.get(o))}this._sort(n,A);for(let r=0,s=n.length;r<s;r++)C.push(n[r][this._idProp])}else for(let n=0,r=I.length;n<r;n++){let s=I[n],o=t.get(s);o!=null&&C.push(o[this._idProp])}return C}getDataSet(){return this}forEach(e,t){let g=t&&Ae(t),A=this._data,I=[...xg(A).call(A)];if(t&&t.order){let C=this.get(t);for(let n=0,r=C.length;n<r;n++){let s=C[n],o=s[this._idProp];e(s,o)}}else for(let C=0,n=I.length;C<n;C++){let r=I[C],s=this._data.get(r);s!=null&&(!g||g(s))&&e(s,r)}}map(e,t){let g=t&&Ae(t),A=[],I=this._data,C=[...xg(I).call(I)];for(let n=0,r=C.length;n<r;n++){let s=C[n],o=this._data.get(s);o!=null&&(!g||g(o))&&A.push(e(o,s))}return t&&t.order&&this._sort(A,t.order),A}_filterFields(e,t){var g;return e&&Ds(g=B(t)?t:K(t)).call(g,(A,I)=>(A[I]=e[I],A),{})}_sort(e,t){if(typeof t=="string"){let g=t;ct(e).call(e,(A,I)=>{let C=A[g],n=I[g];return C>n?1:C<n?-1:0})}else if(typeof t=="function")ct(e).call(e,t);else throw new TypeError("Order must be a function or a string")}remove(e,t){let g=[],A=[],I=B(e)?e:[e];for(let C=0,n=I.length;C<n;C++){let r=this._remove(I[C]);if(r){let s=r[this._idProp];s!=null&&(g.push(s),A.push(r))}}return g.length&&this._trigger("remove",{items:g,oldData:A},t),g}_remove(e){let t;if($l(e)?t=e:e&&typeof e=="object"&&(t=e[this._idProp]),t!=null&&this._data.has(t)){let g=this._data.get(t)||null;return this._data.delete(t),--this.length,g}return null}clear(e){var t;let g=[...xg(t=this._data).call(t)],A=[];for(let I=0,C=g.length;I<C;I++)A.push(this._data.get(g[I]));return this._data.clear(),this.length=0,this._trigger("remove",{items:g,oldData:A},e),g}max(e){let t=null,g=null;for(let I of nI(A=this._data).call(A)){var A;let C=I[e];typeof C=="number"&&(g==null||C>g)&&(t=I,g=C)}return t||null}min(e){let t=null,g=null;for(let I of nI(A=this._data).call(A)){var A;let C=I[e];typeof C=="number"&&(g==null||C<g)&&(t=I,g=C)}return t||null}distinct(e){let t=this._data,g=[...xg(t).call(t)],A=[],I=0;for(let C=0,n=g.length;C<n;C++){let r=g[C],o=t.get(r)[e],a=!1;for(let l=0;l<I;l++)if(A[l]==o){a=!0;break}!a&&o!==void 0&&(A[I]=o,I++)}return A}_addItem(e){let t=kM(e,this._idProp),g=t[this._idProp];if(this._data.has(g))throw new Error("Cannot add item: item with id "+g+" already exists");return this._data.set(g,t),++this.length,g}_updateItem(e){let t=e[this._idProp];if(t==null)throw new Error("Cannot update item: item has no id (item: "+Ug(e)+")");let g=this._data.get(t);if(!g)throw new Error("Cannot update item: no item with id "+t+" found");return this._data.set(t,Xl(Xl({},g),e)),t}stream(e){if(e){let g=this._data;return new rI({*[Sg](){for(let A of e){let I=g.get(A);I!=null&&(yield[A,I])}}})}else{var t;return new rI({[Sg]:y(t=PM(this._data)).call(t,this._data)})}}};function MM(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof e.add=="function"&&typeof e.clear=="function"&&typeof e.distinct=="function"&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof he(e)=="function"&&typeof e.max=="function"&&typeof e.min=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.remove=="function"&&typeof e.setOptions=="function"&&typeof e.stream=="function"&&typeof e.update=="function"&&typeof e.updateOnly=="function"}function su(i,e){return typeof e=="object"&&e!==null&&i===e.idProp&&typeof F(e)=="function"&&typeof e.get=="function"&&typeof e.getDataSet=="function"&&typeof e.getIds=="function"&&typeof e.length=="number"&&typeof he(e)=="function"&&typeof e.off=="function"&&typeof e.on=="function"&&typeof e.stream=="function"&&MM(i,e.getDataSet())}var ou=$,FM=z,BM=L,zM=nt,LM=Gh.trim,ZM=as,GM=BM("".charAt),sI=ou.parseFloat,Jl=ou.Symbol,ql=Jl&&Jl.iterator,jM=1/sI(ZM+"-0")!==-1/0||ql&&!FM(function(){sI(Object(ql))}),VM=jM?function(e){var t=LM(zM(e)),g=sI(t);return g===0&&GM(t,0)==="-"?-0:g}:sI,YM=D,ed=VM;YM({global:!0,forced:parseFloat!==ed},{parseFloat:ed});var WM=Z,UM=WM.parseFloat,HM=UM,KM=HM,QM=KM,au=R(QM),XM=D,$M=z,JM=_I.f,qM=$M(function(){return!Object.getOwnPropertyNames(1)});XM({target:"Object",stat:!0,forced:qM},{getOwnPropertyNames:JM});var eF=Z,tF=eF.Object,gF=function(e){return tF.getOwnPropertyNames(e)},AF=gF,iF=AF,IF=iF,CF=R(IF);function _s(i,e){let t=["node","edge","label"],g=!0,A=Rt(e,"chosen");if(typeof A=="boolean")g=A;else if(typeof A=="object"){if(G(t).call(t,i)===-1)throw new Error("choosify: subOption '"+i+"' should be one of '"+t.join("', '")+"'");let I=Rt(e,["chosen",i]);(typeof I=="boolean"||typeof I=="function")&&(g=I)}return g}function Jn(i,e,t){if(i.width<=0||i.height<=0)return!1;if(t!==void 0){let I={x:e.x-t.x,y:e.y-t.y};if(t.angle!==0){let C=-t.angle;e={x:Math.cos(C)*I.x-Math.sin(C)*I.y,y:Math.sin(C)*I.x+Math.cos(C)*I.y}}else e=I}let g=i.x+i.width,A=i.y+i.width;return i.left<e.x&&g>e.x&&i.top<e.y&&A>e.y}function oI(i){return typeof i=="string"&&i!==""}function lu(i,e,t,g){let A=g.x,I=g.y;if(typeof g.distanceToBorder=="function"){let C=g.distanceToBorder(i,e),n=Math.sin(e)*C,r=Math.cos(e)*C;r===C?(A+=C,I=g.y):n===C?(A=g.x,I-=C):(A+=r,I-=n)}else g.shape.width>g.shape.height?(A=g.x+g.shape.width*.5,I=g.y-t):(A=g.x+t,I=g.y-g.shape.height*.5);return{x:A,y:I}}var qn=class{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let A=t;(t===void 0||t==="")&&(A=" ");let I=this.measureText(A,g),C=ee({},nI(I));C.text=t,C.width=I.width,C.mod=g,(t===void 0||t==="")&&(C.width=0),this.lines[e].blocks.push(C),this.lines[e].width+=C.width}curWidth(){let e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;e<this.lines.length;e++){let t=this.lines[e],g=0;if(t.blocks!==void 0)for(let A=0;A<t.blocks.length;A++){let I=t.blocks[A];g<I.height&&(g=I.height)}t.height=g}}determineLabelSize(){let e=0,t=0;for(let g=0;g<this.lines.length;g++){let A=this.lines[g];A.width>e&&(e=A.width),t+=A.height}this.width=e,this.height=t}removeEmptyBlocks(){let e=[];for(let t=0;t<this.lines.length;t++){let g=this.lines[t];if(g.blocks.length===0||t===this.lines.length-1&&g.width===0)continue;let A={};ee(A,g),A.blocks=[];let I,C=[];for(let n=0;n<g.blocks.length;n++){let r=g.blocks[n];r.width!==0?C.push(r):I===void 0&&(I=r)}C.length===0&&I!==void 0&&C.push(I),A.blocks=C,e.push(A)}return e}finalize(){this.determineLineHeights(),this.determineLabelSize();let e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}},nF={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},aI=class{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,[g,A]=this.prepareRegExp(e),I=g.test(this.text.substr(this.position,A));return I&&t&&(this.position+=A-1),I}parseEndTag(e,t,g){let A=this.mod()===e;return e==="mono"?A=A&&this.mono:A=A&&!this.mono,A&&this.match(t)?(g!==void 0?(this.position===this.text.length-1||this.match(g,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,g;if(e instanceof RegExp)g=e,t=1;else{let A=nF[e];A!==void 0?g=A:g=new RegExp(e),t=e.length}return[g,t]}},er=class{constructor(e,t,g,A){this.ctx=e,this.parent=t,this.selected=g,this.hover=A;let I=(C,n)=>{if(C===void 0)return 0;let r=this.parent.getFormattingValues(e,g,A,n),s=0;return C!==""&&(s=this.ctx.measureText(C).width),{width:s,values:r}};this.lines=new qn(I)}process(e){if(!oI(e))return this.lines.finalize();let t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
652
653
  `),e=e.replace(/\r/g,`
653
- `);let t=String(e).split(`
654
- `),A=t.length;if(g.multi)for(let C=0;C<A;C++){let i=this.splitBlocks(t[C],g.multi);if(i!==void 0){if(i.length===0){this.lines.newLine("");continue}if(g.maxWdt>0)for(let n=0;n<i.length;n++){let r=i[n].mod,s=i[n].text;this.splitStringIntoLines(s,r,!0)}else for(let n=0;n<i.length;n++){let r=i[n].mod,s=i[n].text;this.lines.append(s,r)}this.lines.newLine()}}else if(g.maxWdt>0)for(let C=0;C<A;C++)this.splitStringIntoLines(t[C]);else for(let C=0;C<A;C++)this.lines.newLine(t[C]);return this.lines.finalize()}decodeMarkupSystem(e){let g="none";return e==="markdown"||e==="md"?g="markdown":(e===!0||e==="html")&&(g="html"),g}splitHtmlBlocks(e){let g=new NI(e),t=A=>/&/.test(A)?(g.replace(g.text,"&lt;","<")||g.replace(g.text,"&amp;","&")||g.add("&"),!0):!1;for(;g.position<g.text.length;){let A=g.text.charAt(g.position);g.parseWS(A)||/</.test(A)&&(g.parseStartTag("bold","<b>")||g.parseStartTag("ital","<i>")||g.parseStartTag("mono","<code>")||g.parseEndTag("bold","</b>")||g.parseEndTag("ital","</i>")||g.parseEndTag("mono","</code>"))||t(A)||g.add(A),g.position++}return g.emitBlock(),g.blocks}splitMarkdownBlocks(e){let g=new NI(e),t=!0,A=C=>/\\/.test(C)?(g.position<this.text.length+1&&(g.position++,C=this.text.charAt(g.position),/ \t/.test(C)?g.spacing=!0:(g.add(C),t=!1)),!0):!1;for(;g.position<g.text.length;){let C=g.text.charAt(g.position);g.parseWS(C)||A(C)||(t||g.spacing)&&(g.parseStartTag("bold","*")||g.parseStartTag("ital","_")||g.parseStartTag("mono","`"))||g.parseEndTag("bold","*","afterBold")||g.parseEndTag("ital","_","afterItal")||g.parseEndTag("mono","`","afterMono")||(g.add(C),t=!1),g.position++}return g.emitBlock(),g.blocks}splitBlocks(e,g){let t=this.decodeMarkupSystem(g);if(t==="none")return[{text:e,mod:"normal"}];if(t==="markdown")return this.splitMarkdownBlocks(e);if(t==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let g=this.ctx.measureText(e).width;return this.lines.curWidth()+g>this.parent.fontOptions.maxWdt}getLongestFit(e){let g="",t=0;for(;t<e.length;){let C=g+(g===""?"":" ")+e[t];if(this.overMaxWidth(C))break;g=C,t++}return t}getLongestFitWord(e){let g=0;for(;g<e.length&&!this.overMaxWidth(Le(e).call(e,0,g));)g++;return g}splitStringIntoLines(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,g),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=e.split("\r");for(;A.length>0;){let C=this.getLongestFit(A);if(C===0){let i=A[0],n=this.getLongestFitWord(i);this.lines.newLine(Le(i).call(i,0,n),g),A[0]=Le(i).call(i,n)}else{let i=C;A[C-1]===" "?C--:A[i]===" "&&i++;let n=Le(A).call(A,0,C).join("");C==A.length&&t?this.lines.append(n,g):this.lines.newLine(n,g),A=Le(A).call(A,i)}}}},kt=["bold","ital","boldital","mono"],RI=class I{constructor(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(g),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),SI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let g=e.font.size;g!==void 0&&(this.baseSize=g)}}}initFontOptions(e){if(k(kt,g=>{this.fontOptions[g]={}}),I.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}k(e,(g,t)=>{g!=null&&typeof g!="object"&&(this.fontOptions[t]=g)})}static parseFontString(e,g){if(!g||typeof g!="string")return!1;let t=g.split(" ");return e.size=+t[0].replace("px",""),e.face=t[1],e.color=t[2],!0}constrain(e){let g={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},t=mg(e,"widthConstraint");if(typeof t=="number")g.maxWdt=Number(t),g.minWdt=Number(t);else if(typeof t=="object"){let C=mg(e,["widthConstraint","maximum"]);typeof C=="number"&&(g.maxWdt=Number(C));let i=mg(e,["widthConstraint","minimum"]);typeof i=="number"&&(g.minWdt=Number(i))}let A=mg(e,"heightConstraint");if(typeof A=="number")g.minHgt=Number(A);else if(typeof A=="object"){let C=mg(e,["heightConstraint","minimum"]);typeof C=="number"&&(g.minHgt=Number(C));let i=mg(e,["heightConstraint","valign"]);typeof i=="string"&&(i==="top"||i==="bottom")&&(g.valign=i)}return g}update(e,g){this.setOptions(e,!0),this.propagateFonts(g),_(this.fontOptions,this.constrain(g)),this.fontOptions.chooser=Lr("label",g)}adjustSizes(e){let g=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=g,this.fontOptions.minWdt-=g);let t=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=t)}addFontOptionsToPile(e,g){for(let t=0;t<g.length;++t)this.addFontToPile(e,g[t])}addFontToPile(e,g){if(g===void 0||g.font===void 0||g.font===null)return;let t=g.font;e.push(t)}getBasicOptions(e){let g={};for(let t=0;t<e.length;++t){let A=e[t],C={};I.parseFontString(C,A)&&(A=C),k(A,(i,n)=>{i!==void 0&&(Object.prototype.hasOwnProperty.call(g,n)||(G(kt).call(kt,n)!==-1?g[n]={}:g[n]=i))})}return g}getFontOption(e,g,t){let A;for(let C=0;C<e.length;++C){let i=e[C];if(Object.prototype.hasOwnProperty.call(i,g)){if(A=i[g],A==null)continue;let n={};if(I.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,t))return A[t]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,t))return this.fontOptions[t];throw new Error("Did not find value for multi-font for property: '"+t+"'")}getFontOptions(e,g){let t={},A=["color","size","face","mod","vadjust"];for(let C=0;C<A.length;++C){let i=A[C];t[i]=this.getFontOption(e,g,i)}return t}propagateFonts(e){let g=[];this.addFontOptionsToPile(g,e),this.fontOptions=this.getBasicOptions(g);for(let t=0;t<kt.length;++t){let A=kt[t],C=this.fontOptions[A],i=this.getFontOptions(g,A);k(i,(n,r)=>{C[r]=n}),C.size=Number(C.size),C.vadjust=Number(C.vadjust)}}draw(e,g,t,A,C){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,A,C,g,t,i),this._drawBackground(e),this._drawText(e,g,this.size.yLine,i,n))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;let g=this.getSize();e.fillRect(g.left,g.top,g.width,g.height)}}_drawText(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",C=arguments.length>4?arguments[4]:void 0;[g,t]=this._setAlignment(e,g,t,A),e.textAlign="left",g=g-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(t-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(t+=(this.size.height-this.size.labelHeight)/2));for(let i=0;i<this.lineCount;i++){let n=this.lines[i];if(n&&n.blocks){let r=0;this.isEdgeLabel||this.fontOptions.align==="center"?r+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(r+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let o=n.blocks[s];e.font=o.font;let[d,a]=this._getColor(o.color,C,o.strokeColor);o.strokeWidth>0&&(e.lineWidth=o.strokeWidth,e.strokeStyle=a,e.lineJoin="round"),e.fillStyle=d,o.strokeWidth>0&&e.strokeText(o.text,g+r,t+o.vadjust),e.fillText(o.text,g+r,t+o.vadjust),r+=o.width}t+=n.height}}}_setAlignment(e,g,t,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){g=0,t=0;let C=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",t-=2*C):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",t+=2*C):e.textBaseline="middle"}else e.textBaseline=A;return[g,t]}_getColor(e,g,t){let A=e||"#000000",C=t||"#ffffff";if(g<=this.elementOptions.scaling.label.drawThreshold){let i=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-g)));A=Ne(A,i),C=Ne(C,i)}return[A,C]}getTextSize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,g,t),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,t=this.size.top-.5*2;if(this.isEdgeLabel){let C=-this.size.width*.5;switch(this.fontOptions.align){case"middle":g=C,t=-this.size.height*.5;break;case"top":g=C,t=-(this.size.height+2);break;case"bottom":g=C,t=2;break}}return{left:g,top:t,width:this.size.width,height:this.size.height}}calculateLabelSize(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,g,t),this.size.left=A-this.size.width*.5,this.size.top=C-this.size.height*.5,this.size.yLine=C+(1-this.lineCount)*.5*this.fontOptions.size,i==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,g,t,A){let C=function(r,s,o){return s==="normal"?o==="mod"?"":r[o]:r[s][o]!==void 0?r[s][o]:r[o]},i={color:C(this.fontOptions,A,"color"),size:C(this.fontOptions,A,"size"),face:C(this.fontOptions,A,"face"),mod:C(this.fontOptions,A,"mod"),vadjust:C(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(g||t)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?i.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(i,this.elementOptions.id,g,t));let n="";return i.mod!==void 0&&i.mod!==""&&(n+=i.mod+" "),n+=i.size+"px "+i.face,e.font=n.replace(/"/g,""),i.font=e.font,i.height=i.size,i}differentState(e,g){return e!==this.selectedState||g!==this.hoverState}_processLabelText(e,g,t,A){return new Cn(e,this,g,t).process(A)}_processLabel(e,g,t){if(this.labelDirty===!1&&!this.differentState(g,t))return;let A=this._processLabelText(e,g,t,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=g,this.hoverState=t,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},og=class{constructor(e,g,t){this.body=g,this.labelModule=t,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,g){let t=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}enableShadow(e,g){g.shadow&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,g){if(g.borderDashes!==!1)if(e.setLineDash!==void 0){let t=g.borderDashes;t===!0&&(t=[5,15]),e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1}disableBorderDashes(e,g){g.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,g.borderDashes=!1))}needsRefresh(e,g){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,g)}initContextForDraw(e,g){let t=g.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,t),e.strokeStyle=g.borderColor,e.fillStyle=g.color}performStroke(e,g){let t=g.borderWidth/this.body.view.scale;e.save(),t>0&&(this.enableBorderDashes(e,g),e.stroke(),this.disableBorderDashes(e,g)),e.restore()}performFill(e,g){e.save(),e.fillStyle=g.color,this.enableShadow(e,g),TA(e).call(e),this.disableShadow(e,g),e.restore(),this.performStroke(e,g)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,g,t,A,C){t!==void 0&&this.resize(t,A,C),this.left=e-this.width/2,this.top=g-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C)}getDimensionsFromLabel(e,g,t){this.textSize=this.labelModule.getTextSize(e,g,t);let A=this.textSize.width,C=this.textSize.height,i=14;return A===0&&(A=i,C=i),{width:A,height:C}}},Kk=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),rd(e,this.left,this.top,this.width,this.height,i.borderRadius),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}updateBoundingBox(e,g,t,A,C){this._updateBoundingBox(e,g,t,A,C);let i=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(i)}distanceToBorder(e,g){e&&this.resize(e);let t=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(g)),Math.abs(this.height/2/Math.sin(g)))+t}},eA=class extends og{constructor(e,g,t){super(e,g,t),this.labelOffset=0,this.selected=!1}setOptions(e,g,t){this.options=e,g===void 0&&t===void 0||this.setImages(g,t)}setImages(e,g){g&&this.selected?(this.imageObj=g,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=g)}switchImages(e){let g=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&g){let t=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=t}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let g=this.options.imagePadding;typeof g=="object"?(e.top=g.top,e.right=g.right,e.bottom=g.bottom,e.left=g.left):(e.top=g,e.right=g,e.bottom=g,e.left=g)}return e}_resizeImage(){let e,g;if(this.options.shapeProperties.useImageSize===!1){let t=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?t=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),e=this.options.size*2*t,g=this.options.size*2*A}else{let t=this._getImagePadding();e=this.imageObj.width+t.left+t.right,g=this.imageObj.height+t.top+t.bottom}this.width=e,this.height=g,this.radius=.5*this.width}_drawRawCircle(e,g,t,A){this.initContextForDraw(e,A),Cr(e,g,t,A.size),this.performFill(e,A)}_drawImageAtPosition(e,g){if(this.imageObj.width!=0){e.globalAlpha=g.opacity!==void 0?g.opacity:1,this.enableShadow(e,g);let t=1;this.options.shapeProperties.interpolation===!0&&(t=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),C=this.left+A.left,i=this.top+A.top,n=this.width-A.left-A.right,r=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,t,C,i,n,r),this.disableShadow(e,g)}}_drawImageLabel(e,g,t,A,C){let i=0;if(this.height!==void 0){i=this.height*.5;let r=this.labelModule.getTextSize(e,A,C);r.lineCount>=1&&(i+=r.height/2)}let n=t+i;this.options.label&&(this.labelOffset=i),this.labelModule.draw(e,g,n,A,C,"hanging")}},Qk=class extends eA{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t),C=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=C/2,this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this._drawRawCircle(e,g,t,i),this.updateBoundingBox(g,t),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,t,A,C)}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},nn=class extends eA{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C,this.radius=.5*this.width;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){this.switchImages(A),this.resize();let n=g,r=t;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this._drawRawCircle(e,n,r,i),e.save(),e.clip(),this._drawImageAtPosition(e,i),e.restore(),this._drawImageLabel(e,n,r,A,C),this.updateBoundingBox(g,t)}updateBoundingBox(e,g){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=g,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=g+this.options.size*2):(this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},qe=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(g,t)){var C,i;this.labelModule.getTextSize(e,g,t);let n=2*A.size;this.width=(C=this.customSizeWidth)!==null&&C!==void 0?C:n,this.height=(i=this.customSizeHeight)!==null&&i!==void 0?i:n,this.radius=.5*this.width}}_drawShape(e,g,t,A,C,i,n,r){return this.resize(e,i,n,r),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(e,r),Np(g)(e,A,C,r.size),this.performFill(e,r),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(i?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,A,C)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,i,n,A,C,"hanging");let s=C+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,A,s,i,n,"hanging")}this.updateBoundingBox(A,C)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=g+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}};function Da(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Xk(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Da(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Da(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var rn=class extends qe{constructor(e,g,t,A){super(e,g,t,A),this.ctxRenderer=A}draw(e,g,t,A,C,i){this.resize(e,A,C,i),this.left=g-this.width/2,this.top=t-this.height/2,e.save();let n=this.ctxRenderer({ctx:e,id:this.options.id,x:g,y:t,state:{selected:A,hover:C},style:Xk({},i),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let r=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),r(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},sn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){if(this.needsRefresh(g,t)){let C=this.getDimensionsFromLabel(e,g,t).width+this.margin.right+this.margin.left;this.width=C,this.height=C,this.radius=this.width/2}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.initContextForDraw(e,i),sd(e,g-this.width/2,t-this.height/2,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},Jk=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"diamond",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},on=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"circle",2,g,t,A,C,i)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},kI=class extends og{constructor(e,g,t){super(e,g,t)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(g,t)){let A=this.getDimensionsFromLabel(e,g,t);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width*.5,this.top=t-this.height*.5,this.initContextForDraw(e,i),Oi(e,this.left,this.top,this.width,this.height),this.performFill(e,i),this.updateBoundingBox(g,t,e,A,C),this.labelModule.draw(e,g,t,A,C)}distanceToBorder(e,g){e&&this.resize(e);let t=this.width*.5,A=this.height*.5,C=Math.sin(g)*t,i=Math.cos(g)*A;return t*A/Math.sqrt(C*C+i*i)}},an=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,g,t,A,C,i){return this.resize(e,A,C),this.options.icon.size=this.options.icon.size||50,this.left=g-this.width/2,this.top=t-this.height/2,this._icon(e,g,t,A,C,i),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,t+this.height/2+5,A),this.updateBoundingBox(g,t)}}}updateBoundingBox(e,g){this.boundingBox.top=g-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=g+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,g,t,A,C,i){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,i),e.fillText(this.options.icon.code,g,t),this.disableShadow(e,i)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},$k=class extends eA{constructor(e,g,t,A,C){super(e,g,t),this.setImages(A,C)}resize(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let C=this.options.size*2;this.width=C,this.height=C;return}this.needsRefresh(g,t)&&this._resizeImage()}draw(e,g,t,A,C,i){e.save(),this.switchImages(A),this.resize();let n=g,r=t;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=g,this.top=t,n+=this.width/2,r+=this.height/2):(this.left=g-this.width/2,this.top=t-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let s=this.options.borderWidth,o=this.options.borderWidthSelected||2*this.options.borderWidth,d=(A?o:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,d),e.beginPath();let a=A?this.options.color.highlight.border:C?this.options.color.hover.border:this.options.color.border,l=A?this.options.color.highlight.background:C?this.options.color.hover.background:this.options.color.background;i.opacity!==void 0&&(a=Ne(a,i.opacity),l=Ne(l,i.opacity)),e.strokeStyle=a,e.fillStyle=l,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),TA(e).call(e),this.performStroke(e,i),e.closePath()}this._drawImageAtPosition(e,i),this._drawImageLabel(e,n,r,A,C),this.updateBoundingBox(g,t),e.restore()}updateBoundingBox(e,g){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=g):(this.left=e-this.width/2,this.top=g-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},dn=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"square",2,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},ln=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"hexagon",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},hn=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"star",4,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},cn=class extends og{constructor(e,g,t){super(e,g,t),this._setMargins(t)}resize(e,g,t){this.needsRefresh(g,t)&&(this.textSize=this.labelModule.getTextSize(e,g,t),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,g,t,A,C,i){this.resize(e,A,C),this.left=g-this.width/2,this.top=t-this.height/2,this.enableShadow(e,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,C),this.disableShadow(e,i),this.updateBoundingBox(g,t,e,A,C)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},qk=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangle",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}},un=class extends qe{constructor(e,g,t){super(e,g,t)}draw(e,g,t,A,C,i){return this._drawShape(e,"triangleDown",3,g,t,A,C,i)}distanceToBorder(e,g){return this._distanceToBorder(e,g)}};function Pa(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Sa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Pa(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Pa(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var pe=class I{constructor(e,g,t,A,C,i){this.options=Og(C),this.globalOptions=C,this.defaultOptions=i,this.body=g,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=A,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new RI(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var g;G(g=this.edges).call(g,e)===-1&&this.edges.push(e)}detachEdge(e){var g;let t=G(g=this.edges).call(g,e);if(t!=-1){var A;Ke(A=this.edges).call(A,t,1)}}setOptions(e){let g=this.options.shape;if(!e)return;if(typeof e.color!="undefined"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");I.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Ze(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Ze(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=Zh(e.value)),I.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let t=[e,this.options,this.defaultOptions];return this.chooser=Lr("node",t),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&I.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(g),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,g,t){var A;if(t===void 0)return;let C=e.group;if(g!==void 0&&g.group!==void 0&&C!==g.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof C=="number"||typeof C=="string"&&C!=""))return;let n=t.get(C);n.opacity!==void 0&&g.opacity===void 0&&(I.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let r=te(A=Hk(g)).call(A,s=>g[s]!=null);r.push("font"),EI(r,e,n),e.color=Hi(e.color)}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4?arguments[4]:void 0;if(EI(["color","fixed","shadow"],e,g,t),I.checkMass(g),e.opacity!==void 0&&(I.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),g.opacity!==void 0&&(I.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),g.shapeProperties&&!I.checkCoordinateOrigin(g.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+g.shapeProperties.coordinateOrigin),Se(e,g,"shadow",A),g.color!==void 0&&g.color!==null){let n=Hi(g.color);Xl(e.color,n)}else t===!0&&g.color===null&&(e.color=Og(A.color));g.fixed!==void 0&&g.fixed!==null&&(typeof g.fixed=="boolean"?(e.fixed.x=g.fixed,e.fixed.y=g.fixed):(g.fixed.x!==void 0&&typeof g.fixed.x=="boolean"&&(e.fixed.x=g.fixed.x),g.fixed.y!==void 0&&typeof g.fixed.y=="boolean"&&(e.fixed.y=g.fixed.y))),t===!0&&g.font===null&&(e.font=Og(A.font)),I.updateGroupOptions(e,g,C),g.scaling!==void 0&&Se(e.scaling,g.scaling,"label",A.scaling)}getFormattingValues(){let e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let g=this.options.opacity;e.borderColor=Ne(e.borderColor,g),e.color=Ne(e.color,g),e.shadowColor=Ne(e.shadowColor,g)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),I.updateGroupOptions(this.options,Sa(Sa({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);let g=this.grouplist.get(this.options.group,!1),t=[e,this.options,g,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Kk(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Qk(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new nn(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new rn(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new sn(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Jk(this.options,this.body,this.labelModule);break;case"dot":this.shape=new on(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new kI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new an(this.options,this.body,this.labelModule);break;case"image":this.shape=new $k(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new dn(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new ln(this.options,this.body,this.labelModule);break;case"star":this.shape=new hn(this.options,this.body,this.labelModule);break;case"text":this.shape=new cn(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new qk(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new un(this.options,this.body,this.labelModule);break;default:this.shape=new kI(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,g){return this.shape.distanceToBorder(e,g)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.size=this.options.scaling.min+A*C}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let g=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,g)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let g=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,g)}getItemsOnPoint(e){let g=[];return this.labelModule.visible()&&An(this.labelModule.getSize(),e)&&g.push({nodeId:this.id,labelId:0}),An(this.shape.boundingBox,e)&&g.push({nodeId:this.id}),g}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,g){if(e.mass!==void 0&&e.mass<=0){let t="";g!==void 0&&(t=" in node id: "+g),console.error("%cNegative or zero mass disallowed"+t+", setting mass to 1.",eh),e.mass=1}}},fn=class{constructor(e,g,t,A){var C;if(this.body=e,this.images=g,this.groups=t,this.layoutEngine=A,this.body.functions.createNode=b(C=this.create).call(C,this),this.nodesListeners={add:(i,n)=>{this.add(n.items)},update:(i,n)=>{this.update(n.items,n.data,n.oldData)},remove:(i,n)=>{this.remove(n.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(i,n,r,s){if(n===i)return .5;{let o=1/(n-i);return Math.max(0,(s-i)*o)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Og(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,g;this.body.emitter.on("refreshNodes",b(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",b(g=this.refresh).call(g,this)),this.body.emitter.on("destroy",()=>{k(this.nodesListeners,(t,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,t)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(pe.parseOptions(this.options,e),e.opacity!==void 0&&(qi(e.opacity)||!Fg(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(typeof e.font!="undefined"||typeof e.widthConstraint!="undefined"||typeof e.heightConstraint!="undefined")for(let g of U(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(e.size!==void 0)for(let g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.nodes;if(zh("id",e))this.body.data.nodes=e;else if(z(e))this.body.data.nodes=new sg,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new sg;else throw new TypeError("Array or DataSet expected");if(t&&k(this.nodesListeners,function(A,C){t.off(C,A)}),this.body.nodes={},this.body.data.nodes){let A=this;k(this.nodesListeners,function(i,n){A.body.data.nodes.on(n,i)});let C=this.body.data.nodes.getIds();this.add(C,!0)}g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t,A=[];for(let C=0;C<e.length;C++){t=e[C];let i=this.body.data.nodes.get(t),n=this.create(i);A.push(n),this.body.nodes[t]=n}this.layoutEngine.positionInitially(A),g===!1&&this.body.emitter.emit("_dataChanged")}update(e,g,t){let A=this.body.nodes,C=!1;for(let i=0;i<e.length;i++){let n=e[i],r=A[n],s=g[i];r!==void 0?r.setOptions(s)&&(C=!0):(C=!0,r=this.create(s),A[n]=r)}!C&&t!==void 0&&(C=ph(g).call(g,function(i,n){let r=t[n];return r&&r.level!==i.level})),C===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){let g=this.body.nodes;for(let t=0;t<e.length;t++){let A=e[t];delete g[A]}this.body.emitter.emit("_dataChanged")}create(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pe;return new g(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;k(this.body.nodes,(g,t)=>{let A=this.body.data.nodes.get(t);A!==void 0&&(e===!0&&g.setOptions({x:null,y:null}),g.setOptions({fixed:!1}),g.setOptions(A))})}getPositions(e){let g={};if(e!==void 0){if(z(e)===!0){for(let t=0;t<e.length;t++)if(this.body.nodes[e[t]]!==void 0){let A=this.body.nodes[e[t]];g[e[t]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];g[e]={x:Math.round(t.x),y:Math.round(t.y)}}}else for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];g[this.body.nodeIndices[t]]={x:Math.round(A.x),y:Math.round(A.y)}}return g}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],g=this.body.data.nodes.getDataSet();for(let t of g.get()){let A=t.id,C=this.body.nodes[A],i=Math.round(C.x),n=Math.round(C.y);(t.x!==i||t.y!==n)&&e.push({id:A,x:i,y:n})}g.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,g){let t=[];if(this.body.nodes[e]!==void 0){let A=this.body.nodes[e],C={};for(let i=0;i<A.edges.length;i++){let n=A.edges[i];g!=="to"&&n.toId==A.id?C[n.fromId]===void 0&&(t.push(n.fromId),C[n.fromId]=!0):g!=="from"&&n.fromId==A.id&&C[n.toId]===void 0&&(t.push(n.toId),C[n.toId]=!0)}}return t}getConnectedEdges(e){let g=[];if(this.body.nodes[e]!==void 0){let t=this.body.nodes[e];for(let A=0;A<t.edges.length;A++)g.push(t.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return g}moveNode(e,g,t){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(g),this.body.nodes[e].y=Number(t),Qe(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},eM=S,Na=Math.hypot,gM=Math.abs,tM=Math.sqrt,AM=!!Na&&Na(1/0,NaN)!==1/0;eM({target:"Math",stat:!0,arity:2,forced:AM},{hypot:function(e,g){for(var t=0,A=0,C=arguments.length,i=0,n,r;A<C;)n=gM(arguments[A++]),i<n?(r=i/n,t=t*r*r+1,i=n):n>0?(r=n/i,t+=r*r):t+=n;return i===1/0?1/0:i*tM(t)}});var IM=L,CM=IM.Math.hypot,iM=CM,nM=iM,rM=nM,sM=P(rM),K=class{static transform(e,g){z(e)||(e=[e]);let t=g.point.x,A=g.point.y,C=g.angle,i=g.length;for(let n=0;n<e.length;++n){let r=e[n],s=r.x*Math.cos(C)-r.y*Math.sin(C),o=r.x*Math.sin(C)+r.y*Math.cos(C);r.x=t+i*s,r.y=A+i*o}}static drawPath(e,g){e.beginPath(),e.moveTo(g[0].x,g[0].y);for(let t=1;t<g.length;++t)e.lineTo(g[t].x,g[t].y);e.closePath()}},oM=class extends K{static draw(e,g){if(g.image){e.save(),e.translate(g.point.x,g.point.y),e.rotate(Math.PI/2+g.angle);let t=g.imageWidth!=null?g.imageWidth:g.image.width,A=g.imageHeight!=null?g.imageHeight:g.image.height;g.image.drawImageAtPosition(e,1,-t/2,0,t,A),e.restore()}return!1}},pn=class extends K{static draw(e,g){let t=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},mn=class{static draw(e,g){let t=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},vn=class{static draw(e,g){let t={x:-.4,y:0};K.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle-A/2,i=g.angle+A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},bn=class{static draw(e,g){let t={x:-.3,y:0};K.transform(t,g),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,C=g.angle+A/2,i=g.angle+3*A/2;return e.beginPath(),e.arc(t.x,t.y,g.length*.4,C,i,!1),e.stroke(),!0}},yn=class{static draw(e,g){let t=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return K.transform(t,g),K.drawPath(e,t),!0}},wn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return K.transform(t,g),K.drawPath(e,t),!0}},En=class{static draw(e,g){let t={x:-.4,y:0};return K.transform(t,g),Cr(e,t.x,t.y,g.length*.4),!0}},Tn=class{static draw(e,g){let t=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return K.transform(t,g),K.drawPath(e,t),!0}},xn=class{static draw(e,g){let t=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return K.transform(t,g),K.drawPath(e,t),!0}},On=class{static draw(e,g){let t=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return K.transform(t,g),K.drawPath(e,t),!0}},Dn=class{static draw(e,g){let t=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return K.transform(t,g),K.drawPath(e,t),!0}},MI=class{static draw(e,g){let t;switch(g.type&&(t=g.type.toLowerCase()),t){case"image":return oM.draw(e,g);case"circle":return En.draw(e,g);case"box":return xn.draw(e,g);case"crow":return mn.draw(e,g);case"curve":return vn.draw(e,g);case"diamond":return On.draw(e,g);case"inv_curve":return bn.draw(e,g);case"triangle":return yn.draw(e,g);case"inv_triangle":return wn.draw(e,g);case"bar":return Tn.draw(e,g);case"vee":return Dn.draw(e,g);default:return pn.draw(e,g)}}};function Ra(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function ka(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Ra(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Ra(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var FI=class{constructor(e,g,t){this._body=g,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,g),e.lineWidth=g.width,g.dashes!==!1?this._drawDashedLine(e,g,C):this._drawLine(e,g,C)}_drawLine(e,g,t,A,C){if(this.from!=this.to)this._line(e,g,t,A,C);else{let[i,n,r]=this._getCircleData(e);this._circle(e,g,i,n,r)}}_drawDashedLine(e,g,t,A,C){e.lineCap="round";let i=z(g.dashes)?g.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(i),e.lineDashOffset=0,this.from!=this.to)this._line(e,g,t);else{let[n,r,s]=this._getCircleData(e);this._circle(e,g,n,r,s)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)od(e,this.from.x,this.from.y,this.to.x,this.to.y,i);else{let[n,r,s]=this._getCircleData(e);this._circle(e,g,n,r,s)}this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}}findBorderPosition(e,g,t){return this.from!=this.to?this._findBorderPosition(e,g,t):this._findBorderPositionCircle(e,g,t)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var g;let[t,A]=Le(g=this._getCircleData(e)).call(g,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(e){let g=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let t=Lh(e,this.options.selfReference.angle,g,this.from);return[t.x,t.y,g]}_pointOnCircle(e,g,t,A){let C=A*2*Math.PI;return{x:e+t*Math.cos(C),y:g-t*Math.sin(C)}}_findBorderPositionCircle(e,g,t){let A=t.x,C=t.y,i=t.low,n=t.high,r=t.direction,s=10,o=this.options.selfReference.size,d=.05,a,l=(i+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(r===-1?h=this.options.endPointOffset.from:r===1&&(h=this.options.endPointOffset.to));let c=0;do{l=(i+n)*.5,a=this._pointOnCircle(A,C,o,l);let f=Math.atan2(e.y-a.y,e.x-a.x),u=e.distanceToBorder(g,f)+h,m=Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2)),E=u-m;if(Math.abs(E)<d)break;E>0?r>0?i=l:n=l:r>0?n=l:i=l,++c}while(i<=n&&c<s);return ka(ka({},a),{},{t:l})}getLineWidth(e,g){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):g===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,g){if(g.inheritsColor!==!1){if(g.inheritsColor==="both"&&this.from.id!==this.to.id){let t=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,C=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Ne(this.from.options.color.border,g.opacity),C=Ne(this.to.options.color.border,g.opacity)):this.from.selected===!0&&this.to.selected===!1?C=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),t.addColorStop(0,A),t.addColorStop(1,C),t}return g.inheritsColor==="to"?Ne(this.to.options.color.border,g.opacity):Ne(this.from.options.color.border,g.opacity)}else return Ne(g.color,g.opacity)}_circle(e,g,t,A,C){this.enableShadow(e,g);let i=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let r=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:-1}),d=this._findBorderPositionCircle(this.from,e,{x:t,y:A,low:r,high:s,direction:1});i=Math.atan2(o.y-A,o.x-t),n=Math.atan2(d.y-A,d.x-t)}e.beginPath(),e.arc(t,A,C,i,n,!1),e.stroke(),this.disableShadow(e,g)}getDistanceToEdge(e,g,t,A,C,i){if(this.from!=this.to)return this._getDistanceToEdge(e,g,t,A,C,i);{let[n,r,s]=this._getCircleData(void 0),o=n-C,d=r-i;return Math.abs(Math.sqrt(o*o+d*d)-s)}}_getDistanceToLine(e,g,t,A,C,i){let n=t-e,r=A-g,s=n*n+r*r,o=((C-e)*n+(i-g)*r)/s;o>1?o=1:o<0&&(o=0);let d=e+o*n,a=g+o*r,l=d-C,h=a-i;return Math.sqrt(l*l+h*h)}getArrowData(e,g,t,A,C,i){let n,r,s,o,d,a,l,h=i.width;g==="from"?(s=this.from,o=this.to,d=i.fromArrowScale<0,a=Math.abs(i.fromArrowScale),l=i.fromArrowType):g==="to"?(s=this.to,o=this.from,d=i.toArrowScale<0,a=Math.abs(i.toArrowScale),l=i.toArrowType):(s=this.to,o=this.from,d=i.middleArrowScale<0,a=Math.abs(i.middleArrowScale),l=i.middleArrowType);let c=15*a+3*h;if(s!=o){let E=sM(s.x-o.x,s.y-o.y),w=c/E;if(g!=="middle")if(this.options.smooth.enabled===!0){let O=this._findBorderPosition(s,e,{via:t}),R=this.getPoint(O.t+w*(g==="from"?1:-1),t);n=Math.atan2(O.y-R.y,O.x-R.x),r=O}else n=Math.atan2(s.y-o.y,s.x-o.x),r=this._findBorderPosition(s,e);else{let O=(d?-w:w)/2,R=this.getPoint(.5+O,t),M=this.getPoint(.5-O,t);n=Math.atan2(R.y-M.y,R.x-M.x),r=this.getPoint(.5,t)}}else{let[E,w,O]=this._getCircleData(e);if(g==="from"){let R=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:R,high:M,direction:-1});n=j.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,r=j}else if(g==="to"){let R=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:w,low:R,high:M,direction:1});n=j.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,r=j}else{let R=this.options.selfReference.angle/(2*Math.PI);r=this._pointOnCircle(E,w,O,R),n=R*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let f=r.x-c*.9*Math.cos(n),u=r.y-c*.9*Math.sin(n);return{point:r,core:{x:f,y:u},angle:n,length:c,type:l}}drawArrowHead(e,g,t,A,C){e.strokeStyle=this.getColor(e,g),e.fillStyle=e.strokeStyle,e.lineWidth=g.width,MI.draw(e,C)&&(this.enableShadow(e,g),TA(e).call(e),this.disableShadow(e,g))}enableShadow(e,g){g.shadow===!0&&(e.shadowColor=g.shadowColor,e.shadowBlur=g.shadowSize,e.shadowOffsetX=g.shadowX,e.shadowOffsetY=g.shadowY)}disableShadow(e,g){g.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,g){if(g.background!==!1){let t={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=g.backgroundColor,e.lineWidth=g.backgroundSize,this.setStrokeDashed(e,g.backgroundDashes),e.stroke(),e.strokeStyle=t.strokeStyle,e.lineWidth=t.lineWidth,e.dashes=t.dashes,this.setStrokeDashed(e,g.dashes)}}setStrokeDashed(e,g){if(g!==!1)if(e.setLineDash!==void 0){let t=z(g)?g:[5,5];e.setLineDash(t)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}};function Ma(I,e){var g=U(I);if(Je){var t=Je(I);e&&(t=te(t).call(t,function(A){return gg(I,A).enumerable})),g.push.apply(g,t)}return g}function Fa(I){for(var e=1;e<arguments.length;e++){var g,t,A=arguments[e]!=null?arguments[e]:{};e%2?F(g=Ma(Object(A),!0)).call(g,function(C){ge(I,C,A[C])}):$e?RA(I,$e(A)):F(t=Ma(Object(A))).call(t,function(C){kA(I,C,gg(A,C))})}return I}var gA=class extends FI{constructor(e,g,t){super(e,g,t)}_findBorderPositionBezier(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,C=.2,i=!1,n=1,r=0,s=this.to,o,d,a=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(s=this.from,i=!0,a=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(a=0);let l=0;do{d=(r+n)*.5,o=this.getPoint(d,t);let h=Math.atan2(s.y-o.y,s.x-o.x),c=s.distanceToBorder(g,h)+a,f=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),u=c-f;if(Math.abs(u)<C)break;u<0?i===!1?r=d:n=d:i===!1?n=d:r=d,++l}while(r<=n&&l<A);return Fa(Fa({},o),{},{t:d})}_getDistanceToBezierEdge(e,g,t,A,C,i,n){let r=1e9,s,o,d,a,l,h=e,c=g;for(o=1;o<10;o++)d=.1*o,a=Math.pow(1-d,2)*e+2*d*(1-d)*n.x+Math.pow(d,2)*t,l=Math.pow(1-d,2)*g+2*d*(1-d)*n.y+Math.pow(d,2)*A,o>0&&(s=this._getDistanceToLine(h,c,a,l,C,i),r=s<r?s:r),h=a,c=l;return r}_bezierCurve(e,g,t,A){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),t!=null&&t.x!=null?A!=null&&A.x!=null?e.bezierCurveTo(t.x,t.y,A.x,A.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(t.x,t.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,g),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){return this._getViaCoordinates()}},zI=class extends gA{constructor(e,g,t){super(e,g,t),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let g=!1;this.options.physics!==e.physics&&(g=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),g===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){let e="edgeId:"+this.id,g=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=g,this.via=g,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,g,t){this._bezierCurve(e,g,t)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[t,A,C]=this._getCircleData(),i=2*Math.PI*(1-e);return{x:t+C*Math.sin(i),y:A+C-C*(1-Math.cos(i))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*g.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*g.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g,this.via)}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToBezierEdge(e,g,t,A,C,i,this.via)}},BI=class extends gA{constructor(e,g,t){super(e,g,t)}_line(e,g,t){this._bezierCurve(e,g,t)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,g=this.options.smooth.type,t=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(g==="discrete"||g==="diagonalCross"){let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,r=this.from.y+i;return g==="discrete"&&(t<=A?n=t<e*A?this.from.x:n:r=A<e*t?this.from.y:r),{x:n,y:r}}else if(g==="straightCross"){let C=(1-e)*t,i=(1-e)*A;return t<=A?(C=0,this.from.y<this.to.y&&(i=-i)):(this.from.x<this.to.x&&(C=-C),i=0),{x:this.to.x+C,y:this.to.y+i}}else if(g==="horizontal"){let C=(1-e)*t;return this.from.x<this.to.x&&(C=-C),{x:this.to.x+C,y:this.from.y}}else if(g==="vertical"){let C=(1-e)*A;return this.from.y<this.to.y&&(C=-C),{x:this.from.x,y:this.to.y+C}}else if(g==="curvedCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,r=(Math.atan2(A,t)+(e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}else if(g==="curvedCCW"){t=this.to.x-this.from.x,A=this.from.y-this.to.y;let C=Math.sqrt(t*t+A*A),i=Math.PI,r=(Math.atan2(A,t)+(-e*.5+.5)*i)%(2*i);return{x:this.from.x+(e*.5+.5)*C*Math.sin(r),y:this.from.y+(e*.5+.5)*C*Math.cos(r)}}else{let C,i;t<=A?C=i=e*A:C=i=e*t,this.from.x>this.to.x&&(C=-C),this.from.y>=this.to.y&&(i=-i);let n=this.from.x+C,r=this.from.y+i;return t<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?r=this.to.y>r?this.to.y:r:r=this.to.y<r?this.to.y:r,{x:n,y:r}}}_findBorderPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,g,t.via)}_getDistanceToEdge(e,g,t,A,C,i){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,g,t,A,C,i,n)}getPoint(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),t=e,A=Math.pow(1-t,2)*this.fromPoint.x+2*t*(1-t)*g.x+Math.pow(t,2)*this.toPoint.x,C=Math.pow(1-t,2)*this.fromPoint.y+2*t*(1-t)*g.y+Math.pow(t,2)*this.toPoint.y;return{x:A,y:C}}},Pn=class extends gA{constructor(e,g,t){super(e,g,t)}_getDistanceToBezierEdge2(e,g,t,A,C,i,n,r){let s=1e9,o=e,d=g,a=[0,0,0,0];for(let l=1;l<10;l++){let h=.1*l;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);let c=a[0]*e+a[1]*n.x+a[2]*r.x+a[3]*t,f=a[0]*g+a[1]*n.y+a[2]*r.y+a[3]*A;if(l>0){let u=this._getDistanceToLine(o,d,c,f,C,i);s=u<s?u:s}o=c,d=f}return s}},ZI=class extends Pn{constructor(e,g,t){super(e,g,t)}_line(e,g,t){let A=t[0],C=t[1];this._bezierCurve(e,g,A,C)}_getViaCoordinates(){let e=this.from.x-this.to.x,g=this.from.y-this.to.y,t,A,C,i,n=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(g)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,i=this.to.y,t=this.from.x-n*e,C=this.to.x+n*e):(A=this.from.y-n*g,i=this.to.y+n*g,t=this.from.x,C=this.to.x),[{x:t,y:A},{x:C,y:i}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,g){return this._findBorderPositionBezier(e,g)}_getDistanceToEdge(e,g,t,A,C,i){let[n,r]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,g,t,A,C,i,n,r)}getPoint(e){let[g,t]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=e,C=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],i=C[0]*this.fromPoint.x+C[1]*g.x+C[2]*t.x+C[3]*this.toPoint.x,n=C[0]*this.fromPoint.y+C[1]*g.y+C[2]*t.y+C[3]*this.toPoint.y;return{x:i,y:n}}},LI=class extends FI{constructor(e,g,t){super(e,g,t)}_line(e,g){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,g),e.stroke(),this.disableShadow(e,g)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,g){let t=this.to,A=this.from;e.id===this.from.id&&(t=this.from,A=this.to);let C=Math.atan2(t.y-A.y,t.x-A.x),i=t.x-A.x,n=t.y-A.y,r=Math.sqrt(i*i+n*n),s=e.distanceToBorder(g,C),o=(r-s)/r;return{x:(1-o)*A.x+o*t.x,y:(1-o)*A.y+o*t.y,t:0}}_getDistanceToEdge(e,g,t,A,C,i){return this._getDistanceToLine(e,g,t,A,C,i)}},Dg=class I{constructor(e,g,t,A,C){if(g===void 0)throw new Error("No body provided");this.options=Og(A),this.globalOptions=A,this.defaultOptions=C,this.body=g,this.imagelist=t,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new RI(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let g=typeof e.physics!="undefined"&&this.options.physics!==e.physics||typeof e.hidden!="undefined"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from!="undefined"&&this.options.from!==e.from||typeof e.to!="undefined"&&this.options.to!==e.to;I.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=Zh(e.value));let t=[e,this.options,this.defaultOptions];return this.chooser=Lr("edge",t),this.updateLabelModule(e),g=this.updateEdgeType()||g,this._setInteractionWidths(),this.connect(),g}static parseOptions(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Dt(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,g,t),g.endPointOffset!==void 0&&g.endPointOffset.from!==void 0&&(Fg(g.endPointOffset.from)?e.endPointOffset.from=g.endPointOffset.from:(e.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),g.endPointOffset!==void 0&&g.endPointOffset.to!==void 0&&(Fg(g.endPointOffset.to)?e.endPointOffset.to=g.endPointOffset.to:(e.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),SI(g.label)?e.label=g.label:SI(e.label)||(e.label=void 0),Se(e,g,"smooth",A),Se(e,g,"shadow",A),Se(e,g,"background",A),g.dashes!==void 0&&g.dashes!==null?e.dashes=g.dashes:t===!0&&g.dashes===null&&(e.dashes=Tg(A.dashes)),g.scaling!==void 0&&g.scaling!==null?(g.scaling.min!==void 0&&(e.scaling.min=g.scaling.min),g.scaling.max!==void 0&&(e.scaling.max=g.scaling.max),Se(e.scaling,g.scaling,"label",A.scaling)):t===!0&&g.scaling===null&&(e.scaling=Tg(A.scaling)),g.arrows!==void 0&&g.arrows!==null)if(typeof g.arrows=="string"){let n=g.arrows.toLowerCase();e.arrows.to.enabled=G(n).call(n,"to")!=-1,e.arrows.middle.enabled=G(n).call(n,"middle")!=-1,e.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof g.arrows=="object")Se(e.arrows,g.arrows,"to",A.arrows),Se(e.arrows,g.arrows,"middle",A.arrows),Se(e.arrows,g.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+xt(g.arrows));else t===!0&&g.arrows===null&&(e.arrows=Tg(A.arrows));if(g.color!==void 0&&g.color!==null){let n=vg(g.color)?{color:g.color,highlight:g.color,hover:g.color,inherit:!1,opacity:1}:g.color,r=e.color;if(C)_(r,A.color,!1,t);else for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];if(vg(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,n.opacity===void 0&&(r.opacity=1);else{let s=!1;n.color!==void 0&&(r.color=n.color,s=!0),n.highlight!==void 0&&(r.highlight=n.highlight,s=!0),n.hover!==void 0&&(r.hover=n.hover,s=!0),n.inherit!==void 0&&(r.inherit=n.inherit),n.opacity!==void 0&&(r.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?r.inherit=!1:r.inherit===void 0&&(r.inherit="from")}}else t===!0&&g.color===null&&(e.color=Og(A.color));t===!0&&g.font===null&&(e.font=Og(A.font)),Object.prototype.hasOwnProperty.call(g,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=g.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,g=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,t=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,C={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:t,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:g,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:A?void 0:this.options.color.color,inheritsColor:A,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){let i=this.options.selectionWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.highlight,C.shadow=this.options.shadow.enabled}else if(this.hover){let i=this.options.hoverWidth;typeof i=="function"?C.width=i(C.width):typeof i=="number"&&(C.width+=i),C.width=Math.max(C.width,.3/this.body.view.scale),C.color=this.options.color.hover,C.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(C,this.options.id,this.selected,this.hover),C.color!==void 0&&(C.inheritsColor=!1),C.shadow===!1&&(C.shadowColor!==this.options.shadow.color||C.shadowSize!==this.options.shadow.size||C.shadowX!==this.options.shadow.x||C.shadowY!==this.options.shadow.y)&&(C.shadow=!0));else C.shadow=this.options.shadow.enabled,C.width=Math.max(C.width,.3/this.body.view.scale);return C}updateLabelModule(e){let g=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,g),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,g=!1,t=!0;return this.edgeType!==void 0&&((this.edgeType instanceof zI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof ZI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof BI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof LI&&e.type.enabled===!1)&&(t=!1),t===!0&&(g=this.cleanup())),t===!0?e.enabled===!0?e.type==="dynamic"?(g=!0,this.edgeType=new zI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new ZI(this.options,this.body,this.labelModule):this.edgeType=new BI(this.options,this.body,this.labelModule):this.edgeType=new LI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),g}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,g,t){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,g,t,this.options.value),C=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let i=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*i}this.options.width=this.options.scaling.min+A*C}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode();this.edgeType.drawLine(e,g,this.selected,this.hover,t),this.drawLabel(e,t)}drawArrows(e){let g=this.getFormattingValues();if(g.hidden)return;let t=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,g.fromArrow&&(A.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),g.fromArrowSrc&&(A.from.image=this.imagelist.load(g.fromArrowSrc)),g.fromArrowImageWidth&&(A.from.imageWidth=g.fromArrowImageWidth),g.fromArrowImageHeight&&(A.from.imageHeight=g.fromArrowImageHeight)),g.toArrow&&(A.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover,g),g.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),g.toArrowSrc&&(A.to.image=this.imagelist.load(g.toArrowSrc)),g.toArrowImageWidth&&(A.to.imageWidth=g.toArrowImageWidth),g.toArrowImageHeight&&(A.to.imageHeight=g.toArrowImageHeight)),g.middleArrow&&(A.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover,g),g.middleArrowSrc&&(A.middle.image=this.imagelist.load(g.middleArrowSrc)),g.middleArrowImageWidth&&(A.middle.imageWidth=g.middleArrowImageWidth),g.middleArrowImageHeight&&(A.middle.imageHeight=g.middleArrowImageHeight)),g.fromArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.from),g.middleArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.middle),g.toArrow&&this.edgeType.drawArrowHead(e,g,this.selected,this.hover,A.to)}drawLabel(e,g){if(this.options.label!==void 0){let t=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let C;if(t.id!=A.id){this.labelModule.pointToSelf=!1,C=this.edgeType.getPoint(.5,g),e.save();let i=this._getRotation(e);i.angle!=0&&(e.translate(i.x,i.y),e.rotate(i.angle)),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let i=Lh(e,this.options.selfReference.angle,this.options.selfReference.size,t);C=this._pointOnCircle(i.x,i.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,C.x,C.y,this.selected,this.hover)}}}getItemsOnPoint(e){let g=[];if(this.labelModule.visible()){let A=this._getRotation();An(this.labelModule.getSize(),e,A)&&g.push({edgeId:this.id,labelId:0})}let t={left:e.x,top:e.y};return this.isOverlappingWith(t)&&g.push({edgeId:this.id}),g}isOverlappingWith(e){if(this.connected){let t=this.from.x,A=this.from.y,C=this.to.x,i=this.to.y,n=e.left,r=e.top;return this.edgeType.getDistanceToEdge(t,A,C,i,n,r)<10}else return!1}_getRotation(e){let g=this.edgeType.getViaNode(),t=this.edgeType.getPoint(.5,g);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,t.x,t.y);let A={x:t.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let C=this.from.y-this.to.y,i=this.from.x-this.to.x,n=Math.atan2(C,i);return(n<-1&&i<0||n>0&&i<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(e,g,t,A){return{x:e+t*Math.cos(A),y:g-t*Math.sin(A)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},Sn=class{constructor(e,g,t){var A;this.body=e,this.images=g,this.groups=t,this.body.functions.createEdge=b(A=this.create).call(A,this),this.edgesListeners={add:(C,i)=>{this.add(i.items)},update:(C,i)=>{this.update(i.items)},remove:(C,i)=>{this.remove(i.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(C,i,n,r){if(i===C)return .5;{let s=1/(i-C);return Math.max(0,(r-C)*s)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},_(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,g,t;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let i=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let r=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let o=s.smooth;o!==void 0&&o.enabled===!0&&o.type==="dynamic"&&(A===void 0?r.setOptions({smooth:!1}):r.setOptions({smooth:{type:A}}),i=!0)}}C===!0&&i===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",b(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",b(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{k(this.edgesListeners,(A,C)=>{this.body.data.edges&&this.body.data.edges.off(C,A)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Dg.parseOptions(this.options,e,!0,this.defaultOptions,!0);let g=!1;if(e.smooth!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&(g=this.body.edges[t].updateEdgeType()||g);if(e.font!==void 0)for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&this.body.edges[t].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||g===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.data.edges;if(zh("id",e))this.body.data.edges=e;else if(z(e))this.body.data.edges=new sg,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new sg;else throw new TypeError("Array or DataSet expected");if(t&&k(this.edgesListeners,(A,C)=>{t.off(C,A)}),this.body.edges={},this.body.data.edges){k(this.edgesListeners,(C,i)=>{this.body.data.edges.on(i,C)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}add(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.edges,A=this.body.data.edges;for(let C=0;C<e.length;C++){let i=e[C],n=t[i];n&&n.disconnect();let r=A.get(i,{showInternalIds:!0});t[i]=this.create(r)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),g===!1&&this.body.emitter.emit("_dataChanged")}update(e){let g=this.body.edges,t=this.body.data.edges,A=!1;for(let C=0;C<e.length;C++){let i=e[C],n=t.get(i),r=g[i];r!==void 0?(r.disconnect(),A=r.setOptions(n)||A,r.connect()):(this.body.edges[i]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let t=this.body.edges;k(e,A=>{let C=t[A];C!==void 0&&C.remove()}),g&&this.body.emitter.emit("_dataChanged")}refresh(){k(this.body.edges,(e,g)=>{let t=this.body.data.edges.get(g);t!==void 0&&e.setOptions(t)})}create(e){return new Dg(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,g=this.body.nodes,t=this.body.edges;for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(g[e].edges=[]);for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let A=t[e];A.from=null,A.to=null,A.connect()}}getConnectedNodes(e){let g=[];if(this.body.edges[e]!==void 0){let t=this.body.edges[e];t.fromId!==void 0&&g.push(t.fromId),t.toId!==void 0&&g.push(t.toId)}return g}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];k(this.body.edges,(g,t)=>{let A=this.body.nodes[g.toId],C=this.body.nodes[g.fromId];A!==void 0&&A.isCluster===!0||C!==void 0&&C.isCluster===!0||(A===void 0||C===void 0)&&e.push(t)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let g=this.body.edges,t=[];F(e).call(e,(A,C)=>{g[C]===void 0&&t.push(C)}),this.add(t,!0)}},GI=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.barnesHutTree,this.setOptions(t),this._rng=sC("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,g=this.body.nodes,t=this.physicsBody.physicsNodeIndices,A=t.length,C=this._formBarnesHutTree(g,t);this.barnesHutTree=C;for(let i=0;i<A;i++)e=g[t[i]],e.options.mass>0&&this._getForceContributions(C.root,e)}}_getForceContributions(e,g){this._getForceContribution(e.children.NW,g),this._getForceContribution(e.children.NE,g),this._getForceContribution(e.children.SW,g),this._getForceContribution(e.children.SE,g)}_getForceContribution(e,g){if(e.childrenCount>0){let t=e.centerOfMass.x-g.x,A=e.centerOfMass.y-g.y,C=Math.sqrt(t*t+A*A);C*e.calcSize>this.thetaInversed?this._calculateForces(C,t,A,g,e):e.childrenCount===4?this._getForceContributions(e,g):e.children.data.id!=g.id&&this._calculateForces(C,t,A,g,e)}}_calculateForces(e,g,t,A,C){e===0&&(e=.1,g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=this.options.gravitationalConstant*C.mass*A.options.mass/Math.pow(e,3),n=g*i,r=t*i;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=r}_formBarnesHutTree(e,g){let t,A=g.length,C=e[g[0]].x,i=e[g[0]].y,n=e[g[0]].x,r=e[g[0]].y;for(let f=1;f<A;f++){let u=e[g[f]],m=u.x,E=u.y;u.options.mass>0&&(m<C&&(C=m),m>n&&(n=m),E<i&&(i=E),E>r&&(r=E))}let s=Math.abs(n-C)-Math.abs(r-i);s>0?(i-=.5*s,r+=.5*s):(C+=.5*s,n-=.5*s);let d=Math.max(1e-5,Math.abs(n-C)),a=.5*d,l=.5*(C+n),h=.5*(i+r),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:l-a,maxX:l+a,minY:h-a,maxY:h+a},size:d,calcSize:1/d,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let f=0;f<A;f++)t=e[g[f]],t.options.mass>0&&this._placeInTree(c.root,t);return c}_updateBranchMass(e,g){let t=e.centerOfMass,A=e.mass+g.options.mass,C=1/A;t.x=t.x*e.mass+g.x*g.options.mass,t.x*=C,t.y=t.y*e.mass+g.y*g.options.mass,t.y*=C,e.mass=A;let i=Math.max(Math.max(g.height,g.radius),g.width);e.maxWidth=e.maxWidth<i?i:e.maxWidth}_placeInTree(e,g,t){(t!=!0||t===void 0)&&this._updateBranchMass(e,g);let A=e.children.NW.range,C;A.maxX>g.x?A.maxY>g.y?C="NW":C="SW":A.maxY>g.y?C="NE":C="SE",this._placeInRegion(e,g,C)}_placeInRegion(e,g,t){let A=e.children[t];switch(A.childrenCount){case 0:A.children.data=g,A.childrenCount=1,this._updateBranchMass(A,g);break;case 1:A.children.data.x===g.x&&A.children.data.y===g.y?(g.x+=this._rng(),g.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,g));break;case 4:this._placeInTree(A,g);break}}_splitBranch(e){let g=null;e.childrenCount===1&&(g=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),g!=null&&this._placeInTree(e,g)}_insertRegion(e,g){let t,A,C,i,n=.5*e.size;switch(g){case"NW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY,i=e.range.minY+n;break;case"NE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY,i=e.range.minY+n;break;case"SW":t=e.range.minX,A=e.range.minX+n,C=e.range.minY+n,i=e.range.maxY;break;case"SE":t=e.range.minX+n,A=e.range.maxX,C=e.range.minY+n,i=e.range.maxY;break}e.children[g]={centerOfMass:{x:0,y:0},mass:0,range:{minX:t,maxX:A,minY:C,maxY:i},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,g){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,g))}_drawBranch(e,g,t){t===void 0&&(t="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,g),this._drawBranch(e.children.NE,g),this._drawBranch(e.children.SE,g),this._drawBranch(e.children.SW,g)),g.strokeStyle=t,g.beginPath(),g.moveTo(e.range.minX,e.range.minY),g.lineTo(e.range.maxX,e.range.minY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.minY),g.lineTo(e.range.maxX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.maxX,e.range.maxY),g.lineTo(e.range.minX,e.range.maxY),g.stroke(),g.beginPath(),g.moveTo(e.range.minX,e.range.maxY),g.lineTo(e.range.minX,e.range.minY),g.stroke()}},Nn=class{constructor(e,g,t){this._rng=sC("REPULSION SOLVER"),this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,r,s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces,a=this.options.nodeDistance,l=-2/3/a,h=4/3;for(let c=0;c<o.length-1;c++){n=s[o[c]];for(let f=c+1;f<o.length;f++)r=s[o[f]],e=r.x-n.x,g=r.y-n.y,t=Math.sqrt(e*e+g*g),t===0&&(t=.1*this._rng(),e=t),t<2*a&&(t<.5*a?i=1:i=l*t+h,i=i/t,A=e*i,C=g*i,d[n.id].x-=A,d[n.id].y-=C,d[r.id].x+=A,d[r.id].y+=C)}}},Rn=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,g=this.physicsBody.physicsNodeIndices,t=this.physicsBody.forces,A=this.options.nodeDistance;for(let C=0;C<g.length-1;C++){let i=e[g[C]];for(let n=C+1;n<g.length;n++){let r=e[g[n]];if(i.level===r.level){let s=A+this.overlapAvoidanceFactor*((i.shape.radius||0)/2+(r.shape.radius||0)/2),o=r.x-i.x,d=r.y-i.y,a=Math.sqrt(o*o+d*d),l=.05,h;a<s?h=-Math.pow(l*a,2)+Math.pow(l*s,2):h=0,a!==0&&(h=h/a);let c=o*h,f=d*h;t[i.id].x-=c,t[i.id].y-=f,t[r.id].x+=c,t[r.id].y+=f}}}}},Yt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t=this.physicsBody.physicsEdgeIndices,A=this.body.edges,C,i,n;for(let r=0;r<t.length;r++)g=A[t[r]],g.connected===!0&&g.toId!==g.fromId&&this.body.nodes[g.toId]!==void 0&&this.body.nodes[g.fromId]!==void 0&&(g.edgeType.via!==void 0?(e=g.options.length===void 0?this.options.springLength:g.options.length,C=g.to,i=g.edgeType.via,n=g.from,this._calculateSpringForce(C,i,.5*e),this._calculateSpringForce(i,n,.5*e)):(e=g.options.length===void 0?this.options.springLength*1.5:g.options.length,this._calculateSpringForce(g.from,g.to,e)))}_calculateSpringForce(e,g,t){let A=e.x-g.x,C=e.y-g.y,i=Math.max(Math.sqrt(A*A+C*C),.01),n=this.options.springConstant*(t-i)/i,r=A*n,s=C*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[g.id]!==void 0&&(this.physicsBody.forces[g.id].x-=r,this.physicsBody.forces[g.id].y-=s)}},kn=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C,i,n,r,s=this.body.edges,o=.5,d=this.physicsBody.physicsEdgeIndices,a=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces;for(let w=0;w<a.length;w++){let O=a[w];l[O].springFx=0,l[O].springFy=0}for(let w=0;w<d.length;w++)g=s[d[w]],g.connected===!0&&(e=g.options.length===void 0?this.options.springLength:g.options.length,t=g.from.x-g.to.x,A=g.from.y-g.to.y,r=Math.sqrt(t*t+A*A),r=r===0?.01:r,n=this.options.springConstant*(e-r)/r,C=t*n,i=A*n,g.to.level!=g.from.level?(l[g.toId]!==void 0&&(l[g.toId].springFx-=C,l[g.toId].springFy-=i),l[g.fromId]!==void 0&&(l[g.fromId].springFx+=C,l[g.fromId].springFy+=i)):(l[g.toId]!==void 0&&(l[g.toId].x-=o*C,l[g.toId].y-=o*i),l[g.fromId]!==void 0&&(l[g.fromId].x+=o*C,l[g.fromId].y+=o*i)));n=1;let h,c;for(let w=0;w<a.length;w++){let O=a[w];h=Math.min(n,Math.max(-n,l[O].springFx)),c=Math.min(n,Math.max(-n,l[O].springFy)),l[O].x+=h,l[O].y+=c}let f=0,u=0;for(let w=0;w<a.length;w++){let O=a[w];f+=l[O].x,u+=l[O].y}let m=f/a.length,E=u/a.length;for(let w=0;w<a.length;w++){let O=a[w];l[O].x-=m,l[O].y-=E}}},dt=class{constructor(e,g,t){this.body=e,this.physicsBody=g,this.setOptions(t)}setOptions(e){this.options=e}solve(){let e,g,t,A,C=this.body.nodes,i=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let r=0;r<i.length;r++){let s=i[r];A=C[s],e=-A.x,g=-A.y,t=Math.sqrt(e*e+g*g),this._calculateForces(t,e,g,n,A)}}_calculateForces(e,g,t,A,C){let i=e===0?0:this.options.centralGravity/e;A[C.id].x=g*i,A[C.id].y=t*i}},Mn=class extends GI{constructor(e,g,t){super(e,g,t),this._rng=sC("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,g,t,A,C){e===0&&(e=.1*this._rng(),g=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let i=A.edges.length+1,n=this.options.gravitationalConstant*C.mass*A.options.mass*i/Math.pow(e,2),r=g*n,s=t*n;this.physicsBody.forces[A.id].x+=r,this.physicsBody.forces[A.id].y+=s}},Fn=class extends dt{constructor(e,g,t){super(e,g,t)}_calculateForces(e,g,t,A,C){if(e>0){let i=C.edges.length+1,n=this.options.centralGravity*i*C.options.mass;A[C.id].x=g*n,A[C.id].y=t*n}}},zn=class{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},q(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,EI(["stabilization"],this.options,e),Se(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let g=this.options.wind;g&&((typeof g.x!="number"||qi(g.x))&&(g.x=0),(typeof g.y!="number"||qi(g.y))&&(g.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Mn(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new Fn(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Nn(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new dt(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Rn(this.body,this.physicsBody,e),this.edgesSolver=new kn(this.body,this.physicsBody,e),this.gravitySolver=new dt(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new GI(this.body,this.physicsBody,e),this.edgesSolver=new Yt(this.body,this.physicsBody,e),this.gravitySolver=new dt(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=b(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){let e=mI();this.physicsTick(),(mI()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&Qe(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,g=this.body.edges;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[t].id);for(let t in g)Object.prototype.hasOwnProperty.call(g,t)&&g[t].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(g[t].id);for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let A=this.physicsBody.physicsNodeIndices[t];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let t in this.physicsBody.velocities)e[t]===void 0&&delete this.physicsBody.velocities[t]}revert(){let e=U(this.previousStates),g=this.body.nodes,t=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<e.length;A++){let C=e[A];g[C]!==void 0?g[C].options.physics===!0&&(this.referenceState[C]={positions:{x:g[C].x,y:g[C].y}},t[C].x=this.previousStates[C].vx,t[C].y=this.previousStates[C].vy,g[C].x=this.previousStates[C].x,g[C].y=this.previousStates[C].y):delete this.previousStates[C]}}_evaluateStepQuality(){let e,g,t,A=this.body.nodes,C=this.referenceState,i=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(e=A[n].x-C[n].positions.x,g=A[n].y-C[n].positions.y,t=Math.sqrt(Math.pow(e,2)+Math.pow(g,2)),t>i))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,g=0,t=0,A=5;for(let C=0;C<e.length;C++){let i=e[C],n=this._performStep(i);g=Math.max(g,n),t+=n}this.adaptiveTimestepEnabled=t/e.length<A,this.stabilized=g<this.options.minVelocity}calculateComponentVelocity(e,g,t){let A=this.modelOptions.damping*e,C=(g-A)/t;e+=C*this.timestep;let i=this.options.maxVelocity||1e9;return Math.abs(e)>i&&(e=e>0?i:-i),e}_performStep(e){let g=this.body.nodes[e],t=this.physicsBody.forces[e];this.options.wind&&(t.x+=this.options.wind.x,t.y+=this.options.wind.y);let A=this.physicsBody.velocities[e];return this.previousStates[e]={x:g.x,y:g.y,vx:A.x,vy:A.y},g.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,t.x,g.options.mass),g.x+=A.x*this.timestep):(t.x=0,A.x=0),g.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,t.y,g.options.mass),g.y+=A.y*this.timestep):(t.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let e=this.body.nodes;for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)&&e[g].x&&e[g].y){let t=e[g].options.fixed;this.freezeCache[g]={x:t.x,y:t.y},t.x=!0,t.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&this.freezeCache[g]!==void 0&&(e[g].options.fixed.x=this.freezeCache[g].x,e[g].options.fixed.y=this.freezeCache[g].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,Qe(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,g=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&g();let t=0;for(;e()&&t<this.options.stabilization.updateInterval;)this.physicsTick(),t++;if(g(),e()){var A;Qe(b(A=this._stabilizationBatch).call(A,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let g=0;g<this.physicsBody.physicsNodeIndices.length;g++){let t=this.physicsBody.physicsNodeIndices[g],A=this.body.nodes[t],C=this.physicsBody.forces[t],i=20,n=.03,r=Math.sqrt(Math.pow(C.x,2)+Math.pow(C.x,2)),s=Math.min(Math.max(5,r),15),o=3*s,d=Ui((180-Math.min(1,Math.max(0,n*r))*180)/360,1,1),a={x:A.x+i*C.x,y:A.y+i*C.y};e.lineWidth=s,e.strokeStyle=d,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(a.x,a.y),e.stroke();let l=Math.atan2(C.y,C.x);e.fillStyle=d,MI.draw(e,{type:"arrow",point:a,angle:l,length:o}),TA(e).call(e)}}},de=class{constructor(){}static getRange(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let r=0;r<g.length;r++)n=e[g[r]],C>n.shape.boundingBox.left&&(C=n.shape.boundingBox.left),i<n.shape.boundingBox.right&&(i=n.shape.boundingBox.right),t>n.shape.boundingBox.top&&(t=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static getRangeCore(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=1e9,A=-1e9,C=1e9,i=-1e9,n;if(g.length>0)for(let r=0;r<g.length;r++)n=e[g[r]],C>n.x&&(C=n.x),i<n.x&&(i=n.x),t>n.y&&(t=n.y),A<n.y&&(A=n.y);return C===1e9&&i===-1e9&&t===1e9&&A===-1e9&&(t=0,A=0,C=0,i=0),{minX:C,maxX:i,minY:t,maxY:A}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,g){let t={};return g===void 0||g==="node"?(_(t,e.options,!0),t.x=e.x,t.y=e.y,t.amountOfConnections=e.edges.length):_(t,e.options,!0),t}},Bn=class extends pe{constructor(e,g,t,A,C,i){super(e,g,t,A,C,i),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let g=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!g.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],k(g.edges,t=>{delete this.containedEdges[t.id]}),k(g.containedNodes,(t,A)=>{this.containedNodes[A]=t}),g.containedNodes={},k(g.containedEdges,(t,A)=>{this.containedEdges[A]=t}),g.containedEdges={},k(g.edges,t=>{k(this.edges,A=>{var C,i;let n=G(C=A.clusteringEdgeReplacingIds).call(C,t.id);n!==-1&&(k(t.clusteringEdgeReplacingIds,r=>{A.clusteringEdgeReplacingIds.push(r),this.body.edges[r].edgeReplacedById=A.id}),Ke(i=A.clusteringEdgeReplacingIds).call(i,n,1))})}),g.edges=[]}},Zn=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},q(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,g){e===void 0?e=this._getHubSize():typeof e=="object"&&(g=this._checkOptions(e),e=this._getHubSize());let t=[];for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodes[this.body.nodeIndices[A]];C.edges.length>=e&&t.push(C.id)}for(let A=0;A<t.length;A++)this.clusterByConnection(t[A],g,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);let t={},A={};k(this.body.nodes,(C,i)=>{C.options&&e.joinCondition(C.options)===!0&&(t[i]=C,k(C.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(t,A,e,g)}clusterByEdgeCount(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;g=this._checkOptions(g);let A=[],C={},i,n,r;for(let s=0;s<this.body.nodeIndices.length;s++){let o={},d={},a=this.body.nodeIndices[s],l=this.body.nodes[a];if(C[a]===void 0){r=0,n=[];for(let h=0;h<l.edges.length;h++)i=l.edges[h],this.clusteredEdges[i.id]===void 0&&(i.toId!==i.fromId&&r++,n.push(i));if(r===e){let h=function(f){if(g.joinCondition===void 0||g.joinCondition===null)return!0;let u=de.cloneOptions(f);return g.joinCondition(u)},c=!0;for(let f=0;f<n.length;f++){i=n[f];let u=this._getConnectedId(i,a);if(h(l))d[i.id]=i,o[a]=l,o[u]=this.body.nodes[u],C[a]=!0;else{c=!1;break}}if(U(o).length>0&&U(d).length>0&&c===!0){let u=function(){for(let m=0;m<A.length;++m)for(let E in o)if(A[m].nodes[E]!==void 0)return A[m]}();if(u!==void 0){for(let m in o)u.nodes[m]===void 0&&(u.nodes[m]=o[m]);for(let m in d)u.edges[m]===void 0&&(u.edges[m]=d[m])}else A.push({nodes:o,edges:d})}}}}for(let s=0;s<A.length;s++)this._cluster(A[s].nodes,A[s].edges,g,!1);t===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,g)}clusterBridges(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,g)}clusterByConnection(e,g){var t;let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");let C=this.body.nodes[e];g=this._checkOptions(g,C),g.clusterNodeProperties.x===void 0&&(g.clusterNodeProperties.x=C.x),g.clusterNodeProperties.y===void 0&&(g.clusterNodeProperties.y=C.y),g.clusterNodeProperties.fixed===void 0&&(g.clusterNodeProperties.fixed={},g.clusterNodeProperties.fixed.x=C.options.fixed.x,g.clusterNodeProperties.fixed.y=C.options.fixed.y);let i={},n={},r=C.id,s=de.cloneOptions(C);i[r]=C;for(let d=0;d<C.edges.length;d++){let a=C.edges[d];if(this.clusteredEdges[a.id]===void 0){let l=this._getConnectedId(a,r);if(this.clusteredNodes[l]===void 0)if(l!==r)if(g.joinCondition===void 0)n[a.id]=a,i[l]=this.body.nodes[l];else{let h=de.cloneOptions(this.body.nodes[l]);g.joinCondition(s,h)===!0&&(n[a.id]=a,i[l]=this.body.nodes[l])}else n[a.id]=a}}let o=ae(t=U(i)).call(t,function(d){return i[d].id});for(let d in i){if(!Object.prototype.hasOwnProperty.call(i,d))continue;let a=i[d];for(let l=0;l<a.edges.length;l++){let h=a.edges[l];G(o).call(o,this._getConnectedId(h,a.id))>-1&&(n[h.id]=h)}}this._cluster(i,n,g,A)}_createClusterEdges(e,g,t,A){let C,i,n,r,s,o,d=U(e),a=[];for(let c=0;c<d.length;c++){i=d[c],n=e[i];for(let f=0;f<n.edges.length;f++)C=n.edges[f],this.clusteredEdges[C.id]===void 0&&(C.toId==C.fromId?g[C.id]=C:C.toId==i?(r=t.id,s=C.fromId,o=s):(r=C.toId,s=t.id,o=r),e[o]===void 0&&a.push({edge:C,fromId:s,toId:r}))}let l=[],h=function(c){for(let f=0;f<l.length;f++){let u=l[f],m=c.fromId===u.fromId&&c.toId===u.toId,E=c.fromId===u.toId&&c.toId===u.fromId;if(m||E)return u}return null};for(let c=0;c<a.length;c++){let f=a[c],u=f.edge,m=h(f);m===null?(m=this._createClusteredEdge(f.fromId,f.toId,u,A),l.push(m)):m.clusteringEdgeReplacingIds.push(u.id),this.body.edges[u.id].edgeReplacedById=m.id,this._backupEdgeOptions(u),u.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,C=[];for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&this.clusteredNodes[o]!==void 0&&C.push(o);for(let o=0;o<C.length;++o)delete e[C[o]];if(U(e).length==0||U(e).length==1&&t.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let i=_({},t.clusterNodeProperties);if(t.processProperties!==void 0){let o=[];for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)){let l=de.cloneOptions(e[a]);o.push(l)}let d=[];for(let a in g)if(Object.prototype.hasOwnProperty.call(g,a)&&a.substr(0,12)!=="clusterEdge:"){let l=de.cloneOptions(g[a],"edge");d.push(l)}if(i=t.processProperties(i,o,d),!i)throw new Error("The processProperties function does not return properties!")}i.id===void 0&&(i.id="cluster:"+at());let n=i.id;i.label===void 0&&(i.label="cluster");let r;i.x===void 0&&(r=this._getClusterPosition(e),i.x=r.x),i.y===void 0&&(r===void 0&&(r=this._getClusterPosition(e)),i.y=r.y),i.id=n;let s=this.body.functions.createNode(i,Bn);s.containedNodes=e,s.containedEdges=g,s.clusterEdgeProperties=t.clusterEdgeProperties,this.body.nodes[i.id]=s,this._clusterEdges(e,g,i,t.clusterEdgeProperties),i.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let g=this.clusteredEdges[e.id];g!==void 0&&(e.setOptions({physics:g.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){let g=U(e),t=e[g[0]].x,A=e[g[0]].x,C=e[g[0]].y,i=e[g[0]].y,n;for(let r=1;r<g.length;r++)n=e[g[r]],t=n.x<t?n.x:t,A=n.x>A?n.x:A,C=n.y<C?n.y:C,i=n.y>i?n.y:i;return{x:.5*(t+A),y:.5*(C+i)}}openCluster(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[e];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");let C=this.findNode(e),i=G(C).call(C,e)-1;if(i>=0){let o=C[i];this.body.nodes[o]._openChildCluster(e),delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,r=A.containedEdges;if(g!==void 0&&g.releaseFunction!==void 0&&typeof g.releaseFunction=="function"){let o={},d={x:A.x,y:A.y};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];o[l]={x:h.x,y:h.y}}let a=g.releaseFunction(d,o);for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){let h=this.body.nodes[l];a[l]!==void 0&&(h.x=a[l].x===void 0?A.x:a[l].x,h.y=a[l].y===void 0?A.y:a[l].y)}}else k(n,function(o){o.options.fixed.x===!1&&(o.x=A.x),o.options.fixed.y===!1&&(o.y=A.y)});for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)){let d=this.body.nodes[o];d.vx=A.vx,d.vy=A.vy,d.setOptions({physics:!0}),delete this.clusteredNodes[o]}let s=[];for(let o=0;o<A.edges.length;o++)s.push(A.edges[o]);for(let o=0;o<s.length;o++){let d=s[o],a=this._getConnectedId(d,e),l=this.clusteredNodes[a];for(let h=0;h<d.clusteringEdgeReplacingIds.length;h++){let c=d.clusteringEdgeReplacingIds[h],f=this.body.edges[c];if(f!==void 0)if(l!==void 0){let u=this.body.nodes[l.clusterId];u.containedEdges[f.id]=f,delete r[f.id];let m=f.fromId,E=f.toId;f.toId==a?E=l.clusterId:m=l.clusterId,this._createClusteredEdge(m,E,f,u.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(f)}d.remove()}for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&this._restoreEdge(r[o]);delete this.body.nodes[e],t===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){let g=[];if(this.isCluster(e)===!0){let t=this.body.nodes[e].containedNodes;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&g.push(this.body.nodes[A].id)}return g}findNode(e){let g=[],A=0,C;for(;this.clusteredNodes[e]!==void 0&&A<100;){if(C=this.body.nodes[e],C===void 0)return[];g.push(C.id),e=this.clusteredNodes[e].clusterId,A++}return C=this.body.nodes[e],C===void 0?[]:(g.push(C.id),Zg(g).call(g),g)}updateClusteredNode(e,g){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(g===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(g),this.body.emitter.emit("_dataChanged")}updateEdge(e,g){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(g===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");let t=this.getClusteredEdges(e);for(let A=0;A<t.length;A++)this.body.edges[t[A]].setOptions(g);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){let g=[],A=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&A<100;)g.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,A++;return Zg(g).call(g),g}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let g=[e],t=[],A=[],C=100,i=0;for(;g.length>0&&i<C;){let n=g.pop();if(n===void 0)continue;let r=this.body.edges[n];if(r===void 0)continue;i++;let s=r.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let o=0;o<s.length;++o){let d=s[o];G(g).call(g,s)!==-1||G(t).call(t,s)!==-1||g.push(d)}t.push(n)}return A}_getConnectedId(e,g){return e.toId!=g?e.toId:(e.fromId!=g,e.fromId)}_getHubSize(){let e=0,g=0,t=0,A=0;for(let r=0;r<this.body.nodeIndices.length;r++){let s=this.body.nodes[this.body.nodeIndices[r]];s.edges.length>A&&(A=s.edges.length),e+=s.edges.length,g+=Math.pow(s.edges.length,2),t+=1}e=e/t,g=g/t;let C=g-Math.pow(e,2),i=Math.sqrt(C),n=Math.floor(e+2*i);return n>A&&(n=A),n}_createClusteredEdge(e,g,t,A,C){let i=de.cloneOptions(t,"edge");_(i,A),i.from=e,i.to=g,i.id="clusterEdge:"+at(),C!==void 0&&_(i,C);let n=this.body.functions.createEdge(i);return n.clusteringEdgeReplacingIds=[t.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(e,g,t,A){if(g instanceof Dg){let C=g,i={};i[C.id]=C,g=i}if(e instanceof pe){let C=e,i={};i[C.id]=C,e=i}if(t==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=t.clusterEdgeProperties),this._createClusterEdges(e,g,t,A);for(let C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&this.body.edges[C]!==void 0){let i=this.body.edges[C];this._backupEdgeOptions(i),i.setOptions({physics:!1})}for(let C in e)Object.prototype.hasOwnProperty.call(e,C)&&(this.clusteredNodes[C]={clusterId:t.id,node:this.body.nodes[C]},this.body.nodes[C].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let g=this.clusteredNodes[e];if(g===void 0)return;let t=g.clusterId;if(t!==void 0)return this.body.nodes[t]}_filter(e,g){let t=[];return k(e,A=>{g(A)&&t.push(A)}),t}_updateState(){let e,g=[],t={},A=r=>{k(this.body.nodes,s=>{s.isCluster===!0&&r(s)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&g.push(e)}A(function(r){for(let s=0;s<g.length;s++)delete r.containedNodes[g[s]]});for(let r=0;r<g.length;r++)delete this.clusteredNodes[g[r]];k(this.clusteredEdges,r=>{let s=this.body.edges[r];(s===void 0||!s.endPointsValid())&&(t[r]=r)}),A(function(r){k(r.containedEdges,(s,o)=>{!s.endPointsValid()&&!t[o]&&(t[o]=o)})}),k(this.body.edges,(r,s)=>{let o=!0,d=r.clusteringEdgeReplacingIds;if(d!==void 0){let a=0;k(d,l=>{let h=this.body.edges[l];h!==void 0&&h.endPointsValid()&&(a+=1)}),o=a>0}(!r.endPointsValid()||!o)&&(t[s]=s)}),A(r=>{k(t,s=>{delete r.containedEdges[s],k(r.edges,(o,d)=>{if(o.id===s){r.edges[d]=null;return}o.clusteringEdgeReplacingIds=this._filter(o.clusteringEdgeReplacingIds,function(a){return!t[a]})}),r.edges=this._filter(r.edges,function(o){return o!==null})})}),k(t,r=>{delete this.clusteredEdges[r]}),k(t,r=>{delete this.body.edges[r]});let C=U(this.body.edges);k(C,r=>{let s=this.body.edges[r],o=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(o!==this._isClusteredEdge(s.id))if(o){let d=this._getClusterNodeForNode(s.fromId);d!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,d);let a=this._getClusterNodeForNode(s.toId);a!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,a)}else delete this._clusterEdges[r],this._restoreEdge(s)});let i=!1,n=!0;for(;n;){let r=[];A(function(s){let o=U(s.containedNodes).length,d=s.options.allowSingleNodeCluster===!0;(d&&o<1||!d&&o<2)&&r.push(s.id)});for(let s=0;s<r.length;++s)this.openCluster(r[s],{},!1);n=r.length>0,i=i||n}i&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},Ln=class{constructor(e,g){this.body=e,this.canvas=g,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Qe(()=>{var g;this.zooming=!1,b(g=this._requestRedraw).call(g,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",b(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&Dt(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(b(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;let g={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let t=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,C=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,A,C),this.canvas.frame.clientWidth===0)return;if(t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(t),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:i}=this._drawNodes(t,e);g.drawExternalLabels=i}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(t),g.drawExternalLabels!=null&&g.drawExternalLabels(),e===!1&&this._drawSelectionBox(t),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),e===!0&&t.clearRect(0,0,A,C)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let g=this.body.nodes,t;for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&(t=g[A],t.resize(e),t.updateBoundingBox(e,t.selected));e.restore()}_drawNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.body.nodes,A=this.body.nodeIndices,C,i=[],n=[],r=20,s=this.canvas.DOMtoCanvas({x:-r,y:-r}),o=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),d={top:s.y,left:s.x,bottom:o.y,right:o.x},a=[];for(let f=0;f<A.length;f++)if(C=t[A[f]],C.hover)n.push(A[f]);else if(C.isSelected())i.push(A[f]);else if(g===!0){let u=C.draw(e);u.drawExternalLabel!=null&&a.push(u.drawExternalLabel)}else if(C.isBoundingBoxOverlappingWith(d)===!0){let u=C.draw(e);u.drawExternalLabel!=null&&a.push(u.drawExternalLabel)}else C.updateBoundingBox(e,C.selected);let l,h=i.length,c=n.length;for(l=0;l<h;l++){C=t[i[l]];let f=C.draw(e);f.drawExternalLabel!=null&&a.push(f.drawExternalLabel)}for(l=0;l<c;l++){C=t[n[l]];let f=C.draw(e);f.drawExternalLabel!=null&&a.push(f.drawExternalLabel)}return{drawExternalLabels:()=>{for(let f of a)f()}}}_drawEdges(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.draw(e)}}_drawArrows(e){let g=this.body.edges,t=this.body.edgeIndices;for(let A=0;A<t.length;A++){let C=g[t[A]];C.connected===!0&&C.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let g=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,t=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,g,t),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}},aM=L,dM=aM.setInterval,lM=dM,hM=P(lM);function jI(I,e){e.inputHandler=function(g){g.isFirst&&e(g)},I.on("hammer.input",e.inputHandler)}function Gh(I,e){return e.inputHandler=function(g){g.isFinal&&e(g)},I.on("hammer.input",e.inputHandler)}var Gn=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",g=>{g.width!==0&&(this.body.view.translation.x=g.width*.5),g.height!==0&&(this.body.view.translation.y=g.height*.5)}),this.body.emitter.on("setSize",b(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&Dt(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var g;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:C}=this;A.observe(C),this._cleanupCallbacks.push(()=>{A.unobserve(C)})}else{let A=hM(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let t=b(g=this._onResize).call(g,this);window.addEventListener("resize",t),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",t)})}}_cleanUp(){var e,g,t;F(e=Zg(g=Ke(t=this._cleanupCallbacks).call(t,0)).call(g)).call(e,A=>{try{A()}catch(C){console.error(C)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,g=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,t=this.cameraState.scale;e!=1&&g!=1?t=this.cameraState.scale*.5*(e+g):e!=1?t=this.cameraState.scale*e:g!=1&&(t=this.cameraState.scale*g),this.body.view.scale=t;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),C={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=C.x*this.body.view.scale,this.body.view.translation.y+=C.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(G(e).call(e,"%")!==-1||G(e).call(e,"px")!==-1)return e;if(G(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{let e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new ot(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:ot.DIRECTION_ALL}),jI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new ot(this.frame),Gh(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),g=this._prepareValue(g);let t=!1,A=this.frame.canvas.width,C=this.frame.canvas.height,i=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||g!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=g)this._getCameraState(i),this.frame.style.width=e,this.frame.style.height=g,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=g,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},t=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),r=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==r)&&this._getCameraState(i),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,t=!0),this.frame.canvas.height!==r&&(this.frame.canvas.height=r,t=!0)}return t===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(A/this.pixelRatio),oldHeight:Math.round(C/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,t}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let g=1;typeof window!="undefined"&&(g=window.devicePixelRatio||1);let t=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return g/t}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function cM(I,e){let g=q({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},I!=null?I:{});if(!z(g.nodes))throw new TypeError("Nodes has to be an array of ids.");if(g.nodes.length===0&&(g.nodes=e),!(typeof g.minZoomLevel=="number"&&g.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof g.maxZoomLevel=="number"&&g.minZoomLevel<=g.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return g}var jn=class{constructor(e,g){var t,A;this.body=e,this.canvas=g,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",b(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",b(A=this.releaseNode).call(A,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=cM(e,this.body.nodeIndices);let t=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,C,i;if(t===0||A===0)i=1,C=de.getRange(this.body.nodes,e.nodes);else if(g===!0){let s=0;for(let a in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,a)&&this.body.nodes[a].predefinedPosition===!0&&(s+=1);if(s>.5*this.body.nodeIndices.length){this.fit(e,!1);return}C=de.getRange(this.body.nodes,e.nodes),i=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let d=Math.min(t/600,A/600);i*=d}else{this.body.emitter.emit("_resizeNodes"),C=de.getRange(this.body.nodes,e.nodes);let s=Math.abs(C.maxX-C.minX)*1.1,o=Math.abs(C.maxY-C.minY)*1.1,d=t/s,a=A/o;i=d<=a?d:a}i>e.maxZoomLevel?i=e.maxZoomLevel:i<e.minZoomLevel&&(i=e.minZoomLevel);let r={position:de.findCenter(C),scale:i,animation:e.animation};this.moveTo(r)}focus(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){let t={x:this.body.nodes[e].x,y:this.body.nodes[e].y};g.position=t,g.lockedOnNode=e,this.moveTo(g)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Fg(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Fg(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Fg(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Fg(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.position.x,y:g.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+t.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+t.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=b(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var C;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=b(C=this._transitionRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},g=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),t={x:g.x-e.x,y:g.y-e.y},A=this.body.view.translation,C={x:A.x+t.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+t.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=C}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let g=hO[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*g,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*g,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*g},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var t;this.viewFunction=b(t=this._lockedRedraw).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}},uM=`div.vis-network div.vis-navigation div.vis-button {
654
+ `);let g=String(e).split(`
655
+ `),A=g.length;if(t.multi)for(let I=0;I<A;I++){let C=this.splitBlocks(g[I],t.multi);if(C!==void 0){if(C.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let n=0;n<C.length;n++){let r=C[n].mod,s=C[n].text;this.splitStringIntoLines(s,r,!0)}else for(let n=0;n<C.length;n++){let r=C[n].mod,s=C[n].text;this.lines.append(s,r)}this.lines.newLine()}}else if(t.maxWdt>0)for(let I=0;I<A;I++)this.splitStringIntoLines(g[I]);else for(let I=0;I<A;I++)this.lines.newLine(g[I]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new aI(e),g=A=>/&/.test(A)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let A=t.text.charAt(t.position);t.parseWS(A)||/</.test(A)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||g(A)||t.add(A),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new aI(e),g=!0,A=I=>/\\/.test(I)?(t.position<this.text.length+1&&(t.position++,I=this.text.charAt(t.position),/ \t/.test(I)?t.spacing=!0:(t.add(I),g=!1)),!0):!1;for(;t.position<t.text.length;){let I=t.text.charAt(t.position);t.parseWS(I)||A(I)||(g||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(I),g=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let g=this.decodeMarkupSystem(t);if(g==="none")return[{text:e,mod:"normal"}];if(g==="markdown")return this.splitMarkdownBlocks(e);if(g==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",g=0;for(;g<e.length;){let I=t+(t===""?"":" ")+e[g];if(this.overMaxWidth(I))break;t=I,g++}return g}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(Ye(e).call(e,0,t));)t++;return t}splitStringIntoLines(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let A=e.split("\r");for(;A.length>0;){let I=this.getLongestFit(A);if(I===0){let C=A[0],n=this.getLongestFitWord(C);this.lines.newLine(Ye(C).call(C,0,n),t),A[0]=Ye(C).call(C,n)}else{let C=I;A[I-1]===" "?I--:A[C]===" "&&C++;let n=Ye(A).call(A,0,I).join("");I==A.length&&g?this.lines.append(n,t):this.lines.newLine(n,t),A=Ye(A).call(A,C)}}}},IA=["bold","ital","boldital","mono"],lI=class i{constructor(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=g}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),oI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(k(IA,t=>{this.fontOptions[t]={}}),i.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}k(e,(t,g)=>{t!=null&&typeof t!="object"&&(this.fontOptions[g]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let g=t.split(" ");return e.size=+g[0].replace("px",""),e.face=g[1],e.color=g[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},g=Rt(e,"widthConstraint");if(typeof g=="number")t.maxWdt=Number(g),t.minWdt=Number(g);else if(typeof g=="object"){let I=Rt(e,["widthConstraint","maximum"]);typeof I=="number"&&(t.maxWdt=Number(I));let C=Rt(e,["widthConstraint","minimum"]);typeof C=="number"&&(t.minWdt=Number(C))}let A=Rt(e,"heightConstraint");if(typeof A=="number")t.minHgt=Number(A);else if(typeof A=="object"){let I=Rt(e,["heightConstraint","minimum"]);typeof I=="number"&&(t.minHgt=Number(I));let C=Rt(e,["heightConstraint","valign"]);typeof C=="string"&&(C==="top"||C==="bottom")&&(t.valign=C)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),U(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=_s("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let g=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=g)}addFontOptionsToPile(e,t){for(let g=0;g<t.length;++g)this.addFontToPile(e,t[g])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let g=t.font;e.push(g)}getBasicOptions(e){let t={};for(let g=0;g<e.length;++g){let A=e[g],I={};i.parseFontString(I,A)&&(A=I),k(A,(C,n)=>{C!==void 0&&(Object.prototype.hasOwnProperty.call(t,n)||(G(IA).call(IA,n)!==-1?t[n]={}:t[n]=C))})}return t}getFontOption(e,t,g){let A;for(let I=0;I<e.length;++I){let C=e[I];if(Object.prototype.hasOwnProperty.call(C,t)){if(A=C[t],A==null)continue;let n={};if(i.parseFontString(n,A)&&(A=n),Object.prototype.hasOwnProperty.call(A,g))return A[g]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,g))return this.fontOptions[g];throw new Error("Did not find value for multi-font for property: '"+g+"'")}getFontOptions(e,t){let g={},A=["color","size","face","mod","vadjust"];for(let I=0;I<A.length;++I){let C=A[I];g[C]=this.getFontOption(e,t,C)}return g}propagateFonts(e){let t=[];this.addFontOptionsToPile(t,e),this.fontOptions=this.getBasicOptions(t);for(let g=0;g<IA.length;++g){let A=IA[g],I=this.fontOptions[A],C=this.getFontOptions(t,A);k(C,(n,r)=>{I[r]=n}),I.size=Number(I.size),I.vadjust=Number(I.vadjust)}}draw(e,t,g,A,I){let C=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let n=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&n<this.elementOptions.scaling.label.drawThreshold-1||(n>=this.elementOptions.scaling.label.maxVisible&&(n=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,A,I,t,g,C),this._drawBackground(e),this._drawText(e,t,this.size.yLine,C,n))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;let t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",I=arguments.length>4?arguments[4]:void 0;[t,g]=this._setAlignment(e,t,g,A),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(g-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(g+=(this.size.height-this.size.labelHeight)/2));for(let C=0;C<this.lineCount;C++){let n=this.lines[C];if(n&&n.blocks){let r=0;this.isEdgeLabel||this.fontOptions.align==="center"?r+=(this.size.width-n.width)/2:this.fontOptions.align==="right"&&(r+=this.size.width-n.width);for(let s=0;s<n.blocks.length;s++){let o=n.blocks[s];e.font=o.font;let[a,l]=this._getColor(o.color,I,o.strokeColor);o.strokeWidth>0&&(e.lineWidth=o.strokeWidth,e.strokeStyle=l,e.lineJoin="round"),e.fillStyle=a,o.strokeWidth>0&&e.strokeText(o.text,t+r,g+o.vadjust),e.fillText(o.text,t+r,g+o.vadjust),r+=o.width}g+=n.height}}}_setAlignment(e,t,g,A){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,g=0;let I=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",g-=2*I):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",g+=2*I):e.textBaseline="middle"}else e.textBaseline=A;return[t,g]}_getColor(e,t,g){let A=e||"#000000",I=g||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){let C=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));A=Fe(A,C),I=Fe(I,C)}return[A,I]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,g),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,g=this.size.top-.5*2;if(this.isEdgeLabel){let I=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=I,g=-this.size.height*.5;break;case"top":t=I,g=-(this.size.height+2);break;case"bottom":t=I,g=2;break}}return{left:t,top:g,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,C=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,g),this.size.left=A-this.size.width*.5,this.size.top=I-this.size.height*.5,this.size.yLine=I+(1-this.lineCount)*.5*this.fontOptions.size,C==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,g,A){let I=function(r,s,o){return s==="normal"?o==="mod"?"":r[o]:r[s][o]!==void 0?r[s][o]:r[o]},C={color:I(this.fontOptions,A,"color"),size:I(this.fontOptions,A,"size"),face:I(this.fontOptions,A,"face"),mod:I(this.fontOptions,A,"mod"),vadjust:I(this.fontOptions,A,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||g)&&(A==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?C.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(C,this.elementOptions.id,t,g));let n="";return C.mod!==void 0&&C.mod!==""&&(n+=C.mod+" "),n+=C.size+"px "+C.face,e.font=n.replace(/"/g,""),C.font=e.font,C.height=C.size,C}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,g,A){return new er(e,this,t,g).process(A)}_processLabel(e,t,g){if(this.labelDirty===!1&&!this.differentState(t,g))return;let A=this._processLabelText(e,t,g,this.elementOptions.label);this.fontOptions.minWdt>0&&A.width<this.fontOptions.minWdt&&(A.width=this.fontOptions.minWdt),this.size.labelHeight=A.height,this.fontOptions.minHgt>0&&A.height<this.fontOptions.minHgt&&(A.height=this.fontOptions.minHgt),this.lines=A.lines,this.lineCount=A.lines.length,this.size.width=A.width,this.size.height=A.height,this.selectedState=t,this.hoverState=g,this.labelDirty=!1}visible(){return!(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0||this.fontOptions.size*this.body.view.scale<this.elementOptions.scaling.label.drawThreshold-1)}},mt=class{constructor(e,t,g){this.body=t,this.labelModule=g,this.setOptions(e),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}setOptions(e){this.options=e}_setMargins(e){this.margin={},this.options.margin&&(typeof this.options.margin=="object"?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}_distanceToBorder(e,t){let g=this.options.borderWidth;return e&&this.resize(e),Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+g}enableShadow(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}enableBorderDashes(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){let g=t.borderDashes;g===!0&&(g=[5,15]),e.setLineDash(g)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}disableBorderDashes(e,t){t.borderDashes!==!1&&(e.setLineDash!==void 0?e.setLineDash([0]):(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1))}needsRefresh(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}initContextForDraw(e,t){let g=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,g),e.strokeStyle=t.borderColor,e.fillStyle=t.color}performStroke(e,t){let g=t.borderWidth/this.body.view.scale;e.save(),g>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),$A(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,g,A,I){g!==void 0&&this.resize(g,A,I),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,g,A,I){this._updateBoundingBox(e,t,g,A,I)}getDimensionsFromLabel(e,t,g){this.textSize=this.labelModule.getTextSize(e,t,g);let A=this.textSize.width,I=this.textSize.height,C=14;return A===0&&(A=C,I=C),{width:A,height:I}}},rF=class extends mt{constructor(e,t,g){super(e,t,g),this._setMargins(g)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,g)){let A=this.getDimensionsFromLabel(e,t,g);this.width=A.width+this.margin.right+this.margin.left,this.height=A.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,g,A,I,C){this.resize(e,A,I),this.left=t-this.width/2,this.top=g-this.height/2,this.initContextForDraw(e,C),Md(e,this.left,this.top,this.width,this.height,C.borderRadius),this.performFill(e,C),this.updateBoundingBox(t,g,e,A,I),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,I)}updateBoundingBox(e,t,g,A,I){this._updateBoundingBox(e,t,g,A,I);let C=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(C)}distanceToBorder(e,t){e&&this.resize(e);let g=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+g}},TA=class extends mt{constructor(e,t,g){super(e,t,g),this.labelOffset=0,this.selected=!1}setOptions(e,t,g){this.options=e,t===void 0&&g===void 0||this.setImages(t,g)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){let t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){let g=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=g}}_getImagePadding(){let e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){let t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let g=1,A=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?g=this.imageObj.width/this.imageObj.height:A=this.imageObj.height/this.imageObj.width),e=this.options.size*2*g,t=this.options.size*2*A}else{let g=this._getImagePadding();e=this.imageObj.width+g.left+g.right,t=this.imageObj.height+g.top+g.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,g,A){this.initContextForDraw(e,A),qr(e,t,g,A.size),this.performFill(e,A)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let g=1;this.options.shapeProperties.interpolation===!0&&(g=this.imageObj.width/this.width/this.body.view.scale);let A=this._getImagePadding(),I=this.left+A.left,C=this.top+A.top,n=this.width-A.left-A.right,r=this.height-A.top-A.bottom;this.imageObj.drawImageAtPosition(e,g,I,C,n,r),this.disableShadow(e,t)}}_drawImageLabel(e,t,g,A,I){let C=0;if(this.height!==void 0){C=this.height*.5;let r=this.labelModule.getTextSize(e,A,I);r.lineCount>=1&&(C+=r.height/2)}let n=g+C;this.options.label&&(this.labelOffset=C),this.labelModule.draw(e,t,n,A,I,"hanging")}},sF=class extends TA{constructor(e,t,g){super(e,t,g),this._setMargins(g)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,g)){let A=this.getDimensionsFromLabel(e,t,g),I=Math.max(A.width+this.margin.right+this.margin.left,A.height+this.margin.top+this.margin.bottom);this.options.size=I/2,this.width=I,this.height=I,this.radius=this.width/2}}draw(e,t,g,A,I,C){this.resize(e,A,I),this.left=t-this.width/2,this.top=g-this.height/2,this._drawRawCircle(e,t,g,C),this.updateBoundingBox(t,g),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,g,A,I)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},tr=class extends TA{constructor(e,t,g,A,I){super(e,t,g),this.setImages(A,I)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let I=this.options.size*2;this.width=I,this.height=I,this.radius=.5*this.width;return}this.needsRefresh(t,g)&&this._resizeImage()}draw(e,t,g,A,I,C){this.switchImages(A),this.resize();let n=t,r=g;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=g,n+=this.width/2,r+=this.height/2):(this.left=t-this.width/2,this.top=g-this.height/2),this._drawRawCircle(e,n,r,C),e.save(),e.clip(),this._drawImageAtPosition(e,C),e.restore(),this._drawImageLabel(e,n,r,A,I),this.updateBoundingBox(t,g)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}},Ct=class extends mt{constructor(e,t,g){super(e,t,g)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,g)){var I,C;this.labelModule.getTextSize(e,t,g);let n=2*A.size;this.width=(I=this.customSizeWidth)!==null&&I!==void 0?I:n,this.height=(C=this.customSizeHeight)!==null&&C!==void 0?C:n,this.radius=.5*this.width}}_drawShape(e,t,g,A,I,C,n,r){return this.resize(e,C,n,r),this.left=A-this.width/2,this.top=I-this.height/2,this.initContextForDraw(e,r),Wv(t)(e,A,I,r.size),this.performFill(e,r),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(C?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,A,I)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,C,n,A,I,"hanging");let s=I+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,A,s,C,n,"hanging")}this.updateBoundingBox(A,I)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}};function td(i,e){var t=K(i);if(it){var g=it(i);e&&(g=Ae(g).call(g,function(A){return rt(i,A).enumerable})),t.push.apply(t,g)}return t}function oF(i){for(var e=1;e<arguments.length;e++){var t,g,A=arguments[e]!=null?arguments[e]:{};e%2?F(t=td(Object(A),!0)).call(t,function(I){ge(i,I,A[I])}):It?ii(i,It(A)):F(g=td(Object(A))).call(g,function(I){Ii(i,I,rt(A,I))})}return i}var gr=class extends Ct{constructor(e,t,g,A){super(e,t,g,A),this.ctxRenderer=A}draw(e,t,g,A,I,C){this.resize(e,A,I,C),this.left=t-this.width/2,this.top=g-this.height/2,e.save();let n=this.ctxRenderer({ctx:e,id:this.options.id,x:t,y:g,state:{selected:A,hover:I},style:oF({},C),label:this.options.label});if(n.drawNode!=null&&n.drawNode(),e.restore(),n.drawExternalLabel){let r=n.drawExternalLabel;n.drawExternalLabel=()=>{e.save(),r(),e.restore()}}return n.nodeDimensions&&(this.customSizeWidth=n.nodeDimensions.width,this.customSizeHeight=n.nodeDimensions.height),n}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},Ar=class extends mt{constructor(e,t,g){super(e,t,g),this._setMargins(g)}resize(e,t,g){if(this.needsRefresh(t,g)){let I=this.getDimensionsFromLabel(e,t,g).width+this.margin.right+this.margin.left;this.width=I,this.height=I,this.radius=this.width/2}}draw(e,t,g,A,I,C){this.resize(e,A,I),this.left=t-this.width/2,this.top=g-this.height/2,this.initContextForDraw(e,C),Fd(e,t-this.width/2,g-this.height/2,this.width,this.height),this.performFill(e,C),this.updateBoundingBox(t,g,e,A,I),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,I)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},aF=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"diamond",4,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},ir=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"circle",2,t,g,A,I,C)}distanceToBorder(e){return e&&this.resize(e),this.options.size}},dI=class extends mt{constructor(e,t,g){super(e,t,g)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,g)){let A=this.getDimensionsFromLabel(e,t,g);this.height=A.height*2,this.width=A.width+A.height,this.radius=.5*this.width}}draw(e,t,g,A,I,C){this.resize(e,A,I),this.left=t-this.width*.5,this.top=g-this.height*.5,this.initContextForDraw(e,C),yn(e,this.left,this.top,this.width,this.height),this.performFill(e,C),this.updateBoundingBox(t,g,e,A,I),this.labelModule.draw(e,t,g,A,I)}distanceToBorder(e,t){e&&this.resize(e);let g=this.width*.5,A=this.height*.5,I=Math.sin(t)*g,C=Math.cos(t)*A;return g*A/Math.sqrt(I*I+C*C)}},Ir=class extends mt{constructor(e,t,g){super(e,t,g),this._setMargins(g)}resize(e,t,g){this.needsRefresh(t,g)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,g,A,I,C){return this.resize(e,A,I),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=g-this.height/2,this._icon(e,t,g,A,I,C),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,g+this.height/2+5,A),this.updateBoundingBox(t,g)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,g,A,I,C){let n=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:A?"bold":"",(this.options.icon.weight!=null&&A?5:0)+n+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,C),e.fillText(this.options.icon.code,t,g),this.disableShadow(e,C)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},lF=class extends TA{constructor(e,t,g,A,I){super(e,t,g),this.setImages(A,I)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){let I=this.options.size*2;this.width=I,this.height=I;return}this.needsRefresh(t,g)&&this._resizeImage()}draw(e,t,g,A,I,C){e.save(),this.switchImages(A),this.resize();let n=t,r=g;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=g,n+=this.width/2,r+=this.height/2):(this.left=t-this.width/2,this.top=g-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){let s=this.options.borderWidth,o=this.options.borderWidthSelected||2*this.options.borderWidth,a=(A?o:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.beginPath();let l=A?this.options.color.highlight.border:I?this.options.color.hover.border:this.options.color.border,d=A?this.options.color.highlight.background:I?this.options.color.hover.background:this.options.color.background;C.opacity!==void 0&&(l=Fe(l,C.opacity),d=Fe(d,C.opacity)),e.strokeStyle=l,e.fillStyle=d,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),$A(e).call(e),this.performStroke(e,C),e.closePath()}this._drawImageAtPosition(e,C),this._drawImageLabel(e,n,r,A,I),this.updateBoundingBox(t,g),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},Cr=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"square",2,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},nr=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"hexagon",4,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},rr=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"star",4,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},sr=class extends mt{constructor(e,t,g){super(e,t,g),this._setMargins(g)}resize(e,t,g){this.needsRefresh(t,g)&&(this.textSize=this.labelModule.getTextSize(e,t,g),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,g,A,I,C){this.resize(e,A,I),this.left=t-this.width/2,this.top=g-this.height/2,this.enableShadow(e,C),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,A,I),this.disableShadow(e,C),this.updateBoundingBox(t,g,e,A,I)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},dF=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"triangle",3,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}},or=class extends Ct{constructor(e,t,g){super(e,t,g)}draw(e,t,g,A,I,C){return this._drawShape(e,"triangleDown",3,t,g,A,I,C)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};function gd(i,e){var t=K(i);if(it){var g=it(i);e&&(g=Ae(g).call(g,function(A){return rt(i,A).enumerable})),t.push.apply(t,g)}return t}function Ad(i){for(var e=1;e<arguments.length;e++){var t,g,A=arguments[e]!=null?arguments[e]:{};e%2?F(t=gd(Object(A),!0)).call(t,function(I){ge(i,I,A[I])}):It?ii(i,It(A)):F(g=gd(Object(A))).call(g,function(I){Ii(i,I,rt(A,I))})}return i}var be=class i{constructor(e,t,g,A,I,C){this.options=zt(I),this.globalOptions=I,this.defaultOptions=C,this.body=t,this.edges=[],this.id=void 0,this.imagelist=g,this.grouplist=A,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new lI(this.body,this.options,!1),this.setOptions(e)}attachEdge(e){var t;G(t=this.edges).call(t,e)===-1&&this.edges.push(e)}detachEdge(e){var t;let g=G(t=this.edges).call(t,e);if(g!=-1){var A;tt(A=this.edges).call(A,g,1)}}setOptions(e){let t=this.options.shape;if(!e)return;if(typeof e.color!="undefined"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");i.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Ve(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Ve(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=au(e.value)),i.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);let g=[e,this.options,this.defaultOptions];return this.chooser=_s("node",g),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&i.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),e.hidden!==void 0||e.physics!==void 0}_load_images(){if((this.options.shape==="circularImage"||this.options.shape==="image")&&this.options.image===void 0)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(this.options.image!==void 0){if(this.imagelist===void 0)throw new Error("Internal Error: No images provided");if(typeof this.options.image=="string")this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(this.options.image.unselected===void 0)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.options.image.selected!==void 0?this.imageObjAlt=this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id):this.imageObjAlt=void 0}}}static checkOpacity(e){return 0<=e&&e<=1}static checkCoordinateOrigin(e){return e===void 0||e==="center"||e==="top-left"}static updateGroupOptions(e,t,g){var A;if(g===void 0)return;let I=e.group;if(t!==void 0&&t.group!==void 0&&I!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if(!(typeof I=="number"||typeof I=="string"&&I!=""))return;let n=g.get(I);n.opacity!==void 0&&t.opacity===void 0&&(i.checkOpacity(n.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+n.opacity),n.opacity=void 0));let r=Ae(A=CF(t)).call(A,s=>t[s]!=null);r.push("font"),iI(r,e,n),e.color=Gn(e.color)}static parseOptions(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},I=arguments.length>4?arguments[4]:void 0;if(iI(["color","fixed","shadow"],e,t,g),i.checkMass(t),e.opacity!==void 0&&(i.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(i.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!i.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),Me(e,t,"shadow",A),t.color!==void 0&&t.color!==null){let n=Gn(t.color);wc(e.color,n)}else g===!0&&t.color===null&&(e.color=zt(A.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),g===!0&&t.font===null&&(e.font=zt(A.font)),i.updateGroupOptions(e,t,I),t.scaling!==void 0&&Me(e.scaling,t.scaling,"label",A.scaling)}getFormattingValues(){let e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){let t=this.options.opacity;e.borderColor=Fe(e.borderColor,t),e.color=Fe(e.color,t),e.shadowColor=Fe(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),i.updateGroupOptions(this.options,Ad(Ad({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);let t=this.grouplist.get(this.options.group,!1),g=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,g),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new rF(this.options,this.body,this.labelModule);break;case"circle":this.shape=new sF(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new tr(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new gr(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new Ar(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new aF(this.options,this.body,this.labelModule);break;case"dot":this.shape=new ir(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new dI(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Ir(this.options,this.body,this.labelModule);break;case"image":this.shape=new lF(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Cr(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new nr(this.options,this.body,this.labelModule);break;case"star":this.shape=new rr(this.options,this.body,this.labelModule);break;case"text":this.shape=new sr(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new dF(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new or(this.options,this.body,this.labelModule);break;default:this.shape=new dI(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,g){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,t,g,this.options.value),I=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let C=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*C}this.options.size=this.options.scaling.min+A*I}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){let t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){let t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){let t=[];return this.labelModule.visible()&&Jn(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Jn(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let g="";t!==void 0&&(g=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+g+", setting mass to 1.",Oc),e.mass=1}}},ar=class{constructor(e,t,g,A){var I;if(this.body=e,this.images=t,this.groups=g,this.layoutEngine=A,this.body.functions.createNode=y(I=this.create).call(I,this),this.nodesListeners={add:(C,n)=>{this.add(n.items)},update:(C,n)=>{this.update(n.items,n.data,n.oldData)},remove:(C,n)=>{this.remove(n.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(C,n,r,s){if(n===C)return .5;{let o=1/(n-C);return Math.max(0,(s-C)*o)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=zt(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",y(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",y(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{k(this.nodesListeners,(g,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,g)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(be.parseOptions(this.options,e),e.opacity!==void 0&&(Kn(e.opacity)||!Qt(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(let t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font!="undefined"||typeof e.widthConstraint!="undefined"||typeof e.heightConstraint!="undefined")for(let t of K(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(let t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.body.data.nodes;if(su("id",e))this.body.data.nodes=e;else if(B(e))this.body.data.nodes=new pt,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new pt;else throw new TypeError("Array or DataSet expected");if(g&&k(this.nodesListeners,function(A,I){g.off(I,A)}),this.body.nodes={},this.body.data.nodes){let A=this;k(this.nodesListeners,function(C,n){A.body.data.nodes.on(n,C)});let I=this.body.data.nodes.getIds();this.add(I,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,A=[];for(let I=0;I<e.length;I++){g=e[I];let C=this.body.data.nodes.get(g),n=this.create(C);A.push(n),this.body.nodes[g]=n}this.layoutEngine.positionInitially(A),t===!1&&this.body.emitter.emit("_dataChanged")}update(e,t,g){let A=this.body.nodes,I=!1;for(let C=0;C<e.length;C++){let n=e[C],r=A[n],s=t[C];r!==void 0?r.setOptions(s)&&(I=!0):(I=!0,r=this.create(s),A[n]=r)}!I&&g!==void 0&&(I=Wc(t).call(t,function(C,n){let r=g[n];return r&&r.level!==C.level})),I===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}remove(e){let t=this.body.nodes;for(let g=0;g<e.length;g++){let A=e[g];delete t[A]}this.body.emitter.emit("_dataChanged")}create(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:be;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;k(this.body.nodes,(t,g)=>{let A=this.body.data.nodes.get(g);A!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(A))})}getPositions(e){let t={};if(e!==void 0){if(B(e)===!0){for(let g=0;g<e.length;g++)if(this.body.nodes[e[g]]!==void 0){let A=this.body.nodes[e[g]];t[e[g]]={x:Math.round(A.x),y:Math.round(A.y)}}}else if(this.body.nodes[e]!==void 0){let g=this.body.nodes[e];t[e]={x:Math.round(g.x),y:Math.round(g.y)}}}else for(let g=0;g<this.body.nodeIndices.length;g++){let A=this.body.nodes[this.body.nodeIndices[g]];t[this.body.nodeIndices[g]]={x:Math.round(A.x),y:Math.round(A.y)}}return t}getPosition(e){if(e==null)throw new TypeError("No id was specified for getPosition method.");if(this.body.nodes[e]==null)throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(e));return{x:Math.round(this.body.nodes[e].x),y:Math.round(this.body.nodes[e].y)}}storePositions(){let e=[],t=this.body.data.nodes.getDataSet();for(let g of t.get()){let A=g.id,I=this.body.nodes[A],C=Math.round(I.x),n=Math.round(I.y);(g.x!==C||g.y!==n)&&e.push({id:A,x:C,y:n})}t.update(e)}getBoundingBox(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}getConnectedNodes(e,t){let g=[];if(this.body.nodes[e]!==void 0){let A=this.body.nodes[e],I={};for(let C=0;C<A.edges.length;C++){let n=A.edges[C];t!=="to"&&n.toId==A.id?I[n.fromId]===void 0&&(g.push(n.fromId),I[n.fromId]=!0):t!=="from"&&n.fromId==A.id&&I[n.toId]===void 0&&(g.push(n.toId),I[n.toId]=!0)}}return g}getConnectedEdges(e){let t=[];if(this.body.nodes[e]!==void 0){let g=this.body.nodes[e];for(let A=0;A<g.edges.length;A++)t.push(g.edges[A].id)}else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}moveNode(e,t,g){this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(g),gt(()=>{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}},hF=D,id=Math.hypot,cF=Math.abs,uF=Math.sqrt,fF=!!id&&id(1/0,NaN)!==1/0;hF({target:"Math",stat:!0,arity:2,forced:fF},{hypot:function(e,t){for(var g=0,A=0,I=arguments.length,C=0,n,r;A<I;)n=cF(arguments[A++]),C<n?(r=C/n,g=g*r*r+1,C=n):n>0?(r=n/C,g+=r*r):g+=n;return C===1/0?1/0:C*uF(g)}});var pF=Z,mF=pF.Math.hypot,vF=mF,bF=vF,yF=bF,wF=R(yF),Q=class{static transform(e,t){B(e)||(e=[e]);let g=t.point.x,A=t.point.y,I=t.angle,C=t.length;for(let n=0;n<e.length;++n){let r=e[n],s=r.x*Math.cos(I)-r.y*Math.sin(I),o=r.x*Math.sin(I)+r.y*Math.cos(I);r.x=g+C*s,r.y=A+C*o}}static drawPath(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let g=1;g<t.length;++g)e.lineTo(t[g].x,t[g].y);e.closePath()}},xF=class extends Q{static draw(e,t){if(t.image){e.save(),e.translate(t.point.x,t.point.y),e.rotate(Math.PI/2+t.angle);let g=t.imageWidth!=null?t.imageWidth:t.image.width,A=t.imageHeight!=null?t.imageHeight:t.image.height;t.image.drawImageAtPosition(e,1,-g/2,0,g,A),e.restore()}return!1}},lr=class extends Q{static draw(e,t){let g=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Q.transform(g,t),Q.drawPath(e,g),!0}},dr=class{static draw(e,t){let g=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Q.transform(g,t),Q.drawPath(e,g),!0}},hr=class{static draw(e,t){let g={x:-.4,y:0};Q.transform(g,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,I=t.angle-A/2,C=t.angle+A/2;return e.beginPath(),e.arc(g.x,g.y,t.length*.4,I,C,!1),e.stroke(),!0}},cr=class{static draw(e,t){let g={x:-.3,y:0};Q.transform(g,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";let A=Math.PI,I=t.angle+A/2,C=t.angle+3*A/2;return e.beginPath(),e.arc(g.x,g.y,t.length*.4,I,C,!1),e.stroke(),!0}},ur=class{static draw(e,t){let g=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Q.transform(g,t),Q.drawPath(e,g),!0}},fr=class{static draw(e,t){let g=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Q.transform(g,t),Q.drawPath(e,g),!0}},pr=class{static draw(e,t){let g={x:-.4,y:0};return Q.transform(g,t),qr(e,g.x,g.y,t.length*.4),!0}},mr=class{static draw(e,t){let g=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Q.transform(g,t),Q.drawPath(e,g),!0}},vr=class{static draw(e,t){let g=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Q.transform(g,t),Q.drawPath(e,g),!0}},br=class{static draw(e,t){let g=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Q.transform(g,t),Q.drawPath(e,g),!0}},yr=class{static draw(e,t){let g=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Q.transform(g,t),Q.drawPath(e,g),!0}},hI=class{static draw(e,t){let g;switch(t.type&&(g=t.type.toLowerCase()),g){case"image":return xF.draw(e,t);case"circle":return pr.draw(e,t);case"box":return vr.draw(e,t);case"crow":return dr.draw(e,t);case"curve":return hr.draw(e,t);case"diamond":return br.draw(e,t);case"inv_curve":return cr.draw(e,t);case"triangle":return ur.draw(e,t);case"inv_triangle":return fr.draw(e,t);case"bar":return mr.draw(e,t);case"vee":return yr.draw(e,t);default:return lr.draw(e,t)}}};function Id(i,e){var t=K(i);if(it){var g=it(i);e&&(g=Ae(g).call(g,function(A){return rt(i,A).enumerable})),t.push.apply(t,g)}return t}function Cd(i){for(var e=1;e<arguments.length;e++){var t,g,A=arguments[e]!=null?arguments[e]:{};e%2?F(t=Id(Object(A),!0)).call(t,function(I){ge(i,I,A[I])}):It?ii(i,It(A)):F(g=Id(Object(A))).call(g,function(I){Ii(i,I,rt(A,I))})}return i}var cI=class{constructor(e,t,g){this._body=t,this._labelModule=g,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(e),this.fromPoint=this.from,this.toPoint=this.to}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}cleanup(){return!1}setOptions(e){this.options=e,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.id=this.options.id}drawLine(e,t,g,A){let I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,I):this._drawLine(e,t,I)}_drawLine(e,t,g,A,I){if(this.from!=this.to)this._line(e,t,g,A,I);else{let[C,n,r]=this._getCircleData(e);this._circle(e,t,C,n,r)}}_drawDashedLine(e,t,g,A,I){e.lineCap="round";let C=B(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(C),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,g);else{let[n,r,s]=this._getCircleData(e);this._circle(e,t,n,r,s)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)Bd(e,this.from.x,this.from.y,this.to.x,this.to.y,C);else{let[n,r,s]=this._getCircleData(e);this._circle(e,t,n,r,s)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,g){return this.from!=this.to?this._findBorderPosition(e,t,g):this._findBorderPositionCircle(e,t,g)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;let[g,A]=Ye(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:g,y:A,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:g,y:A,low:.6,high:.8,direction:1})}}}_getCircleData(e){let t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);let g=lu(e,this.options.selfReference.angle,t,this.from);return[g.x,g.y,t]}_pointOnCircle(e,t,g,A){let I=A*2*Math.PI;return{x:e+g*Math.cos(I),y:t-g*Math.sin(I)}}_findBorderPositionCircle(e,t,g){let A=g.x,I=g.y,C=g.low,n=g.high,r=g.direction,s=10,o=this.options.selfReference.size,a=.05,l,d=(C+n)*.5,h=0;this.options.arrowStrikethrough===!0&&(r===-1?h=this.options.endPointOffset.from:r===1&&(h=this.options.endPointOffset.to));let c=0;do{d=(C+n)*.5,l=this._pointOnCircle(A,I,o,d);let u=Math.atan2(e.y-l.y,e.x-l.x),f=e.distanceToBorder(t,u)+h,p=Math.sqrt(Math.pow(l.x-e.x,2)+Math.pow(l.y-e.y,2)),E=f-p;if(Math.abs(E)<a)break;E>0?r>0?C=d:n=d:r>0?n=d:C=d,++c}while(C<=n&&c<s);return Cd(Cd({},l),{},{t:d})}getLineWidth(e,t){return e===!0?Math.max(this.selectionWidth,.3/this._body.view.scale):t===!0?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){let g=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),A=this.from.options.color.highlight.border,I=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(A=Fe(this.from.options.color.border,t.opacity),I=Fe(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?I=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(A=this.from.options.color.border),g.addColorStop(0,A),g.addColorStop(1,I),g}return t.inheritsColor==="to"?Fe(this.to.options.color.border,t.opacity):Fe(this.from.options.color.border,t.opacity)}else return Fe(t.color,t.opacity)}_circle(e,t,g,A,I){this.enableShadow(e,t);let C=0,n=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){let r=this.options.selfReference.angle,s=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,e,{x:g,y:A,low:r,high:s,direction:-1}),a=this._findBorderPositionCircle(this.from,e,{x:g,y:A,low:r,high:s,direction:1});C=Math.atan2(o.y-A,o.x-g),n=Math.atan2(a.y-A,a.x-g)}e.beginPath(),e.arc(g,A,I,C,n,!1),e.stroke(),this.disableShadow(e,t)}getDistanceToEdge(e,t,g,A,I,C){if(this.from!=this.to)return this._getDistanceToEdge(e,t,g,A,I,C);{let[n,r,s]=this._getCircleData(void 0),o=n-I,a=r-C;return Math.abs(Math.sqrt(o*o+a*a)-s)}}_getDistanceToLine(e,t,g,A,I,C){let n=g-e,r=A-t,s=n*n+r*r,o=((I-e)*n+(C-t)*r)/s;o>1?o=1:o<0&&(o=0);let a=e+o*n,l=t+o*r,d=a-I,h=l-C;return Math.sqrt(d*d+h*h)}getArrowData(e,t,g,A,I,C){let n,r,s,o,a,l,d,h=C.width;t==="from"?(s=this.from,o=this.to,a=C.fromArrowScale<0,l=Math.abs(C.fromArrowScale),d=C.fromArrowType):t==="to"?(s=this.to,o=this.from,a=C.toArrowScale<0,l=Math.abs(C.toArrowScale),d=C.toArrowType):(s=this.to,o=this.from,a=C.middleArrowScale<0,l=Math.abs(C.middleArrowScale),d=C.middleArrowType);let c=15*l+3*h;if(s!=o){let E=wF(s.x-o.x,s.y-o.y),x=c/E;if(t!=="middle")if(this.options.smooth.enabled===!0){let P=this._findBorderPosition(s,e,{via:g}),_=this.getPoint(P.t+x*(t==="from"?1:-1),g);n=Math.atan2(P.y-_.y,P.x-_.x),r=P}else n=Math.atan2(s.y-o.y,s.x-o.x),r=this._findBorderPosition(s,e);else{let P=(a?-x:x)/2,_=this.getPoint(.5+P,g),M=this.getPoint(.5-P,g);n=Math.atan2(_.y-M.y,_.x-M.x),r=this.getPoint(.5,g)}}else{let[E,x,P]=this._getCircleData(e);if(t==="from"){let _=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:x,low:_,high:M,direction:-1});n=j.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,r=j}else if(t==="to"){let _=this.options.selfReference.angle,M=this.options.selfReference.angle+Math.PI,j=this._findBorderPositionCircle(this.from,e,{x:E,y:x,low:_,high:M,direction:1});n=j.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,r=j}else{let _=this.options.selfReference.angle/(2*Math.PI);r=this._pointOnCircle(E,x,P,_),n=_*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}let u=r.x-c*.9*Math.cos(n),f=r.y-c*.9*Math.sin(n);return{point:r,core:{x:u,y:f},angle:n,length:c,type:d}}drawArrowHead(e,t,g,A,I){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,hI.draw(e,I)&&(this.enableShadow(e,t),$A(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){let g={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=g.strokeStyle,e.lineWidth=g.lineWidth,e.dashes=g.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){let g=B(t)?t:[5,5];e.setLineDash(g)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}};function nd(i,e){var t=K(i);if(it){var g=it(i);e&&(g=Ae(g).call(g,function(A){return rt(i,A).enumerable})),t.push.apply(t,g)}return t}function rd(i){for(var e=1;e<arguments.length;e++){var t,g,A=arguments[e]!=null?arguments[e]:{};e%2?F(t=nd(Object(A),!0)).call(t,function(I){ge(i,I,A[I])}):It?ii(i,It(A)):F(g=nd(Object(A))).call(g,function(I){Ii(i,I,rt(A,I))})}return i}var OA=class extends cI{constructor(e,t,g){super(e,t,g)}_findBorderPositionBezier(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),A=10,I=.2,C=!1,n=1,r=0,s=this.to,o,a,l=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(s=this.from,C=!0,l=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(l=0);let d=0;do{a=(r+n)*.5,o=this.getPoint(a,g);let h=Math.atan2(s.y-o.y,s.x-o.x),c=s.distanceToBorder(t,h)+l,u=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),f=c-u;if(Math.abs(f)<I)break;f<0?C===!1?r=a:n=a:C===!1?n=a:r=a,++d}while(r<=n&&d<A);return rd(rd({},o),{},{t:a})}_getDistanceToBezierEdge(e,t,g,A,I,C,n){let r=1e9,s,o,a,l,d,h=e,c=t;for(o=1;o<10;o++)a=.1*o,l=Math.pow(1-a,2)*e+2*a*(1-a)*n.x+Math.pow(a,2)*g,d=Math.pow(1-a,2)*t+2*a*(1-a)*n.y+Math.pow(a,2)*A,o>0&&(s=this._getDistanceToLine(h,c,l,d,I,C),r=s<r?s:r),h=l,c=d;return r}_bezierCurve(e,t,g,A){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),g!=null&&g.x!=null?A!=null&&A.x!=null?e.bezierCurveTo(g.x,g.y,A.x,A.y,this.toPoint.x,this.toPoint.y):e.quadraticCurveTo(g.x,g.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){return this._getViaCoordinates()}},uI=class extends OA{constructor(e,t,g){super(e,t,g),this.via=this.via,this._boundFunction=()=>{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){let e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,g){this._bezierCurve(e,t,g)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){let[g,A,I]=this._getCircleData(),C=2*Math.PI*(1-e);return{x:g+I*Math.sin(C),y:A+I-I*(1-Math.cos(C))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,g,A,I,C){return this._getDistanceToBezierEdge(e,t,g,A,I,C,this.via)}},fI=class extends OA{constructor(e,t,g){super(e,t,g)}_line(e,t,g){this._bezierCurve(e,t,g)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){let e=this.options.smooth.roundness,t=this.options.smooth.type,g=Math.abs(this.from.x-this.to.x),A=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let I,C;g<=A?I=C=e*A:I=C=e*g,this.from.x>this.to.x&&(I=-I),this.from.y>=this.to.y&&(C=-C);let n=this.from.x+I,r=this.from.y+C;return t==="discrete"&&(g<=A?n=g<e*A?this.from.x:n:r=A<e*g?this.from.y:r),{x:n,y:r}}else if(t==="straightCross"){let I=(1-e)*g,C=(1-e)*A;return g<=A?(I=0,this.from.y<this.to.y&&(C=-C)):(this.from.x<this.to.x&&(I=-I),C=0),{x:this.to.x+I,y:this.to.y+C}}else if(t==="horizontal"){let I=(1-e)*g;return this.from.x<this.to.x&&(I=-I),{x:this.to.x+I,y:this.from.y}}else if(t==="vertical"){let I=(1-e)*A;return this.from.y<this.to.y&&(I=-I),{x:this.from.x,y:this.to.y+I}}else if(t==="curvedCW"){g=this.to.x-this.from.x,A=this.from.y-this.to.y;let I=Math.sqrt(g*g+A*A),C=Math.PI,r=(Math.atan2(A,g)+(e*.5+.5)*C)%(2*C);return{x:this.from.x+(e*.5+.5)*I*Math.sin(r),y:this.from.y+(e*.5+.5)*I*Math.cos(r)}}else if(t==="curvedCCW"){g=this.to.x-this.from.x,A=this.from.y-this.to.y;let I=Math.sqrt(g*g+A*A),C=Math.PI,r=(Math.atan2(A,g)+(-e*.5+.5)*C)%(2*C);return{x:this.from.x+(e*.5+.5)*I*Math.sin(r),y:this.from.y+(e*.5+.5)*I*Math.cos(r)}}else{let I,C;g<=A?I=C=e*A:I=C=e*g,this.from.x>this.to.x&&(I=-I),this.from.y>=this.to.y&&(C=-C);let n=this.from.x+I,r=this.from.y+C;return g<=A?this.from.x<=this.to.x?n=this.to.x<n?this.to.x:n:n=this.to.x>n?this.to.x:n:this.from.y>=this.to.y?r=this.to.y>r?this.to.y:r:r=this.to.y<r?this.to.y:r,{x:n,y:r}}}_findBorderPosition(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,g.via)}_getDistanceToEdge(e,t,g,A,I,C){let n=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,g,A,I,C,n)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),g=e,A=Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*t.x+Math.pow(g,2)*this.toPoint.x,I=Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*t.y+Math.pow(g,2)*this.toPoint.y;return{x:A,y:I}}},wr=class extends OA{constructor(e,t,g){super(e,t,g)}_getDistanceToBezierEdge2(e,t,g,A,I,C,n,r){let s=1e9,o=e,a=t,l=[0,0,0,0];for(let d=1;d<10;d++){let h=.1*d;l[0]=Math.pow(1-h,3),l[1]=3*h*Math.pow(1-h,2),l[2]=3*Math.pow(h,2)*(1-h),l[3]=Math.pow(h,3);let c=l[0]*e+l[1]*n.x+l[2]*r.x+l[3]*g,u=l[0]*t+l[1]*n.y+l[2]*r.y+l[3]*A;if(d>0){let f=this._getDistanceToLine(o,a,c,u,I,C);s=f<s?f:s}o=c,a=u}return s}},pI=class extends wr{constructor(e,t,g){super(e,t,g)}_line(e,t,g){let A=g[0],I=g[1];this._bezierCurve(e,t,A,I)}_getViaCoordinates(){let e=this.from.x-this.to.x,t=this.from.y-this.to.y,g,A,I,C,n=this.options.smooth.roundness;return(Math.abs(e)>Math.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(A=this.from.y,C=this.to.y,g=this.from.x-n*e,I=this.to.x+n*e):(A=this.from.y-n*t,C=this.to.y+n*t,g=this.from.x,I=this.to.x),[{x:g,y:A},{x:I,y:C}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,g,A,I,C){let[n,r]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,g,A,I,C,n,r)}getPoint(e){let[t,g]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),A=e,I=[Math.pow(1-A,3),3*A*Math.pow(1-A,2),3*Math.pow(A,2)*(1-A),Math.pow(A,3)],C=I[0]*this.fromPoint.x+I[1]*t.x+I[2]*g.x+I[3]*this.toPoint.x,n=I[0]*this.fromPoint.y+I[1]*t.y+I[2]*g.y+I[3]*this.toPoint.y;return{x:C,y:n}}},mI=class extends cI{constructor(e,t,g){super(e,t,g)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let g=this.to,A=this.from;e.id===this.from.id&&(g=this.from,A=this.to);let I=Math.atan2(g.y-A.y,g.x-A.x),C=g.x-A.x,n=g.y-A.y,r=Math.sqrt(C*C+n*n),s=e.distanceToBorder(t,I),o=(r-s)/r;return{x:(1-o)*A.x+o*g.x,y:(1-o)*A.y+o*g.y,t:0}}_getDistanceToEdge(e,t,g,A,I,C){return this._getDistanceToLine(e,t,g,A,I,C)}},Lt=class i{constructor(e,t,g,A,I){if(t===void 0)throw new Error("No body provided");this.options=zt(A),this.globalOptions=A,this.defaultOptions=I,this.body=t,this.imagelist=g,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new lI(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics!="undefined"&&this.options.physics!==e.physics||typeof e.hidden!="undefined"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from!="undefined"&&this.options.from!==e.from||typeof e.to!="undefined"&&this.options.to!==e.to;i.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=au(e.value));let g=[e,this.options,this.defaultOptions];return this.chooser=_s("edge",g),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Kg(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,g),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(Qt(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=A.endPointOffset.from!==void 0?A.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(Qt(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=A.endPointOffset.to!==void 0?A.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),oI(t.label)?e.label=t.label:oI(e.label)||(e.label=void 0),Me(e,t,"smooth",A),Me(e,t,"shadow",A),Me(e,t,"background",A),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:g===!0&&t.dashes===null&&(e.dashes=Ft(A.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),Me(e.scaling,t.scaling,"label",A.scaling)):g===!0&&t.scaling===null&&(e.scaling=Ft(A.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){let n=t.arrows.toLowerCase();e.arrows.to.enabled=G(n).call(n,"to")!=-1,e.arrows.middle.enabled=G(n).call(n,"middle")!=-1,e.arrows.from.enabled=G(n).call(n,"from")!=-1}else if(typeof t.arrows=="object")Me(e.arrows,t.arrows,"to",A.arrows),Me(e.arrows,t.arrows,"middle",A.arrows),Me(e.arrows,t.arrows,"from",A.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Ug(t.arrows));else g===!0&&t.arrows===null&&(e.arrows=Ft(A.arrows));if(t.color!==void 0&&t.color!==null){let n=Dt(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,r=e.color;if(I)U(r,A.color,!1,g);else for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&delete r[s];if(Dt(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,n.opacity===void 0&&(r.opacity=1);else{let s=!1;n.color!==void 0&&(r.color=n.color,s=!0),n.highlight!==void 0&&(r.highlight=n.highlight,s=!0),n.hover!==void 0&&(r.hover=n.hover,s=!0),n.inherit!==void 0&&(r.inherit=n.inherit),n.opacity!==void 0&&(r.opacity=Math.min(1,Math.max(0,n.opacity))),s===!0?r.inherit=!1:r.inherit===void 0&&(r.inherit="from")}}else g===!0&&t.color===null&&(e.color=zt(A.color));g===!0&&t.font===null&&(e.font=zt(A.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){let e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,g=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,A=this.options.color.inherit,I={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:g,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:A?void 0:this.options.color.color,inheritsColor:A,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){let C=this.options.selectionWidth;typeof C=="function"?I.width=C(I.width):typeof C=="number"&&(I.width+=C),I.width=Math.max(I.width,.3/this.body.view.scale),I.color=this.options.color.highlight,I.shadow=this.options.shadow.enabled}else if(this.hover){let C=this.options.hoverWidth;typeof C=="function"?I.width=C(I.width):typeof C=="number"&&(I.width+=C),I.width=Math.max(I.width,.3/this.body.view.scale),I.color=this.options.color.hover,I.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(I,this.options.id,this.selected,this.hover),I.color!==void 0&&(I.inheritsColor=!1),I.shadow===!1&&(I.shadowColor!==this.options.shadow.color||I.shadowSize!==this.options.shadow.size||I.shadowX!==this.options.shadow.x||I.shadowY!==this.options.shadow.y)&&(I.shadow=!0));else I.shadow=this.options.shadow.enabled,I.width=Math.max(I.width,.3/this.body.view.scale);return I}updateLabelModule(e){let t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){let e=this.options.smooth,t=!1,g=!0;return this.edgeType!==void 0&&((this.edgeType instanceof uI&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof pI&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof fI&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof mI&&e.type.enabled===!1)&&(g=!1),g===!0&&(t=this.cleanup())),g===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new uI(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new pI(this.options,this.body,this.labelModule):this.edgeType=new fI(this.options,this.body,this.labelModule):this.edgeType=new mI(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,g){if(this.options.value!==void 0){let A=this.options.scaling.customScalingFunction(e,t,g,this.options.value),I=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){let C=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+A*C}this.options.width=this.options.scaling.min+A*I}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){let t=this.getFormattingValues();if(t.hidden)return;let g=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,g),this.drawLabel(e,g)}drawArrows(e){let t=this.getFormattingValues();if(t.hidden)return;let g=this.edgeType.getViaNode(),A={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(A.from=this.edgeType.getArrowData(e,"from",g,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=A.from.core),t.fromArrowSrc&&(A.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(A.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(A.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(A.to=this.edgeType.getArrowData(e,"to",g,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=A.to.core),t.toArrowSrc&&(A.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(A.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(A.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(A.middle=this.edgeType.getArrowData(e,"middle",g,this.selected,this.hover,t),t.middleArrowSrc&&(A.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(A.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(A.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,A.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,A.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,A.to)}drawLabel(e,t){if(this.options.label!==void 0){let g=this.from,A=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let I;if(g.id!=A.id){this.labelModule.pointToSelf=!1,I=this.edgeType.getPoint(.5,t),e.save();let C=this._getRotation(e);C.angle!=0&&(e.translate(C.x,C.y),e.rotate(C.angle)),this.labelModule.draw(e,I.x,I.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;let C=lu(e,this.options.selfReference.angle,this.options.selfReference.size,g);I=this._pointOnCircle(C.x,C.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,I.x,I.y,this.selected,this.hover)}}}getItemsOnPoint(e){let t=[];if(this.labelModule.visible()){let A=this._getRotation();Jn(this.labelModule.getSize(),e,A)&&t.push({edgeId:this.id,labelId:0})}let g={left:e.x,top:e.y};return this.isOverlappingWith(g)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){let g=this.from.x,A=this.from.y,I=this.to.x,C=this.to.y,n=e.left,r=e.top;return this.edgeType.getDistanceToEdge(g,A,I,C,n,r)<10}else return!1}_getRotation(e){let t=this.edgeType.getViaNode(),g=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,g.x,g.y);let A={x:g.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return A;let I=this.from.y-this.to.y,C=this.from.x-this.to.x,n=Math.atan2(I,C);return(n<-1&&C<0||n>0&&C<0)&&(n+=Math.PI),A.angle=n,A}_pointOnCircle(e,t,g,A){return{x:e+g*Math.cos(A),y:t-g*Math.sin(A)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}},xr=class{constructor(e,t,g){var A;this.body=e,this.images=t,this.groups=g,this.body.functions.createEdge=y(A=this.create).call(A,this),this.edgesListeners={add:(I,C)=>{this.add(C.items)},update:(I,C)=>{this.update(C.items)},remove:(I,C)=>{this.remove(C.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(I,C,n,r){if(C===I)return .5;{let s=1/(C-I);return Math.max(0,(r-I)*s)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},U(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,g;this.body.emitter.on("_forceDisableDynamicCurves",function(A){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;A==="dynamic"&&(A="continuous");let C=!1;for(let n in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,n)){let r=e.body.edges[n],s=e.body.data.edges.get(n);if(s!=null){let o=s.smooth;o!==void 0&&o.enabled===!0&&o.type==="dynamic"&&(A===void 0?r.setOptions({smooth:!1}):r.setOptions({smooth:{type:A}}),C=!0)}}I===!0&&C===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",y(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",y(g=this.refresh).call(g,this)),this.body.emitter.on("destroy",()=>{k(this.edgesListeners,(A,I)=>{this.body.data.edges&&this.body.data.edges.off(I,A)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Lt.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(let g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&(t=this.body.edges[g].updateEdgeType()||t);if(e.font!==void 0)for(let g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&this.body.edges[g].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.body.data.edges;if(su("id",e))this.body.data.edges=e;else if(B(e))this.body.data.edges=new pt,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new pt;else throw new TypeError("Array or DataSet expected");if(g&&k(this.edgesListeners,(A,I)=>{g.off(I,A)}),this.body.edges={},this.body.data.edges){k(this.edgesListeners,(I,C)=>{this.body.data.edges.on(C,I)});let A=this.body.data.edges.getIds();this.add(A,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.body.edges,A=this.body.data.edges;for(let I=0;I<e.length;I++){let C=e[I],n=g[C];n&&n.disconnect();let r=A.get(C,{showInternalIds:!0});g[C]=this.create(r)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}update(e){let t=this.body.edges,g=this.body.data.edges,A=!1;for(let I=0;I<e.length;I++){let C=e[I],n=g.get(C),r=t[C];r!==void 0?(r.disconnect(),A=r.setOptions(n)||A,r.connect()):(this.body.edges[C]=this.create(n),A=!0)}A===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}remove(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;let g=this.body.edges;k(e,A=>{let I=g[A];I!==void 0&&I.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){k(this.body.edges,(e,t)=>{let g=this.body.data.edges.get(t);g!==void 0&&e.setOptions(g)})}create(e){return new Lt(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e,t=this.body.nodes,g=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in g)if(Object.prototype.hasOwnProperty.call(g,e)){let A=g[e];A.from=null,A.to=null,A.connect()}}getConnectedNodes(e){let t=[];if(this.body.edges[e]!==void 0){let g=this.body.edges[e];g.fromId!==void 0&&t.push(g.fromId),g.toId!==void 0&&t.push(g.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){let e=[];k(this.body.edges,(t,g)=>{let A=this.body.nodes[t.toId],I=this.body.nodes[t.fromId];A!==void 0&&A.isCluster===!0||I!==void 0&&I.isCluster===!0||(A===void 0||I===void 0)&&e.push(g)}),this.remove(e,!1)}_addMissingEdges(){let e=this.body.data.edges;if(e==null)return;let t=this.body.edges,g=[];F(e).call(e,(A,I)=>{t[I]===void 0&&g.push(I)}),this.add(g,!0)}},vI=class{constructor(e,t,g){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(g),this._rng=VI("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e,t=this.body.nodes,g=this.physicsBody.physicsNodeIndices,A=g.length,I=this._formBarnesHutTree(t,g);this.barnesHutTree=I;for(let C=0;C<A;C++)e=t[g[C]],e.options.mass>0&&this._getForceContributions(I.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){let g=e.centerOfMass.x-t.x,A=e.centerOfMass.y-t.y,I=Math.sqrt(g*g+A*A);I*e.calcSize>this.thetaInversed?this._calculateForces(I,g,A,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(I,g,A,t,e)}}_calculateForces(e,t,g,A,I){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let C=this.options.gravitationalConstant*I.mass*A.options.mass/Math.pow(e,3),n=t*C,r=g*C;this.physicsBody.forces[A.id].x+=n,this.physicsBody.forces[A.id].y+=r}_formBarnesHutTree(e,t){let g,A=t.length,I=e[t[0]].x,C=e[t[0]].y,n=e[t[0]].x,r=e[t[0]].y;for(let u=1;u<A;u++){let f=e[t[u]],p=f.x,E=f.y;f.options.mass>0&&(p<I&&(I=p),p>n&&(n=p),E<C&&(C=E),E>r&&(r=E))}let s=Math.abs(n-I)-Math.abs(r-C);s>0?(C-=.5*s,r+=.5*s):(I+=.5*s,n-=.5*s);let a=Math.max(1e-5,Math.abs(n-I)),l=.5*a,d=.5*(I+n),h=.5*(C+r),c={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:d-l,maxX:d+l,minY:h-l,maxY:h+l},size:a,calcSize:1/a,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(c.root);for(let u=0;u<A;u++)g=e[t[u]],g.options.mass>0&&this._placeInTree(c.root,g);return c}_updateBranchMass(e,t){let g=e.centerOfMass,A=e.mass+t.options.mass,I=1/A;g.x=g.x*e.mass+t.x*t.options.mass,g.x*=I,g.y=g.y*e.mass+t.y*t.options.mass,g.y*=I,e.mass=A;let C=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<C?C:e.maxWidth}_placeInTree(e,t,g){(g!=!0||g===void 0)&&this._updateBranchMass(e,t);let A=e.children.NW.range,I;A.maxX>t.x?A.maxY>t.y?I="NW":I="SW":A.maxY>t.y?I="NE":I="SE",this._placeInRegion(e,t,I)}_placeInRegion(e,t,g){let A=e.children[g];switch(A.childrenCount){case 0:A.children.data=t,A.childrenCount=1,this._updateBranchMass(A,t);break;case 1:A.children.data.x===t.x&&A.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(A),this._placeInTree(A,t));break;case 4:this._placeInTree(A,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let g,A,I,C,n=.5*e.size;switch(t){case"NW":g=e.range.minX,A=e.range.minX+n,I=e.range.minY,C=e.range.minY+n;break;case"NE":g=e.range.minX+n,A=e.range.maxX,I=e.range.minY,C=e.range.minY+n;break;case"SW":g=e.range.minX,A=e.range.minX+n,I=e.range.minY+n,C=e.range.maxY;break;case"SE":g=e.range.minX+n,A=e.range.maxX,I=e.range.minY+n,C=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:g,maxX:A,minY:I,maxY:C},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,g){g===void 0&&(g="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=g,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}},Er=class{constructor(e,t,g){this._rng=VI("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(g)}setOptions(e){this.options=e}solve(){let e,t,g,A,I,C,n,r,s=this.body.nodes,o=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,l=this.options.nodeDistance,d=-2/3/l,h=4/3;for(let c=0;c<o.length-1;c++){n=s[o[c]];for(let u=c+1;u<o.length;u++)r=s[o[u]],e=r.x-n.x,t=r.y-n.y,g=Math.sqrt(e*e+t*t),g===0&&(g=.1*this._rng(),e=g),g<2*l&&(g<.5*l?C=1:C=d*g+h,C=C/g,A=e*C,I=t*C,a[n.id].x-=A,a[n.id].y-=I,a[r.id].x+=A,a[r.id].y+=I)}}},Tr=class{constructor(e,t,g){this.body=e,this.physicsBody=t,this.setOptions(g)}setOptions(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}solve(){let e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,g=this.physicsBody.forces,A=this.options.nodeDistance;for(let I=0;I<t.length-1;I++){let C=e[t[I]];for(let n=I+1;n<t.length;n++){let r=e[t[n]];if(C.level===r.level){let s=A+this.overlapAvoidanceFactor*((C.shape.radius||0)/2+(r.shape.radius||0)/2),o=r.x-C.x,a=r.y-C.y,l=Math.sqrt(o*o+a*a),d=.05,h;l<s?h=-Math.pow(d*l,2)+Math.pow(d*s,2):h=0,l!==0&&(h=h/l);let c=o*h,u=a*h;g[C.id].x-=c,g[C.id].y-=u,g[r.id].x+=c,g[r.id].y+=u}}}}},cA=class{constructor(e,t,g){this.body=e,this.physicsBody=t,this.setOptions(g)}setOptions(e){this.options=e}solve(){let e,t,g=this.physicsBody.physicsEdgeIndices,A=this.body.edges,I,C,n;for(let r=0;r<g.length;r++)t=A[g[r]],t.connected===!0&&t.toId!==t.fromId&&this.body.nodes[t.toId]!==void 0&&this.body.nodes[t.fromId]!==void 0&&(t.edgeType.via!==void 0?(e=t.options.length===void 0?this.options.springLength:t.options.length,I=t.to,C=t.edgeType.via,n=t.from,this._calculateSpringForce(I,C,.5*e),this._calculateSpringForce(C,n,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}_calculateSpringForce(e,t,g){let A=e.x-t.x,I=e.y-t.y,C=Math.max(Math.sqrt(A*A+I*I),.01),n=this.options.springConstant*(g-C)/C,r=A*n,s=I*n;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=s),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=r,this.physicsBody.forces[t.id].y-=s)}},Or=class{constructor(e,t,g){this.body=e,this.physicsBody=t,this.setOptions(g)}setOptions(e){this.options=e}solve(){let e,t,g,A,I,C,n,r,s=this.body.edges,o=.5,a=this.physicsBody.physicsEdgeIndices,l=this.physicsBody.physicsNodeIndices,d=this.physicsBody.forces;for(let x=0;x<l.length;x++){let P=l[x];d[P].springFx=0,d[P].springFy=0}for(let x=0;x<a.length;x++)t=s[a[x]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,g=t.from.x-t.to.x,A=t.from.y-t.to.y,r=Math.sqrt(g*g+A*A),r=r===0?.01:r,n=this.options.springConstant*(e-r)/r,I=g*n,C=A*n,t.to.level!=t.from.level?(d[t.toId]!==void 0&&(d[t.toId].springFx-=I,d[t.toId].springFy-=C),d[t.fromId]!==void 0&&(d[t.fromId].springFx+=I,d[t.fromId].springFy+=C)):(d[t.toId]!==void 0&&(d[t.toId].x-=o*I,d[t.toId].y-=o*C),d[t.fromId]!==void 0&&(d[t.fromId].x+=o*I,d[t.fromId].y+=o*C)));n=1;let h,c;for(let x=0;x<l.length;x++){let P=l[x];h=Math.min(n,Math.max(-n,d[P].springFx)),c=Math.min(n,Math.max(-n,d[P].springFy)),d[P].x+=h,d[P].y+=c}let u=0,f=0;for(let x=0;x<l.length;x++){let P=l[x];u+=d[P].x,f+=d[P].y}let p=u/l.length,E=f/l.length;for(let x=0;x<l.length;x++){let P=l[x];d[P].x-=p,d[P].y-=E}}},Ng=class{constructor(e,t,g){this.body=e,this.physicsBody=t,this.setOptions(g)}setOptions(e){this.options=e}solve(){let e,t,g,A,I=this.body.nodes,C=this.physicsBody.physicsNodeIndices,n=this.physicsBody.forces;for(let r=0;r<C.length;r++){let s=C[r];A=I[s],e=-A.x,t=-A.y,g=Math.sqrt(e*e+t*t),this._calculateForces(g,e,t,n,A)}}_calculateForces(e,t,g,A,I){let C=e===0?0:this.options.centralGravity/e;A[I.id].x=t*C,A[I.id].y=g*C}},Pr=class extends vI{constructor(e,t,g){super(e,t,g),this._rng=VI("FORCE ATLAS 2 BASED REPULSION SOLVER")}_calculateForces(e,t,g,A,I){e===0&&(e=.1*this._rng(),t=e),this.overlapAvoidanceFactor<1&&A.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*A.shape.radius,e-A.shape.radius));let C=A.edges.length+1,n=this.options.gravitationalConstant*I.mass*A.options.mass*C/Math.pow(e,2),r=t*n,s=g*n;this.physicsBody.forces[A.id].x+=r,this.physicsBody.forces[A.id].y+=s}},Sr=class extends Ng{constructor(e,t,g){super(e,t,g)}_calculateForces(e,t,g,A,I){if(e>0){let C=I.edges.length+1,n=this.options.centralGravity*C*I.options.mass;A[I.id].x=t*n,A[I.id].y=g*n}}},Rr=class{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},ee(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,iI(["stabilization"],this.options,e),Me(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());let t=this.options.wind;t&&((typeof t.x!="number"||Kn(t.x))&&(t.x=0),(typeof t.y!="number"||Kn(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Pr(this.body,this.physicsBody,e),this.edgesSolver=new cA(this.body,this.physicsBody,e),this.gravitySolver=new Sr(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Er(this.body,this.physicsBody,e),this.edgesSolver=new cA(this.body,this.physicsBody,e),this.gravitySolver=new Ng(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Tr(this.body,this.physicsBody,e),this.edgesSolver=new Or(this.body,this.physicsBody,e),this.gravitySolver=new Ng(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new vI(this.body,this.physicsBody,e),this.edgesSolver=new cA(this.body,this.physicsBody,e),this.gravitySolver=new Ng(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=y(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){let e=qi();this.physicsTick(),(qi()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&gt(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/1.2))}physicsTick(){this._startStabilizing(),this.stabilized!==!0&&(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0?(this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1):(this.timestep=this.options.timestep,this.physicsStep()),this.stabilized===!0&&this.revert(),this.stabilizationIterations++)}updatePhysicsData(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];let e=this.body.nodes,t=this.body.edges;for(let g in e)Object.prototype.hasOwnProperty.call(e,g)&&e[g].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[g].id);for(let g in t)Object.prototype.hasOwnProperty.call(t,g)&&t[g].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[g].id);for(let g=0;g<this.physicsBody.physicsNodeIndices.length;g++){let A=this.physicsBody.physicsNodeIndices[g];this.physicsBody.forces[A]={x:0,y:0},this.physicsBody.velocities[A]===void 0&&(this.physicsBody.velocities[A]={x:0,y:0})}for(let g in this.physicsBody.velocities)e[g]===void 0&&delete this.physicsBody.velocities[g]}revert(){let e=K(this.previousStates),t=this.body.nodes,g=this.physicsBody.velocities;this.referenceState={};for(let A=0;A<e.length;A++){let I=e[A];t[I]!==void 0?t[I].options.physics===!0&&(this.referenceState[I]={positions:{x:t[I].x,y:t[I].y}},g[I].x=this.previousStates[I].vx,g[I].y=this.previousStates[I].vy,t[I].x=this.previousStates[I].x,t[I].y=this.previousStates[I].y):delete this.previousStates[I]}}_evaluateStepQuality(){let e,t,g,A=this.body.nodes,I=this.referenceState,C=.3;for(let n in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,n)&&A[n]!==void 0&&(e=A[n].x-I[n].positions.x,t=A[n].y-I[n].positions.y,g=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),g>C))return!1;return!0}moveNodes(){let e=this.physicsBody.physicsNodeIndices,t=0,g=0,A=5;for(let I=0;I<e.length;I++){let C=e[I],n=this._performStep(C);t=Math.max(t,n),g+=n}this.adaptiveTimestepEnabled=g/e.length<A,this.stabilized=t<this.options.minVelocity}calculateComponentVelocity(e,t,g){let A=this.modelOptions.damping*e,I=(t-A)/g;e+=I*this.timestep;let C=this.options.maxVelocity||1e9;return Math.abs(e)>C&&(e=e>0?C:-C),e}_performStep(e){let t=this.body.nodes[e],g=this.physicsBody.forces[e];this.options.wind&&(g.x+=this.options.wind.x,g.y+=this.options.wind.y);let A=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:A.x,vy:A.y},t.options.fixed.x===!1?(A.x=this.calculateComponentVelocity(A.x,g.x,t.options.mass),t.x+=A.x*this.timestep):(g.x=0,A.x=0),t.options.fixed.y===!1?(A.y=this.calculateComponentVelocity(A.y,g.y,t.options.mass),t.y+=A.y*this.timestep):(g.y=0,A.y=0),Math.sqrt(Math.pow(A.x,2)+Math.pow(A.y,2))}_freezeNodes(){let e=this.body.nodes;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){let g=e[t].options.fixed;this.freezeCache[t]={x:g.x,y:g.y},g.x=!0,g.y=!0}}_restoreFrozenNodes(){let e=this.body.nodes;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,gt(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){let e=()=>this.stabilized===!1&&this.stabilizationIterations<this.targetIterations,t=()=>{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let g=0;for(;e()&&g<this.options.stabilization.updateInterval;)this.physicsTick(),g++;if(t(),e()){var A;gt(y(A=this._stabilizationBatch).call(A,this),0)}else this._finalizeStabilization()}_finalizeStabilization(){this.body.emitter.emit("_allowRedraw"),this.options.stabilization.fit===!0&&this.body.emitter.emit("fit"),this.options.stabilization.onlyDynamicEdges===!0&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),this.stabilized===!0?this._emitStabilized():this.startSimulation(),this.ready=!0}_drawForces(e){for(let t=0;t<this.physicsBody.physicsNodeIndices.length;t++){let g=this.physicsBody.physicsNodeIndices[t],A=this.body.nodes[g],I=this.physicsBody.forces[g],C=20,n=.03,r=Math.sqrt(Math.pow(I.x,2)+Math.pow(I.x,2)),s=Math.min(Math.max(5,r),15),o=3*s,a=jn((180-Math.min(1,Math.max(0,n*r))*180)/360,1,1),l={x:A.x+C*I.x,y:A.y+C*I.y};e.lineWidth=s,e.strokeStyle=a,e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(l.x,l.y),e.stroke();let d=Math.atan2(I.y,I.x);e.fillStyle=a,hI.draw(e,{type:"arrow",point:l,angle:d,length:o}),$A(e).call(e)}}},ce=class{constructor(){}static getRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],g=1e9,A=-1e9,I=1e9,C=-1e9,n;if(t.length>0)for(let r=0;r<t.length;r++)n=e[t[r]],I>n.shape.boundingBox.left&&(I=n.shape.boundingBox.left),C<n.shape.boundingBox.right&&(C=n.shape.boundingBox.right),g>n.shape.boundingBox.top&&(g=n.shape.boundingBox.top),A<n.shape.boundingBox.bottom&&(A=n.shape.boundingBox.bottom);return I===1e9&&C===-1e9&&g===1e9&&A===-1e9&&(g=0,A=0,I=0,C=0),{minX:I,maxX:C,minY:g,maxY:A}}static getRangeCore(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],g=1e9,A=-1e9,I=1e9,C=-1e9,n;if(t.length>0)for(let r=0;r<t.length;r++)n=e[t[r]],I>n.x&&(I=n.x),C<n.x&&(C=n.x),g>n.y&&(g=n.y),A<n.y&&(A=n.y);return I===1e9&&C===-1e9&&g===1e9&&A===-1e9&&(g=0,A=0,I=0,C=0),{minX:I,maxX:C,minY:g,maxY:A}}static findCenter(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}static cloneOptions(e,t){let g={};return t===void 0||t==="node"?(U(g,e.options,!0),g.x=e.x,g.y=e.y,g.amountOfConnections=e.edges.length):U(g,e.options,!0),g}},Dr=class extends be{constructor(e,t,g,A,I,C){super(e,t,g,A,I,C),this.isCluster=!0,this.containedNodes={},this.containedEdges={}}_openChildCluster(e){let t=this.body.nodes[e];if(this.containedNodes[e]===void 0)throw new Error("node with id: "+e+" not in current cluster");if(!t.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],k(t.edges,g=>{delete this.containedEdges[g.id]}),k(t.containedNodes,(g,A)=>{this.containedNodes[A]=g}),t.containedNodes={},k(t.containedEdges,(g,A)=>{this.containedEdges[A]=g}),t.containedEdges={},k(t.edges,g=>{k(this.edges,A=>{var I,C;let n=G(I=A.clusteringEdgeReplacingIds).call(I,g.id);n!==-1&&(k(g.clusteringEdgeReplacingIds,r=>{A.clusteringEdgeReplacingIds.push(r),this.body.edges[r].edgeReplacedById=A.id}),tt(C=A.clusteringEdgeReplacingIds).call(C,n,1))})}),t.edges=[]}},Nr=class{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},ee(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());let g=[];for(let A=0;A<this.body.nodeIndices.length;A++){let I=this.body.nodes[this.body.nodeIndices[A]];I.edges.length>=e&&g.push(I.id)}for(let A=0;A<g.length;A++)this.clusterByConnection(g[A],t,!0);this.body.emitter.emit("_dataChanged")}cluster(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);let g={},A={};k(this.body.nodes,(I,C)=>{I.options&&e.joinCondition(I.options)===!0&&(g[C]=I,k(I.edges,n=>{this.clusteredEdges[n.id]===void 0&&(A[n.id]=n)}))}),this._cluster(g,A,e,t)}clusterByEdgeCount(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);let A=[],I={},C,n,r;for(let s=0;s<this.body.nodeIndices.length;s++){let o={},a={},l=this.body.nodeIndices[s],d=this.body.nodes[l];if(I[l]===void 0){r=0,n=[];for(let h=0;h<d.edges.length;h++)C=d.edges[h],this.clusteredEdges[C.id]===void 0&&(C.toId!==C.fromId&&r++,n.push(C));if(r===e){let h=function(u){if(t.joinCondition===void 0||t.joinCondition===null)return!0;let f=ce.cloneOptions(u);return t.joinCondition(f)},c=!0;for(let u=0;u<n.length;u++){C=n[u];let f=this._getConnectedId(C,l);if(h(d))a[C.id]=C,o[l]=d,o[f]=this.body.nodes[f],I[l]=!0;else{c=!1;break}}if(K(o).length>0&&K(a).length>0&&c===!0){let f=function(){for(let p=0;p<A.length;++p)for(let E in o)if(A[p].nodes[E]!==void 0)return A[p]}();if(f!==void 0){for(let p in o)f.nodes[p]===void 0&&(f.nodes[p]=o[p]);for(let p in a)f.edges[p]===void 0&&(f.edges[p]=a[p])}else A.push({nodes:o,edges:a})}}}}for(let s=0;s<A.length;s++)this._cluster(A[s].nodes,A[s].edges,t,!1);g===!0&&this.body.emitter.emit("_dataChanged")}clusterOutliers(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var g;let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");let I=this.body.nodes[e];t=this._checkOptions(t,I),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=I.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=I.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=I.options.fixed.x,t.clusterNodeProperties.fixed.y=I.options.fixed.y);let C={},n={},r=I.id,s=ce.cloneOptions(I);C[r]=I;for(let a=0;a<I.edges.length;a++){let l=I.edges[a];if(this.clusteredEdges[l.id]===void 0){let d=this._getConnectedId(l,r);if(this.clusteredNodes[d]===void 0)if(d!==r)if(t.joinCondition===void 0)n[l.id]=l,C[d]=this.body.nodes[d];else{let h=ce.cloneOptions(this.body.nodes[d]);t.joinCondition(s,h)===!0&&(n[l.id]=l,C[d]=this.body.nodes[d])}else n[l.id]=l}}let o=he(g=K(C)).call(g,function(a){return C[a].id});for(let a in C){if(!Object.prototype.hasOwnProperty.call(C,a))continue;let l=C[a];for(let d=0;d<l.edges.length;d++){let h=l.edges[d];G(o).call(o,this._getConnectedId(h,l.id))>-1&&(n[h.id]=h)}}this._cluster(C,n,t,A)}_createClusterEdges(e,t,g,A){let I,C,n,r,s,o,a=K(e),l=[];for(let c=0;c<a.length;c++){C=a[c],n=e[C];for(let u=0;u<n.edges.length;u++)I=n.edges[u],this.clusteredEdges[I.id]===void 0&&(I.toId==I.fromId?t[I.id]=I:I.toId==C?(r=g.id,s=I.fromId,o=s):(r=I.toId,s=g.id,o=r),e[o]===void 0&&l.push({edge:I,fromId:s,toId:r}))}let d=[],h=function(c){for(let u=0;u<d.length;u++){let f=d[u],p=c.fromId===f.fromId&&c.toId===f.toId,E=c.fromId===f.toId&&c.toId===f.fromId;if(p||E)return f}return null};for(let c=0;c<l.length;c++){let u=l[c],f=u.edge,p=h(u);p===null?(p=this._createClusteredEdge(u.fromId,u.toId,f,A),d.push(p)):p.clusteringEdgeReplacingIds.push(f.id),this.body.edges[f.id].edgeReplacedById=p.id,this._backupEdgeOptions(f),f.setOptions({physics:!1})}}_checkOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,I=[];for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&this.clusteredNodes[o]!==void 0&&I.push(o);for(let o=0;o<I.length;++o)delete e[I[o]];if(K(e).length==0||K(e).length==1&&g.clusterNodeProperties.allowSingleNodeCluster!=!0)return;let C=U({},g.clusterNodeProperties);if(g.processProperties!==void 0){let o=[];for(let l in e)if(Object.prototype.hasOwnProperty.call(e,l)){let d=ce.cloneOptions(e[l]);o.push(d)}let a=[];for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&l.substr(0,12)!=="clusterEdge:"){let d=ce.cloneOptions(t[l],"edge");a.push(d)}if(C=g.processProperties(C,o,a),!C)throw new Error("The processProperties function does not return properties!")}C.id===void 0&&(C.id="cluster:"+Dg());let n=C.id;C.label===void 0&&(C.label="cluster");let r;C.x===void 0&&(r=this._getClusterPosition(e),C.x=r.x),C.y===void 0&&(r===void 0&&(r=this._getClusterPosition(e)),C.y=r.y),C.id=n;let s=this.body.functions.createNode(C,Dr);s.containedNodes=e,s.containedEdges=t,s.clusterEdgeProperties=g.clusterEdgeProperties,this.body.nodes[C.id]=s,this._clusterEdges(e,t,C,g.clusterEdgeProperties),C.id=void 0,A===!0&&this.body.emitter.emit("_dataChanged")}_backupEdgeOptions(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}_restoreEdge(e){let t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}isCluster(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}_getClusterPosition(e){let t=K(e),g=e[t[0]].x,A=e[t[0]].x,I=e[t[0]].y,C=e[t[0]].y,n;for(let r=1;r<t.length;r++)n=e[t[r]],g=n.x<g?n.x:g,A=n.x>A?n.x:A,I=n.y<I?n.y:I,C=n.y>C?n.y:C;return{x:.5*(g+A),y:.5*(I+C)}}openCluster(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");let A=this.body.nodes[e];if(A===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(A.isCluster!==!0||A.containedNodes===void 0||A.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");let I=this.findNode(e),C=G(I).call(I,e)-1;if(C>=0){let o=I[C];this.body.nodes[o]._openChildCluster(e),delete this.body.nodes[e],g===!0&&this.body.emitter.emit("_dataChanged");return}let n=A.containedNodes,r=A.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){let o={},a={x:A.x,y:A.y};for(let d in n)if(Object.prototype.hasOwnProperty.call(n,d)){let h=this.body.nodes[d];o[d]={x:h.x,y:h.y}}let l=t.releaseFunction(a,o);for(let d in n)if(Object.prototype.hasOwnProperty.call(n,d)){let h=this.body.nodes[d];l[d]!==void 0&&(h.x=l[d].x===void 0?A.x:l[d].x,h.y=l[d].y===void 0?A.y:l[d].y)}}else k(n,function(o){o.options.fixed.x===!1&&(o.x=A.x),o.options.fixed.y===!1&&(o.y=A.y)});for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o)){let a=this.body.nodes[o];a.vx=A.vx,a.vy=A.vy,a.setOptions({physics:!0}),delete this.clusteredNodes[o]}let s=[];for(let o=0;o<A.edges.length;o++)s.push(A.edges[o]);for(let o=0;o<s.length;o++){let a=s[o],l=this._getConnectedId(a,e),d=this.clusteredNodes[l];for(let h=0;h<a.clusteringEdgeReplacingIds.length;h++){let c=a.clusteringEdgeReplacingIds[h],u=this.body.edges[c];if(u!==void 0)if(d!==void 0){let f=this.body.nodes[d.clusterId];f.containedEdges[u.id]=u,delete r[u.id];let p=u.fromId,E=u.toId;u.toId==l?E=d.clusterId:p=d.clusterId,this._createClusteredEdge(p,E,u,f.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(u)}a.remove()}for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&this._restoreEdge(r[o]);delete this.body.nodes[e],g===!0&&this.body.emitter.emit("_dataChanged")}getNodesInCluster(e){let t=[];if(this.isCluster(e)===!0){let g=this.body.nodes[e].containedNodes;for(let A in g)Object.prototype.hasOwnProperty.call(g,A)&&t.push(this.body.nodes[A].id)}return t}findNode(e){let t=[],A=0,I;for(;this.clusteredNodes[e]!==void 0&&A<100;){if(I=this.body.nodes[e],I===void 0)return[];t.push(I.id),e=this.clusteredNodes[e].clusterId,A++}return I=this.body.nodes[e],I===void 0?[]:(t.push(I.id),Jt(t).call(t),t)}updateClusteredNode(e,t){if(e===void 0)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(t===void 0)throw new Error("No newOptions supplied to updateClusteredNode.");if(this.body.nodes[e]===void 0)throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}updateEdge(e,t){if(e===void 0)throw new Error("No startEdgeId supplied to updateEdge.");if(t===void 0)throw new Error("No newOptions supplied to updateEdge.");if(this.body.edges[e]===void 0)throw new Error("The startEdgeId supplied to updateEdge does not exist.");let g=this.getClusteredEdges(e);for(let A=0;A<g.length;A++)this.body.edges[g[A]].setOptions(t);this.body.emitter.emit("_dataChanged")}getClusteredEdges(e){let t=[],A=0;for(;e!==void 0&&this.body.edges[e]!==void 0&&A<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,A++;return Jt(t).call(t),t}getBaseEdge(e){return this.getBaseEdges(e)[0]}getBaseEdges(e){let t=[e],g=[],A=[],I=100,C=0;for(;t.length>0&&C<I;){let n=t.pop();if(n===void 0)continue;let r=this.body.edges[n];if(r===void 0)continue;C++;let s=r.clusteringEdgeReplacingIds;if(s===void 0)A.push(n);else for(let o=0;o<s.length;++o){let a=s[o];G(t).call(t,s)!==-1||G(g).call(g,s)!==-1||t.push(a)}g.push(n)}return A}_getConnectedId(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}_getHubSize(){let e=0,t=0,g=0,A=0;for(let r=0;r<this.body.nodeIndices.length;r++){let s=this.body.nodes[this.body.nodeIndices[r]];s.edges.length>A&&(A=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),g+=1}e=e/g,t=t/g;let I=t-Math.pow(e,2),C=Math.sqrt(I),n=Math.floor(e+2*C);return n>A&&(n=A),n}_createClusteredEdge(e,t,g,A,I){let C=ce.cloneOptions(g,"edge");U(C,A),C.from=e,C.to=t,C.id="clusterEdge:"+Dg(),I!==void 0&&U(C,I);let n=this.body.functions.createEdge(C);return n.clusteringEdgeReplacingIds=[g.id],n.connect(),this.body.edges[n.id]=n,n}_clusterEdges(e,t,g,A){if(t instanceof Lt){let I=t,C={};C[I.id]=I,t=C}if(e instanceof be){let I=e,C={};C[I.id]=I,e=C}if(g==null)throw new Error("_clusterEdges: parameter clusterNode required");A===void 0&&(A=g.clusterEdgeProperties),this._createClusterEdges(e,t,g,A);for(let I in t)if(Object.prototype.hasOwnProperty.call(t,I)&&this.body.edges[I]!==void 0){let C=this.body.edges[I];this._backupEdgeOptions(C),C.setOptions({physics:!1})}for(let I in e)Object.prototype.hasOwnProperty.call(e,I)&&(this.clusteredNodes[I]={clusterId:g.id,node:this.body.nodes[I]},this.body.nodes[I].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;let t=this.clusteredNodes[e];if(t===void 0)return;let g=t.clusterId;if(g!==void 0)return this.body.nodes[g]}_filter(e,t){let g=[];return k(e,A=>{t(A)&&g.push(A)}),g}_updateState(){let e,t=[],g={},A=r=>{k(this.body.nodes,s=>{s.isCluster===!0&&r(s)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}A(function(r){for(let s=0;s<t.length;s++)delete r.containedNodes[t[s]]});for(let r=0;r<t.length;r++)delete this.clusteredNodes[t[r]];k(this.clusteredEdges,r=>{let s=this.body.edges[r];(s===void 0||!s.endPointsValid())&&(g[r]=r)}),A(function(r){k(r.containedEdges,(s,o)=>{!s.endPointsValid()&&!g[o]&&(g[o]=o)})}),k(this.body.edges,(r,s)=>{let o=!0,a=r.clusteringEdgeReplacingIds;if(a!==void 0){let l=0;k(a,d=>{let h=this.body.edges[d];h!==void 0&&h.endPointsValid()&&(l+=1)}),o=l>0}(!r.endPointsValid()||!o)&&(g[s]=s)}),A(r=>{k(g,s=>{delete r.containedEdges[s],k(r.edges,(o,a)=>{if(o.id===s){r.edges[a]=null;return}o.clusteringEdgeReplacingIds=this._filter(o.clusteringEdgeReplacingIds,function(l){return!g[l]})}),r.edges=this._filter(r.edges,function(o){return o!==null})})}),k(g,r=>{delete this.clusteredEdges[r]}),k(g,r=>{delete this.body.edges[r]});let I=K(this.body.edges);k(I,r=>{let s=this.body.edges[r],o=this._isClusteredNode(s.fromId)||this._isClusteredNode(s.toId);if(o!==this._isClusteredEdge(s.id))if(o){let a=this._getClusterNodeForNode(s.fromId);a!==void 0&&this._clusterEdges(this.body.nodes[s.fromId],s,a);let l=this._getClusterNodeForNode(s.toId);l!==void 0&&this._clusterEdges(this.body.nodes[s.toId],s,l)}else delete this._clusterEdges[r],this._restoreEdge(s)});let C=!1,n=!0;for(;n;){let r=[];A(function(s){let o=K(s.containedNodes).length,a=s.options.allowSingleNodeCluster===!0;(a&&o<1||!a&&o<2)&&r.push(s.id)});for(let s=0;s<r.length;++s)this.openCluster(r[s],{},!1);n=r.length>0,C=C||n}C&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}},_r=class{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=gt(()=>{var t;this.zooming=!1,y(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",y(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&Kg(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(y(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;let t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();let g=this.canvas.getContext(),A=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;if(g.clearRect(0,0,A,I),this.canvas.frame.clientWidth===0)return;if(g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale),g.beginPath(),this.body.emitter.emit("beforeDrawing",g),g.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(g),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){let{drawExternalLabels:C}=this._drawNodes(g,e);t.drawExternalLabels=C}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(g),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(g),g.beginPath(),this.body.emitter.emit("afterDrawing",g),g.closePath(),g.restore(),e===!0&&g.clearRect(0,0,A,I)}}_resizeNodes(){this.canvas.setTransform();let e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);let t=this.body.nodes,g;for(let A in t)Object.prototype.hasOwnProperty.call(t,A)&&(g=t[A],g.resize(e),g.updateBoundingBox(e,g.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.body.nodes,A=this.body.nodeIndices,I,C=[],n=[],r=20,s=this.canvas.DOMtoCanvas({x:-r,y:-r}),o=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+r,y:this.canvas.frame.canvas.clientHeight+r}),a={top:s.y,left:s.x,bottom:o.y,right:o.x},l=[];for(let u=0;u<A.length;u++)if(I=g[A[u]],I.hover)n.push(A[u]);else if(I.isSelected())C.push(A[u]);else if(t===!0){let f=I.draw(e);f.drawExternalLabel!=null&&l.push(f.drawExternalLabel)}else if(I.isBoundingBoxOverlappingWith(a)===!0){let f=I.draw(e);f.drawExternalLabel!=null&&l.push(f.drawExternalLabel)}else I.updateBoundingBox(e,I.selected);let d,h=C.length,c=n.length;for(d=0;d<h;d++){I=g[C[d]];let u=I.draw(e);u.drawExternalLabel!=null&&l.push(u.drawExternalLabel)}for(d=0;d<c;d++){I=g[n[d]];let u=I.draw(e);u.drawExternalLabel!=null&&l.push(u.drawExternalLabel)}return{drawExternalLabels:()=>{for(let u of l)u()}}}_drawEdges(e){let t=this.body.edges,g=this.body.edgeIndices;for(let A=0;A<g.length;A++){let I=t[g[A]];I.connected===!0&&I.draw(e)}}_drawArrows(e){let t=this.body.edges,g=this.body.edgeIndices;for(let A=0;A<g.length;A++){let I=t[g[A]];I.connected===!0&&I.drawArrows(e)}}_drawSelectionBox(e){if(this.body.selectionBox.show){e.beginPath();let t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,g=this.body.selectionBox.position.end.y-this.body.selectionBox.position.start.y;e.rect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,g),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,g),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}},EF=Z,TF=EF.setInterval,OF=TF,PF=R(OF);function bI(i,e){e.inputHandler=function(t){t.isFirst&&e(t)},i.on("hammer.input",e.inputHandler)}function du(i,e){return e.inputHandler=function(t){t.isFinal&&e(t)},i.on("hammer.input",e.inputHandler)}var kr=class{constructor(e){this.body=e,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.once("resize",t=>{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",y(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&Kg(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){let A=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:I}=this;A.observe(I),this._cleanupCallbacks.push(()=>{A.unobserve(I)})}else{let A=PF(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(A)})}let g=y(t=this._onResize).call(t,this);window.addEventListener("resize",g),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",g)})}}_cleanUp(){var e,t,g;F(e=Jt(t=tt(g=this._cleanupCallbacks).call(g,0)).call(t)).call(e,A=>{try{A()}catch(I){console.error(I)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){let e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,g=this.cameraState.scale;e!=1&&t!=1?g=this.cameraState.scale*.5*(e+t):e!=1?g=this.cameraState.scale*e:t!=1&&(g=this.cameraState.scale*t),this.body.view.scale=g;let A=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),I={x:A.x-this.cameraState.position.x,y:A.y-this.cameraState.position.y};this.body.view.translation.x+=I.x*this.body.view.scale,this.body.view.translation.y+=I.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(G(e).call(e,"%")!==-1||G(e).call(e,"px")!==-1)return e;if(G(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{let e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Rg(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Rg.DIRECTION_ALL}),bI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new Rg(this.frame),du(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let g=!1,A=this.frame.canvas.width,I=this.frame.canvas.height,C=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(C),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},g=!0;else{let n=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),r=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==n||this.frame.canvas.height!==r)&&this._getCameraState(C),this.frame.canvas.width!==n&&(this.frame.canvas.width=n,g=!0),this.frame.canvas.height!==r&&(this.frame.canvas.height=r,g=!0)}return g===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(A/this.pixelRatio),oldHeight:Math.round(I/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,g}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window!="undefined"&&(t=window.devicePixelRatio||1);let g=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/g}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){let e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}};function SF(i,e){let t=ee({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},i!=null?i:{});if(!B(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}var Mr=class{constructor(e,t){var g,A;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",y(g=this.fit).call(g,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",y(A=this.releaseNode).call(A,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=SF(e,this.body.nodeIndices);let g=this.canvas.frame.canvas.clientWidth,A=this.canvas.frame.canvas.clientHeight,I,C;if(g===0||A===0)C=1,I=ce.getRange(this.body.nodes,e.nodes);else if(t===!0){let s=0;for(let l in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,l)&&this.body.nodes[l].predefinedPosition===!0&&(s+=1);if(s>.5*this.body.nodeIndices.length){this.fit(e,!1);return}I=ce.getRange(this.body.nodes,e.nodes),C=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;let a=Math.min(g/600,A/600);C*=a}else{this.body.emitter.emit("_resizeNodes"),I=ce.getRange(this.body.nodes,e.nodes);let s=Math.abs(I.maxX-I.minX)*1.1,o=Math.abs(I.maxY-I.minY)*1.1,a=g/s,l=A/o;C=a<=l?a:l}C>e.maxZoomLevel?C=e.maxZoomLevel:C<e.minZoomLevel&&(C=e.minZoomLevel);let r={position:ce.findCenter(I),scale:C,animation:e.animation};this.moveTo(r)}focus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){let g={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=g,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!Qt(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!Qt(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!Qt(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!Qt(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;let t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),g={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+g.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+g.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var A;this.viewFunction=y(A=this._lockedRedraw).call(A,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var I;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=y(I=this._transitionRedraw).call(I,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){let e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),g={x:t.x-e.x,y:t.y-e.y},A=this.body.view.translation,I={x:A.x+g.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:A.y+g.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=I}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;let t=PP[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var g;this.viewFunction=y(g=this._lockedRedraw).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}},RF=`div.vis-network div.vis-navigation div.vis-button {
655
656
  width: 34px;
656
657
  height: 34px;
657
658
  -moz-border-radius: 17px;
@@ -712,7 +713,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
712
713
  bottom: 50px;
713
714
  right: 15px;
714
715
  }
715
- `;Hg(uM);function za(I){var e=I&&I.preventDefault||!1,g=I&&I.container||window,t={},A={keydown:{},keyup:{}},C={},i;for(i=97;i<=122;i++)C[String.fromCharCode(i)]={code:65+(i-97),shift:!1};for(i=65;i<=90;i++)C[String.fromCharCode(i)]={code:i,shift:!0};for(i=0;i<=9;i++)C[""+i]={code:48+i,shift:!1};for(i=1;i<=12;i++)C["F"+i]={code:111+i,shift:!1};for(i=0;i<=9;i++)C["num"+i]={code:96+i,shift:!1};C["num*"]={code:106,shift:!1},C["num+"]={code:107,shift:!1},C["num-"]={code:109,shift:!1},C["num/"]={code:111,shift:!1},C["num."]={code:110,shift:!1},C.left={code:37,shift:!1},C.up={code:38,shift:!1},C.right={code:39,shift:!1},C.down={code:40,shift:!1},C.space={code:32,shift:!1},C.enter={code:13,shift:!1},C.shift={code:16,shift:void 0},C.esc={code:27,shift:!1},C.backspace={code:8,shift:!1},C.tab={code:9,shift:!1},C.ctrl={code:17,shift:!1},C.alt={code:18,shift:!1},C.delete={code:46,shift:!1},C.pageup={code:33,shift:!1},C.pagedown={code:34,shift:!1},C["="]={code:187,shift:!1},C["-"]={code:189,shift:!1},C["]"]={code:221,shift:!1},C["["]={code:219,shift:!1};var n=function(o){s(o,"keydown")},r=function(o){s(o,"keyup")},s=function(o,d){if(A[d][o.keyCode]!==void 0){for(var a=A[d][o.keyCode],l=0;l<a.length;l++)(a[l].shift===void 0||a[l].shift==!0&&o.shiftKey==!0||a[l].shift==!1&&o.shiftKey==!1)&&a[l].fn(o);e==!0&&o.preventDefault()}};return t.bind=function(o,d,a){if(a===void 0&&(a="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);A[a][C[o].code]===void 0&&(A[a][C[o].code]=[]),A[a][C[o].code].push({fn:d,shift:C[o].shift})},t.bindAll=function(o,d){d===void 0&&(d="keydown");for(var a in C)C.hasOwnProperty(a)&&t.bind(a,o,d)},t.getKey=function(o){for(var d in C)if(C.hasOwnProperty(d)){if(o.shiftKey==!0&&C[d].shift==!0&&o.keyCode==C[d].code)return d;if(o.shiftKey==!1&&C[d].shift==!1&&o.keyCode==C[d].code)return d;if(o.keyCode==C[d].code&&d=="shift")return d}return"unknown key, currently not supported"},t.unbind=function(o,d,a){if(a===void 0&&(a="keydown"),C[o]===void 0)throw new Error("unsupported key: "+o);if(d!==void 0){var l=[],h=A[a][C[o].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==d&&h[c].shift==C[o].shift||l.push(A[a][C[o].code][c]);A[a][C[o].code]=l}else A[a][C[o].code]=[]},t.reset=function(){A={keydown:{},keyup:{}}},t.destroy=function(){A={keydown:{},keyup:{}},g.removeEventListener("keydown",n,!0),g.removeEventListener("keyup",r,!0)},g.addEventListener("keydown",n,!0),g.addEventListener("keyup",r,!0),t}var Vn=class{constructor(e,g){this.body=e,this.canvas=g,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],g=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let i=0;i<e.length;i++){this.navigationDOM[e[i]]=document.createElement("div"),this.navigationDOM[e[i]].className="vis-button vis-"+e[i],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[i]]);let n=new ot(this.navigationDOM[e[i]]);if(g[i]==="_fit"){var t;jI(n,b(t=this._fit).call(t,this))}else{var A;jI(n,b(A=this.bindToRedraw).call(A,this,g[i]))}this.navigationHammers.push(n)}let C=new ot(this.canvas.frame);Gh(C,()=>{this._stopMovement()}),this.navigationHammers.push(C),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var g;this.boundFunctions[e]=b(g=this[e]).call(g,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){let e=this.body.view.scale,g=this.body.view.scale*(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,g=this.body.view.scale/(1+this.options.keyboard.speed.zoom),t=this.body.view.translation,A=g/e,C=(1-A)*this.canvas.canvasViewCenter.x+t.x*A,i=(1-A)*this.canvas.canvasViewCenter.y+t.y*A;this.body.view.scale=g,this.body.view.translation={x:C,y:i},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=za({container:window,preventDefault:!0}):this.keycharm=za({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,g,t,A,C,i,n,r,s,o,d,a,l,h,c,f,u,m,E,w,O,R,M,j;b(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),b(g=this.keycharm).call(g,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),b(t=this.keycharm).call(t,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),b(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),b(C=this.keycharm).call(C,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(i=this.keycharm).call(i,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(r=this.keycharm).call(r,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(o=this.keycharm).call(o,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(d=this.keycharm).call(d,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),b(a=this.keycharm).call(a,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),b(l=this.keycharm).call(l,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),b(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),b(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),b(f=this.keycharm).call(f,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),b(u=this.keycharm).call(u,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(m=this.keycharm).call(m,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(w=this.keycharm).call(w,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(O=this.keycharm).call(O,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),b(R=this.keycharm).call(R,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(M=this.keycharm).call(M,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),b(j=this.keycharm).call(j,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},Yn=class{constructor(e,g,t){var A,C,i,n,r,s,o,d,a,l,h,c,f;this.body=e,this.canvas=g,this.selectionHandler=t,this.navigationHandler=new Vn(e,g),this.body.eventListeners.onTap=b(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=b(C=this.onTouch).call(C,this),this.body.eventListeners.onDoubleTap=b(i=this.onDoubleTap).call(i,this),this.body.eventListeners.onHold=b(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=b(r=this.onDragStart).call(r,this),this.body.eventListeners.onDrag=b(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=b(o=this.onDragEnd).call(o,this),this.body.eventListeners.onMouseWheel=b(d=this.onMouseWheel).call(d,this),this.body.eventListeners.onPinch=b(a=this.onPinch).call(a,this),this.body.eventListeners.onMouseMove=b(l=this.onMouseMove).call(l,this),this.body.eventListeners.onRelease=b(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=b(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=b(f=this.getPointer).call(f,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(EI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Se(this.options,e,"keyboard"),e.tooltip&&(q(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Hi(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-oO(this.canvas.frame.canvas),y:e.y-aO(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g)}onDoubleTap(e){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,g)}onHold(e){let g=this.getPointer(e.center),t=this.selectionHandler.options.multiselect;this.checkSelectionChanges(g,t),this.selectionHandler.commitAndEmit(g,e),this.selectionHandler.generateClickEvent("click",e,g),this.selectionHandler.generateClickEvent("hold",e,g)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let g=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,g),this.touchTime=new Date().valueOf()}}onContext(e){let g=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,g)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,g){let t=function(A,C){let i=[];for(let n=0;n<A.length;n++){let r=A[n];G(C).call(C,r)===-1&&i.push(r)}return i};return{nodes:t(e.nodes,g.nodes),edges:t(e.edges,g.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let g=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=q({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let t=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)}}else if(g!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=g.id,g.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[g.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(let t of this.selectionHandler.getSelectedNodes()){let A={id:t.id,node:t,x:t.x,y:t.y,xFixed:t.options.fixed.x,yFixed:t.options.fixed.y};t.options.fixed.x=!0,t.options.fixed.y=!0,this.drag.selection.push(A)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");let g=this.getPointer(e.center),t=this.drag.selection;if(t&&t.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,g);let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;F(t).call(t,i=>{let n=i.node;i.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(i.x)+A)),i.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(i.y)+C))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,g,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let A=g.x-this.drag.pointer.x,C=g.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+C},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var g;this.body.selectionBox.show=!1;let t=this.body.selectionBox.position,A={minX:Math.min(t.start.x,t.end.x),minY:Math.min(t.start.y,t.end.y),maxX:Math.max(t.start.x,t.end.x),maxY:Math.max(t.start.y,t.end.y)},C=te(g=this.body.nodeIndices).call(g,n=>{let r=this.body.nodes[n];return r.x>=A.minX&&r.x<=A.maxX&&r.y>=A.minY&&r.y<=A.maxY});F(C).call(C,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let i=this.getPointer(e.center);this.selectionHandler.commitAndEmit(i,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let t=this.drag.selection;t&&t.length?(F(t).call(t,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){let g=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let t=this.pinch.scale*e.scale;this.zoom(t,g)}zoom(e,g){if(this.options.zoomView===!0){let t=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let C=this.body.view.translation,i=e/t,n=(1-i)*g.x+C.x*i,r=(1-i)*g.y+C.y*i;if(this.body.view.scale=e,this.body.view.translation={x:n,y:r},A!=null){let s=this.canvas.canvasToDOM(A);this.drag.pointer.x=s.x,this.drag.pointer.y=s.y}this.body.emitter.emit("_requestRedraw"),t<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:g}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:g})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let g=this.body.view.scale;g*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let t=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(g,t)}e.preventDefault()}}onMouseMove(e){let g=this.getPointer({x:e.clientX,y:e.clientY}),t=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(g),this.popup.hidden===!1&&(t=!0,this.popup.setPosition(g.x+3,g.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),t===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=Qe(()=>this._checkShowPopup(g),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,g)}_checkShowPopup(e){let g=this.canvas._XconvertDOMtoCanvas(e.x),t=this.canvas._YconvertDOMtoCanvas(e.y),A={left:g,top:t,right:g,bottom:t},C=this.popupObj===void 0?void 0:this.popupObj.id,i=!1,n="node";if(this.popupObj===void 0){let r=this.body.nodeIndices,s=this.body.nodes,o,d=[];for(let a=0;a<r.length;a++)o=s[r[a]],o.isOverlappingWith(A)===!0&&(i=!0,o.getTitle()!==void 0&&d.push(r[a]));d.length>0&&(this.popupObj=s[d[d.length-1]],i=!0)}if(this.popupObj===void 0&&i===!1){let r=this.body.edgeIndices,s=this.body.edges,o,d=[];for(let a=0;a<r.length;a++)o=s[r[a]],o.isOverlappingWith(A)===!0&&o.connected===!0&&o.getTitle()!==void 0&&d.push(r[a]);d.length>0&&(this.popupObj=s[d[d.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==C&&(this.popup===void 0&&(this.popup=new yO(this.canvas.frame)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){let g=this.selectionHandler._pointerToPositionObject(e),t=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(t=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(g),t===!0)){let A=this.selectionHandler.getNodeAt(e);t=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(t=this.body.edges[this.popup.popupTargetId].isOverlappingWith(g));t===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},fM=Z,Ba=Mr,tI=oC.getWeakData,pM=Rr,mM=dg,vM=mt,fi=ce,bM=Nr,jh=Ng,Za=ne,Vh=Ug,yM=Vh.set,wM=Vh.getterFor,EM=jh.find,TM=jh.findIndex,xM=fM([].splice),OM=0,AI=function(I){return I.frozen||(I.frozen=new Yh)},Yh=function(){this.entries=[]},pi=function(I,e){return EM(I.entries,function(g){return g[0]===e})};Yh.prototype={get:function(I){var e=pi(this,I);if(e)return e[1]},has:function(I){return!!pi(this,I)},set:function(I,e){var g=pi(this,I);g?g[1]=e:this.entries.push([I,e])},delete:function(I){var e=TM(this.entries,function(g){return g[0]===I});return~e&&xM(this.entries,e,1),!!~e}};var DM={getConstructor:function(I,e,g,t){var A=I(function(r,s){pM(r,C),yM(r,{type:e,id:OM++,frozen:void 0}),vM(s)||bM(s,r[t],{that:r,AS_ENTRIES:g})}),C=A.prototype,i=wM(e),n=function(r,s,o){var d=i(r),a=tI(mM(s),!0);return a===!0?AI(d).set(s,o):a[d.id]=o,r};return Ba(C,{delete:function(r){var s=i(this);if(!fi(r))return!1;var o=tI(r);return o===!0?AI(s).delete(r):o&&Za(o,s.id)&&delete o[s.id]},has:function(s){var o=i(this);if(!fi(s))return!1;var d=tI(s);return d===!0?AI(o).has(s):d&&Za(d,o.id)}}),Ba(C,g?{get:function(s){var o=i(this);if(fi(s)){var d=tI(s);return d===!0?AI(o).get(s):d?d[o.id]:void 0}},set:function(s,o){return n(this,s,o)}}:{add:function(s){return n(this,s,!0)}}),A}},PM=sh,La=X,lI=Z,Ga=Mr,SM=oC,NM=kr,Wh=DM,II=ce,CI=Ug.enforce,RM=B,kM=xd,MA=Object,MM=Array.isArray,iI=MA.isExtensible,_h=MA.isFrozen,FM=MA.isSealed,Hh=MA.freeze,zM=MA.seal,ja={},Va={},BM=!La.ActiveXObject&&"ActiveXObject"in La,Mt,Uh=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},Kh=NM("WeakMap",Uh,Wh),Ct=Kh.prototype,hI=lI(Ct.set),ZM=function(){return PM&&RM(function(){var I=Hh([]);return hI(new Kh,I,1),!_h(I)})};kM&&(BM?(Mt=Wh.getConstructor(Uh,"WeakMap",!0),SM.enable(),mi=lI(Ct.delete),Ft=lI(Ct.has),vi=lI(Ct.get),Ga(Ct,{delete:function(I){if(II(I)&&!iI(I)){var e=CI(this);return e.frozen||(e.frozen=new Mt),mi(this,I)||e.frozen.delete(I)}return mi(this,I)},has:function(e){if(II(e)&&!iI(e)){var g=CI(this);return g.frozen||(g.frozen=new Mt),Ft(this,e)||g.frozen.has(e)}return Ft(this,e)},get:function(e){if(II(e)&&!iI(e)){var g=CI(this);return g.frozen||(g.frozen=new Mt),Ft(this,e)?vi(this,e):g.frozen.get(e)}return vi(this,e)},set:function(e,g){if(II(e)&&!iI(e)){var t=CI(this);t.frozen||(t.frozen=new Mt),Ft(this,e)?hI(this,e,g):t.frozen.set(e,g)}else hI(this,e,g);return this}})):ZM()&&Ga(Ct,{set:function(e,g){var t;return MM(e)&&(_h(e)?t=ja:FM(e)&&(t=Va)),hI(this,e,g),t===ja&&Hh(e),t===Va&&zM(e),this}}));var mi,Ft,vi,LM=L,GM=LM.WeakMap,jM=GM,VM=jM,YM=VM,Wt=P(YM);function W(I,e,g,t){if(g==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?I!==e||!t:!e.has(I))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?t:g==="a"?t.call(I):t?t.value:e.get(I)}function Wn(I,e,g,t,A){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?I!==e||!A:!e.has(I))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?A.call(I,g):A?A.value=g:e.set(I,g),g}var kg,Pe,ug,fg,cI;function Ya(I,e){let g=new Ge;for(let t of e)I.has(t)||g.add(t);return g}var VI=class{constructor(){kg.set(this,new Ge),Pe.set(this,new Ge)}get size(){return W(this,Pe,"f").size}add(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)W(this,Pe,"f").add(A)}delete(){for(var e=arguments.length,g=new Array(e),t=0;t<e;t++)g[t]=arguments[t];for(let A of g)W(this,Pe,"f").delete(A)}clear(){W(this,Pe,"f").clear()}getSelection(){return[...W(this,Pe,"f")]}getChanges(){return{added:[...Ya(W(this,kg,"f"),W(this,Pe,"f"))],deleted:[...Ya(W(this,Pe,"f"),W(this,kg,"f"))],previous:[...new Ge(W(this,kg,"f"))],current:[...new Ge(W(this,Pe,"f"))]}}commit(){let e=this.getChanges();Wn(this,kg,W(this,Pe,"f"),"f"),Wn(this,Pe,new Ge(W(this,kg,"f")),"f");for(let g of e.added)g.select();for(let g of e.deleted)g.unselect();return e}};kg=new Wt,Pe=new Wt;var _n=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};ug.set(this,new VI),fg.set(this,new VI),cI.set(this,void 0),Wn(this,cI,e,"f")}get sizeNodes(){return W(this,ug,"f").size}get sizeEdges(){return W(this,fg,"f").size}getNodes(){return W(this,ug,"f").getSelection()}getEdges(){return W(this,fg,"f").getSelection()}addNodes(){W(this,ug,"f").add(...arguments)}addEdges(){W(this,fg,"f").add(...arguments)}deleteNodes(e){W(this,ug,"f").delete(e)}deleteEdges(e){W(this,fg,"f").delete(e)}clear(){W(this,ug,"f").clear(),W(this,fg,"f").clear()}commit(){let e={nodes:W(this,ug,"f").commit(),edges:W(this,fg,"f").commit()};for(var g=arguments.length,t=new Array(g),A=0;A<g;A++)t[A]=arguments[A];return W(this,cI,"f").call(this,e,...t),e}};ug=new Wt,fg=new Wt,cI=new Wt;var Hn=class{constructor(e,g){this.body=e,this.canvas=g,this._selectionAccumulator=new _n,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},q(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&Dt(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),t!==void 0&&(g=this.selectObject(t)),this.body.emitter.emit("_requestRedraw")}return g}selectAdditionalOnPoint(e){let g=!1;if(this.options.selectable===!0){let t=this.getNodeAt(e)||this.getEdgeAt(e);t!==void 0&&(g=!0,t.isSelected()===!0?this.deselectObject(t):this.selectObject(t),this.body.emitter.emit("_requestRedraw"))}return g}_initBaseEvent(e,g){let t={};return t.pointer={DOM:{x:g.x,y:g.y},canvas:this.canvas.DOMtoCanvas(g)},t.event=e,t}generateClickEvent(e,g,t,A){let C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,i=this._initBaseEvent(g,t);if(C===!0)i.nodes=[],i.edges=[];else{let n=this.getSelection();i.nodes=n.nodes,i.edges=n.edges}A!==void 0&&(i.previousSelection=A),e=="click"&&(i.items=this.getClickedItems(t)),g.controlEdge!==void 0&&(i.controlEdge=g.controlEdge),this.body.emitter.emit(e,i)}selectObject(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof pe?(g===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let g=[],t=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let C=this.body.nodeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}return g}_pointerToPositionObject(e){let g=this.canvas.DOMtoCanvas(e);return{left:g.x-1,top:g.y+1,right:g.x+1,bottom:g.y-1}}getNodeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this._pointerToPositionObject(e),A=this._getAllNodesOverlappingWith(t);if(A.length>0)return g===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(e,g){let t=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let C=this.body.edgeIndices[A];t[C].isOverlappingWith(e)&&g.push(C)}}_getAllEdgesOverlappingWith(e){let g=[];return this._getEdgesOverlappingWith(e,g),g}getEdgeAt(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.canvas.DOMtoCanvas(e),A=10,C=null,i=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let r=this.body.edgeIndices[n],s=i[r];if(s.connected){let o=s.from.x,d=s.from.y,a=s.to.x,l=s.to.y,h=s.edgeType.getDistanceToEdge(o,d,a,l,t.x,t.y);h<A&&(C=r,A=h)}}if(C!==null)return g===!0?this.body.edges[C]:C}_addToHover(e){e instanceof pe?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof pe?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let g=0;g<e.edges.length;g++){let t=e.edges[g];t.hover=!0,this._addToHover(t)}}emitBlurEvent(e,g,t){let A=this._initBaseEvent(e,g);t.hover===!0&&(t.hover=!1,t instanceof pe?(A.node=t.id,this.body.emitter.emit("blurNode",A)):(A.edge=t.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(e,g,t){let A=this._initBaseEvent(e,g),C=!1;return t.hover===!1&&(t.hover=!0,this._addToHover(t),C=!0,t instanceof pe?(A.node=t.id,this.body.emitter.emit("hoverNode",A)):(A.edge=t.id,this.body.emitter.emit("hoverEdge",A))),C}hoverObject(e,g){let t=this.getNodeAt(g);t===void 0&&(t=this.getEdgeAt(g));let A=!1;for(let C in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,C)&&(t===void 0||t instanceof pe&&t.id!=C||t instanceof Dg)&&(this.emitBlurEvent(e,g,this.hoverObj.nodes[C]),delete this.hoverObj.nodes[C],A=!0);for(let C in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,C)&&(A===!0?(this.hoverObj.edges[C].hover=!1,delete this.hoverObj.edges[C]):(t===void 0||t instanceof Dg&&t.id!=C||t instanceof pe&&!t.hover)&&(this.emitBlurEvent(e,g,this.hoverObj.edges[C]),delete this.hoverObj.edges[C],A=!0));if(t!==void 0){let C=U(this.hoverObj.edges).length,i=U(this.hoverObj.nodes).length,n=t instanceof Dg&&C===0&&i===0,r=t instanceof pe&&C===0&&i===0;(A||n||r)&&(A=this.emitHoverEvent(e,g,t)),t instanceof pe&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(t)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,g){let t=!1,A=this._selectionAccumulator.commit(),C={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",g,e,C),t=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",g,e,C),t=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",g,e),t=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",g,e),t=!0),t===!0&&this.generateClickEvent("select",g,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return ae(e=this._selectionAccumulator.getNodes()).call(e,g=>g.id)}getSelectedEdgeIds(){var e;return ae(e=this._selectionAccumulator.getEdges()).call(e,g=>g.id)}setSelection(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((g.unselectAll||g.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let t of e.nodes){let A=this.body.nodes[t];if(!A)throw new RangeError('Node with id "'+t+'" not found');this.selectObject(A,g.highlightEdges)}if(e.edges)for(let t of e.edges){let A=this.body.edges[t];if(!A)throw new RangeError('Edge with id "'+t+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:g})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let g=this.canvas.DOMtoCanvas(e),t=[],A=this.body.nodeIndices,C=this.body.nodes;for(let r=A.length-1;r>=0;r--){let o=C[A[r]].getItemsOnPoint(g);t.push.apply(t,o)}let i=this.body.edgeIndices,n=this.body.edges;for(let r=i.length-1;r>=0;r--){let o=n[i[r]].getItemsOnPoint(g);t.push.apply(t,o)}return t}},YI=class{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,g,t),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,g){this.fake_use(e,g),this.abstract()}shift(e,g){this.fake_use(e,g),this.abstract()}},Un=class extends YI{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.x=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_x,max:g.max_x}}sort(e){ig(e).call(e,function(g,t){return g.x-t.x})}fix(e,g){e.y=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.y=!0}shift(e,g){this.layout.body.nodes[e].x+=g}},Kn=class extends YI{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;t!==void 0&&this.layout.hierarchical.addToOrdering(e,t),e.y=g}getTreeSize(e){let g=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:g.min_y,max:g.max_y}}sort(e){ig(e).call(e,function(g,t){return g.y-t.y})}fix(e,g){e.x=this.layout.options.hierarchical.levelSeparation*g,e.options.fixed.x=!0}shift(e,g){this.layout.body.nodes[e].y+=g}},WM=S,_M=Ng.every,HM=Tt,UM=HM("every");WM({target:"Array",proto:!0,forced:!UM},{every:function(e){return _M(this,e,arguments.length>1?arguments[1]:void 0)}});var KM=Ie,QM=KM("Array").every,XM=J,JM=QM,bi=Array.prototype,$M=function(I){var e=I.every;return I===bi||XM(bi,I)&&e===bi.every?JM:e},qM=$M,e5=qM,g5=e5,Qh=P(g5);function t5(I,e){let g=new Ge;return F(I).call(I,t=>{var A;F(A=t.edges).call(A,C=>{C.connected&&g.add(C)})}),F(g).call(g,t=>{let A=t.from.id,C=t.to.id;e[A]==null&&(e[A]=0),(e[C]==null||e[A]>=e[C])&&(e[C]=e[A]+1)}),e}function A5(I){return Xh(e=>{var g,t;return Qh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.to===e)},(e,g)=>g>e,"from",I)}function I5(I){return Xh(e=>{var g,t;return Qh(g=te(t=e.edges).call(t,A=>I.has(A.toId))).call(g,A=>A.from===e)},(e,g)=>g<e,"to",I)}function Xh(I,e,g,t){var A;let C=Tg(null),i=Br(A=[...OI(t).call(t)]).call(A,(d,a)=>d+1+a.edges.length,0),n=g+"Id",r=g==="to"?1:-1;for(let[d,a]of t){if(!t.has(d)||!I(a))continue;C[d]=0;let l=[a],h=0,c;for(;c=l.pop();){var s,o;if(!t.has(d))continue;let f=C[c.id]+r;if(F(s=te(o=c.edges).call(o,u=>u.connected&&u.to!==u.from&&u[g]!==c&&t.has(u.toId)&&t.has(u.fromId))).call(s,u=>{let m=u[n],E=C[m];(E==null||e(f,E))&&(C[m]=f,l.push(u[g]))}),h>i)return t5(t,C);++h}}return C}var Qn=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,g){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(g),this.parentReference[g]===void 0&&(this.parentReference[g]=[]),this.parentReference[g].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,g){g!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=g,this.treeIndex=Math.max(g,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let g={},t=A=>{if(g[A]!==void 0)return g[A];let C=this.levels[A];if(this.childrenReference[A]){let i=this.childrenReference[A];if(i.length>0)for(let n=0;n<i.length;n++)C=Math.max(C,t(i[n]))}return g[A]=C,C};return t(e)}levelDownstream(e,g){this.levels[g.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[g.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let g=new NA,t=0,A=ig(e=[...new Ge(WT(this.levels))]).call(e,(C,i)=>C-i);for(let C of A)g.set(C,t++);for(let C in this.levels)Object.prototype.hasOwnProperty.call(this.levels,C)&&(this.levels[C]=g.get(this.levels[C]))}getTreeSize(e,g){let t=1e9,A=-1e9,C=1e9,i=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===g){let r=e[n];t=Math.min(r.x,t),A=Math.max(r.x,A),C=Math.min(r.y,C),i=Math.max(r.y,i)}return{min_x:t,max_x:A,min_y:C,max_y:i}}hasSameParent(e,g){let t=this.parentReference[e.id],A=this.parentReference[g.id];if(t===void 0||A===void 0)return!1;for(let C=0;C<t.length;C++)for(let i=0;i<A.length;i++)if(t[C]==A[i])return!0;return!1}inSameSubNetwork(e,g){return this.trees[e.id]===this.trees[g.id]}getLevels(){return U(this.distributionOrdering)}addToOrdering(e,g){this.distributionOrdering[g]===void 0&&(this.distributionOrdering[g]=[]);let t=!1,A=this.distributionOrdering[g];for(let C in A)if(A[C]===e){t=!0;break}t||(this.distributionOrdering[g].push(e),this.distributionIndex[e.id]=this.distributionOrdering[g].length-1)}},Xn=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+mI()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},q(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,g){if(e!==void 0){let t=this.options.hierarchical,A=t.enabled;if(Dt(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Se(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),t.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),t.direction==="RL"||t.direction==="DU"?t.levelSeparation>0&&(t.levelSeparation*=-1):t.levelSeparation<0&&(t.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(g);if(A===!0)return this.body.emitter.emit("refresh"),_(g,this.optionsBackup)}return g}_resetRNG(e){this.initialRandomSeed=e,this._rng=sC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let g=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:g.enabled===void 0?!0:g.enabled,solver:"hierarchicalRepulsion"},g.enabled=g.enabled===void 0?!0:g.enabled,g.solver=g.solver||"barnesHut"):typeof e.physics=="object"?(g.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,g.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(g.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let t=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:t};else{let A=e.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(t=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},e.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:t,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",t)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let g=e.length+50;for(let t=0;t<e.length;t++){let A=e[t],C=2*Math.PI*this._rng();A.x===void 0&&(A.x=g*Math.cos(C)),A.y===void 0&&(A.y=g*Math.sin(C))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,g=0;for(let t=0;t<e.length;t++)this.body.nodes[e[t]].predefinedPosition===!0&&(g+=1);if(g<.5*e.length){let A=0,C=this.options.clusterThreshold,i={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>C){let r=e.length;for(;e.length>C&&A<=10;){A+=1;let s=e.length;A%3===0?this.body.modules.clustering.clusterBridges(i):this.body.modules.clustering.clusterOutliers(i);let o=e.length;if(s==o&&A%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}A>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();let n=70;for(let r=0;r<e.length;r++){let s=this.body.nodes[e[r]];s.predefinedPosition===!1&&(s.x+=(.5-this._rng())*n,s.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let e=de.getRangeCore(this.body.nodes,this.body.nodeIndices),g=de.findCenter(e);for(let t=0;t<this.body.nodeIndices.length;t++){let A=this.body.nodes[this.body.nodeIndices[t]];A.x-=g.x,A.y-=g.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let g=0;g<this.body.nodeIndices.length;g++)this.body.nodes[this.body.nodeIndices[g]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[g],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,g,t=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Qn;for(g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&(e=this.body.nodes[g],e.options.level!==void 0?(t=!0,this.hierarchical.levels[g]=e.options.level):A=!0);if(A===!0&&t===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(A===!0){let i=this.options.hierarchical.sortMethod;i==="hubsize"?this._determineLevelsByHubsize():i==="directed"?this._determineLevelsDirected():i==="custom"&&this._determineLevelsCustomCallback()}for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&this.hierarchical.ensureLevel(i);let C=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(C),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let g=!1,t={},A=()=>{let u=i(),m=0;for(let E=0;E<u.length-1;E++){let w=u[E].max-u[E+1].min;m+=w+this.options.hierarchical.treeSpacing,C(E+1,m)}},C=(u,m)=>{let E=this.hierarchical.trees;for(let w in E)Object.prototype.hasOwnProperty.call(E,w)&&E[w]===u&&this.direction.shift(w,m)},i=()=>{let u=[];for(let m=0;m<this.hierarchical.numTrees();m++)u.push(this.direction.getTreeSize(m));return u},n=(u,m)=>{if(!m[u.id]&&(m[u.id]=!0,this.hierarchical.childrenReference[u.id])){let E=this.hierarchical.childrenReference[u.id];if(E.length>0)for(let w=0;w<E.length;w++)n(this.body.nodes[E[w]],m)}},r=function(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,w=1e9,O=1e9,R=-1e9;for(let M in u)if(Object.prototype.hasOwnProperty.call(u,M)){let j=e.body.nodes[M],ye=e.hierarchical.levels[j.id],ue=e.direction.getPosition(j),[Qg,Xg]=e._getSpaceAroundNode(j,u);E=Math.min(Qg,E),w=Math.min(Xg,w),ye<=m&&(O=Math.min(ue,O),R=Math.max(ue,R))}return[O,R,E,w]},s=(u,m)=>{let E=this.hierarchical.getMaxLevel(u.id),w=this.hierarchical.getMaxLevel(m.id);return Math.min(E,w)},o=(u,m,E)=>{let w=this.hierarchical;for(let O=0;O<m.length;O++){let R=m[O],M=w.distributionOrdering[R];if(M.length>1)for(let j=0;j<M.length-1;j++){let ye=M[j],ue=M[j+1];w.hasSameParent(ye,ue)&&w.inSameSubNetwork(ye,ue)&&u(ye,ue,E)}}},d=function(u,m){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,w=e.direction.getPosition(u),O=e.direction.getPosition(m),R=Math.abs(O-w),M=e.options.hierarchical.nodeSpacing;if(R>M){let j={},ye={};n(u,j),n(m,ye);let ue=s(u,m),Qg=r(j,ue),Xg=r(ye,ue),FA=Qg[1],Jg=Xg[0],Ce=Xg[2];if(Math.abs(FA-Jg)>M){let Y=FA-Jg+M;Y<-Ce+M&&(Y=-Ce+M),Y<0&&(e._shiftBlock(m.id,Y),g=!0,E===!0&&e._centerParent(m))}}},a=(u,m)=>{let E=m.id,w=m.edges,O=this.hierarchical.levels[m.id],R=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,M={},j=[];for(let Ce=0;Ce<w.length;Ce++){let V=w[Ce];if(V.toId!=V.fromId){let Y=V.toId==E?V.from:V.to;M[w[Ce].id]=Y,this.hierarchical.levels[Y.id]<O&&j.push(V)}}let ye=(Ce,V)=>{let Y=0;for(let he=0;he<V.length;he++)if(M[V[he].id]!==void 0){let fe=this.direction.getPosition(M[V[he].id])-Ce;Y+=fe/Math.sqrt(fe*fe+R)}return Y},ue=(Ce,V)=>{let Y=0;for(let he=0;he<V.length;he++)if(M[V[he].id]!==void 0){let fe=this.direction.getPosition(M[V[he].id])-Ce;Y-=R*Math.pow(fe*fe+R,-1.5)}return Y},Qg=(Ce,V)=>{let Y=this.direction.getPosition(m),he={};for(let fe=0;fe<Ce;fe++){let Fe=ye(Y,V),$g=ue(Y,V),Pt=40,Cc=Math.max(-Pt,Math.min(Pt,Math.round(Fe/$g)));if(Y=Y-Cc,he[Y]!==void 0)break;he[Y]=fe}return Y},Xg=Ce=>{let V=this.direction.getPosition(m);if(t[m.id]===void 0){let Pt={};n(m,Pt),t[m.id]=Pt}let Y=r(t[m.id]),he=Y[2],fe=Y[3],Fe=Ce-V,$g=0;Fe>0?$g=Math.min(Fe,fe-this.options.hierarchical.nodeSpacing):Fe<0&&($g=-Math.min(-Fe,he-this.options.hierarchical.nodeSpacing)),$g!=0&&(this._shiftBlock(m.id,$g),g=!0)},FA=Ce=>{let V=this.direction.getPosition(m),[Y,he]=this._getSpaceAroundNode(m),fe=Ce-V,Fe=V;fe>0?Fe=Math.min(V+(he-this.options.hierarchical.nodeSpacing),Ce):fe<0&&(Fe=Math.max(V-(Y-this.options.hierarchical.nodeSpacing),Ce)),Fe!==V&&(this.direction.setPosition(m,Fe),g=!0)},Jg=Qg(u,j);Xg(Jg),Jg=Qg(u,w),FA(Jg)},l=u=>{let m=this.hierarchical.getLevels();m=Zg(m).call(m);for(let E=0;E<u;E++){g=!1;for(let w=0;w<m.length;w++){let O=m[w],R=this.hierarchical.distributionOrdering[O];for(let M=0;M<R.length;M++)a(1e3,R[M])}if(g!==!0)break}},h=u=>{let m=this.hierarchical.getLevels();m=Zg(m).call(m);for(let E=0;E<u&&(g=!1,o(d,m,!0),g===!0);E++);},c=()=>{for(let u in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,u)&&this._centerParent(this.body.nodes[u])},f=()=>{let u=this.hierarchical.getLevels();u=Zg(u).call(u);for(let m=0;m<u.length;m++){let E=u[m],w=this.hierarchical.distributionOrdering[E];for(let O=0;O<w.length;O++)this._centerParent(w[O])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&l(20),this.options.hierarchical.parentCentralization===!0&&f(),A()}_getSpaceAroundNode(e,g){let t=!0;g===void 0&&(t=!1);let A=this.hierarchical.levels[e.id];if(A!==void 0){let C=this.hierarchical.distributionIndex[e.id],i=this.direction.getPosition(e),n=this.hierarchical.distributionOrdering[A],r=1e9,s=1e9;if(C!==0){let o=n[C-1];if(t===!0&&g[o.id]===void 0||t===!1){let d=this.direction.getPosition(o);r=i-d}}if(C!=n.length-1){let o=n[C+1];if(t===!0&&g[o.id]===void 0||t===!1){let d=this.direction.getPosition(o);s=Math.min(s,d-i)}}return[r,s]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let g=this.hierarchical.parentReference[e.id];for(let t=0;t<g.length;t++){let A=g[t],C=this.body.nodes[A],i=this.hierarchical.childrenReference[A];if(i!==void 0){let n=this._getCenterPosition(i),r=this.direction.getPosition(C),[s,o]=this._getSpaceAroundNode(C),d=r-n;(d<0&&Math.abs(d)<o-this.options.hierarchical.nodeSpacing||d>0&&Math.abs(d)<s-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(C,n)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var g;let A=U(e[t]);A=this._indexArrayToNodes(A),ig(g=this.direction).call(g,A);let C=0;for(let i=0;i<A.length;i++){let n=A[i];if(this.positionedNodes[n.id]===void 0){let r=this.options.hierarchical.nodeSpacing,s=r*C;C>0&&(s=this.direction.getPosition(A[i-1])+r),this.direction.setPosition(n,s,t),this._validatePositionAndContinue(n,t,s),C++}}}}_placeBranchNodes(e,g){var t;let A=this.hierarchical.childrenReference[e];if(A===void 0)return;let C=[];for(let n=0;n<A.length;n++)C.push(this.body.nodes[A[n]]);ig(t=this.direction).call(t,C);for(let n=0;n<C.length;n++){let r=C[n],s=this.hierarchical.levels[r.id];if(s>g&&this.positionedNodes[r.id]===void 0){let o=this.options.hierarchical.nodeSpacing,d;n===0?d=this.direction.getPosition(this.body.nodes[e]):d=this.direction.getPosition(C[n-1])+o,this.direction.setPosition(r,d,s),this._validatePositionAndContinue(r,s,d)}else return}let i=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[e],i,g)}_validatePositionAndContinue(e,g,t){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[g]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[g]]);if(t-A<this.options.hierarchical.nodeSpacing){let C=A+this.options.hierarchical.nodeSpacing-t,i=this._findCommonParent(this.lastNodeOnLevel[g],e.id);this._shiftBlock(i.withChild,C)}}this.lastNodeOnLevel[g]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,g)}}_indexArrayToNodes(e){let g=[];for(let t=0;t<e.length;t++)g.push(this.body.nodes[e[t]]);return g}_getDistribution(){let e={},g,t;for(g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){t=this.body.nodes[g];let A=this.hierarchical.levels[g]===void 0?0:this.hierarchical.levels[g];this.direction.fix(t,A),e[A]===void 0&&(e[A]={}),e[A][g]=t}return e}_getActiveEdges(e){let g=[];return k(e.edges,t=>{var A;G(A=this.body.edgeIndices).call(A,t.id)!==-1&&g.push(t)}),g}_getHubSizes(){let e={},g=this.body.nodeIndices;k(g,A=>{let C=this.body.nodes[A],i=this._getActiveEdges(C).length;e[i]=!0});let t=[];return k(e,A=>{t.push(Number(A))}),ig(t).call(t,function(A,C){return C-A}),t}_determineLevelsByHubsize(){let e=(t,A)=>{this.hierarchical.levelDownstream(t,A)},g=this._getHubSizes();for(let t=0;t<g.length;++t){let A=g[t];if(A===0)break;k(this.body.nodeIndices,C=>{let i=this.body.nodes[C];A===this._getActiveEdges(i).length&&this._crawlNetwork(e,C)})}}_determineLevelsCustomCallback(){let g=function(A,C,i){},t=(A,C,i)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let r=g(de.cloneOptions(A,"node"),de.cloneOptions(C,"node"),de.cloneOptions(i,"edge"));this.hierarchical.levels[C.id]=n+r};this._crawlNetwork(t),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let g=Br(e=this.body.nodeIndices).call(e,(t,A)=>(t.set(A,this.body.nodes[A]),t),new NA);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=I5(g):this.hierarchical.levels=A5(g),this.hierarchical.setMinLevelToZero()}_generateMap(){let e=(g,t)=>{this.hierarchical.levels[t.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,t.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},g=arguments.length>1?arguments[1]:void 0,t={},A=(C,i)=>{if(t[C.id]===void 0){this.hierarchical.setTreeIndex(C,i),t[C.id]=!0;let n,r=this._getActiveEdges(C);for(let s=0;s<r.length;s++){let o=r[s];o.connected===!0&&(o.toId==C.id?n=o.from:n=o.to,C.id!=n.id&&(e(C,n,o),A(n,i)))}}};if(g===void 0){let C=0;for(let i=0;i<this.body.nodeIndices.length;i++){let n=this.body.nodeIndices[i];if(t[n]===void 0){let r=this.body.nodes[n];A(r,C),C+=1}}}else{let C=this.body.nodes[g];if(C===void 0){console.error("Node not found:",g);return}A(C)}}_shiftBlock(e,g){let t={},A=C=>{if(t[C])return;t[C]=!0,this.direction.shift(C,g);let i=this.hierarchical.childrenReference[C];if(i!==void 0)for(let n=0;n<i.length;n++)A(i[n])};A(e)}_findCommonParent(e,g){let t={},A=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];i[o]=!0,A(i,o)}},C=(i,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];if(i[o]!==void 0)return{foundParent:o,withChild:n};let d=C(i,o);if(d.foundParent!==null)return d}return{foundParent:null,withChild:n}};return A(t,e),C(t,g)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Un(this):this.direction=new Kn(this)}_getCenterPosition(e){let g=1e9,t=-1e9;for(let A=0;A<e.length;A++){let C;if(e[A].id!==void 0)C=e[A];else{let n=e[A];C=this.body.nodes[n]}let i=this.direction.getPosition(C);g=Math.min(g,i),t=Math.max(t,i)}return .5*(g+t)}},C5=`div.vis-network div.vis-manipulation {
716
+ `;Cg(RF);function sd(i){var e=i&&i.preventDefault||!1,t=i&&i.container||window,g={},A={keydown:{},keyup:{}},I={},C;for(C=97;C<=122;C++)I[String.fromCharCode(C)]={code:65+(C-97),shift:!1};for(C=65;C<=90;C++)I[String.fromCharCode(C)]={code:C,shift:!0};for(C=0;C<=9;C++)I[""+C]={code:48+C,shift:!1};for(C=1;C<=12;C++)I["F"+C]={code:111+C,shift:!1};for(C=0;C<=9;C++)I["num"+C]={code:96+C,shift:!1};I["num*"]={code:106,shift:!1},I["num+"]={code:107,shift:!1},I["num-"]={code:109,shift:!1},I["num/"]={code:111,shift:!1},I["num."]={code:110,shift:!1},I.left={code:37,shift:!1},I.up={code:38,shift:!1},I.right={code:39,shift:!1},I.down={code:40,shift:!1},I.space={code:32,shift:!1},I.enter={code:13,shift:!1},I.shift={code:16,shift:void 0},I.esc={code:27,shift:!1},I.backspace={code:8,shift:!1},I.tab={code:9,shift:!1},I.ctrl={code:17,shift:!1},I.alt={code:18,shift:!1},I.delete={code:46,shift:!1},I.pageup={code:33,shift:!1},I.pagedown={code:34,shift:!1},I["="]={code:187,shift:!1},I["-"]={code:189,shift:!1},I["]"]={code:221,shift:!1},I["["]={code:219,shift:!1};var n=function(o){s(o,"keydown")},r=function(o){s(o,"keyup")},s=function(o,a){if(A[a][o.keyCode]!==void 0){for(var l=A[a][o.keyCode],d=0;d<l.length;d++)(l[d].shift===void 0||l[d].shift==!0&&o.shiftKey==!0||l[d].shift==!1&&o.shiftKey==!1)&&l[d].fn(o);e==!0&&o.preventDefault()}};return g.bind=function(o,a,l){if(l===void 0&&(l="keydown"),I[o]===void 0)throw new Error("unsupported key: "+o);A[l][I[o].code]===void 0&&(A[l][I[o].code]=[]),A[l][I[o].code].push({fn:a,shift:I[o].shift})},g.bindAll=function(o,a){a===void 0&&(a="keydown");for(var l in I)I.hasOwnProperty(l)&&g.bind(l,o,a)},g.getKey=function(o){for(var a in I)if(I.hasOwnProperty(a)){if(o.shiftKey==!0&&I[a].shift==!0&&o.keyCode==I[a].code)return a;if(o.shiftKey==!1&&I[a].shift==!1&&o.keyCode==I[a].code)return a;if(o.keyCode==I[a].code&&a=="shift")return a}return"unknown key, currently not supported"},g.unbind=function(o,a,l){if(l===void 0&&(l="keydown"),I[o]===void 0)throw new Error("unsupported key: "+o);if(a!==void 0){var d=[],h=A[l][I[o].code];if(h!==void 0)for(var c=0;c<h.length;c++)h[c].fn==a&&h[c].shift==I[o].shift||d.push(A[l][I[o].code][c]);A[l][I[o].code]=d}else A[l][I[o].code]=[]},g.reset=function(){A={keydown:{},keyup:{}}},g.destroy=function(){A={keydown:{},keyup:{}},t.removeEventListener("keydown",n,!0),t.removeEventListener("keyup",r,!0)},t.addEventListener("keydown",n,!0),t.addEventListener("keyup",r,!0),g}var Fr=class{constructor(e,t){this.body=e,this.canvas=t,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",()=>{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}loadNavigationElements(){this.cleanNavigation(),this.navigationDOM={};let e=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],t=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(let C=0;C<e.length;C++){this.navigationDOM[e[C]]=document.createElement("div"),this.navigationDOM[e[C]].className="vis-button vis-"+e[C],this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[C]]);let n=new Rg(this.navigationDOM[e[C]]);if(t[C]==="_fit"){var g;bI(n,y(g=this._fit).call(g,this))}else{var A;bI(n,y(A=this.bindToRedraw).call(A,this,t[C]))}this.navigationHammers.push(n)}let I=new Rg(this.canvas.frame);du(I,()=>{this._stopMovement()}),this.navigationHammers.push(I),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=y(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(let e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){let e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),g=this.body.view.translation,A=t/e,I=(1-A)*this.canvas.canvasViewCenter.x+g.x*A,C=(1-A)*this.canvas.canvasViewCenter.y+g.y*A;this.body.view.scale=t,this.body.view.translation={x:I,y:C},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){let e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),g=this.body.view.translation,A=t/e,I=(1-A)*this.canvas.canvasViewCenter.x+g.x*A,C=(1-A)*this.canvas.canvasViewCenter.y+g.y*A;this.body.view.scale=t,this.body.view.translation={x:I,y:C},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=sd({container:window,preventDefault:!0}):this.keycharm=sd({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,g,A,I,C,n,r,s,o,a,l,d,h,c,u,f,p,E,x,P,_,M,j;y(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),y(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),y(g=this.keycharm).call(g,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),y(A=this.keycharm).call(A,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),y(I=this.keycharm).call(I,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),y(C=this.keycharm).call(C,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),y(n=this.keycharm).call(n,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),y(r=this.keycharm).call(r,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),y(s=this.keycharm).call(s,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),y(o=this.keycharm).call(o,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),y(a=this.keycharm).call(a,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),y(l=this.keycharm).call(l,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),y(d=this.keycharm).call(d,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),y(h=this.keycharm).call(h,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),y(c=this.keycharm).call(c,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),y(u=this.keycharm).call(u,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),y(f=this.keycharm).call(f,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),y(p=this.keycharm).call(p,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),y(E=this.keycharm).call(E,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),y(x=this.keycharm).call(x,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),y(P=this.keycharm).call(P,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),y(_=this.keycharm).call(_,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),y(M=this.keycharm).call(M,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),y(j=this.keycharm).call(j,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}},Br=class{constructor(e,t,g){var A,I,C,n,r,s,o,a,l,d,h,c,u;this.body=e,this.canvas=t,this.selectionHandler=g,this.navigationHandler=new Fr(e,t),this.body.eventListeners.onTap=y(A=this.onTap).call(A,this),this.body.eventListeners.onTouch=y(I=this.onTouch).call(I,this),this.body.eventListeners.onDoubleTap=y(C=this.onDoubleTap).call(C,this),this.body.eventListeners.onHold=y(n=this.onHold).call(n,this),this.body.eventListeners.onDragStart=y(r=this.onDragStart).call(r,this),this.body.eventListeners.onDrag=y(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=y(o=this.onDragEnd).call(o,this),this.body.eventListeners.onMouseWheel=y(a=this.onMouseWheel).call(a,this),this.body.eventListeners.onPinch=y(l=this.onPinch).call(l,this),this.body.eventListeners.onMouseMove=y(d=this.onMouseMove).call(d,this),this.body.eventListeners.onRelease=y(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=y(c=this.onContext).call(c,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=y(u=this.getPointer).call(u,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(iI(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Me(this.options,e,"keyboard"),e.tooltip&&(ee(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Gn(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-xP(this.canvas.frame.canvas),y:e.y-EP(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){let t=this.getPointer(e.center),g=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,g),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){let t=this.getPointer(e.center),g=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,g),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){let t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){let t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){let g=function(A,I){let C=[];for(let n=0;n<A.length;n++){let r=A[n];G(I).call(I,r)===-1&&C.push(r)}return C};return{nodes:g(e.nodes,t.nodes),edges:g(e.edges,t.edges)}}onDragStart(e){if(this.drag.dragging)return;this.drag.pointer===void 0&&this.onTouch(e);let t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=ee({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;let g=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(g.x),y:this.canvas._YconvertDOMtoCanvas(g.y)}}else if(t!==void 0&&this.options.dragNodes===!0){this.drag.nodeId=t.id,t.isSelected()===!1&&this.selectionHandler.setSelection({nodes:[t.id]}),this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer);for(let g of this.selectionHandler.getSelectedNodes()){let A={id:g.id,node:g,x:g.x,y:g.y,xFixed:g.options.fixed.x,yFixed:g.options.fixed.y};g.options.fixed.x=!0,g.options.fixed.y=!0,this.drag.selection.push(A)}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}onDrag(e){if(this.drag.pinched===!0)return;this.body.emitter.emit("unlockNode");let t=this.getPointer(e.center),g=this.drag.selection;if(g&&g.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,t);let A=t.x-this.drag.pointer.x,I=t.y-this.drag.pointer.y;F(g).call(g,C=>{let n=C.node;C.xFixed===!1&&(n.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(C.x)+A)),C.yFixed===!1&&(n.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(C.y)+I))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}let A=t.x-this.drag.pointer.x,I=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+A,y:this.drag.translation.y+I},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;let g=this.body.selectionBox.position,A={minX:Math.min(g.start.x,g.end.x),minY:Math.min(g.start.y,g.end.y),maxX:Math.max(g.start.x,g.end.x),maxY:Math.max(g.start.y,g.end.y)},I=Ae(t=this.body.nodeIndices).call(t,n=>{let r=this.body.nodes[n];return r.x>=A.minX&&r.x<=A.maxX&&r.y>=A.minY&&r.y<=A.maxY});F(I).call(I,n=>this.selectionHandler.selectObject(this.body.nodes[n]));let C=this.getPointer(e.center);this.selectionHandler.commitAndEmit(C,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{let g=this.drag.selection;g&&g.length?(F(g).call(g,function(A){A.node.options.fixed.x=A.xFixed,A.node.options.fixed.y=A.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){let t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);let g=this.pinch.scale*e.scale;this.zoom(g,t)}zoom(e,t){if(this.options.zoomView===!0){let g=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let A;this.drag!==void 0&&this.drag.dragging===!0&&(A=this.canvas.DOMtoCanvas(this.drag.pointer));let I=this.body.view.translation,C=e/g,n=(1-C)*t.x+I.x*C,r=(1-C)*t.y+I.y*C;if(this.body.view.scale=e,this.body.view.translation={x:n,y:r},A!=null){let s=this.canvas.canvasToDOM(A);this.drag.pointer.x=s.x,this.drag.pointer.y=s.y}this.body.emitter.emit("_requestRedraw"),g<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}onMouseWheel(e){if(this.options.zoomView===!0){if(e.deltaY!==0){let t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);let g=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,g)}e.preventDefault()}}onMouseMove(e){let t=this.getPointer({x:e.clientX,y:e.clientY}),g=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(t),this.popup.hidden===!1&&(g=!0,this.popup.setPosition(t.x+3,t.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),g===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=gt(()=>this._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){let t=this.canvas._XconvertDOMtoCanvas(e.x),g=this.canvas._YconvertDOMtoCanvas(e.y),A={left:t,top:g,right:t,bottom:g},I=this.popupObj===void 0?void 0:this.popupObj.id,C=!1,n="node";if(this.popupObj===void 0){let r=this.body.nodeIndices,s=this.body.nodes,o,a=[];for(let l=0;l<r.length;l++)o=s[r[l]],o.isOverlappingWith(A)===!0&&(C=!0,o.getTitle()!==void 0&&a.push(r[l]));a.length>0&&(this.popupObj=s[a[a.length-1]],C=!0)}if(this.popupObj===void 0&&C===!1){let r=this.body.edgeIndices,s=this.body.edges,o,a=[];for(let l=0;l<r.length;l++)o=s[r[l]],o.isOverlappingWith(A)===!0&&o.connected===!0&&o.getTitle()!==void 0&&a.push(r[l]);a.length>0&&(this.popupObj=s[a[a.length-1]],n="edge")}this.popupObj!==void 0?this.popupObj.id!==I&&(this.popup===void 0&&(this.popup=new FP(this.canvas.frame)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){let t=this.selectionHandler._pointerToPositionObject(e),g=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(g=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),g===!0)){let A=this.selectionHandler.getNodeAt(e);g=A===void 0?!1:A.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(g=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));g===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}},DF=L,od=Ps,Fi=YI.getWeakData,NF=Ts,_F=bt,kF=Lg,ln=pe,MF=Es,hu=jt,ad=re,cu=ng,FF=cu.set,BF=cu.getterFor,zF=hu.find,LF=hu.findIndex,ZF=DF([].splice),GF=0,Bi=function(i){return i.frozen||(i.frozen=new uu)},uu=function(){this.entries=[]},dn=function(i,e){return zF(i.entries,function(t){return t[0]===e})};uu.prototype={get:function(i){var e=dn(this,i);if(e)return e[1]},has:function(i){return!!dn(this,i)},set:function(i,e){var t=dn(this,i);t?t[1]=e:this.entries.push([i,e])},delete:function(i){var e=LF(this.entries,function(t){return t[0]===i});return~e&&ZF(this.entries,e,1),!!~e}};var jF={getConstructor:function(i,e,t,g){var A=i(function(r,s){NF(r,I),FF(r,{type:e,id:GF++,frozen:void 0}),kF(s)||MF(s,r[g],{that:r,AS_ENTRIES:t})}),I=A.prototype,C=BF(e),n=function(r,s,o){var a=C(r),l=Fi(_F(s),!0);return l===!0?Bi(a).set(s,o):l[a.id]=o,r};return od(I,{delete:function(r){var s=C(this);if(!ln(r))return!1;var o=Fi(r);return o===!0?Bi(s).delete(r):o&&ad(o,s.id)&&delete o[s.id]},has:function(s){var o=C(this);if(!ln(s))return!1;var a=Fi(s);return a===!0?Bi(o).has(s):a&&ad(a,o.id)}}),od(I,t?{get:function(s){var o=C(this);if(ln(s)){var a=Fi(s);return a===!0?Bi(o).get(s):a?a[o.id]:void 0}},set:function(s,o){return n(this,s,o)}}:{add:function(s){return n(this,s,!0)}}),A}},VF=Fc,ld=$,Hi=L,dd=Ps,YF=YI,WF=Os,fu=jF,zi=pe,Li=ng.enforce,UF=z,HF=qd,Ci=Object,KF=Array.isArray,Zi=Ci.isExtensible,pu=Ci.isFrozen,QF=Ci.isSealed,mu=Ci.freeze,XF=Ci.seal,hd={},cd={},$F=!ld.ActiveXObject&&"ActiveXObject"in ld,CA,vu=function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}},bu=WF("WeakMap",vu,fu),Eg=bu.prototype,Ki=Hi(Eg.set),JF=function(){return VF&&UF(function(){var i=mu([]);return Ki(new bu,i,1),!pu(i)})};HF&&($F?(CA=fu.getConstructor(vu,"WeakMap",!0),YF.enable(),hn=Hi(Eg.delete),nA=Hi(Eg.has),cn=Hi(Eg.get),dd(Eg,{delete:function(i){if(zi(i)&&!Zi(i)){var e=Li(this);return e.frozen||(e.frozen=new CA),hn(this,i)||e.frozen.delete(i)}return hn(this,i)},has:function(e){if(zi(e)&&!Zi(e)){var t=Li(this);return t.frozen||(t.frozen=new CA),nA(this,e)||t.frozen.has(e)}return nA(this,e)},get:function(e){if(zi(e)&&!Zi(e)){var t=Li(this);return t.frozen||(t.frozen=new CA),nA(this,e)?cn(this,e):t.frozen.get(e)}return cn(this,e)},set:function(e,t){if(zi(e)&&!Zi(e)){var g=Li(this);g.frozen||(g.frozen=new CA),nA(this,e)?Ki(this,e,t):g.frozen.set(e,t)}else Ki(this,e,t);return this}})):JF()&&dd(Eg,{set:function(e,t){var g;return KF(e)&&(pu(e)?g=hd:QF(e)&&(g=cd)),Ki(this,e,t),g===hd&&mu(e),g===cd&&XF(e),this}}));var hn,nA,cn,qF=Z,e3=qF.WeakMap,t3=e3,g3=t3,A3=g3,uA=R(A3);function W(i,e,t,g){if(t==="a"&&!g)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!g:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?g:t==="a"?g.call(i):g?g.value:e.get(i)}function zr(i,e,t,g,A){if(g==="m")throw new TypeError("Private method is not writable");if(g==="a"&&!A)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!A:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return g==="a"?A.call(i,t):A?A.value=t:e.set(i,t),t}var Ht,ke,Ot,Pt,Qi;function ud(i,e){let t=new We;for(let g of e)i.has(g)||t.add(g);return t}var yI=class{constructor(){Ht.set(this,new We),ke.set(this,new We)}get size(){return W(this,ke,"f").size}add(){for(var e=arguments.length,t=new Array(e),g=0;g<e;g++)t[g]=arguments[g];for(let A of t)W(this,ke,"f").add(A)}delete(){for(var e=arguments.length,t=new Array(e),g=0;g<e;g++)t[g]=arguments[g];for(let A of t)W(this,ke,"f").delete(A)}clear(){W(this,ke,"f").clear()}getSelection(){return[...W(this,ke,"f")]}getChanges(){return{added:[...ud(W(this,Ht,"f"),W(this,ke,"f"))],deleted:[...ud(W(this,ke,"f"),W(this,Ht,"f"))],previous:[...new We(W(this,Ht,"f"))],current:[...new We(W(this,ke,"f"))]}}commit(){let e=this.getChanges();zr(this,Ht,W(this,ke,"f"),"f"),zr(this,ke,new We(W(this,Ht,"f")),"f");for(let t of e.added)t.select();for(let t of e.deleted)t.unselect();return e}};Ht=new uA,ke=new uA;var Lr=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};Ot.set(this,new yI),Pt.set(this,new yI),Qi.set(this,void 0),zr(this,Qi,e,"f")}get sizeNodes(){return W(this,Ot,"f").size}get sizeEdges(){return W(this,Pt,"f").size}getNodes(){return W(this,Ot,"f").getSelection()}getEdges(){return W(this,Pt,"f").getSelection()}addNodes(){W(this,Ot,"f").add(...arguments)}addEdges(){W(this,Pt,"f").add(...arguments)}deleteNodes(e){W(this,Ot,"f").delete(e)}deleteEdges(e){W(this,Pt,"f").delete(e)}clear(){W(this,Ot,"f").clear(),W(this,Pt,"f").clear()}commit(){let e={nodes:W(this,Ot,"f").commit(),edges:W(this,Pt,"f").commit()};for(var t=arguments.length,g=new Array(t),A=0;A<t;A++)g[A]=arguments[A];return W(this,Qi,"f").call(this,e,...g),e}};Ot=new uA,Pt=new uA,Qi=new uA;var Zr=class{constructor(e,t){this.body=e,this.canvas=t,this._selectionAccumulator=new Lr,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},ee(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",()=>{this.updateSelection()})}setOptions(e){e!==void 0&&Kg(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){let g=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),g!==void 0&&(t=this.selectObject(g)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){let g=this.getNodeAt(e)||this.getEdgeAt(e);g!==void 0&&(t=!0,g.isSelected()===!0?this.deselectObject(g):this.selectObject(g),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){let g={};return g.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},g.event=e,g}generateClickEvent(e,t,g,A){let I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,C=this._initBaseEvent(t,g);if(I===!0)C.nodes=[],C.edges=[];else{let n=this.getSelection();C.nodes=n.nodes,C.edges=n.edges}A!==void 0&&(C.previousSelection=A),e=="click"&&(C.items=this.getClickedItems(g)),t.controlEdge!==void 0&&(C.controlEdge=t.controlEdge),this.body.emitter.emit(e,C)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof be?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){let t=[],g=this.body.nodes;for(let A=0;A<this.body.nodeIndices.length;A++){let I=this.body.nodeIndices[A];g[I].isOverlappingWith(e)&&t.push(I)}return t}_pointerToPositionObject(e){let t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}getNodeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,g=this._pointerToPositionObject(e),A=this._getAllNodesOverlappingWith(g);if(A.length>0)return t===!0?this.body.nodes[A[A.length-1]]:A[A.length-1]}_getEdgesOverlappingWith(e,t){let g=this.body.edges;for(let A=0;A<this.body.edgeIndices.length;A++){let I=this.body.edgeIndices[A];g[I].isOverlappingWith(e)&&t.push(I)}}_getAllEdgesOverlappingWith(e){let t=[];return this._getEdgesOverlappingWith(e,t),t}getEdgeAt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,g=this.canvas.DOMtoCanvas(e),A=10,I=null,C=this.body.edges;for(let n=0;n<this.body.edgeIndices.length;n++){let r=this.body.edgeIndices[n],s=C[r];if(s.connected){let o=s.from.x,a=s.from.y,l=s.to.x,d=s.to.y,h=s.edgeType.getDistanceToEdge(o,a,l,d,g.x,g.y);h<A&&(I=r,A=h)}}if(I!==null)return t===!0?this.body.edges[I]:I}_addToHover(e){e instanceof be?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}_removeFromSelection(e){e instanceof be?(this._selectionAccumulator.deleteNodes(e),this._selectionAccumulator.deleteEdges(...e.edges)):this._selectionAccumulator.deleteEdges(e)}unselectAll(){this._selectionAccumulator.clear()}getSelectedNodeCount(){return this._selectionAccumulator.sizeNodes}getSelectedEdgeCount(){return this._selectionAccumulator.sizeEdges}_hoverConnectedEdges(e){for(let t=0;t<e.edges.length;t++){let g=e.edges[t];g.hover=!0,this._addToHover(g)}}emitBlurEvent(e,t,g){let A=this._initBaseEvent(e,t);g.hover===!0&&(g.hover=!1,g instanceof be?(A.node=g.id,this.body.emitter.emit("blurNode",A)):(A.edge=g.id,this.body.emitter.emit("blurEdge",A)))}emitHoverEvent(e,t,g){let A=this._initBaseEvent(e,t),I=!1;return g.hover===!1&&(g.hover=!0,this._addToHover(g),I=!0,g instanceof be?(A.node=g.id,this.body.emitter.emit("hoverNode",A)):(A.edge=g.id,this.body.emitter.emit("hoverEdge",A))),I}hoverObject(e,t){let g=this.getNodeAt(t);g===void 0&&(g=this.getEdgeAt(t));let A=!1;for(let I in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,I)&&(g===void 0||g instanceof be&&g.id!=I||g instanceof Lt)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[I]),delete this.hoverObj.nodes[I],A=!0);for(let I in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,I)&&(A===!0?(this.hoverObj.edges[I].hover=!1,delete this.hoverObj.edges[I]):(g===void 0||g instanceof Lt&&g.id!=I||g instanceof be&&!g.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[I]),delete this.hoverObj.edges[I],A=!0));if(g!==void 0){let I=K(this.hoverObj.edges).length,C=K(this.hoverObj.nodes).length,n=g instanceof Lt&&I===0&&C===0,r=g instanceof be&&I===0&&C===0;(A||n||r)&&(A=this.emitHoverEvent(e,t,g)),g instanceof be&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(g)}A===!0&&this.body.emitter.emit("_requestRedraw")}commitWithoutEmitting(){this._selectionAccumulator.commit()}commitAndEmit(e,t){let g=!1,A=this._selectionAccumulator.commit(),I={nodes:A.nodes.previous,edges:A.edges.previous};A.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,I),g=!0),A.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,I),g=!0),A.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),g=!0),A.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),g=!0),g===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return he(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return he(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(let g of e.nodes){let A=this.body.nodes[g];if(!A)throw new RangeError('Node with id "'+g+'" not found');this.selectObject(A,t.highlightEdges)}if(e.edges)for(let g of e.edges){let A=this.body.edges[g];if(!A)throw new RangeError('Edge with id "'+g+'" not found');this.selectObject(A)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(let e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(let e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){let t=this.canvas.DOMtoCanvas(e),g=[],A=this.body.nodeIndices,I=this.body.nodes;for(let r=A.length-1;r>=0;r--){let o=I[A[r]].getItemsOnPoint(t);g.push.apply(g,o)}let C=this.body.edgeIndices,n=this.body.edges;for(let r=C.length-1;r>=0;r--){let o=n[C[r]].getItemsOnPoint(t);g.push.apply(g,o)}return g}},wI=class{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,g),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}},Gr=class extends wI{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;g!==void 0&&this.layout.hierarchical.addToOrdering(e,g),e.x=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){ct(e).call(e,function(t,g){return t.x-g.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}},jr=class extends wI{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;g!==void 0&&this.layout.hierarchical.addToOrdering(e,g),e.y=t}getTreeSize(e){let t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){ct(e).call(e,function(t,g){return t.y-g.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}},i3=D,I3=jt.every,C3=Wg,n3=C3("every");i3({target:"Array",proto:!0,forced:!n3},{every:function(e){return I3(this,e,arguments.length>1?arguments[1]:void 0)}});var r3=Ie,s3=r3("Array").every,o3=J,a3=s3,un=Array.prototype,l3=function(i){var e=i.every;return i===un||o3(un,i)&&e===un.every?a3:e},d3=l3,h3=d3,c3=h3,yu=R(c3);function u3(i,e){let t=new We;return F(i).call(i,g=>{var A;F(A=g.edges).call(A,I=>{I.connected&&t.add(I)})}),F(t).call(t,g=>{let A=g.from.id,I=g.to.id;e[A]==null&&(e[A]=0),(e[I]==null||e[A]>=e[I])&&(e[I]=e[A]+1)}),e}function f3(i){return wu(e=>{var t,g;return yu(t=Ae(g=e.edges).call(g,A=>i.has(A.toId))).call(t,A=>A.to===e)},(e,t)=>t>e,"from",i)}function p3(i){return wu(e=>{var t,g;return yu(t=Ae(g=e.edges).call(g,A=>i.has(A.toId))).call(t,A=>A.from===e)},(e,t)=>t<e,"to",i)}function wu(i,e,t,g){var A;let I=Ft(null),C=Ds(A=[...nI(g).call(g)]).call(A,(a,l)=>a+1+l.edges.length,0),n=t+"Id",r=t==="to"?1:-1;for(let[a,l]of g){if(!g.has(a)||!i(l))continue;I[a]=0;let d=[l],h=0,c;for(;c=d.pop();){var s,o;if(!g.has(a))continue;let u=I[c.id]+r;if(F(s=Ae(o=c.edges).call(o,f=>f.connected&&f.to!==f.from&&f[t]!==c&&g.has(f.toId)&&g.has(f.fromId))).call(s,f=>{let p=f[n],E=I[p];(E==null||e(u,E))&&(I[p]=u,d.push(f[t]))}),h>C)return u3(g,I);++h}}return I}var Vr=class{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(let e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){let t={},g=A=>{if(t[A]!==void 0)return t[A];let I=this.levels[A];if(this.childrenReference[A]){let C=this.childrenReference[A];if(C.length>0)for(let n=0;n<C.length;n++)I=Math.max(I,g(C[n]))}return t[A]=I,I};return g(e)}levelDownstream(e,t){this.levels[t.id]===void 0&&(this.levels[e.id]===void 0&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}setMinLevelToZero(){var e;let t=new Ai,g=0,A=ct(e=[...new We(i2(this.levels))]).call(e,(I,C)=>I-C);for(let I of A)t.set(I,g++);for(let I in this.levels)Object.prototype.hasOwnProperty.call(this.levels,I)&&(this.levels[I]=t.get(this.levels[I]))}getTreeSize(e,t){let g=1e9,A=-1e9,I=1e9,C=-1e9;for(let n in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,n)&&this.trees[n]===t){let r=e[n];g=Math.min(r.x,g),A=Math.max(r.x,A),I=Math.min(r.y,I),C=Math.max(r.y,C)}return{min_x:g,max_x:A,min_y:I,max_y:C}}hasSameParent(e,t){let g=this.parentReference[e.id],A=this.parentReference[t.id];if(g===void 0||A===void 0)return!1;for(let I=0;I<g.length;I++)for(let C=0;C<A.length;C++)if(g[I]==A[C])return!0;return!1}inSameSubNetwork(e,t){return this.trees[e.id]===this.trees[t.id]}getLevels(){return K(this.distributionOrdering)}addToOrdering(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);let g=!1,A=this.distributionOrdering[t];for(let I in A)if(A[I]===e){g=!0;break}g||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}},Yr=class{constructor(e){this.body=e,this._resetRNG(Math.random()+":"+qi()),this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,clusterThreshold:150,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},ee(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("_dataChanged",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;let e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){let g=this.options.hierarchical,A=g.enabled;if(Kg(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),Me(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),g.enabled===!0)return A===!0&&this.body.emitter.emit("refresh",!0),g.direction==="RL"||g.direction==="DU"?g.levelSeparation>0&&(g.levelSeparation*=-1):g.levelSeparation<0&&(g.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(A===!0)return this.body.emitter.emit("refresh"),U(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=VI(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){let t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let g=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:g};else{let A=e.edges.smooth;A.type!==void 0&&A.type!=="dynamic"&&(g=A.type),this.optionsBackup.edges={smooth:{enabled:A.enabled===void 0?!0:A.enabled,type:A.type===void 0?"dynamic":A.type,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}},e.edges.smooth={enabled:A.enabled===void 0?!0:A.enabled,type:g,roundness:A.roundness===void 0?.5:A.roundness,forceDirection:A.forceDirection===void 0?!1:A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",g)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);let t=e.length+50;for(let g=0;g<e.length;g++){let A=e[g],I=2*Math.PI*this._rng();A.x===void 0&&(A.x=t*Math.cos(I)),A.y===void 0&&(A.y=t*Math.sin(I))}}}layoutNetwork(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){let e=this.body.nodeIndices,t=0;for(let g=0;g<e.length;g++)this.body.nodes[e[g]].predefinedPosition===!0&&(t+=1);if(t<.5*e.length){let A=0,I=this.options.clusterThreshold,C={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>I){let r=e.length;for(;e.length>I&&A<=10;){A+=1;let s=e.length;A%3===0?this.body.modules.clustering.clusterBridges(C):this.body.modules.clustering.clusterOutliers(C);let o=e.length;if(s==o&&A%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*r)})}A>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();let n=70;for(let r=0;r<e.length;r++){let s=this.body.nodes[e[r]];s.predefinedPosition===!1&&(s.x+=(.5-this._rng())*n,s.y+=(.5-this._rng())*n)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}_shiftToCenter(){let e=ce.getRangeCore(this.body.nodes,this.body.nodeIndices),t=ce.findCenter(e);for(let g=0;g<this.body.nodeIndices.length;g++){let A=this.body.nodes[this.body.nodeIndices[g]];A.x-=t.x,A.y-=t.y}}_declusterAll(){let e=!0;for(;e===!0;){e=!1;for(let t=0;t<this.body.nodeIndices.length;t++)this.body.nodes[this.body.nodeIndices[t]].isCluster===!0&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));e===!0&&this.body.emitter.emit("_dataChanged")}}getSeed(){return this.initialRandomSeed}setupHierarchicalLayout(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){let e,t,g=!1,A=!1;this.lastNodeOnLevel={},this.hierarchical=new Vr;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(g=!0,this.hierarchical.levels[t]=e.options.level):A=!0);if(A===!0&&g===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(A===!0){let C=this.options.hierarchical.sortMethod;C==="hubsize"?this._determineLevelsByHubsize():C==="directed"?this._determineLevelsDirected():C==="custom"&&this._determineLevelsCustomCallback()}for(let C in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,C)&&this.hierarchical.ensureLevel(C);let I=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(I),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1,g={},A=()=>{let f=C(),p=0;for(let E=0;E<f.length-1;E++){let x=f[E].max-f[E+1].min;p+=x+this.options.hierarchical.treeSpacing,I(E+1,p)}},I=(f,p)=>{let E=this.hierarchical.trees;for(let x in E)Object.prototype.hasOwnProperty.call(E,x)&&E[x]===f&&this.direction.shift(x,p)},C=()=>{let f=[];for(let p=0;p<this.hierarchical.numTrees();p++)f.push(this.direction.getTreeSize(p));return f},n=(f,p)=>{if(!p[f.id]&&(p[f.id]=!0,this.hierarchical.childrenReference[f.id])){let E=this.hierarchical.childrenReference[f.id];if(E.length>0)for(let x=0;x<E.length;x++)n(this.body.nodes[E[x]],p)}},r=function(f){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,x=1e9,P=1e9,_=-1e9;for(let M in f)if(Object.prototype.hasOwnProperty.call(f,M)){let j=e.body.nodes[M],Ee=e.hierarchical.levels[j.id],me=e.direction.getPosition(j),[sg,og]=e._getSpaceAroundNode(j,f);E=Math.min(sg,E),x=Math.min(og,x),Ee<=p&&(P=Math.min(me,P),_=Math.max(me,_))}return[P,_,E,x]},s=(f,p)=>{let E=this.hierarchical.getMaxLevel(f.id),x=this.hierarchical.getMaxLevel(p.id);return Math.min(E,x)},o=(f,p,E)=>{let x=this.hierarchical;for(let P=0;P<p.length;P++){let _=p[P],M=x.distributionOrdering[_];if(M.length>1)for(let j=0;j<M.length-1;j++){let Ee=M[j],me=M[j+1];x.hasSameParent(Ee,me)&&x.inSameSubNetwork(Ee,me)&&f(Ee,me,E)}}},a=function(f,p){let E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=e.direction.getPosition(f),P=e.direction.getPosition(p),_=Math.abs(P-x),M=e.options.hierarchical.nodeSpacing;if(_>M){let j={},Ee={};n(f,j),n(p,Ee);let me=s(f,p),sg=r(j,me),og=r(Ee,me),ni=sg[1],ag=og[0],Ce=og[2];if(Math.abs(ni-ag)>M){let Y=ni-ag+M;Y<-Ce+M&&(Y=-Ce+M),Y<0&&(e._shiftBlock(p.id,Y),t=!0,E===!0&&e._centerParent(p))}}},l=(f,p)=>{let E=p.id,x=p.edges,P=this.hierarchical.levels[p.id],_=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,M={},j=[];for(let Ce=0;Ce<x.length;Ce++){let V=x[Ce];if(V.toId!=V.fromId){let Y=V.toId==E?V.from:V.to;M[x[Ce].id]=Y,this.hierarchical.levels[Y.id]<P&&j.push(V)}}let Ee=(Ce,V)=>{let Y=0;for(let fe=0;fe<V.length;fe++)if(M[V[fe].id]!==void 0){let ve=this.direction.getPosition(M[V[fe].id])-Ce;Y+=ve/Math.sqrt(ve*ve+_)}return Y},me=(Ce,V)=>{let Y=0;for(let fe=0;fe<V.length;fe++)if(M[V[fe].id]!==void 0){let ve=this.direction.getPosition(M[V[fe].id])-Ce;Y-=_*Math.pow(ve*ve+_,-1.5)}return Y},sg=(Ce,V)=>{let Y=this.direction.getPosition(p),fe={};for(let ve=0;ve<Ce;ve++){let Ze=Ee(Y,V),lg=me(Y,V),Qg=40,Nu=Math.max(-Qg,Math.min(Qg,Math.round(Ze/lg)));if(Y=Y-Nu,fe[Y]!==void 0)break;fe[Y]=ve}return Y},og=Ce=>{let V=this.direction.getPosition(p);if(g[p.id]===void 0){let Qg={};n(p,Qg),g[p.id]=Qg}let Y=r(g[p.id]),fe=Y[2],ve=Y[3],Ze=Ce-V,lg=0;Ze>0?lg=Math.min(Ze,ve-this.options.hierarchical.nodeSpacing):Ze<0&&(lg=-Math.min(-Ze,fe-this.options.hierarchical.nodeSpacing)),lg!=0&&(this._shiftBlock(p.id,lg),t=!0)},ni=Ce=>{let V=this.direction.getPosition(p),[Y,fe]=this._getSpaceAroundNode(p),ve=Ce-V,Ze=V;ve>0?Ze=Math.min(V+(fe-this.options.hierarchical.nodeSpacing),Ce):ve<0&&(Ze=Math.max(V-(Y-this.options.hierarchical.nodeSpacing),Ce)),Ze!==V&&(this.direction.setPosition(p,Ze),t=!0)},ag=sg(f,j);og(ag),ag=sg(f,x),ni(ag)},d=f=>{let p=this.hierarchical.getLevels();p=Jt(p).call(p);for(let E=0;E<f;E++){t=!1;for(let x=0;x<p.length;x++){let P=p[x],_=this.hierarchical.distributionOrdering[P];for(let M=0;M<_.length;M++)l(1e3,_[M])}if(t!==!0)break}},h=f=>{let p=this.hierarchical.getLevels();p=Jt(p).call(p);for(let E=0;E<f&&(t=!1,o(a,p,!0),t===!0);E++);},c=()=>{for(let f in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,f)&&this._centerParent(this.body.nodes[f])},u=()=>{let f=this.hierarchical.getLevels();f=Jt(f).call(f);for(let p=0;p<f.length;p++){let E=f[p],x=this.hierarchical.distributionOrdering[E];for(let P=0;P<x.length;P++)this._centerParent(x[P])}};this.options.hierarchical.blockShifting===!0&&(h(5),c()),this.options.hierarchical.edgeMinimization===!0&&d(20),this.options.hierarchical.parentCentralization===!0&&u(),A()}_getSpaceAroundNode(e,t){let g=!0;t===void 0&&(g=!1);let A=this.hierarchical.levels[e.id];if(A!==void 0){let I=this.hierarchical.distributionIndex[e.id],C=this.direction.getPosition(e),n=this.hierarchical.distributionOrdering[A],r=1e9,s=1e9;if(I!==0){let o=n[I-1];if(g===!0&&t[o.id]===void 0||g===!1){let a=this.direction.getPosition(o);r=C-a}}if(I!=n.length-1){let o=n[I+1];if(g===!0&&t[o.id]===void 0||g===!1){let a=this.direction.getPosition(o);s=Math.min(s,a-C)}}return[r,s]}else return[0,0]}_centerParent(e){if(this.hierarchical.parentReference[e.id]){let t=this.hierarchical.parentReference[e.id];for(let g=0;g<t.length;g++){let A=t[g],I=this.body.nodes[A],C=this.hierarchical.childrenReference[A];if(C!==void 0){let n=this._getCenterPosition(C),r=this.direction.getPosition(I),[s,o]=this._getSpaceAroundNode(I),a=r-n;(a<0&&Math.abs(a)<o-this.options.hierarchical.nodeSpacing||a>0&&Math.abs(a)<s-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(I,n)}}}}_placeNodesByHierarchy(e){this.positionedNodes={};for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)){var t;let A=K(e[g]);A=this._indexArrayToNodes(A),ct(t=this.direction).call(t,A);let I=0;for(let C=0;C<A.length;C++){let n=A[C];if(this.positionedNodes[n.id]===void 0){let r=this.options.hierarchical.nodeSpacing,s=r*I;I>0&&(s=this.direction.getPosition(A[C-1])+r),this.direction.setPosition(n,s,g),this._validatePositionAndContinue(n,g,s),I++}}}}_placeBranchNodes(e,t){var g;let A=this.hierarchical.childrenReference[e];if(A===void 0)return;let I=[];for(let n=0;n<A.length;n++)I.push(this.body.nodes[A[n]]);ct(g=this.direction).call(g,I);for(let n=0;n<I.length;n++){let r=I[n],s=this.hierarchical.levels[r.id];if(s>t&&this.positionedNodes[r.id]===void 0){let o=this.options.hierarchical.nodeSpacing,a;n===0?a=this.direction.getPosition(this.body.nodes[e]):a=this.direction.getPosition(I[n-1])+o,this.direction.setPosition(r,a,s),this._validatePositionAndContinue(r,s,a)}else return}let C=this._getCenterPosition(I);this.direction.setPosition(this.body.nodes[e],C,t)}_validatePositionAndContinue(e,t,g){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){let A=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(g-A<this.options.hierarchical.nodeSpacing){let I=A+this.options.hierarchical.nodeSpacing-g,C=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(C.withChild,I)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}_indexArrayToNodes(e){let t=[];for(let g=0;g<e.length;g++)t.push(this.body.nodes[e[g]]);return t}_getDistribution(){let e={},t,g;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){g=this.body.nodes[t];let A=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(g,A),e[A]===void 0&&(e[A]={}),e[A][t]=g}return e}_getActiveEdges(e){let t=[];return k(e.edges,g=>{var A;G(A=this.body.edgeIndices).call(A,g.id)!==-1&&t.push(g)}),t}_getHubSizes(){let e={},t=this.body.nodeIndices;k(t,A=>{let I=this.body.nodes[A],C=this._getActiveEdges(I).length;e[C]=!0});let g=[];return k(e,A=>{g.push(Number(A))}),ct(g).call(g,function(A,I){return I-A}),g}_determineLevelsByHubsize(){let e=(g,A)=>{this.hierarchical.levelDownstream(g,A)},t=this._getHubSizes();for(let g=0;g<t.length;++g){let A=t[g];if(A===0)break;k(this.body.nodeIndices,I=>{let C=this.body.nodes[I];A===this._getActiveEdges(C).length&&this._crawlNetwork(e,I)})}}_determineLevelsCustomCallback(){let t=function(A,I,C){},g=(A,I,C)=>{let n=this.hierarchical.levels[A.id];n===void 0&&(n=this.hierarchical.levels[A.id]=1e5);let r=t(ce.cloneOptions(A,"node"),ce.cloneOptions(I,"node"),ce.cloneOptions(C,"edge"));this.hierarchical.levels[I.id]=n+r};this._crawlNetwork(g),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;let t=Ds(e=this.body.nodeIndices).call(e,(g,A)=>(g.set(A,this.body.nodes[A]),g),new Ai);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=p3(t):this.hierarchical.levels=f3(t),this.hierarchical.setMinLevelToZero()}_generateMap(){let e=(t,g)=>{this.hierarchical.levels[g.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,g.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0,g={},A=(I,C)=>{if(g[I.id]===void 0){this.hierarchical.setTreeIndex(I,C),g[I.id]=!0;let n,r=this._getActiveEdges(I);for(let s=0;s<r.length;s++){let o=r[s];o.connected===!0&&(o.toId==I.id?n=o.from:n=o.to,I.id!=n.id&&(e(I,n,o),A(n,C)))}}};if(t===void 0){let I=0;for(let C=0;C<this.body.nodeIndices.length;C++){let n=this.body.nodeIndices[C];if(g[n]===void 0){let r=this.body.nodes[n];A(r,I),I+=1}}}else{let I=this.body.nodes[t];if(I===void 0){console.error("Node not found:",t);return}A(I)}}_shiftBlock(e,t){let g={},A=I=>{if(g[I])return;g[I]=!0,this.direction.shift(I,t);let C=this.hierarchical.childrenReference[I];if(C!==void 0)for(let n=0;n<C.length;n++)A(C[n])};A(e)}_findCommonParent(e,t){let g={},A=(C,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];C[o]=!0,A(C,o)}},I=(C,n)=>{let r=this.hierarchical.parentReference[n];if(r!==void 0)for(let s=0;s<r.length;s++){let o=r[s];if(C[o]!==void 0)return{foundParent:o,withChild:n};let a=I(C,o);if(a.foundParent!==null)return a}return{foundParent:null,withChild:n}};return A(g,e),I(g,t)}setDirectionStrategy(){this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU"?this.direction=new Gr(this):this.direction=new jr(this)}_getCenterPosition(e){let t=1e9,g=-1e9;for(let A=0;A<e.length;A++){let I;if(e[A].id!==void 0)I=e[A];else{let n=e[A];I=this.body.nodes[n]}let C=this.direction.getPosition(I);t=Math.min(t,C),g=Math.max(g,C)}return .5*(t+g)}},m3=`div.vis-network div.vis-manipulation {
716
717
  box-sizing: content-box;
717
718
 
718
719
  border-width: 0;
@@ -906,19 +907,30 @@ div.network-navigation_wrapper {
906
907
  height: 100%;
907
908
  }
908
909
  */
909
- `;Hg(C5);var Jn=class{constructor(e,g,t,A){var C,i;this.body=e,this.canvas=g,this.selectionHandler=t,this.interactionHandler=A,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},q(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",b(C=this._restore).call(C,this)),this.body.emitter.on("_resetData",b(i=this._restore).call(i,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,g,t){g!==void 0&&(g.locale!==void 0?this.options.locale=g.locale:this.options.locale=t.locale,g.locales!==void 0?this.options.locales=g.locales:this.options.locales=t.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,_(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,g;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let t=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),C=t+A,i=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(i),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(i)),t===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(i)):A===1&&t===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(i)),C!==0&&(t>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(i)):t===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(i))),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",b(g=this.showManipulatorToolbar).call(g,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var g;let t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,b(g=this.toggleEditMode).call(g,this))}this._temporaryBindEvent("click",b(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){let g=_({},e.options,!1);if(g.x=e.x,g.y=e.y,this.options.editNode.length===2)this.options.editNode(g,t=>{t!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(t),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,g,t,A,C;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var i;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,b(i=this.toggleEditMode).call(i,this))}this._temporaryBindUI("onTouch",b(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",b(g=this._finishConnect).call(g,this)),this._temporaryBindUI("onDrag",b(t=this._dragControlNode).call(t,this)),this._temporaryBindUI("onRelease",b(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",b(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let i=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(i.from.id,i.to.id);return}if(this.guiEnabled===!0){var e;let i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,b(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var g,t,A,C;let i=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(i.from.x,i.from.y),r=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(r.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id),this._temporaryBindUI("onTouch",b(g=this._controlNodeTouch).call(g,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",b(t=this._controlNodeDragStart).call(t,this)),this._temporaryBindUI("onDrag",b(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",b(C=this._controlNodeDragEnd).call(C,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",s=>{let o=i.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=o.from.x,n.y=o.from.y),r.selected===!1&&(r.x=o.to.x,r.y=o.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let e=this.selectionHandler.getSelectedNodeIds(),g=this.selectionHandler.getSelectedEdgeIds(),t;if(e.length>0){for(let A=0;A<e.length;A++)if(this.body.nodes[e[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(t=this.options.deleteNode)}else g.length>0&&typeof this.options.deleteEdge=="function"&&(t=this.options.deleteEdge);if(typeof t=="function"){let A={nodes:e,edges:g};if(t.length===2)t(A,C=>{C!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(C.edges),this.body.data.nodes.getDataSet().remove(C.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(g),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,g;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(g=this.options.locales[this.options.locale])===null||g===void 0?void 0:g.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,g){let t=_({},this.options.controlNodeStyle);t.id="targetNode"+at(),t.hidden=!1,t.physics=!1,t.x=e,t.y=g;let A=this.body.functions.createNode(t);return A.shape.boundingBox={left:e,right:e,top:g,bottom:g},A}_createEditButton(){var e;this._clean(),this.manipulationDOM={},pg(this.editModeDiv);let g=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-edit vis-edit-mode",g.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindElementEvents(t,b(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(pg(this.editModeDiv),pg(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let g of Ke(e=this._domEventListenerCleanupQueue).call(e,0)){var e;g()}}_removeManipulationDOM(){this._clean(),pg(this.manipulationDiv),pg(this.editModeDiv),pg(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var g;let t=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addNodeMode).call(g,this))}_createAddEdgeButton(e){var g;let t=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.addEdgeMode).call(g,this))}_createEditNodeButton(e){var g;let t=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editNode).call(g,this))}_createEditEdgeButton(e){var g;let t=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.editEdgeMode).call(g,this))}_createDeleteButton(e){var g;let t;this.options.rtl?t="vis-delete-rtl":t="vis-delete";let A=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,b(g=this.deleteSelected).call(g,this))}_createBackButton(e){var g;let t=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindElementEvents(t,b(g=this.showManipulatorToolbar).call(g,this))}_createButton(e,g,t){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+g,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=A,this.manipulationDOM[e+"Label"].innerText=t,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,g){this.temporaryEventFunctions.push({event:e,boundFunction:g}),this.body.emitter.on(e,g)}_temporaryBindUI(e,g){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=g;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+xt(U(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let g=this.temporaryEventFunctions[e].event,t=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(g,t)}this.temporaryEventFunctions=[]}_bindElementEvents(e,g){let t=new ot(e,{});jI(t,g),this._domEventListenerCleanupQueue.push(()=>{t.destroy()});let A=C=>{let{keyCode:i,key:n}=C;(n==="Enter"||n===" "||i===13||i===32)&&g()};e.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let C=0;C<this.temporaryIds.edges.length;C++){var e;this.body.edges[this.temporaryIds.edges[C]].disconnect(),delete this.body.edges[this.temporaryIds.edges[C]];let i=G(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[C]);if(i!==-1){var g;Ke(g=this.body.edgeIndices).call(g,i,1)}}for(let C=0;C<this.temporaryIds.nodes.length;C++){var t;delete this.body.nodes[this.temporaryIds.nodes[C]];let i=G(t=this.body.nodeIndices).call(t,this.temporaryIds.nodes[C]);if(i!==-1){var A;Ke(A=this.body.nodeIndices).call(A,i,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,g=this.selectionHandler._pointerToPositionObject(e),t=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],C=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let i=t.isOverlappingWith(g),n=A.isOverlappingWith(g);i===!0?(this.selectedControlNode=t,C.edgeType.from=t):n===!0&&(this.selectedControlNode=A,C.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");let g=this.body.functions.getPointer(e.center),t=this.canvas.DOMtoCanvas(g);this.selectedControlNode!==void 0?(this.selectedControlNode.x=t.x,this.selectedControlNode.y=t.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let n=C.length-1;n>=0;n--)if(C[n]!==this.selectedControlNode.id){i=this.body.nodes[C[n]];break}if(i!==void 0&&this.selectedControlNode!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(i.id,A.to.id):this._performEditEdge(A.from.id,i.id)}else A.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=q({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let g=this.lastTouch,t=this.selectionHandler.getNodeAt(g);if(t!==void 0)if(t.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(t.x,t.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let C=this.body.functions.createEdge({id:"connectionEdge"+at(),from:t.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(C.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];break}}if(e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,g),this.temporaryIds.nodes[0]!==void 0){let r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(g.x),r.y=this.canvas._YconvertDOMtoCanvas(g.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){let g=this.body.functions.getPointer(e.center),t=this.selectionHandler._pointerToPositionObject(g),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let C=this.selectionHandler._getAllNodesOverlappingWith(t),i;for(let r=C.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,C[r])===-1){i=this.body.nodes[C[r]];break}}this._cleanupTemporaryNodesAndEdges(),i!==void 0&&(i.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[i.id]!==void 0&&this._performAddEdge(A,i.id)),e.controlEdge={from:A,to:i?i.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,g),this.body.emitter.emit("_redraw")}_dragStartEdge(e){let g=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,g,void 0,!0)}_performAddNode(e){let g={id:at(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(g,t=>{t!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()}_performAddEdge(e,g){let t={from:e,to:g};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(t,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,g){let t={id:this.edgeBeingEditedId,from:e,to:g,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(t,C=>{C==null||this.inMode!=="editEdge"?(this.body.edges[t.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(t),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},y="string",v="boolean",p="number",Zt="array",x="object",Jh="dom",i5="any",yi=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],wi={borderWidth:{number:p},borderWidthSelected:{number:p,undefined:"undefined"},brokenImage:{string:y,undefined:"undefined"},chosen:{label:{boolean:v,function:"function"},node:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{border:{string:y},background:{string:y},highlight:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},hover:{border:{string:y},background:{string:y},__type__:{object:x,string:y}},__type__:{object:x,string:y}},opacity:{number:p,undefined:"undefined"},fixed:{x:{boolean:v},y:{boolean:v},__type__:{object:x,boolean:v}},font:{align:{string:y},color:{string:y},size:{number:p},face:{string:y},background:{string:y},strokeWidth:{number:p},strokeColor:{string:y},vadjust:{number:p},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},__type__:{object:x,string:y}},group:{string:y,number:p,undefined:"undefined"},heightConstraint:{minimum:{number:p},valign:{string:y},__type__:{object:x,boolean:v,number:p}},hidden:{boolean:v},icon:{face:{string:y},code:{string:y},size:{number:p},color:{string:y},weight:{string:y,number:p},__type__:{object:x}},id:{string:y,number:p},image:{selected:{string:y,undefined:"undefined"},unselected:{string:y,undefined:"undefined"},__type__:{object:x,string:y}},imagePadding:{top:{number:p},right:{number:p},bottom:{number:p},left:{number:p},__type__:{object:x,number:p}},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},level:{number:p,undefined:"undefined"},margin:{top:{number:p},right:{number:p},bottom:{number:p},left:{number:p},__type__:{object:x,number:p}},mass:{number:p},physics:{boolean:v},scaling:{min:{number:p},max:{number:p},label:{enabled:{boolean:v},min:{number:p},max:{number:p},maxVisible:{number:p},drawThreshold:{number:p},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:p},x:{number:p},y:{number:p},__type__:{object:x,boolean:v}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:v,array:Zt},borderRadius:{number:p},interpolation:{boolean:v},useImageSize:{boolean:v},useBorderWithImage:{boolean:v},coordinateOrigin:{string:["center","top-left"]},__type__:{object:x}},size:{number:p},title:{string:y,dom:Jh,undefined:"undefined"},value:{number:p,undefined:"undefined"},widthConstraint:{minimum:{number:p},maximum:{number:p},__type__:{object:x,boolean:v,number:p}},x:{number:p},y:{number:p},__type__:{object:x}},n5={configure:{enabled:{boolean:v},filter:{boolean:v,string:y,array:Zt,function:"function"},container:{dom:Jh},showButton:{boolean:v},__type__:{object:x,boolean:v,string:y,array:Zt,function:"function"}},edges:{arrows:{to:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageHeight:{number:p},imageWidth:{number:p},src:{string:y},__type__:{object:x,boolean:v}},middle:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageWidth:{number:p},imageHeight:{number:p},src:{string:y},__type__:{object:x,boolean:v}},from:{enabled:{boolean:v},scaleFactor:{number:p},type:{string:yi},imageWidth:{number:p},imageHeight:{number:p},src:{string:y},__type__:{object:x,boolean:v}},__type__:{string:["from","to","middle"],object:x}},endPointOffset:{from:{number:p},to:{number:p},__type__:{object:x,number:p}},arrowStrikethrough:{boolean:v},background:{enabled:{boolean:v},color:{string:y},size:{number:p},dashes:{boolean:v,array:Zt},__type__:{object:x,boolean:v}},chosen:{label:{boolean:v,function:"function"},edge:{boolean:v,function:"function"},__type__:{object:x,boolean:v}},color:{color:{string:y},highlight:{string:y},hover:{string:y},inherit:{string:["from","to","both"],boolean:v},opacity:{number:p},__type__:{object:x,string:y}},dashes:{boolean:v,array:Zt},font:{color:{string:y},size:{number:p},face:{string:y},background:{string:y},strokeWidth:{number:p},strokeColor:{string:y},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:p},multi:{boolean:v,string:y},bold:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},boldital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},ital:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},mono:{color:{string:y},size:{number:p},face:{string:y},mod:{string:y},vadjust:{number:p},__type__:{object:x,string:y}},__type__:{object:x,string:y}},hidden:{boolean:v},hoverWidth:{function:"function",number:p},label:{string:y,undefined:"undefined"},labelHighlightBold:{boolean:v},length:{number:p,undefined:"undefined"},physics:{boolean:v},scaling:{min:{number:p},max:{number:p},label:{enabled:{boolean:v},min:{number:p},max:{number:p},maxVisible:{number:p},drawThreshold:{number:p},__type__:{object:x,boolean:v}},customScalingFunction:{function:"function"},__type__:{object:x}},selectionWidth:{function:"function",number:p},selfReferenceSize:{number:p},selfReference:{size:{number:p},angle:{number:p},renderBehindTheNode:{boolean:v},__type__:{object:x}},shadow:{enabled:{boolean:v},color:{string:y},size:{number:p},x:{number:p},y:{number:p},__type__:{object:x,boolean:v}},smooth:{enabled:{boolean:v},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:p},forceDirection:{string:["horizontal","vertical","none"],boolean:v},__type__:{object:x,boolean:v}},title:{string:y,undefined:"undefined"},width:{number:p},widthConstraint:{maximum:{number:p},__type__:{object:x,boolean:v,number:p}},value:{number:p,undefined:"undefined"},__type__:{object:x}},groups:{useDefaultGroups:{boolean:v},__any__:wi,__type__:{object:x}},interaction:{dragNodes:{boolean:v},dragView:{boolean:v},hideEdgesOnDrag:{boolean:v},hideEdgesOnZoom:{boolean:v},hideNodesOnDrag:{boolean:v},hover:{boolean:v},keyboard:{enabled:{boolean:v},speed:{x:{number:p},y:{number:p},zoom:{number:p},__type__:{object:x}},bindToWindow:{boolean:v},autoFocus:{boolean:v},__type__:{object:x,boolean:v}},multiselect:{boolean:v},navigationButtons:{boolean:v},selectable:{boolean:v},selectConnectedEdges:{boolean:v},hoverConnectedEdges:{boolean:v},tooltipDelay:{number:p},zoomView:{boolean:v},zoomSpeed:{number:p},__type__:{object:x}},layout:{randomSeed:{undefined:"undefined",number:p,string:y},improvedLayout:{boolean:v},clusterThreshold:{number:p},hierarchical:{enabled:{boolean:v},levelSeparation:{number:p},nodeSpacing:{number:p},treeSpacing:{number:p},blockShifting:{boolean:v},edgeMinimization:{boolean:v},parentCentralization:{boolean:v},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:x,boolean:v}},__type__:{object:x}},manipulation:{enabled:{boolean:v},initiallyActive:{boolean:v},addNode:{boolean:v,function:"function"},addEdge:{boolean:v,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:x,boolean:v,function:"function"}},deleteNode:{boolean:v,function:"function"},deleteEdge:{boolean:v,function:"function"},controlNodeStyle:wi,__type__:{object:x,boolean:v}},nodes:wi,physics:{enabled:{boolean:v},barnesHut:{theta:{number:p},gravitationalConstant:{number:p},centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},forceAtlas2Based:{theta:{number:p},gravitationalConstant:{number:p},centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},repulsion:{centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},nodeDistance:{number:p},damping:{number:p},__type__:{object:x}},hierarchicalRepulsion:{centralGravity:{number:p},springLength:{number:p},springConstant:{number:p},nodeDistance:{number:p},damping:{number:p},avoidOverlap:{number:p},__type__:{object:x}},maxVelocity:{number:p},minVelocity:{number:p},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:v},iterations:{number:p},updateInterval:{number:p},onlyDynamicEdges:{boolean:v},fit:{boolean:v},__type__:{object:x,boolean:v}},timestep:{number:p},adaptiveTimestep:{boolean:v},wind:{x:{number:p},y:{number:p},__type__:{object:x}},__type__:{object:x,boolean:v}},autoResize:{boolean:v},clickToUse:{boolean:v},locale:{string:y},locales:{__any__:{any:i5},__type__:{object:x}},height:{string:y},width:{string:y},__type__:{object:x}},$h={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},r5=(I,e,g)=>{var t;return!!(Eg(I).call(I,"physics")&&Eg(t=$h.physics.solver).call(t,e)&&g.physics.solver!==e&&e!=="wind")};var $n=class{constructor(){}getDistances(e,g,t){let A={},C=e.edges;for(let n=0;n<g.length;n++){let r=g[n],s={};A[r]=s;for(let o=0;o<g.length;o++)s[g[o]]=n==o?0:1e9}for(let n=0;n<t.length;n++){let r=C[t[n]];r.connected===!0&&A[r.fromId]!==void 0&&A[r.toId]!==void 0&&(A[r.fromId][r.toId]=1,A[r.toId][r.fromId]=1)}let i=g.length;for(let n=0;n<i;n++){let r=g[n],s=A[r];for(let o=0;o<i-1;o++){let d=g[o],a=A[d];for(let l=o+1;l<i;l++){let h=g[l],c=A[h],f=Math.min(a[h],a[r]+s[h]);a[h]=f,c[d]=f}}}return A}},qn=class{constructor(e,g,t){this.body=e,this.springLength=g,this.springConstant=t,this.distanceSolver=new $n}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,g){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,e,g);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let C=.01,i=1,n=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,o=1e9,d=0,a=0,l=0,h=0,c=0;for(;o>C&&n<r;)for(n+=1,[d,o,a,l]=this._getHighestEnergyNode(t),h=o,c=0;h>i&&c<s;)c+=1,this._moveNode(d,a,l),[h,a,l]=this._getEnergy(d)}_getHighestEnergyNode(e){let g=this.body.nodeIndices,t=this.body.nodes,A=0,C=g[0],i=0,n=0;for(let r=0;r<g.length;r++){let s=g[r];if(t[s].predefinedPosition!==!0||t[s].isCluster===!0&&e===!0||t[s].options.fixed.x!==!0||t[s].options.fixed.y!==!0){let[o,d,a]=this._getEnergy(s);A<o&&(A=o,C=s,i=d,n=a)}}return[C,A,i,n]}_getEnergy(e){let[g,t]=this.E_sums[e];return[Math.sqrt(g**2+t**2),g,t]}_moveNode(e,g,t){let A=this.body.nodeIndices,C=this.body.nodes,i=0,n=0,r=0,s=C[e].x,o=C[e].y,d=this.K_matrix[e],a=this.L_matrix[e];for(let w=0;w<A.length;w++){let O=A[w];if(O!==e){let R=C[O].x,M=C[O].y,j=d[O],ye=a[O],ue=1/((s-R)**2+(o-M)**2)**1.5;i+=j*(1-ye*(o-M)**2*ue),n+=j*(ye*(s-R)*(o-M)*ue),r+=j*(1-ye*(s-R)**2*ue)}}let l=i,h=n,c=g,f=r,u=t,m=(c/l+u/h)/(h/l-f/h),E=-(h*m+c)/l;C[e].x+=E,C[e].y+=m,this._updateE_matrix(e)}_createL_matrix(e){let g=this.body.nodeIndices,t=this.springLength;this.L_matrix=[];for(let A=0;A<g.length;A++){this.L_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.L_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]}}_createK_matrix(e){let g=this.body.nodeIndices,t=this.springConstant;this.K_matrix=[];for(let A=0;A<g.length;A++){this.K_matrix[g[A]]={};for(let C=0;C<g.length;C++)this.K_matrix[g[A]][g[C]]=t*e[g[A]][g[C]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,g=this.body.nodes;this.E_matrix={},this.E_sums={};for(let t=0;t<e.length;t++)this.E_matrix[e[t]]=[];for(let t=0;t<e.length;t++){let A=e[t],C=g[A].x,i=g[A].y,n=0,r=0;for(let s=t;s<e.length;s++){let o=e[s];if(o!==A){let d=g[o].x,a=g[o].y,l=1/Math.sqrt((C-d)**2+(i-a)**2);this.E_matrix[A][s]=[this.K_matrix[A][o]*(C-d-this.L_matrix[A][o]*(C-d)*l),this.K_matrix[A][o]*(i-a-this.L_matrix[A][o]*(i-a)*l)],this.E_matrix[o][t]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],r+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,r]}}_updateE_matrix(e){let g=this.body.nodeIndices,t=this.body.nodes,A=this.E_matrix[e],C=this.K_matrix[e],i=this.L_matrix[e],n=t[e].x,r=t[e].y,s=0,o=0;for(let d=0;d<g.length;d++){let a=g[d];if(a!==e){let l=A[d],h=l[0],c=l[1],f=t[a].x,u=t[a].y,m=1/Math.sqrt((n-f)**2+(r-u)**2),E=C[a]*(n-f-i[a]*(n-f)*m),w=C[a]*(r-u-i[a]*(r-u)*m);A[d]=[E,w],s+=E,o+=w;let O=this.E_sums[a];O[0]+=E-h,O[1]+=w-c}}this.E_sums[e]=[s,o]}};function T(I,e,g){var t,A,C,i;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:HO,clickToUse:!1},q(this.options,this.defaultOptions),this.body={container:I,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:b(t=this.on).call(t,this),off:b(A=this.off).call(A,this),emit:b(C=this.emit).call(C,this),once:b(i=this.once).call(i,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new Ji(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new $i,this.canvas=new Gn(this.body),this.selectionHandler=new Hn(this.body,this.canvas),this.interactionHandler=new Yn(this.body,this.canvas,this.selectionHandler),this.view=new jn(this.body,this.canvas),this.renderer=new Ln(this.body,this.canvas),this.physics=new zn(this.body),this.layoutEngine=new Xn(this.body),this.clustering=new Zn(this.body),this.manipulation=new Jn(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new fn(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Sn(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new qn(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(g),this.setData(e)}dd(T.prototype);T.prototype.setOptions=function(I){if(I===null&&(I=void 0),I!==void 0){if(wO.validate(I,n5)===!0&&console.error("%cErrors have been found in the supplied options object.",eh),Dt(["locale","locales","clickToUse"],this.options,I),I.locale!==void 0&&(I.locale=UO(I.locales||this.options.locales,I.locale)),I=this.layoutEngine.setOptions(I.layout,I),this.canvas.setOptions(I),this.groups.setOptions(I.groups),this.nodesHandler.setOptions(I.nodes),this.edgesHandler.setOptions(I.edges),this.physics.setOptions(I.physics),this.manipulation.setOptions(I.manipulation,I,this.options),this.interactionHandler.setOptions(I.interaction),this.renderer.setOptions(I.interaction),this.selectionHandler.setOptions(I.interaction),I.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in I&&(this.configurator||(this.configurator=new bO(this,this.body.container,$h,this.canvas.pixelRatio,r5)),this.configurator.setOptions(I.configure)),this.configurator&&this.configurator.options.enabled===!0){let t={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};_(t.nodes,this.nodesHandler.options),_(t.edges,this.edgesHandler.options),_(t.layout,this.layoutEngine.options),_(t.interaction,this.selectionHandler.options),_(t.interaction,this.renderer.options),_(t.interaction,this.interactionHandler.options),_(t.manipulation,this.manipulation.options),_(t.physics,this.physics.options),_(t.global,this.canvas.options),_(t.global,this.options),this.configurator.setModuleOptions(t)}I.clickToUse!==void 0?I.clickToUse===!0?this.activator===void 0&&(this.activator=new vO(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};T.prototype._updateVisibleIndices=function(){let I=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let g in I)Object.prototype.hasOwnProperty.call(I,g)&&!this.clustering._isClusteredNode(g)&&I[g].options.hidden===!1&&this.body.nodeIndices.push(I[g].id);for(let g in e)if(Object.prototype.hasOwnProperty.call(e,g)){let t=e[g],A=I[t.fromId],C=I[t.toId],i=A!==void 0&&C!==void 0;!this.clustering._isClusteredEdge(g)&&t.options.hidden===!1&&i&&A.options.hidden===!1&&C.options.hidden===!1&&this.body.edgeIndices.push(t.id)}};T.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})};T.prototype.setData=function(I){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),I&&I.dot&&(I.nodes||I.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(I&&I.options),I&&I.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");let e=kO(I.dot);this.setData(e);return}else if(I&&I.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");let e=MO(I.gephi);this.setData(e);return}else this.nodesHandler.setData(I&&I.nodes,!0),this.edgesHandler.setData(I&&I.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};T.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&delete this.body.nodes[I];for(let I in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,I)&&delete this.body.edges[I];pg(this.body.container)};T.prototype._updateValueRange=function(I){let e,g,t,A=0;for(e in I)if(Object.prototype.hasOwnProperty.call(I,e)){let C=I[e].getValue();C!==void 0&&(g=g===void 0?C:Math.min(C,g),t=t===void 0?C:Math.max(C,t),A+=C)}if(g!==void 0&&t!==void 0)for(e in I)Object.prototype.hasOwnProperty.call(I,e)&&I[e].setValueRange(g,t,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.prototype.getConnectedNodes=function(I){return this.body.nodes[I]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let I=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.getEdgeAt=function(){let I=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return I!==void 0&&I.id!==void 0?I.id:I};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let I={};return this.configurator&&(I=this.configurator.getOptions.apply(this.configurator)),I};function aC(){return document.documentElement.getAttribute("data-theme")||"light"}function dC(I){let e=getComputedStyle(document.documentElement);return{uri:e.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:e.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:e.getPropertyValue("--yasgui-graph-blank-node").trim()||(I==="dark"?"#888888":"#c5c5c5ff"),typeObject:e.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:e.getPropertyValue("--yasgui-graph-text").trim()||(I==="dark"?"#e0e0e0":"#000000"),edge:e.getPropertyValue("--yasgui-graph-edge").trim()||(I==="dark"?"#666666":"#cccccc"),edgeLabel:e.getPropertyValue("--yasgui-graph-edge-label").trim()||(I==="dark"?"#cccccc":"#666666"),edgeLabelBackground:e.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(I==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:e.getPropertyValue("--yasgui-graph-background").trim()||(I==="dark"?"#1e1e1e":"#ffffff")}}function qh(I){let e=new MutationObserver(g=>{g.forEach(t=>{if(t.attributeName==="data-theme"){let A=aC();I(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}var ec={edgeStyle:"curved",compactMode:!1,predicateDisplay:"icon",showNodeLabels:!0,physicsEnabled:!0,nodeSize:"medium"},gc="yasgui-graph-plugin-settings";function tc(){try{let I=localStorage.getItem(gc);if(I)return{...ec,...JSON.parse(I)}}catch(I){}return{...ec}}function Ac(I){try{localStorage.setItem(gc,JSON.stringify(I))}catch(e){}}var s5=4,Ic="#ffa500",o5=3,lC=2,Gr=class{constructor(e){this.settingsPanelOpen=!1;this.clickOutsideHandler=null;this.expansionAbortController=null;this.uriToNodeId=new Map;this.yasr=e,this.network=null,this.currentTheme=aC(),this.themeObserver=null,this.resizeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null,this.settings=tc()}static get priority(){return 20}static get label(){return"Graph"}static get helpReference(){return"https://yasgui-doc.matdata.eu/docs/user-guide#graph-plugin"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let g=e.getBindings();if(g&&g.length>0){let t=g[0];return t.subject!==void 0&&t.predicate!==void 0&&t.object!==void 0}}return!1}draw(){let e=this.settingsPanelOpen;this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.expandedNodes=new Set,this.uriToNodeId=new Map,this.yasr.resultsEl.innerHTML="";try{if(this.triples=Wr(this.yasr.results),!this.triples||this.triples.length===0){let o=document.createElement("div");o.className="yasgui-graph-plugin-empty-state",o.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(o);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=Vr(this.yasr),this.currentTheme=aC();let g=dC(this.currentTheme),{nodes:t,edges:A}=BA(this.triples,this.prefixMap,g,this.settings),C=document.createElement("div");C.className="yasgui-graph-plugin-container",C.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(C),this.nodesDataSet=new sg(t),this.edgesDataSet=new sg(A);let i=cC(g,this.settings);this.network=new T(C,{nodes:this.nodesDataSet,edges:this.edgesDataSet},i),this.setupHtmlTooltips(C),this.applyCanvasBackground(g.background),this.setupContainerResize(C),this.settings.physicsEnabled?this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:3})}):setTimeout(()=>{this.network&&this.network.fit({maxZoomLevel:3})},100),this.network.on("dragEnd",o=>{if(o.nodes.length>0){let d=this.network.getPositions(o.nodes),a=o.nodes.map(l=>({id:l,x:d[l].x,y:d[l].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(a)}}),this.setupNodeExpansion(),this.uriToNodeId=new Map,this.nodesDataSet.get().forEach(o=>{o.uri&&this.uriToNodeId.set(o.uri,o.id)}),this.themeObserver||(this.themeObserver=qh(o=>{this.applyTheme(o)}));let n=document.createElement("div");n.className="yasgui-graph-controls",C.appendChild(n);let r=document.createElement("button");r.className="yasgui-graph-button",r.textContent="Zoom to Fit",r.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},n.appendChild(r);let s=document.createElement("button");s.className="yasgui-graph-button yasgui-graph-settings-button",s.setAttribute("aria-label","Graph settings"),s.innerHTML=`<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
910
+ `;Cg(m3);var Wr=class{constructor(e,t,g,A){var I,C;this.body=e,this.canvas=t,this.selectionHandler=g,this.interactionHandler=A,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},ee(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",y(I=this._restore).call(I,this)),this.body.emitter.on("_resetData",y(C=this._restore).call(C,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,g){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=g.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=g.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,U(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let g=this.selectionHandler.getSelectedNodeCount(),A=this.selectionHandler.getSelectedEdgeCount(),I=g+A,C=this.options.locales[this.options.locale],n=!1;this.options.addNode!==!1&&(this._createAddNodeButton(C),n=!0),this.options.addEdge!==!1&&(n===!0?this._createSeperator(1):n=!0,this._createAddEdgeButton(C)),g===1&&typeof this.options.editNode=="function"?(n===!0?this._createSeperator(2):n=!0,this._createEditNodeButton(C)):A===1&&g===0&&this.options.editEdge!==!1&&(n===!0?this._createSeperator(3):n=!0,this._createEditEdgeButton(C)),I!==0&&(g>0&&this.options.deleteNode!==!1?(n===!0&&this._createSeperator(4),this._createDeleteButton(C)):g===0&&this.options.deleteEdge!==!1&&(n===!0&&this._createSeperator(4),this._createDeleteButton(C))),this._bindElementEvents(this.closeDiv,y(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",y(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;let g=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(g),this._createSeperator(),this._createDescription(g.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,y(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",y(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){let t=U({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,g=>{g!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(g),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,g,A,I;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var C;let n=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(n),this._createSeperator(),this._createDescription(n.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,y(C=this.toggleEditMode).call(C,this))}this._temporaryBindUI("onTouch",y(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",y(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",y(g=this._dragControlNode).call(g,this)),this._temporaryBindUI("onRelease",y(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDragStart",y(I=this._dragStartEdge).call(I,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let C=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(C.from.id,C.to.id);return}if(this.guiEnabled===!0){var e;let C=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(C),this._createSeperator(),this._createDescription(C.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,y(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,g,A,I;let C=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(C.from.x,C.from.y),r=this._getNewTargetNode(C.to.x,C.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(r.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id),this._temporaryBindUI("onTouch",y(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",y(g=this._controlNodeDragStart).call(g,this)),this._temporaryBindUI("onDrag",y(A=this._controlNodeDrag).call(A,this)),this._temporaryBindUI("onDragEnd",y(I=this._controlNodeDragEnd).call(I,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",s=>{let o=C.edgeType.findBorderPositions(s);n.selected===!1&&(n.x=o.from.x,n.y=o.from.y),r.selected===!1&&(r.x=o.to.x,r.y=o.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds(),g;if(e.length>0){for(let A=0;A<e.length;A++)if(this.body.nodes[e[A]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(g=this.options.deleteNode)}else t.length>0&&typeof this.options.deleteEdge=="function"&&(g=this.options.deleteEdge);if(typeof g=="function"){let A={nodes:e,edges:t};if(g.length===2)g(A,I=>{I!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(I.edges),this.body.data.nodes.getDataSet().remove(I.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){let g=U({},this.options.controlNodeStyle);g.id="targetNode"+Dg(),g.hidden=!1,g.physics=!1,g.x=e,g.y=t;let A=this.body.functions.createNode(g);return A.shape.boundingBox={left:e,right:e,top:t,bottom:t},A}_createEditButton(){var e;this._clean(),this.manipulationDOM={},St(this.editModeDiv);let t=this.options.locales[this.options.locale],g=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(g),this._bindElementEvents(g,y(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(St(this.editModeDiv),St(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let t of tt(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),St(this.manipulationDiv),St(this.editModeDiv),St(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;let g=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(g),this._bindElementEvents(g,y(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;let g=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(g),this._bindElementEvents(g,y(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;let g=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(g),this._bindElementEvents(g,y(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;let g=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(g),this._bindElementEvents(g,y(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let g;this.options.rtl?g="vis-delete-rtl":g="vis-delete";let A=this._createButton("delete",g,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,y(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;let g=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(g),this._bindElementEvents(g,y(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,g){let A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=A,this.manipulationDOM[e+"Label"].innerText=g,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Ug(K(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e<this.temporaryEventFunctions.length;e++){let t=this.temporaryEventFunctions[e].event,g=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,g)}this.temporaryEventFunctions=[]}_bindElementEvents(e,t){let g=new Rg(e,{});bI(g,t),this._domEventListenerCleanupQueue.push(()=>{g.destroy()});let A=I=>{let{keyCode:C,key:n}=I;(n==="Enter"||n===" "||C===13||C===32)&&t()};e.addEventListener("keyup",A,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",A,!1)})}_cleanupTemporaryNodesAndEdges(){for(let I=0;I<this.temporaryIds.edges.length;I++){var e;this.body.edges[this.temporaryIds.edges[I]].disconnect(),delete this.body.edges[this.temporaryIds.edges[I]];let C=G(e=this.body.edgeIndices).call(e,this.temporaryIds.edges[I]);if(C!==-1){var t;tt(t=this.body.edgeIndices).call(t,C,1)}}for(let I=0;I<this.temporaryIds.nodes.length;I++){var g;delete this.body.nodes[this.temporaryIds.nodes[I]];let C=G(g=this.body.nodeIndices).call(g,this.temporaryIds.nodes[I]);if(C!==-1){var A;tt(A=this.body.nodeIndices).call(A,C,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ee({},this.body.view.translation)}_controlNodeDragStart(){let e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),g=this.body.nodes[this.temporaryIds.nodes[0]],A=this.body.nodes[this.temporaryIds.nodes[1]],I=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let C=g.isOverlappingWith(t),n=A.isOverlappingWith(t);C===!0?(this.selectedControlNode=g,I.edgeType.from=g):n===!0&&(this.selectedControlNode=A,I.edgeType.to=A),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(e){this.body.emitter.emit("disablePhysics");let t=this.body.functions.getPointer(e.center),g=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=g.x,this.selectedControlNode.y=g.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(e){let t=this.body.functions.getPointer(e.center),g=this.selectionHandler._pointerToPositionObject(t),A=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let I=this.selectionHandler._getAllNodesOverlappingWith(g),C;for(let n=I.length-1;n>=0;n--)if(I[n]!==this.selectedControlNode.id){C=this.body.nodes[I[n]];break}if(C!==void 0&&this.selectedControlNode!==void 0)if(C.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let n=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===n.id?this._performEditEdge(C.id,A.to.id):this._performEditEdge(A.from.id,C.id)}else A.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=ee({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let t=this.lastTouch,g=this.selectionHandler.getNodeAt(t);if(g!==void 0)if(g.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let A=this._getNewTargetNode(g.x,g.y);this.body.nodes[A.id]=A,this.body.nodeIndices.push(A.id);let I=this.body.functions.createEdge({id:"connectionEdge"+Dg(),from:g.id,to:A.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[I.id]=I,this.body.edgeIndices.push(I.id),this.temporaryIds.nodes.push(A.id),this.temporaryIds.edges.push(I.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){let t=this.body.functions.getPointer(e.center),g=this.selectionHandler._pointerToPositionObject(t),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let I=this.selectionHandler._getAllNodesOverlappingWith(g),C;for(let r=I.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,I[r])===-1){C=this.body.nodes[I[r]];break}}if(e.controlEdge={from:A,to:C?C.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){let r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(t.x),r.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){let t=this.body.functions.getPointer(e.center),g=this.selectionHandler._pointerToPositionObject(t),A;this.temporaryIds.edges[0]!==void 0&&(A=this.body.edges[this.temporaryIds.edges[0]].fromId);let I=this.selectionHandler._getAllNodesOverlappingWith(g),C;for(let r=I.length-1;r>=0;r--){var n;if(G(n=this.temporaryIds.nodes).call(n,I[r])===-1){C=this.body.nodes[I[r]];break}}this._cleanupTemporaryNodesAndEdges(),C!==void 0&&(C.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[A]!==void 0&&this.body.nodes[C.id]!==void 0&&this._performAddEdge(A,C.id)),e.controlEdge={from:A,to:C?C.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){let t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){let t={id:Dg(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,g=>{g!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){let g={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(g,A=>{A!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(A),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){let g={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},A=this.options.editEdge;if(typeof A=="object"&&(A=A.editWithoutDrag),typeof A=="function")if(A.length===2)A(g,I=>{I==null||this.inMode!=="editEdge"?(this.body.edges[g.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(I),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},w="string",b="boolean",m="number",oA="array",O="object",xu="dom",v3="any",fn=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],pn={borderWidth:{number:m},borderWidthSelected:{number:m,undefined:"undefined"},brokenImage:{string:w,undefined:"undefined"},chosen:{label:{boolean:b,function:"function"},node:{boolean:b,function:"function"},__type__:{object:O,boolean:b}},color:{border:{string:w},background:{string:w},highlight:{border:{string:w},background:{string:w},__type__:{object:O,string:w}},hover:{border:{string:w},background:{string:w},__type__:{object:O,string:w}},__type__:{object:O,string:w}},opacity:{number:m,undefined:"undefined"},fixed:{x:{boolean:b},y:{boolean:b},__type__:{object:O,boolean:b}},font:{align:{string:w},color:{string:w},size:{number:m},face:{string:w},background:{string:w},strokeWidth:{number:m},strokeColor:{string:w},vadjust:{number:m},multi:{boolean:b,string:w},bold:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},boldital:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},ital:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},mono:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},__type__:{object:O,string:w}},group:{string:w,number:m,undefined:"undefined"},heightConstraint:{minimum:{number:m},valign:{string:w},__type__:{object:O,boolean:b,number:m}},hidden:{boolean:b},icon:{face:{string:w},code:{string:w},size:{number:m},color:{string:w},weight:{string:w,number:m},__type__:{object:O}},id:{string:w,number:m},image:{selected:{string:w,undefined:"undefined"},unselected:{string:w,undefined:"undefined"},__type__:{object:O,string:w}},imagePadding:{top:{number:m},right:{number:m},bottom:{number:m},left:{number:m},__type__:{object:O,number:m}},label:{string:w,undefined:"undefined"},labelHighlightBold:{boolean:b},level:{number:m,undefined:"undefined"},margin:{top:{number:m},right:{number:m},bottom:{number:m},left:{number:m},__type__:{object:O,number:m}},mass:{number:m},physics:{boolean:b},scaling:{min:{number:m},max:{number:m},label:{enabled:{boolean:b},min:{number:m},max:{number:m},maxVisible:{number:m},drawThreshold:{number:m},__type__:{object:O,boolean:b}},customScalingFunction:{function:"function"},__type__:{object:O}},shadow:{enabled:{boolean:b},color:{string:w},size:{number:m},x:{number:m},y:{number:m},__type__:{object:O,boolean:b}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:b,array:oA},borderRadius:{number:m},interpolation:{boolean:b},useImageSize:{boolean:b},useBorderWithImage:{boolean:b},coordinateOrigin:{string:["center","top-left"]},__type__:{object:O}},size:{number:m},title:{string:w,dom:xu,undefined:"undefined"},value:{number:m,undefined:"undefined"},widthConstraint:{minimum:{number:m},maximum:{number:m},__type__:{object:O,boolean:b,number:m}},x:{number:m},y:{number:m},__type__:{object:O}},b3={configure:{enabled:{boolean:b},filter:{boolean:b,string:w,array:oA,function:"function"},container:{dom:xu},showButton:{boolean:b},__type__:{object:O,boolean:b,string:w,array:oA,function:"function"}},edges:{arrows:{to:{enabled:{boolean:b},scaleFactor:{number:m},type:{string:fn},imageHeight:{number:m},imageWidth:{number:m},src:{string:w},__type__:{object:O,boolean:b}},middle:{enabled:{boolean:b},scaleFactor:{number:m},type:{string:fn},imageWidth:{number:m},imageHeight:{number:m},src:{string:w},__type__:{object:O,boolean:b}},from:{enabled:{boolean:b},scaleFactor:{number:m},type:{string:fn},imageWidth:{number:m},imageHeight:{number:m},src:{string:w},__type__:{object:O,boolean:b}},__type__:{string:["from","to","middle"],object:O}},endPointOffset:{from:{number:m},to:{number:m},__type__:{object:O,number:m}},arrowStrikethrough:{boolean:b},background:{enabled:{boolean:b},color:{string:w},size:{number:m},dashes:{boolean:b,array:oA},__type__:{object:O,boolean:b}},chosen:{label:{boolean:b,function:"function"},edge:{boolean:b,function:"function"},__type__:{object:O,boolean:b}},color:{color:{string:w},highlight:{string:w},hover:{string:w},inherit:{string:["from","to","both"],boolean:b},opacity:{number:m},__type__:{object:O,string:w}},dashes:{boolean:b,array:oA},font:{color:{string:w},size:{number:m},face:{string:w},background:{string:w},strokeWidth:{number:m},strokeColor:{string:w},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:m},multi:{boolean:b,string:w},bold:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},boldital:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},ital:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},mono:{color:{string:w},size:{number:m},face:{string:w},mod:{string:w},vadjust:{number:m},__type__:{object:O,string:w}},__type__:{object:O,string:w}},hidden:{boolean:b},hoverWidth:{function:"function",number:m},label:{string:w,undefined:"undefined"},labelHighlightBold:{boolean:b},length:{number:m,undefined:"undefined"},physics:{boolean:b},scaling:{min:{number:m},max:{number:m},label:{enabled:{boolean:b},min:{number:m},max:{number:m},maxVisible:{number:m},drawThreshold:{number:m},__type__:{object:O,boolean:b}},customScalingFunction:{function:"function"},__type__:{object:O}},selectionWidth:{function:"function",number:m},selfReferenceSize:{number:m},selfReference:{size:{number:m},angle:{number:m},renderBehindTheNode:{boolean:b},__type__:{object:O}},shadow:{enabled:{boolean:b},color:{string:w},size:{number:m},x:{number:m},y:{number:m},__type__:{object:O,boolean:b}},smooth:{enabled:{boolean:b},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:m},forceDirection:{string:["horizontal","vertical","none"],boolean:b},__type__:{object:O,boolean:b}},title:{string:w,undefined:"undefined"},width:{number:m},widthConstraint:{maximum:{number:m},__type__:{object:O,boolean:b,number:m}},value:{number:m,undefined:"undefined"},__type__:{object:O}},groups:{useDefaultGroups:{boolean:b},__any__:pn,__type__:{object:O}},interaction:{dragNodes:{boolean:b},dragView:{boolean:b},hideEdgesOnDrag:{boolean:b},hideEdgesOnZoom:{boolean:b},hideNodesOnDrag:{boolean:b},hover:{boolean:b},keyboard:{enabled:{boolean:b},speed:{x:{number:m},y:{number:m},zoom:{number:m},__type__:{object:O}},bindToWindow:{boolean:b},autoFocus:{boolean:b},__type__:{object:O,boolean:b}},multiselect:{boolean:b},navigationButtons:{boolean:b},selectable:{boolean:b},selectConnectedEdges:{boolean:b},hoverConnectedEdges:{boolean:b},tooltipDelay:{number:m},zoomView:{boolean:b},zoomSpeed:{number:m},__type__:{object:O}},layout:{randomSeed:{undefined:"undefined",number:m,string:w},improvedLayout:{boolean:b},clusterThreshold:{number:m},hierarchical:{enabled:{boolean:b},levelSeparation:{number:m},nodeSpacing:{number:m},treeSpacing:{number:m},blockShifting:{boolean:b},edgeMinimization:{boolean:b},parentCentralization:{boolean:b},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:O,boolean:b}},__type__:{object:O}},manipulation:{enabled:{boolean:b},initiallyActive:{boolean:b},addNode:{boolean:b,function:"function"},addEdge:{boolean:b,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:O,boolean:b,function:"function"}},deleteNode:{boolean:b,function:"function"},deleteEdge:{boolean:b,function:"function"},controlNodeStyle:pn,__type__:{object:O,boolean:b}},nodes:pn,physics:{enabled:{boolean:b},barnesHut:{theta:{number:m},gravitationalConstant:{number:m},centralGravity:{number:m},springLength:{number:m},springConstant:{number:m},damping:{number:m},avoidOverlap:{number:m},__type__:{object:O}},forceAtlas2Based:{theta:{number:m},gravitationalConstant:{number:m},centralGravity:{number:m},springLength:{number:m},springConstant:{number:m},damping:{number:m},avoidOverlap:{number:m},__type__:{object:O}},repulsion:{centralGravity:{number:m},springLength:{number:m},springConstant:{number:m},nodeDistance:{number:m},damping:{number:m},__type__:{object:O}},hierarchicalRepulsion:{centralGravity:{number:m},springLength:{number:m},springConstant:{number:m},nodeDistance:{number:m},damping:{number:m},avoidOverlap:{number:m},__type__:{object:O}},maxVelocity:{number:m},minVelocity:{number:m},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:b},iterations:{number:m},updateInterval:{number:m},onlyDynamicEdges:{boolean:b},fit:{boolean:b},__type__:{object:O,boolean:b}},timestep:{number:m},adaptiveTimestep:{boolean:b},wind:{x:{number:m},y:{number:m},__type__:{object:O}},__type__:{object:O,boolean:b}},autoResize:{boolean:b},clickToUse:{boolean:b},locale:{string:w},locales:{__any__:{any:v3},__type__:{object:O}},height:{string:w},width:{string:w},__type__:{object:O}},Eu={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},y3=(i,e,t)=>{var g;return!!(Mt(i).call(i,"physics")&&Mt(g=Eu.physics.solver).call(g,e)&&t.physics.solver!==e&&e!=="wind")};var Ur=class{constructor(){}getDistances(e,t,g){let A={},I=e.edges;for(let n=0;n<t.length;n++){let r=t[n],s={};A[r]=s;for(let o=0;o<t.length;o++)s[t[o]]=n==o?0:1e9}for(let n=0;n<g.length;n++){let r=I[g[n]];r.connected===!0&&A[r.fromId]!==void 0&&A[r.toId]!==void 0&&(A[r.fromId][r.toId]=1,A[r.toId][r.fromId]=1)}let C=t.length;for(let n=0;n<C;n++){let r=t[n],s=A[r];for(let o=0;o<C-1;o++){let a=t[o],l=A[a];for(let d=o+1;d<C;d++){let h=t[d],c=A[h],u=Math.min(l[h],l[r]+s[h]);l[h]=u,c[a]=u}}}return A}},Hr=class{constructor(e,t,g){this.body=e,this.springLength=t,this.springConstant=g,this.distanceSolver=new Ur}setOptions(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}solve(e,t){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,A=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(A),this._createK_matrix(A),this._createE_matrix();let I=.01,C=1,n=0,r=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),s=5,o=1e9,a=0,l=0,d=0,h=0,c=0;for(;o>I&&n<r;)for(n+=1,[a,o,l,d]=this._getHighestEnergyNode(g),h=o,c=0;h>C&&c<s;)c+=1,this._moveNode(a,l,d),[h,l,d]=this._getEnergy(a)}_getHighestEnergyNode(e){let t=this.body.nodeIndices,g=this.body.nodes,A=0,I=t[0],C=0,n=0;for(let r=0;r<t.length;r++){let s=t[r];if(g[s].predefinedPosition!==!0||g[s].isCluster===!0&&e===!0||g[s].options.fixed.x!==!0||g[s].options.fixed.y!==!0){let[o,a,l]=this._getEnergy(s);A<o&&(A=o,I=s,C=a,n=l)}}return[I,A,C,n]}_getEnergy(e){let[t,g]=this.E_sums[e];return[Math.sqrt(t**2+g**2),t,g]}_moveNode(e,t,g){let A=this.body.nodeIndices,I=this.body.nodes,C=0,n=0,r=0,s=I[e].x,o=I[e].y,a=this.K_matrix[e],l=this.L_matrix[e];for(let x=0;x<A.length;x++){let P=A[x];if(P!==e){let _=I[P].x,M=I[P].y,j=a[P],Ee=l[P],me=1/((s-_)**2+(o-M)**2)**1.5;C+=j*(1-Ee*(o-M)**2*me),n+=j*(Ee*(s-_)*(o-M)*me),r+=j*(1-Ee*(s-_)**2*me)}}let d=C,h=n,c=t,u=r,f=g,p=(c/d+f/h)/(h/d-u/h),E=-(h*p+c)/d;I[e].x+=E,I[e].y+=p,this._updateE_matrix(e)}_createL_matrix(e){let t=this.body.nodeIndices,g=this.springLength;this.L_matrix=[];for(let A=0;A<t.length;A++){this.L_matrix[t[A]]={};for(let I=0;I<t.length;I++)this.L_matrix[t[A]][t[I]]=g*e[t[A]][t[I]]}}_createK_matrix(e){let t=this.body.nodeIndices,g=this.springConstant;this.K_matrix=[];for(let A=0;A<t.length;A++){this.K_matrix[t[A]]={};for(let I=0;I<t.length;I++)this.K_matrix[t[A]][t[I]]=g*e[t[A]][t[I]]**-2}}_createE_matrix(){let e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(let g=0;g<e.length;g++)this.E_matrix[e[g]]=[];for(let g=0;g<e.length;g++){let A=e[g],I=t[A].x,C=t[A].y,n=0,r=0;for(let s=g;s<e.length;s++){let o=e[s];if(o!==A){let a=t[o].x,l=t[o].y,d=1/Math.sqrt((I-a)**2+(C-l)**2);this.E_matrix[A][s]=[this.K_matrix[A][o]*(I-a-this.L_matrix[A][o]*(I-a)*d),this.K_matrix[A][o]*(C-l-this.L_matrix[A][o]*(C-l)*d)],this.E_matrix[o][g]=this.E_matrix[A][s],n+=this.E_matrix[A][s][0],r+=this.E_matrix[A][s][1]}}this.E_sums[A]=[n,r]}}_updateE_matrix(e){let t=this.body.nodeIndices,g=this.body.nodes,A=this.E_matrix[e],I=this.K_matrix[e],C=this.L_matrix[e],n=g[e].x,r=g[e].y,s=0,o=0;for(let a=0;a<t.length;a++){let l=t[a];if(l!==e){let d=A[a],h=d[0],c=d[1],u=g[l].x,f=g[l].y,p=1/Math.sqrt((n-u)**2+(r-f)**2),E=I[l]*(n-u-C[l]*(n-u)*p),x=I[l]*(r-f-C[l]*(r-f)*p);A[a]=[E,x],s+=E,o+=x;let P=this.E_sums[l];P[0]+=E-h,P[1]+=x-c}}this.E_sums[e]=[s,o]}};function T(i,e,t){var g,A,I,C;if(!(this instanceof T))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:CS,clickToUse:!1},ee(this.options,this.defaultOptions),this.body={container:i,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:y(g=this.on).call(g,this),off:y(A=this.off).call(A,this),emit:y(I=this.emit).call(I,this),once:y(C=this.once).call(C,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new Un(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new Hn,this.canvas=new kr(this.body),this.selectionHandler=new Zr(this.body,this.canvas),this.interactionHandler=new Br(this.body,this.canvas,this.selectionHandler),this.view=new Mr(this.body,this.canvas),this.renderer=new _r(this.body,this.canvas),this.physics=new Rr(this.body),this.layoutEngine=new Yr(this.body),this.clustering=new Nr(this.body),this.manipulation=new Wr(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new ar(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new xr(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Hr(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}Ld(T.prototype);T.prototype.setOptions=function(i){if(i===null&&(i=void 0),i!==void 0){if(BP.validate(i,b3)===!0&&console.error("%cErrors have been found in the supplied options object.",Oc),Kg(["locale","locales","clickToUse"],this.options,i),i.locale!==void 0&&(i.locale=nS(i.locales||this.options.locales,i.locale)),i=this.layoutEngine.setOptions(i.layout,i),this.canvas.setOptions(i),this.groups.setOptions(i.groups),this.nodesHandler.setOptions(i.nodes),this.edgesHandler.setOptions(i.edges),this.physics.setOptions(i.physics),this.manipulation.setOptions(i.manipulation,i,this.options),this.interactionHandler.setOptions(i.interaction),this.renderer.setOptions(i.interaction),this.selectionHandler.setOptions(i.interaction),i.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in i&&(this.configurator||(this.configurator=new MP(this,this.body.container,Eu,this.canvas.pixelRatio,y3)),this.configurator.setOptions(i.configure)),this.configurator&&this.configurator.options.enabled===!0){let g={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};U(g.nodes,this.nodesHandler.options),U(g.edges,this.edgesHandler.options),U(g.layout,this.layoutEngine.options),U(g.interaction,this.selectionHandler.options),U(g.interaction,this.renderer.options),U(g.interaction,this.interactionHandler.options),U(g.manipulation,this.manipulation.options),U(g.physics,this.physics.options),U(g.global,this.canvas.options),U(g.global,this.options),this.configurator.setModuleOptions(g)}i.clickToUse!==void 0?i.clickToUse===!0?this.activator===void 0&&(this.activator=new kP(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};T.prototype._updateVisibleIndices=function(){let i=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&!this.clustering._isClusteredNode(t)&&i[t].options.hidden===!1&&this.body.nodeIndices.push(i[t].id);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let g=e[t],A=i[g.fromId],I=i[g.toId],C=A!==void 0&&I!==void 0;!this.clustering._isClusteredEdge(t)&&g.options.hidden===!1&&C&&A.options.hidden===!1&&I.options.hidden===!1&&this.body.edgeIndices.push(g.id)}};T.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})};T.prototype.setData=function(i){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),i&&i.dot&&(i.nodes||i.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(i&&i.options),i&&i.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");let e=HP(i.dot);this.setData(e);return}else if(i&&i.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");let e=KP(i.gephi);this.setData(e);return}else this.nodesHandler.setData(i&&i.nodes,!0),this.edgesHandler.setData(i&&i.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};T.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let i in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,i)&&delete this.body.nodes[i];for(let i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&delete this.body.edges[i];St(this.body.container)};T.prototype._updateValueRange=function(i){let e,t,g,A=0;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let I=i[e].getValue();I!==void 0&&(t=t===void 0?I:Math.min(I,t),g=g===void 0?I:Math.max(I,g),A+=I)}if(t!==void 0&&g!==void 0)for(e in i)Object.prototype.hasOwnProperty.call(i,e)&&i[e].setValueRange(t,g,A)};T.prototype.isActive=function(){return!this.activator||this.activator.active};T.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};T.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};T.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};T.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};T.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};T.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};T.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};T.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};T.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};T.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};T.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};T.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};T.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};T.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};T.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};T.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};T.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};T.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};T.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};T.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};T.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};T.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};T.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};T.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};T.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};T.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};T.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};T.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};T.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};T.prototype.getConnectedNodes=function(i){return this.body.nodes[i]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};T.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};T.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};T.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};T.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};T.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};T.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};T.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};T.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};T.prototype.getNodeAt=function(){let i=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};T.prototype.getEdgeAt=function(){let i=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return i!==void 0&&i.id!==void 0?i.id:i};T.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};T.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};T.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};T.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};T.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};T.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};T.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};T.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};T.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};T.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};T.prototype.getOptionsFromConfigurator=function(){let i={};return this.configurator&&(i=this.configurator.getOptions.apply(this.configurator)),i};function WI(){return document.documentElement.getAttribute("data-theme")||"light"}function UI(i){let e=getComputedStyle(document.documentElement);return{uri:e.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:e.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:e.getPropertyValue("--yasgui-graph-blank-node").trim()||(i==="dark"?"#888888":"#c5c5c5ff"),typeObject:e.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:e.getPropertyValue("--yasgui-graph-text").trim()||(i==="dark"?"#e0e0e0":"#000000"),edge:e.getPropertyValue("--yasgui-graph-edge").trim()||(i==="dark"?"#666666":"#cccccc"),edgeLabel:e.getPropertyValue("--yasgui-graph-edge-label").trim()||(i==="dark"?"#cccccc":"#666666"),edgeLabelBackground:e.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(i==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:e.getPropertyValue("--yasgui-graph-background").trim()||(i==="dark"?"#1e1e1e":"#ffffff")}}function Tu(i){let e=new MutationObserver(t=>{t.forEach(g=>{if(g.attributeName==="data-theme"){let A=WI();i(A)}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),e}var Ou={edgeStyle:"curved",compactMode:!1,predicateDisplay:"icon",showNodeLabels:!0,physicsEnabled:!0,nodeSize:"medium"},Pu="yasgui-graph-plugin-settings";function Su(){try{let i=localStorage.getItem(Pu);if(i)return{...Ou,...JSON.parse(i)}}catch(i){}return{...Ou}}function Ru(i){try{localStorage.setItem(Pu,JSON.stringify(i))}catch(e){}}var w3=4,Du="#ffa500",x3=3,HI=2,ks=class{constructor(e){this.settingsPanelOpen=!1;this.clickOutsideHandler=null;this.expansionAbortController=null;this.uriToNodeId=new Map;this.yasr=e,this.network=null,this.currentTheme=WI(),this.themeObserver=null,this.resizeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null,this.settings=Su()}static get priority(){return 20}static get label(){return"Graph"}static get helpReference(){return"https://yasgui-doc.matdata.eu/docs/user-guide#graph-plugin"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let e=this.yasr.results;if(e.getBindings&&typeof e.getBindings=="function"){let t=e.getBindings();if(t&&t.length>0){let g=t[0];return g.subject!==void 0&&g.predicate!==void 0&&g.object!==void 0}}return!1}draw(){let e=this.settingsPanelOpen;this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.uriToNodeId=new Map,this.yasr.resultsEl.innerHTML="";try{if(this.triples=po(this.yasr.results),!this.triples||this.triples.length===0){let o=document.createElement("div");o.className="yasgui-graph-plugin-empty-state",o.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(o);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=Bs(this.yasr),this.currentTheme=WI();let t=UI(this.currentTheme),{nodes:g,edges:A}=fi(this.triples,this.prefixMap,t,this.settings),I=document.createElement("div");I.className="yasgui-graph-plugin-container",I.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(I),this.nodesDataSet=new pt(g),this.edgesDataSet=new pt(A);let C=QI(t,this.settings);this.network=new T(I,{nodes:this.nodesDataSet,edges:this.edgesDataSet},C),this.setupHtmlTooltips(I),this.applyCanvasBackground(t.background),this.setupContainerResize(I),this.settings.physicsEnabled?this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:3})}):setTimeout(()=>{this.network&&this.network.fit({maxZoomLevel:3})},100),this.network.on("dragEnd",o=>{if(o.nodes.length>0){let a=this.network.getPositions(o.nodes),l=o.nodes.map(d=>({id:d,x:a[d].x,y:a[d].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(l)}}),this.setupNodeExpansion(),this.uriToNodeId=new Map,this.nodesDataSet.get().forEach(o=>{o.uri&&this.uriToNodeId.set(o.uri,o.id)}),this.themeObserver||(this.themeObserver=Tu(o=>{this.applyTheme(o)}));let n=document.createElement("div");n.className="yasgui-graph-controls",I.appendChild(n);let r=document.createElement("button");r.className="yasgui-graph-button",r.textContent="Zoom to Fit",r.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},n.appendChild(r);let s=document.createElement("button");s.className="yasgui-graph-button yasgui-graph-settings-button",s.setAttribute("aria-label","Graph settings"),s.innerHTML=`<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
910
911
  <path d="M8 10.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z"/>
911
912
  <path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.434.901-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.892 3.434-.901 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.892-1.64-.901-3.434-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.474l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"/>
912
- </svg> Settings`,s.onclick=()=>{this.toggleSettingsPanel(C)},n.appendChild(s),e&&this.toggleSettingsPanel(C)}catch(g){console.error("Error rendering graph:",g);let t=document.createElement("div");t.className="yasgui-graph-plugin-error",t.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(t)}}setupHtmlTooltips(e){if(!this.network)return;let g=null;this.network.on("hoverNode",t=>{g&&(clearTimeout(g),g=null);let A=t.node,C=this.nodesDataSet.get(A);C&&C.title&&this.showHtmlTooltip(e,C.title,t.pointer.DOM)}),this.network.on("hoverEdge",t=>{g&&(clearTimeout(g),g=null);let A=t.edge,C=this.edgesDataSet.get(A);C&&C.title&&this.showHtmlTooltip(e,C.title,t.pointer.DOM)}),this.network.on("blurNode",()=>{g=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("blurEdge",()=>{g=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("dragStart",()=>{g&&(clearTimeout(g),g=null),this.hideHtmlTooltip(e)}),this.network.on("zoom",()=>{g&&(clearTimeout(g),g=null),this.hideHtmlTooltip(e)})}showHtmlTooltip(e,g,t){this.hideHtmlTooltip(e);let A=document.createElement("div");A.className="yasgui-graph-tooltip-container",A.innerHTML=g,A.style.position="absolute",A.style.left=`${t.x+10}px`,A.style.top=`${t.y+10}px`,A.style.zIndex="1000",A.addEventListener("mouseleave",()=>{this.hideHtmlTooltip(e)}),e.appendChild(A);let C=A.getBoundingClientRect(),i=e.getBoundingClientRect();C.right>i.right&&(A.style.left=`${t.x-C.width-10}px`),C.bottom>i.bottom&&(A.style.top=`${t.y-C.height-10}px`)}hideHtmlTooltip(e){let g=e.querySelector(".yasgui-graph-tooltip-container");g&&g.remove()}hideHtmlTooltipIfNotHovered(e){let g=e.querySelector(".yasgui-graph-tooltip-container");g&&(g.matches(":hover")||g.remove())}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let g=dC(e),t={};this.nodesDataSet.get().forEach(r=>{var o,d;(r.fixed===!0||typeof r.fixed=="object"&&((o=r.fixed)!=null&&o.x)&&((d=r.fixed)!=null&&d.y))&&r.x!==void 0&&r.y!==void 0&&(t[r.id]={x:r.x,y:r.y})});let{nodes:A,edges:C}=BA(this.triples,this.prefixMap,g,this.settings);this.nodesDataSet.clear(),this.nodesDataSet.add(A),this.edgesDataSet.clear(),this.edgesDataSet.add(C);let i=Object.keys(t);if(i.length>0){let r=i.map(s=>({id:s,x:t[s].x,y:t[s].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(r)}let n=cC(g,this.settings);this.network.setOptions(n),this.applyCanvasBackground(g.background)}applyCanvasBackground(e){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",e)}setupContainerResize(e){let g=e.parentElement;if(!g)return;let t=()=>{let A=g.clientHeight;A>0&&(e.style.height=`${A}px`,this.network&&this.network.fit({maxZoomLevel:1e3}))};t(),this.resizeObserver=new ResizeObserver(()=>{t()}),this.resizeObserver.observe(g)}toggleSettingsPanel(e){let g=e.querySelector(".yasgui-graph-settings-panel");if(g)g.remove(),this.settingsPanelOpen=!1,this.removeClickOutsideHandler();else{let t=this.createSettingsPanel(e);e.appendChild(t),this.settingsPanelOpen=!0,this.setupClickOutsideHandler(e,t)}}setupClickOutsideHandler(e,g){this.removeClickOutsideHandler(),this.clickOutsideHandler=t=>{let A=t.target;!g.contains(A)&&!this.isSettingsButton(A)&&this.toggleSettingsPanel(e)},setTimeout(()=>{document.addEventListener("click",this.clickOutsideHandler)},100)}removeClickOutsideHandler(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}isSettingsButton(e){let g=e;for(;g;){if(g instanceof Element&&g.classList.contains("yasgui-graph-settings-button"))return!0;g=g.parentNode}return!1}createSettingsPanel(e){let g=document.createElement("div");g.className="yasgui-graph-settings-panel",g.setAttribute("role","dialog"),g.setAttribute("aria-label","Graph settings");let t=document.createElement("div");t.className="yasgui-graph-settings-title",t.textContent="Graph Settings",g.appendChild(t);let A=r=>{let s=document.createElement("div");s.className="yasgui-graph-settings-section",s.textContent=r,g.appendChild(s)},C=(r,s,o)=>{let d=document.createElement("label");d.className="yasgui-graph-settings-row";let a=document.createElement("input");a.type="checkbox",a.checked=s,a.addEventListener("change",()=>o(a.checked));let l=document.createElement("span");l.textContent=r,d.appendChild(a),d.appendChild(l),g.appendChild(d)},i=(r,s,o,d)=>{let a=document.createElement("div");a.className="yasgui-graph-settings-row";let l=document.createElement("span");l.textContent=r;let h=document.createElement("select");h.className="yasgui-graph-settings-select",s.forEach(c=>{let f=document.createElement("option");f.value=c.value,f.textContent=c.label,c.value===o&&(f.selected=!0),h.appendChild(f)}),h.addEventListener("change",()=>d(h.value)),a.appendChild(l),a.appendChild(h),g.appendChild(a)},n=()=>{Ac(this.settings),this.draw()};return A("Arrows"),i("Style",[{value:"curved",label:"Curved"},{value:"straight",label:"Straight"}],this.settings.edgeStyle,r=>{this.settings.edgeStyle=r,n()}),A("Predicate display"),i("Display",[{value:"label",label:"Label (prefixed URI)"},{value:"icon",label:"Icon / symbol"},{value:"none",label:"Hidden"}],this.settings.predicateDisplay,r=>{this.settings.predicateDisplay=r,n()}),A("Compact mode"),C("Compact mode",this.settings.compactMode,r=>{this.settings.compactMode=r,n()}),A("Display"),C("Show node labels",this.settings.showNodeLabels,r=>{this.settings.showNodeLabels=r,n()}),C("Enable physics",this.settings.physicsEnabled,r=>{this.settings.physicsEnabled=r,n()}),i("Node size",[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],this.settings.nodeSize,r=>{this.settings.nodeSize=r,n()}),g}setupNodeExpansion(){this.network&&this.network.on("doubleClick",e=>{if(e.nodes.length===0)return;let g=e.nodes[0],t=this.nodesDataSet.get(g);t&&t.uri&&!t.uri.startsWith("_:")&&this.expandNode(t.uri)})}async expandNode(e){if(!this.yasr.executeQuery){console.warn("yasgui-graph-plugin: background query execution not available (yasr.executeQuery is not configured)");return}if(!this.triples||!this.prefixMap)return;this.expansionAbortController&&this.expansionAbortController.abort();let g=new AbortController;this.expansionAbortController=g;let t=this.uriToNodeId.get(e),A,C;if(t!==void 0){let n=this.nodesDataSet.get(t);n&&(A=n.color,C=n.borderWidth),this.nodesDataSet.update({id:t,borderWidth:s5,color:typeof A=="object"&&A!==null?{...A,border:Ic}:{border:Ic,background:A!=null?A:void 0}})}let i=n=>{t!==void 0&&this.nodesDataSet.update({id:t,borderWidth:n,color:A})};try{let n=await this.yasr.executeQuery(`DESCRIBE <${e}>`,{acceptHeader:"application/sparql-results+json",signal:g.signal});if(g.signal.aborted){i(C!=null?C:lC);return}let r=await Yr(n);if(g.signal.aborted){i(C!=null?C:lC);return}let s=new Set(this.triples.map(d=>`${d.subject}|${d.predicate}|${d.object.value}`)),o=r.filter(d=>!s.has(`${d.subject}|${d.predicate}|${d.object.value}`));o.length>0&&(this.triples=[...this.triples,...o],this.mergeNewTriples()),i(o5)}catch(n){if((n==null?void 0:n.name)==="AbortError"){i(C!=null?C:lC);return}console.error("yasgui-graph-plugin: error expanding node",e,n),i(C!=null?C:lC)}}mergeNewTriples(){if(!this.triples||!this.prefixMap||!this.nodesDataSet||!this.edgesDataSet)return;let e=dC(this.currentTheme),{nodes:g,edges:t}=BA(this.triples,this.prefixMap,e,this.settings),A=new Set(this.nodesDataSet.get().map(r=>r.fullValue)),C=g.filter(r=>!A.has(r.fullValue)),i=new Set(this.edgesDataSet.get().map(r=>`${r.from}|${r.predicate}|${r.to}`)),n=t.filter(r=>!i.has(`${r.from}|${r.predicate}|${r.to}`));C.length>0&&(this.nodesDataSet.add(C),C.forEach(r=>{r.uri!=null&&this.uriToNodeId.set(r.uri,r.id)})),n.length>0&&this.edgesDataSet.add(n)}getIcon(){let e=document.createElement("div");return e.className="yasgui-graph-icon",e.setAttribute("aria-label","Graph visualization"),e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
913
+ </svg> Settings`,s.onclick=()=>{this.toggleSettingsPanel(I)},n.appendChild(s),e&&this.toggleSettingsPanel(I)}catch(t){console.error("Error rendering graph:",t);let g=document.createElement("div");g.className="yasgui-graph-plugin-error",g.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(g)}}setupHtmlTooltips(e){if(!this.network)return;let t=null;this.network.on("hoverNode",g=>{t&&(clearTimeout(t),t=null);let A=g.node,I=this.nodesDataSet.get(A);I&&I.title&&this.showHtmlTooltip(e,I.title,g.pointer.DOM)}),this.network.on("hoverEdge",g=>{t&&(clearTimeout(t),t=null);let A=g.edge,I=this.edgesDataSet.get(A);I&&I.title&&this.showHtmlTooltip(e,I.title,g.pointer.DOM)}),this.network.on("blurNode",()=>{t=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("blurEdge",()=>{t=window.setTimeout(()=>{this.hideHtmlTooltipIfNotHovered(e)},200)}),this.network.on("dragStart",()=>{t&&(clearTimeout(t),t=null),this.hideHtmlTooltip(e)}),this.network.on("zoom",()=>{t&&(clearTimeout(t),t=null),this.hideHtmlTooltip(e)})}showHtmlTooltip(e,t,g){this.hideHtmlTooltip(e);let A=document.createElement("div");A.className="yasgui-graph-tooltip-container",A.innerHTML=t,A.style.position="absolute",A.style.left=`${g.x+10}px`,A.style.top=`${g.y+10}px`,A.style.zIndex="1000",A.addEventListener("mouseleave",()=>{this.hideHtmlTooltip(e)}),e.appendChild(A);let I=A.getBoundingClientRect(),C=e.getBoundingClientRect();I.right>C.right&&(A.style.left=`${g.x-I.width-10}px`),I.bottom>C.bottom&&(A.style.top=`${g.y-I.height-10}px`)}hideHtmlTooltip(e){let t=e.querySelector(".yasgui-graph-tooltip-container");t&&t.remove()}hideHtmlTooltipIfNotHovered(e){let t=e.querySelector(".yasgui-graph-tooltip-container");t&&(t.matches(":hover")||t.remove())}applyTheme(e){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=e;let t=UI(e),g={};this.nodesDataSet.get().forEach(r=>{var o,a;(r.fixed===!0||typeof r.fixed=="object"&&((o=r.fixed)!=null&&o.x)&&((a=r.fixed)!=null&&a.y))&&r.x!==void 0&&r.y!==void 0&&(g[r.id]={x:r.x,y:r.y})});let{nodes:A,edges:I}=fi(this.triples,this.prefixMap,t,this.settings);this.nodesDataSet.clear(),this.nodesDataSet.add(A),this.edgesDataSet.clear(),this.edgesDataSet.add(I);let C=Object.keys(g);if(C.length>0){let r=C.map(s=>({id:s,x:g[s].x,y:g[s].y,fixed:{x:!0,y:!0}}));this.nodesDataSet.update(r)}let n=QI(t,this.settings);this.network.setOptions(n),this.applyCanvasBackground(t.background)}applyCanvasBackground(e){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",e)}setupContainerResize(e){let t=e.parentElement;if(!t)return;let g=()=>{let A=t.clientHeight;A>0&&(e.style.height=`${A}px`,this.network&&this.network.fit({maxZoomLevel:1e3}))};g(),this.resizeObserver=new ResizeObserver(()=>{g()}),this.resizeObserver.observe(t)}toggleSettingsPanel(e){let t=e.querySelector(".yasgui-graph-settings-panel");if(t)t.remove(),this.settingsPanelOpen=!1,this.removeClickOutsideHandler();else{let g=this.createSettingsPanel(e);e.appendChild(g),this.settingsPanelOpen=!0,this.setupClickOutsideHandler(e,g)}}setupClickOutsideHandler(e,t){this.removeClickOutsideHandler(),this.clickOutsideHandler=g=>{let A=g.target;!t.contains(A)&&!this.isSettingsButton(A)&&this.toggleSettingsPanel(e)},setTimeout(()=>{document.addEventListener("click",this.clickOutsideHandler)},100)}removeClickOutsideHandler(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler),this.clickOutsideHandler=null)}isSettingsButton(e){let t=e;for(;t;){if(t instanceof Element&&t.classList.contains("yasgui-graph-settings-button"))return!0;t=t.parentNode}return!1}createSettingsPanel(e){let t=document.createElement("div");t.className="yasgui-graph-settings-panel",t.setAttribute("role","dialog"),t.setAttribute("aria-label","Graph settings");let g=document.createElement("div");g.className="yasgui-graph-settings-title",g.textContent="Graph Settings",t.appendChild(g);let A=r=>{let s=document.createElement("div");s.className="yasgui-graph-settings-section",s.textContent=r,t.appendChild(s)},I=(r,s,o)=>{let a=document.createElement("label");a.className="yasgui-graph-settings-row";let l=document.createElement("input");l.type="checkbox",l.checked=s,l.addEventListener("change",()=>o(l.checked));let d=document.createElement("span");d.textContent=r,a.appendChild(l),a.appendChild(d),t.appendChild(a)},C=(r,s,o,a)=>{let l=document.createElement("div");l.className="yasgui-graph-settings-row";let d=document.createElement("span");d.textContent=r;let h=document.createElement("select");h.className="yasgui-graph-settings-select",s.forEach(c=>{let u=document.createElement("option");u.value=c.value,u.textContent=c.label,c.value===o&&(u.selected=!0),h.appendChild(u)}),h.addEventListener("change",()=>a(h.value)),l.appendChild(d),l.appendChild(h),t.appendChild(l)},n=()=>{Ru(this.settings),this.draw()};return A("Arrows"),C("Style",[{value:"curved",label:"Curved"},{value:"straight",label:"Straight"}],this.settings.edgeStyle,r=>{this.settings.edgeStyle=r,n()}),A("Predicate display"),C("Display",[{value:"label",label:"Label (prefixed URI)"},{value:"icon",label:"Icon / symbol"},{value:"none",label:"Hidden"}],this.settings.predicateDisplay,r=>{this.settings.predicateDisplay=r,n()}),A("Compact mode"),I("Compact mode",this.settings.compactMode,r=>{this.settings.compactMode=r,n()}),A("Display"),I("Show node labels",this.settings.showNodeLabels,r=>{this.settings.showNodeLabels=r,n()}),I("Enable physics",this.settings.physicsEnabled,r=>{this.settings.physicsEnabled=r,n()}),C("Node size",[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}],this.settings.nodeSize,r=>{this.settings.nodeSize=r,n()}),t}setupNodeExpansion(){this.network&&this.network.on("doubleClick",e=>{if(e.nodes.length===0)return;let t=e.nodes[0],g=this.nodesDataSet.get(t);g&&g.uri&&!g.uri.startsWith("_:")&&this.expandNode(g.uri)})}async expandNode(e){if(!this.yasr.executeQuery){console.warn("yasgui-graph-plugin: background query execution not available (yasr.executeQuery is not configured)");return}if(!this.triples||!this.prefixMap)return;this.expansionAbortController&&this.expansionAbortController.abort();let t=new AbortController;this.expansionAbortController=t;let g=this.uriToNodeId.get(e),A,I;if(g!==void 0){let n=this.nodesDataSet.get(g);n&&(A=n.color,I=n.borderWidth),this.nodesDataSet.update({id:g,borderWidth:w3,color:typeof A=="object"&&A!==null?{...A,border:Du}:{border:Du,background:A!=null?A:void 0}})}let C=n=>{g!==void 0&&this.nodesDataSet.update({id:g,borderWidth:n,color:A})};try{let n=await this.yasr.executeQuery(`DESCRIBE <${e}>`,{acceptHeader:"text/turtle",signal:t.signal});if(t.signal.aborted){C(I!=null?I:HI);return}let r=await fo(n);if(t.signal.aborted){C(I!=null?I:HI);return}let s=new Set(this.triples.map(a=>`${a.subject}|${a.predicate}|${a.object.value}`)),o=r.filter(a=>!s.has(`${a.subject}|${a.predicate}|${a.object.value}`));o.length>0&&(this.triples=[...this.triples,...o],this.mergeNewTriples()),C(x3)}catch(n){if((n==null?void 0:n.name)==="AbortError"){C(I!=null?I:HI);return}console.error("yasgui-graph-plugin: error expanding node",e,n),C(I!=null?I:HI)}}mergeNewTriples(){if(!this.triples||!this.prefixMap||!this.nodesDataSet||!this.edgesDataSet)return;let e=UI(this.currentTheme),{nodes:t,edges:g}=fi(this.triples,this.prefixMap,e,this.settings),A=new Set(this.nodesDataSet.get().map(r=>r.fullValue)),I=t.filter(r=>!A.has(r.fullValue)),C=new Set(this.edgesDataSet.get().map(r=>`${r.from}|${r.predicate}|${r.to}`)),n=g.filter(r=>!C.has(`${r.from}|${r.predicate}|${r.to}`));I.length>0&&(this.nodesDataSet.add(I),I.forEach(r=>{r.uri!=null&&this.uriToNodeId.set(r.uri,r.id)})),n.length>0&&this.edgesDataSet.add(n)}getIcon(){let e=document.createElement("div");return e.className="yasgui-graph-icon",e.setAttribute("aria-label","Graph visualization"),e.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
913
914
  <circle cx="3" cy="3" r="2" />
914
915
  <circle cx="13" cy="3" r="2" />
915
916
  <circle cx="8" cy="13" r="2" />
916
917
  <line x1="4.5" y1="4" x2="7" y2="11.5" stroke="currentColor" stroke-width="1.5" />
917
918
  <line x1="11.5" y1="4" x2="9" y2="11.5" stroke="currentColor" stroke-width="1.5" />
918
919
  <line x1="5" y1="3" x2="11" y2="3" stroke="currentColor" stroke-width="1.5" />
919
- </svg>`,e}destroy(){this.removeClickOutsideHandler(),this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},jr=Gr;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",jr);var a5=jr;return ac(d5);})();
920
+ </svg>`,e}destroy(){this.removeClickOutsideHandler(),this.expansionAbortController&&(this.expansionAbortController.abort(),this.expansionAbortController=null),this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},Ms=ks;typeof window!="undefined"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",Ms);var E3=Ms;return Zu(T3);})();
920
921
  /*! Bundled license information:
921
922
 
923
+ ieee754/index.js:
924
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
925
+
926
+ buffer/index.js:
927
+ (*!
928
+ * The buffer module from node.js, for the browser.
929
+ *
930
+ * @author Feross Aboukhadijeh <https://feross.org>
931
+ * @license MIT
932
+ *)
933
+
922
934
  vis-network/standalone/esm/vis-network.js:
923
935
  (**
924
936
  * vis-network