UNPKG

zwave-js-ui

Version:

Z-Wave Control Panel and MQTT Gateway

99 lines 562 kB
import{bH as bT,_ as $T,m as wT,u as Gv,bI as Jo,bJ as mr,bK as _T,bL as Kv,bM as ET,bN as ST,o as fi,c as Nu,b as ee,w as X,k as it,e as OT,f as ba,T as es,ae as Fu,an as qv,am as Yv,l as ts,Z as en,i as Bu,t as rr,aD as Xv,a1 as $a,Y as Zv,v as rs,h as is,n as Qv,ao as Jv,R as ep,bA as TT,U as tn,x as IT,af as kT,ab as PT,N as CT,M as xT,q as RT}from"./index-B9yS4Bcc.js";import{a as AT,b as DT,c as MT,V as NT}from"./VExpansionPanels-BZZ3W0eQ.js";import{R as FT}from"./index-_vbXjPry.js";var Ct;(function(r){r[r.None=0]="None",r[r.LWR=1]="LWR",r[r.NLWR=2]="NLWR",r[r.Application=16]="Application"})(Ct||(Ct={}));bT["9k6"];/**
 * vis-data
 * http://visjs.org/
 *
 * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
 *
 * @version 7.1.9
 * @date    2023-11-24T17:53:34.179Z
 *
 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
 *
 * @license
 * vis.js is dual licensed under both
 *
 *   1. The Apache 2.0 License
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   and
 *
 *   2. The MIT License
 *      http://opensource.org/licenses/MIT
 *
 * vis.js may be distributed under either license.
 */function Al(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var Lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var g1={exports:{}},ns=function(r){return r&&r.Math===Math&&r},ge=ns(typeof globalThis=="object"&&globalThis)||ns(typeof window=="object"&&window)||ns(typeof self=="object"&&self)||ns(typeof Lu=="object"&&Lu)||function(){return this}()||Lu||Function("return this")(),oe=function(r){try{return!!r()}catch{return!0}},BT=oe,oo=!BT(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),LT=oo,y1=Function.prototype,tp=y1.apply,rp=y1.call,Gn=typeof Reflect=="object"&&Reflect.apply||(LT?rp.bind(tp):function(){return rp.apply(tp,arguments)}),m1=oo,b1=Function.prototype,Jh=b1.call,jT=m1&&b1.bind.bind(Jh,Jh),pe=m1?jT:function(r){return function(){return Jh.apply(r,arguments)}},$1=pe,zT=$1({}.toString),HT=$1("".slice),ii=function(r){return HT(zT(r),8,-1)},WT=ii,UT=pe,w1=function(r){if(WT(r)==="Function")return UT(r)},ec=typeof document=="object"&&document.all,VT=typeof ec>"u"&&ec!==void 0,_1={all:ec,IS_HTMLDDA:VT},E1=_1,GT=E1.all,_e=E1.IS_HTMLDDA?function(r){return typeof r=="function"||r===GT}:function(r){return typeof r=="function"},Li={},KT=oe,ze=!KT(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),qT=oo,as=Function.prototype.call,He=qT?as.bind(as):function(){return as.apply(as,arguments)},Dl={},S1={}.propertyIsEnumerable,O1=Object.getOwnPropertyDescriptor,YT=O1&&!S1.call({1:2},1);Dl.f=YT?function(n){var e=O1(this,n);return!!e&&e.enumerable}:S1;var ji=function(r,n){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:n}},XT=pe,ZT=oe,QT=ii,ju=Object,JT=XT("".split),Ml=ZT(function(){return!ju("z").propertyIsEnumerable(0)})?function(r){return QT(r)==="String"?JT(r,""):ju(r)}:ju,Kn=function(r){return r==null},eI=Kn,tI=TypeError,vf=function(r){if(eI(r))throw new tI("Can't call method on "+r);return r},rI=Ml,iI=vf,fr=function(r){return rI(iI(r))},ip=_e,T1=_1,nI=T1.all,Qe=T1.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:ip(r)||r===nI}:function(r){return typeof r=="object"?r!==null:ip(r)},ye={},zu=ye,Hu=ge,aI=_e,np=function(r){return aI(r)?r:void 0},ct=function(r,n){return arguments.length<2?np(zu[r])||np(Hu[r]):zu[r]&&zu[r][n]||Hu[r]&&Hu[r][n]},oI=pe,Ne=oI({}.isPrototypeOf),ni=typeof navigator<"u"&&String(navigator.userAgent)||"",I1=ge,Wu=ni,ap=I1.process,op=I1.Deno,sp=ap&&ap.versions||op&&op.version,lp=sp&&sp.v8,qt,sl;lp&&(qt=lp.split("."),sl=qt[0]>0&&qt[0]<4?1:+(qt[0]+qt[1]));!sl&&Wu&&(qt=Wu.match(/Edge\/(\d+)/),(!qt||qt[1]>=74)&&(qt=Wu.match(/Chrome\/(\d+)/),qt&&(sl=+qt[1])));var qn=sl,up=qn,sI=oe,lI=ge,uI=lI.String,Yn=!!Object.getOwnPropertySymbols&&!sI(function(){var r=Symbol("symbol detection");return!uI(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&up&&up<41}),dI=Yn,k1=dI&&!Symbol.sham&&typeof Symbol.iterator=="symbol",hI=ct,cI=_e,fI=Ne,vI=k1,pI=Object,so=vI?function(r){return typeof r=="symbol"}:function(r){var n=hI("Symbol");return cI(n)&&fI(n.prototype,pI(r))},gI=String,Xn=function(r){try{return gI(r)}catch{return"Object"}},yI=_e,mI=Xn,bI=TypeError,Et=function(r){if(yI(r))return r;throw new bI(mI(r)+" is not a function")},$I=Et,wI=Kn,pf=function(r,n){var e=r[n];return wI(e)?void 0:$I(e)},Uu=He,Vu=_e,Gu=Qe,_I=TypeError,EI=function(r,n){var e,t;if(n==="string"&&Vu(e=r.toString)&&!Gu(t=Uu(e,r))||Vu(e=r.valueOf)&&!Gu(t=Uu(e,r))||n!=="string"&&Vu(e=r.toString)&&!Gu(t=Uu(e,r)))return t;throw new _I("Can't convert object to primitive value")},P1={exports:{}},SI=!0,dp=ge,OI=Object.defineProperty,TI=function(r,n){try{OI(dp,r,{value:n,configurable:!0,writable:!0})}catch{dp[r]=n}return n},II=ge,kI=TI,hp="__core-js_shared__",PI=II[hp]||kI(hp,{}),gf=PI,cp=gf;(P1.exports=function(r,n){return cp[r]||(cp[r]=n!==void 0?n:{})})("versions",[]).push({version:"3.33.2",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var Zn=P1.exports,CI=vf,xI=Object,St=function(r){return xI(CI(r))},RI=pe,AI=St,DI=RI({}.hasOwnProperty),Fe=Object.hasOwn||function(n,e){return DI(AI(n),e)},MI=pe,NI=0,FI=Math.random(),BI=MI(1 .toString),Nl=function(r){return"Symbol("+(r===void 0?"":r)+")_"+BI(++NI+FI,36)},LI=ge,jI=Zn,fp=Fe,zI=Nl,HI=Yn,WI=k1,gn=LI.Symbol,Ku=jI("wks"),UI=WI?gn.for||gn:gn&&gn.withoutSetter||zI,be=function(r){return fp(Ku,r)||(Ku[r]=HI&&fp(gn,r)?gn[r]:UI("Symbol."+r)),Ku[r]},VI=He,vp=Qe,pp=so,GI=pf,KI=EI,qI=be,YI=TypeError,XI=qI("toPrimitive"),ZI=function(r,n){if(!vp(r)||pp(r))return r;var e=GI(r,XI),t;if(e){if(n===void 0&&(n="default"),t=VI(e,r,n),!vp(t)||pp(t))return t;throw new YI("Can't convert object to primitive value")}return n===void 0&&(n="number"),KI(r,n)},QI=ZI,JI=so,Fl=function(r){var n=QI(r,"string");return JI(n)?n:n+""},ek=ge,gp=Qe,tc=ek.document,tk=gp(tc)&&gp(tc.createElement),yf=function(r){return tk?tc.createElement(r):{}},rk=ze,ik=oe,nk=yf,C1=!rk&&!ik(function(){return Object.defineProperty(nk("div"),"a",{get:function(){return 7}}).a!==7}),ak=ze,ok=He,sk=Dl,lk=ji,uk=fr,dk=Fl,hk=Fe,ck=C1,yp=Object.getOwnPropertyDescriptor;Li.f=ak?yp:function(n,e){if(n=uk(n),e=dk(e),ck)try{return yp(n,e)}catch{}if(hk(n,e))return lk(!ok(sk.f,n,e),n[e])};var fk=oe,vk=_e,pk=/#|\.prototype\./,lo=function(r,n){var e=yk[gk(r)];return e===bk?!0:e===mk?!1:vk(n)?fk(n):!!n},gk=lo.normalize=function(r){return String(r).replace(pk,".").toLowerCase()},yk=lo.data={},mk=lo.NATIVE="N",bk=lo.POLYFILL="P",x1=lo,mp=w1,$k=Et,wk=oo,_k=mp(mp.bind),ai=function(r,n){return $k(r),n===void 0?r:wk?_k(r,n):function(){return r.apply(n,arguments)}},Ot={},Ek=ze,Sk=oe,R1=Ek&&Sk(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ok=Qe,Tk=String,Ik=TypeError,Dt=function(r){if(Ok(r))return r;throw new Ik(Tk(r)+" is not an object")},kk=ze,Pk=C1,Ck=R1,os=Dt,bp=Fl,xk=TypeError,qu=Object.defineProperty,Rk=Object.getOwnPropertyDescriptor,Yu="enumerable",Xu="configurable",Zu="writable";Ot.f=kk?Ck?function(n,e,t){if(os(n),e=bp(e),os(t),typeof n=="function"&&e==="prototype"&&"value"in t&&Zu in t&&!t[Zu]){var i=Rk(n,e);i&&i[Zu]&&(n[e]=t.value,t={configurable:Xu in t?t[Xu]:i[Xu],enumerable:Yu in t?t[Yu]:i[Yu],writable:!1})}return qu(n,e,t)}:qu:function(n,e,t){if(os(n),e=bp(e),os(t),Pk)try{return qu(n,e,t)}catch{}if("get"in t||"set"in t)throw new xk("Accessors not supported");return"value"in t&&(n[e]=t.value),n};var Ak=ze,Dk=Ot,Mk=ji,Ar=Ak?function(r,n,e){return Dk.f(r,n,Mk(1,e))}:function(r,n,e){return r[n]=e,r},ss=ge,Nk=Gn,Fk=w1,Bk=_e,Lk=Li.f,jk=x1,rn=ye,zk=ai,nn=Ar,$p=Fe,Hk=function(r){var n=function(e,t,i){if(this instanceof n){switch(arguments.length){case 0:return new r;case 1:return new r(e);case 2:return new r(e,t)}return new r(e,t,i)}return Nk(r,this,arguments)};return n.prototype=r.prototype,n},W=function(r,n){var e=r.target,t=r.global,i=r.stat,a=r.proto,o=t?ss:i?ss[e]:(ss[e]||{}).prototype,s=t?rn:rn[e]||nn(rn,e,{})[e],l=s.prototype,u,d,h,c,f,v,p,g,y;for(c in n)u=jk(t?c:e+(i?".":"#")+c,r.forced),d=!u&&o&&$p(o,c),v=s[c],d&&(r.dontCallGetSet?(y=Lk(o,c),p=y&&y.value):p=o[c]),f=d&&p?p:n[c],!(d&&typeof v==typeof f)&&(r.bind&&d?g=zk(f,ss):r.wrap&&d?g=Hk(f):a&&Bk(f)?g=Fk(f):g=f,(r.sham||f&&f.sham||v&&v.sham)&&nn(g,"sham",!0),nn(s,c,g),a&&(h=e+"Prototype",$p(rn,h)||nn(rn,h,{}),nn(rn[h],c,f),r.real&&l&&(u||!l[c])&&nn(l,c,f)))},Wk=W,Uk=ze,wp=Ot.f;Wk({target:"Object",stat:!0,forced:Object.defineProperty!==wp,sham:!Uk},{defineProperty:wp});var Vk=ye,A1=Vk.Object,Gk=g1.exports=function(n,e,t){return A1.defineProperty(n,e,t)};A1.defineProperty.sham&&(Gk.sham=!0);var Kk=g1.exports,qk=Kk,D1=qk,Yk=D1,Xk=Yk,Zk=Xk,Qk=Zk,M1=Qk,Bl=G(M1),Jk=ii,oi=Array.isArray||function(n){return Jk(n)==="Array"},eP=Math.ceil,tP=Math.floor,rP=Math.trunc||function(n){var e=+n;return(e>0?tP:eP)(e)},iP=rP,Ll=function(r){var n=+r;return n!==n||n===0?0:iP(n)},nP=Ll,aP=Math.min,oP=function(r){return r>0?aP(nP(r),9007199254740991):0},sP=oP,Mt=function(r){return sP(r.length)},lP=TypeError,uP=9007199254740991,jl=function(r){if(r>uP)throw lP("Maximum allowed index exceeded");return r},dP=Fl,hP=Ot,cP=ji,Qn=function(r,n,e){var t=dP(n);t in r?hP.f(r,t,cP(0,e)):r[t]=e},fP=be,vP=fP("toStringTag"),N1={};N1[vP]="z";var mf=String(N1)==="[object z]",pP=mf,gP=_e,Ws=ii,yP=be,mP=yP("toStringTag"),bP=Object,$P=Ws(function(){return arguments}())==="Arguments",wP=function(r,n){try{return r[n]}catch{}},Dr=pP?Ws:function(r){var n,e,t;return r===void 0?"Undefined":r===null?"Null":typeof(e=wP(n=bP(r),mP))=="string"?e:$P?Ws(n):(t=Ws(n))==="Object"&&gP(n.callee)?"Arguments":t},_P=pe,EP=_e,rc=gf,SP=_P(Function.toString);EP(rc.inspectSource)||(rc.inspectSource=function(r){return SP(r)});var F1=rc.inspectSource,OP=pe,TP=oe,B1=_e,IP=Dr,kP=ct,PP=F1,L1=function(){},CP=[],j1=kP("Reflect","construct"),bf=/^\s*(?:class|function)\b/,xP=OP(bf.exec),RP=!bf.test(L1),wa=function(n){if(!B1(n))return!1;try{return j1(L1,CP,n),!0}catch{return!1}},z1=function(n){if(!B1(n))return!1;switch(IP(n)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return RP||!!xP(bf,PP(n))}catch{return!0}};z1.sham=!0;var zl=!j1||TP(function(){var r;return wa(wa.call)||!wa(Object)||!wa(function(){r=!0})||r})?z1:wa,_p=oi,AP=zl,DP=Qe,MP=be,NP=MP("species"),Ep=Array,FP=function(r){var n;return _p(r)&&(n=r.constructor,AP(n)&&(n===Ep||_p(n.prototype))?n=void 0:DP(n)&&(n=n[NP],n===null&&(n=void 0))),n===void 0?Ep:n},BP=FP,Hl=function(r,n){return new(BP(r))(n===0?0:n)},LP=oe,jP=be,zP=qn,HP=jP("species"),uo=function(r){return zP>=51||!LP(function(){var n=[],e=n.constructor={};return e[HP]=function(){return{foo:1}},n[r](Boolean).foo!==1})},WP=W,UP=oe,VP=oi,GP=Qe,KP=St,qP=Mt,Sp=jl,Op=Qn,YP=Hl,XP=uo,ZP=be,QP=qn,H1=ZP("isConcatSpreadable"),JP=QP>=51||!UP(function(){var r=[];return r[H1]=!1,r.concat()[0]!==r}),eC=function(r){if(!GP(r))return!1;var n=r[H1];return n!==void 0?!!n:VP(r)},tC=!JP||!XP("concat");WP({target:"Array",proto:!0,arity:1,forced:tC},{concat:function(n){var e=KP(this),t=YP(e,0),i=0,a,o,s,l,u;for(a=-1,s=arguments.length;a<s;a++)if(u=a===-1?e:arguments[a],eC(u))for(l=qP(u),Sp(i+l),o=0;o<l;o++,i++)o in u&&Op(t,i,u[o]);else Sp(i+1),Op(t,i++,u);return t.length=i,t}});var rC=Dr,iC=String,zi=function(r){if(rC(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return iC(r)},Wl={},nC=Ll,aC=Math.max,oC=Math.min,Ul=function(r,n){var e=nC(r);return e<0?aC(e+n,0):oC(e,n)},sC=fr,lC=Ul,uC=Mt,Tp=function(r){return function(n,e,t){var i=sC(n),a=uC(i),o=lC(t,a),s;if(r&&e!==e){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((r||o in i)&&i[o]===e)return r||o||0;return!r&&-1}},dC={includes:Tp(!0),indexOf:Tp(!1)},ho={},hC=pe,Qu=Fe,cC=fr,fC=dC.indexOf,vC=ho,Ip=hC([].push),W1=function(r,n){var e=cC(r),t=0,i=[],a;for(a in e)!Qu(vC,a)&&Qu(e,a)&&Ip(i,a);for(;n.length>t;)Qu(e,a=n[t++])&&(~fC(i,a)||Ip(i,a));return i},$f=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pC=W1,gC=$f,Vl=Object.keys||function(n){return pC(n,gC)},yC=ze,mC=R1,bC=Ot,$C=Dt,wC=fr,_C=Vl;Wl.f=yC&&!mC?Object.defineProperties:function(n,e){$C(n);for(var t=wC(e),i=_C(e),a=i.length,o=0,s;a>o;)bC.f(n,s=i[o++],t[s]);return n};var EC=ct,U1=EC("document","documentElement"),SC=Zn,OC=Nl,kp=SC("keys"),Gl=function(r){return kp[r]||(kp[r]=OC(r))},TC=Dt,IC=Wl,Pp=$f,kC=ho,PC=U1,CC=yf,xC=Gl,Cp=">",xp="<",ic="prototype",nc="script",V1=xC("IE_PROTO"),Ju=function(){},G1=function(r){return xp+nc+Cp+r+xp+"/"+nc+Cp},Rp=function(r){r.write(G1("")),r.close();var n=r.parentWindow.Object;return r=null,n},RC=function(){var r=CC("iframe"),n="java"+nc+":",e;return r.style.display="none",PC.appendChild(r),r.src=String(n),e=r.contentWindow.document,e.open(),e.write(G1("document.F=Object")),e.close(),e.F},ls,Us=function(){try{ls=new ActiveXObject("htmlfile")}catch{}Us=typeof document<"u"?document.domain&&ls?Rp(ls):RC():Rp(ls);for(var r=Pp.length;r--;)delete Us[ic][Pp[r]];return Us()};kC[V1]=!0;var Hi=Object.create||function(n,e){var t;return n!==null?(Ju[ic]=TC(n),t=new Ju,Ju[ic]=null,t[V1]=n):t=Us(),e===void 0?t:IC.f(t,e)},co={},AC=W1,DC=$f,MC=DC.concat("length","prototype");co.f=Object.getOwnPropertyNames||function(n){return AC(n,MC)};var wf={},Ap=Ul,NC=Mt,FC=Qn,BC=Array,LC=Math.max,K1=function(r,n,e){for(var t=NC(r),i=Ap(n,t),a=Ap(e===void 0?t:e,t),o=BC(LC(a-i,0)),s=0;i<a;i++,s++)FC(o,s,r[i]);return o.length=s,o},jC=ii,zC=fr,q1=co.f,HC=K1,Y1=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],WC=function(r){try{return q1(r)}catch{return HC(Y1)}};wf.f=function(n){return Y1&&jC(n)==="Window"?WC(n):q1(zC(n))};var fo={};fo.f=Object.getOwnPropertySymbols;var UC=Ar,Jn=function(r,n,e,t){return t&&t.enumerable?r[n]=e:UC(r,n,e),r},VC=Ot,_f=function(r,n,e){return VC.f(r,n,e)},vo={},GC=be;vo.f=GC;var Dp=ye,KC=Fe,qC=vo,YC=Ot.f,Ee=function(r){var n=Dp.Symbol||(Dp.Symbol={});KC(n,r)||YC(n,r,{value:qC.f(r)})},XC=He,ZC=ct,QC=be,JC=Jn,X1=function(){var r=ZC("Symbol"),n=r&&r.prototype,e=n&&n.valueOf,t=QC("toPrimitive");n&&!n[t]&&JC(n,t,function(i){return XC(e,this)},{arity:1})},ex=mf,tx=Dr,rx=ex?{}.toString:function(){return"[object "+tx(this)+"]"},ix=mf,nx=Ot.f,ax=Ar,ox=Fe,sx=rx,lx=be,Mp=lx("toStringTag"),Wi=function(r,n,e,t){if(r){var i=e?r:r.prototype;ox(i,Mp)||nx(i,Mp,{configurable:!0,value:n}),t&&!ix&&ax(i,"toString",sx)}},ux=ge,dx=_e,Np=ux.WeakMap,hx=dx(Np)&&/native code/.test(String(Np)),cx=hx,Z1=ge,fx=Qe,vx=Ar,ed=Fe,td=gf,px=Gl,gx=ho,Fp="Object already initialized",ac=Z1.TypeError,yx=Z1.WeakMap,ll,Wa,ul,mx=function(r){return ul(r)?Wa(r):ll(r,{})},bx=function(r){return function(n){var e;if(!fx(n)||(e=Wa(n)).type!==r)throw new ac("Incompatible receiver, "+r+" required");return e}};if(cx||td.state){var ir=td.state||(td.state=new yx);ir.get=ir.get,ir.has=ir.has,ir.set=ir.set,ll=function(r,n){if(ir.has(r))throw new ac(Fp);return n.facade=r,ir.set(r,n),n},Wa=function(r){return ir.get(r)||{}},ul=function(r){return ir.has(r)}}else{var an=px("state");gx[an]=!0,ll=function(r,n){if(ed(r,an))throw new ac(Fp);return n.facade=r,vx(r,an,n),n},Wa=function(r){return ed(r,an)?r[an]:{}},ul=function(r){return ed(r,an)}}var ea={set:ll,get:Wa,has:ul,enforce:mx,getterFor:bx},$x=ai,wx=pe,_x=Ml,Ex=St,Sx=Mt,Ox=Hl,Bp=wx([].push),Fr=function(r){var n=r===1,e=r===2,t=r===3,i=r===4,a=r===6,o=r===7,s=r===5||a;return function(l,u,d,h){for(var c=Ex(l),f=_x(c),v=$x(u,d),p=Sx(f),g=0,y=h||Ox,m=n?y(l,p):e||o?y(l,0):void 0,$,b;p>g;g++)if((s||g in f)&&($=f[g],b=v($,g,c),r))if(n)m[g]=b;else if(b)switch(r){case 3:return!0;case 5:return $;case 6:return g;case 2:Bp(m,$)}else switch(r){case 4:return!1;case 7:Bp(m,$)}return a?-1:t||i?i:m}},ta={forEach:Fr(0),map:Fr(1),filter:Fr(2),some:Fr(3),every:Fr(4),find:Fr(5),findIndex:Fr(6),filterReject:Fr(7)},Kl=W,po=ge,Ef=He,Tx=pe,Rn=ze,An=Yn,Ix=oe,Le=Fe,kx=Ne,oc=Dt,ql=fr,Sf=Fl,Px=zi,sc=ji,Ua=Hi,Q1=Vl,Cx=co,J1=wf,xx=fo,ew=Li,tw=Ot,Rx=Wl,rw=Dl,Lp=Jn,Ax=_f,Of=Zn,Dx=Gl,iw=ho,jp=Nl,Mx=be,Nx=vo,Fx=Ee,Bx=X1,Lx=Wi,nw=ea,Yl=ta.forEach,yt=Dx("hidden"),Xl="Symbol",Va="prototype",jx=nw.set,zp=nw.getterFor(Xl),Qt=Object[Va],$i=po.Symbol,ka=$i&&$i[Va],zx=po.RangeError,Hx=po.TypeError,rd=po.QObject,aw=ew.f,wi=tw.f,ow=J1.f,Wx=rw.f,sw=Tx([].push),Pr=Of("symbols"),go=Of("op-symbols"),Ux=Of("wks"),lc=!rd||!rd[Va]||!rd[Va].findChild,lw=function(r,n,e){var t=aw(Qt,n);t&&delete Qt[n],wi(r,n,e),t&&r!==Qt&&wi(Qt,n,t)},uc=Rn&&Ix(function(){return Ua(wi({},"a",{get:function(){return wi(this,"a",{value:7}).a}})).a!==7})?lw:wi,id=function(r,n){var e=Pr[r]=Ua(ka);return jx(e,{type:Xl,tag:r,description:n}),Rn||(e.description=n),e},Zl=function(n,e,t){n===Qt&&Zl(go,e,t),oc(n);var i=Sf(e);return oc(t),Le(Pr,i)?(t.enumerable?(Le(n,yt)&&n[yt][i]&&(n[yt][i]=!1),t=Ua(t,{enumerable:sc(0,!1)})):(Le(n,yt)||wi(n,yt,sc(1,{})),n[yt][i]=!0),uc(n,i,t)):wi(n,i,t)},Tf=function(n,e){oc(n);var t=ql(e),i=Q1(t).concat(cw(t));return Yl(i,function(a){(!Rn||Ef(uw,t,a))&&Zl(n,a,t[a])}),n},Vx=function(n,e){return e===void 0?Ua(n):Tf(Ua(n),e)},uw=function(n){var e=Sf(n),t=Ef(Wx,this,e);return this===Qt&&Le(Pr,e)&&!Le(go,e)?!1:t||!Le(this,e)||!Le(Pr,e)||Le(this,yt)&&this[yt][e]?t:!0},dw=function(n,e){var t=ql(n),i=Sf(e);if(!(t===Qt&&Le(Pr,i)&&!Le(go,i))){var a=aw(t,i);return a&&Le(Pr,i)&&!(Le(t,yt)&&t[yt][i])&&(a.enumerable=!0),a}},hw=function(n){var e=ow(ql(n)),t=[];return Yl(e,function(i){!Le(Pr,i)&&!Le(iw,i)&&sw(t,i)}),t},cw=function(r){var n=r===Qt,e=ow(n?go:ql(r)),t=[];return Yl(e,function(i){Le(Pr,i)&&(!n||Le(Qt,i))&&sw(t,Pr[i])}),t};An||($i=function(){if(kx(ka,this))throw new Hx("Symbol is not a constructor");var n=!arguments.length||arguments[0]===void 0?void 0:Px(arguments[0]),e=jp(n),t=function(i){var a=this===void 0?po:this;a===Qt&&Ef(t,go,i),Le(a,yt)&&Le(a[yt],e)&&(a[yt][e]=!1);var o=sc(1,i);try{uc(a,e,o)}catch(s){if(!(s instanceof zx))throw s;lw(a,e,o)}};return Rn&&lc&&uc(Qt,e,{configurable:!0,set:t}),id(e,n)},ka=$i[Va],Lp(ka,"toString",function(){return zp(this).tag}),Lp($i,"withoutSetter",function(r){return id(jp(r),r)}),rw.f=uw,tw.f=Zl,Rx.f=Tf,ew.f=dw,Cx.f=J1.f=hw,xx.f=cw,Nx.f=function(r){return id(Mx(r),r)},Rn&&Ax(ka,"description",{configurable:!0,get:function(){return zp(this).description}}));Kl({global:!0,constructor:!0,wrap:!0,forced:!An,sham:!An},{Symbol:$i});Yl(Q1(Ux),function(r){Fx(r)});Kl({target:Xl,stat:!0,forced:!An},{useSetter:function(){lc=!0},useSimple:function(){lc=!1}});Kl({target:"Object",stat:!0,forced:!An,sham:!Rn},{create:Vx,defineProperty:Zl,defineProperties:Tf,getOwnPropertyDescriptor:dw});Kl({target:"Object",stat:!0,forced:!An},{getOwnPropertyNames:hw});Bx();Lx($i,Xl);iw[yt]=!0;var Gx=Yn,fw=Gx&&!!Symbol.for&&!!Symbol.keyFor,Kx=W,qx=ct,Yx=Fe,Xx=zi,vw=Zn,Zx=fw,nd=vw("string-to-symbol-registry"),Qx=vw("symbol-to-string-registry");Kx({target:"Symbol",stat:!0,forced:!Zx},{for:function(r){var n=Xx(r);if(Yx(nd,n))return nd[n];var e=qx("Symbol")(n);return nd[n]=e,Qx[e]=n,e}});var Jx=W,eR=Fe,tR=so,rR=Xn,iR=Zn,nR=fw,Hp=iR("symbol-to-string-registry");Jx({target:"Symbol",stat:!0,forced:!nR},{keyFor:function(n){if(!tR(n))throw new TypeError(rR(n)+" is not a symbol");if(eR(Hp,n))return Hp[n]}});var aR=pe,yo=aR([].slice),oR=pe,Wp=oi,sR=_e,Up=ii,lR=zi,Vp=oR([].push),uR=function(r){if(sR(r))return r;if(Wp(r)){for(var n=r.length,e=[],t=0;t<n;t++){var i=r[t];typeof i=="string"?Vp(e,i):(typeof i=="number"||Up(i)==="Number"||Up(i)==="String")&&Vp(e,lR(i))}var a=e.length,o=!0;return function(s,l){if(o)return o=!1,l;if(Wp(this))return l;for(var u=0;u<a;u++)if(e[u]===s)return l}}},dR=W,pw=ct,gw=Gn,hR=He,mo=pe,yw=oe,Gp=_e,Kp=so,mw=yo,cR=uR,fR=Yn,vR=String,Gr=pw("JSON","stringify"),us=mo(/./.exec),qp=mo("".charAt),pR=mo("".charCodeAt),gR=mo("".replace),yR=mo(1 .toString),mR=/[\uD800-\uDFFF]/g,Yp=/^[\uD800-\uDBFF]$/,Xp=/^[\uDC00-\uDFFF]$/,Zp=!fR||yw(function(){var r=pw("Symbol")("stringify detection");return Gr([r])!=="[null]"||Gr({a:r})!=="{}"||Gr(Object(r))!=="{}"}),Qp=yw(function(){return Gr("\uDF06\uD834")!=='"\\udf06\\ud834"'||Gr("\uDEAD")!=='"\\udead"'}),bR=function(r,n){var e=mw(arguments),t=cR(n);if(!(!Gp(t)&&(r===void 0||Kp(r))))return e[1]=function(i,a){if(Gp(t)&&(a=hR(t,this,vR(i),a)),!Kp(a))return a},gw(Gr,null,e)},$R=function(r,n,e){var t=qp(e,n-1),i=qp(e,n+1);return us(Yp,r)&&!us(Xp,i)||us(Xp,r)&&!us(Yp,t)?"\\u"+yR(pR(r,0),16):r};Gr&&dR({target:"JSON",stat:!0,arity:3,forced:Zp||Qp},{stringify:function(n,e,t){var i=mw(arguments),a=gw(Zp?bR:Gr,null,i);return Qp&&typeof a=="string"?gR(a,mR,$R):a}});var wR=W,_R=Yn,ER=oe,bw=fo,SR=St,OR=!_R||ER(function(){bw.f(1)});wR({target:"Object",stat:!0,forced:OR},{getOwnPropertySymbols:function(n){var e=bw.f;return e?e(SR(n)):[]}});var TR=Ee;TR("asyncIterator");var IR=Ee;IR("hasInstance");var kR=Ee;kR("isConcatSpreadable");var PR=Ee;PR("iterator");var CR=Ee;CR("match");var xR=Ee;xR("matchAll");var RR=Ee;RR("replace");var AR=Ee;AR("search");var DR=Ee;DR("species");var MR=Ee;MR("split");var NR=Ee,FR=X1;NR("toPrimitive");FR();var BR=ct,LR=Ee,jR=Wi;LR("toStringTag");jR(BR("Symbol"),"Symbol");var zR=Ee;zR("unscopables");var HR=ge,WR=Wi;WR(HR.JSON,"JSON",!0);var UR=ye,VR=UR.Symbol,ra={},dc=ze,GR=Fe,$w=Function.prototype,KR=dc&&Object.getOwnPropertyDescriptor,If=GR($w,"name"),qR=If&&(function(){}).name==="something",YR=If&&(!dc||dc&&KR($w,"name").configurable),XR={EXISTS:If,PROPER:qR,CONFIGURABLE:YR},ZR=oe,ww=!ZR(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),QR=Fe,JR=_e,eA=St,tA=Gl,rA=ww,Jp=tA("IE_PROTO"),hc=Object,iA=hc.prototype,Ql=rA?hc.getPrototypeOf:function(r){var n=eA(r);if(QR(n,Jp))return n[Jp];var e=n.constructor;return JR(e)&&n instanceof e?e.prototype:n instanceof hc?iA:null},nA=oe,aA=_e,oA=Qe,sA=Hi,eg=Ql,lA=Jn,uA=be,cc=uA("iterator"),_w=!1,$r,ad,od;[].keys&&(od=[].keys(),"next"in od?(ad=eg(eg(od)),ad!==Object.prototype&&($r=ad)):_w=!0);var dA=!oA($r)||nA(function(){var r={};return $r[cc].call(r)!==r});dA?$r={}:$r=sA($r);aA($r[cc])||lA($r,cc,function(){return this});var Ew={IteratorPrototype:$r,BUGGY_SAFARI_ITERATORS:_w},hA=Ew.IteratorPrototype,cA=Hi,fA=ji,vA=Wi,pA=ra,gA=function(){return this},yA=function(r,n,e,t){var i=n+" Iterator";return r.prototype=cA(hA,{next:fA(+!t,e)}),vA(r,i,!1,!0),pA[i]=gA,r},mA=pe,bA=Et,$A=function(r,n,e){try{return mA(bA(Object.getOwnPropertyDescriptor(r,n)[e]))}catch{}},wA=_e,_A=String,EA=TypeError,SA=function(r){if(typeof r=="object"||wA(r))return r;throw new EA("Can't set "+_A(r)+" as a prototype")},OA=$A,TA=Dt,IA=SA,Sw=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,n={},e;try{e=OA(Object.prototype,"__proto__","set"),e(n,[]),r=n instanceof Array}catch{}return function(i,a){return TA(i),IA(a),r?e(i,a):i.__proto__=a,i}}():void 0),kA=W,PA=He,CA=XR,xA=yA,RA=Ql,AA=Wi,tg=Jn,DA=be,rg=ra,MA=Ew,NA=CA.PROPER,ds=MA.BUGGY_SAFARI_ITERATORS,sd=DA("iterator"),ig="keys",hs="values",ng="entries",FA=function(){return this},kf=function(r,n,e,t,i,a,o){xA(e,n,t);var s=function(y){if(y===i&&c)return c;if(!ds&&y&&y in d)return d[y];switch(y){case ig:return function(){return new e(this,y)};case hs:return function(){return new e(this,y)};case ng:return function(){return new e(this,y)}}return function(){return new e(this)}},l=n+" Iterator",u=!1,d=r.prototype,h=d[sd]||d["@@iterator"]||i&&d[i],c=!ds&&h||s(i),f=n==="Array"&&d.entries||h,v,p,g;if(f&&(v=RA(f.call(new r)),v!==Object.prototype&&v.next&&(AA(v,l,!0,!0),rg[l]=FA)),NA&&i===hs&&h&&h.name!==hs&&(u=!0,c=function(){return PA(h,this)}),i)if(p={values:s(hs),keys:a?c:s(ig),entries:s(ng)},o)for(g in p)(ds||u||!(g in d))&&tg(d,g,p[g]);else kA({target:n,proto:!0,forced:ds||u},p);return o&&d[sd]!==c&&tg(d,sd,c,{name:i}),rg[n]=c,p},Pf=function(r,n){return{value:r,done:n}},BA=fr,ag=ra,Ow=ea;Ot.f;var LA=kf,cs=Pf,Tw="Array Iterator",jA=Ow.set,zA=Ow.getterFor(Tw);LA(Array,"Array",function(r,n){jA(this,{type:Tw,target:BA(r),index:0,kind:n})},function(){var r=zA(this),n=r.target,e=r.index++;if(!n||e>=n.length)return r.target=void 0,cs(void 0,!0);switch(r.kind){case"keys":return cs(e,!1);case"values":return cs(n[e],!1)}return cs([e,n[e]],!1)},"values");ag.Arguments=ag.Array;var HA={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},WA=HA,UA=ge,VA=Dr,GA=Ar,og=ra,KA=be,sg=KA("toStringTag");for(var ld in WA){var lg=UA[ld],ud=lg&&lg.prototype;ud&&VA(ud)!==sg&&GA(ud,sg,ld),og[ld]=og.Array}var qA=VR,Iw=qA,YA=be,XA=Ot.f,ug=YA("metadata"),dg=Function.prototype;dg[ug]===void 0&&XA(dg,ug,{value:null});var ZA=Ee;ZA("asyncDispose");var QA=Ee;QA("dispose");var JA=Ee;JA("metadata");var eD=Iw,tD=eD,rD=ct,iD=pe,Cf=rD("Symbol"),nD=Cf.keyFor,aD=iD(Cf.prototype.valueOf),kw=Cf.isRegisteredSymbol||function(n){try{return nD(aD(n))!==void 0}catch{return!1}},oD=W,sD=kw;oD({target:"Symbol",stat:!0},{isRegisteredSymbol:sD});var lD=Zn,Pw=ct,uD=pe,dD=so,hD=be,dl=Pw("Symbol"),hg=dl.isWellKnownSymbol,Cw=Pw("Object","getOwnPropertyNames"),cD=uD(dl.prototype.valueOf),cg=lD("wks");for(var dd=0,fg=Cw(dl),fD=fg.length;dd<fD;dd++)try{var vg=fg[dd];dD(dl[vg])&&hD(vg)}catch{}var xw=function(n){if(hg&&hg(n))return!0;try{for(var e=cD(n),t=0,i=Cw(cg),a=i.length;t<a;t++)if(cg[i[t]]==e)return!0}catch{}return!1},vD=W,pD=xw;vD({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:pD});var gD=Ee;gD("matcher");var yD=Ee;yD("observable");var mD=W,bD=kw;mD({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:bD});var $D=W,wD=xw;$D({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:wD});var _D=Ee;_D("metadataKey");var ED=Ee;ED("patternMatch");var SD=Ee;SD("replaceAll");var OD=tD,TD=OD,xf=TD,yn=G(xf),Rf=pe,ID=Ll,kD=zi,PD=vf,CD=Rf("".charAt),pg=Rf("".charCodeAt),xD=Rf("".slice),gg=function(r){return function(n,e){var t=kD(PD(n)),i=ID(e),a=t.length,o,s;return i<0||i>=a?r?"":void 0:(o=pg(t,i),o<55296||o>56319||i+1===a||(s=pg(t,i+1))<56320||s>57343?r?CD(t,i):o:r?xD(t,i,i+2):(o-55296<<10)+(s-56320)+65536)}},RD={codeAt:gg(!1),charAt:gg(!0)},AD=RD.charAt,DD=zi,Rw=ea,MD=kf,yg=Pf,Aw="String Iterator",ND=Rw.set,FD=Rw.getterFor(Aw);MD(String,"String",function(r){ND(this,{type:Aw,string:DD(r),index:0})},function(){var n=FD(this),e=n.string,t=n.index,i;return t>=e.length?yg(void 0,!0):(i=AD(e,t),n.index+=i.length,yg(i,!1))});var BD=vo,LD=BD.f("iterator"),jD=LD,Dw=jD,zD=Dw,HD=zD,WD=HD,UD=WD,Mw=UD,VD=G(Mw);function Dn(r){"@babel/helpers - typeof";return Dn=typeof yn=="function"&&typeof VD=="symbol"?function(n){return typeof n}:function(n){return n&&typeof yn=="function"&&n.constructor===yn&&n!==yn.prototype?"symbol":typeof n},Dn(r)}var GD=vo,KD=GD.f("toPrimitive"),qD=KD,YD=qD,XD=YD,ZD=XD,QD=ZD,JD=QD,eM=JD,tM=G(eM);function rM(r,n){if(Dn(r)!=="object"||r===null)return r;var e=r[tM];if(e!==void 0){var t=e.call(r,n||"default");if(Dn(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function Nw(r){var n=rM(r,"string");return Dn(n)==="symbol"?n:String(n)}function mg(r,n){for(var e=0;e<n.length;e++){var t=n[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Bl(r,Nw(t.key),t)}}function Jl(r,n,e){return n&&mg(r.prototype,n),e&&mg(r,e),Bl(r,"prototype",{writable:!1}),r}function Kr(r,n,e){return n=Nw(n),n in r?Bl(r,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[n]=e,r}var Fw=pe,iM=Et,nM=Qe,aM=Fe,bg=yo,oM=oo,Bw=Function,sM=Fw([].concat),lM=Fw([].join),hd={},uM=function(r,n,e){if(!aM(hd,n)){for(var t=[],i=0;i<n;i++)t[i]="a["+i+"]";hd[n]=Bw("C,a","return new C("+lM(t,",")+")")}return hd[n](r,e)},Lw=oM?Bw.bind:function(n){var e=iM(this),t=e.prototype,i=bg(arguments,1),a=function(){var s=sM(i,bg(arguments));return this instanceof a?uM(e,s.length,s):e.apply(n,s)};return nM(t)&&(a.prototype=t),a},dM=W,$g=Lw;dM({target:"Function",proto:!0,forced:Function.bind!==$g},{bind:$g});var hM=ge,cM=ye,nt=function(r,n){var e=cM[r+"Prototype"],t=e&&e[n];if(t)return t;var i=hM[r],a=i&&i.prototype;return a&&a[n]},fM=nt,vM=fM("Function","bind"),pM=Ne,gM=vM,cd=Function.prototype,yM=function(r){var n=r.bind;return r===cd||pM(cd,r)&&n===cd.bind?gM:n},mM=yM,jw=mM,bM=jw,zw=G(bM),$M=Et,wM=St,_M=Ml,EM=Mt,SM=TypeError,wg=function(r){return function(n,e,t,i){$M(e);var a=wM(n),o=_M(a),s=EM(a),l=r?s-1:0,u=r?-1:1;if(t<2)for(;;){if(l in o){i=o[l],l+=u;break}if(l+=u,r?l<0:s<=l)throw new SM("Reduce of empty array with no initial value")}for(;r?l>=0:s>l;l+=u)l in o&&(i=e(i,o[l],l,a));return i}},OM={left:wg(!1),right:wg(!0)},TM=oe,eu=function(r,n){var e=[][r];return!!e&&TM(function(){e.call(null,n||function(){return 1},1)})},IM=ge,kM=ii,bo=kM(IM.process)==="process",PM=W,CM=OM.left,xM=eu,_g=qn,RM=bo,AM=!RM&&_g>79&&_g<83,DM=AM||!xM("reduce");PM({target:"Array",proto:!0,forced:DM},{reduce:function(n){var e=arguments.length;return CM(this,n,e,e>1?arguments[1]:void 0)}});var MM=nt,NM=MM("Array","reduce"),FM=Ne,BM=NM,fd=Array.prototype,LM=function(r){var n=r.reduce;return r===fd||FM(fd,r)&&n===fd.reduce?BM:n},jM=LM,zM=jM,HM=zM,WM=G(HM),UM=W,VM=ta.filter,GM=uo,KM=GM("filter");UM({target:"Array",proto:!0,forced:!KM},{filter:function(n){return VM(this,n,arguments.length>1?arguments[1]:void 0)}});var qM=nt,YM=qM("Array","filter"),XM=Ne,ZM=YM,vd=Array.prototype,QM=function(r){var n=r.filter;return r===vd||XM(vd,r)&&n===vd.filter?ZM:n},JM=QM,eN=JM,tN=eN,mn=G(tN),rN=W,iN=ta.map,nN=uo,aN=nN("map");rN({target:"Array",proto:!0,forced:!aN},{map:function(n){return iN(this,n,arguments.length>1?arguments[1]:void 0)}});var oN=nt,sN=oN("Array","map"),lN=Ne,uN=sN,pd=Array.prototype,dN=function(r){var n=r.map;return r===pd||lN(pd,r)&&n===pd.map?uN:n},hN=dN,cN=hN,fN=cN,Yt=G(fN),vN=oi,pN=Mt,gN=jl,yN=ai,Hw=function(r,n,e,t,i,a,o,s){for(var l=i,u=0,d=o?yN(o,s):!1,h,c;u<t;)u in e&&(h=d?d(e[u],u,n):e[u],a>0&&vN(h)?(c=pN(h),l=Hw(r,n,h,c,l,a-1)-1):(gN(l+1),r[l]=h),l++),u++;return l},mN=Hw,bN=W,$N=mN,wN=Et,_N=St,EN=Mt,SN=Hl;bN({target:"Array",proto:!0},{flatMap:function(n){var e=_N(this),t=EN(e),i;return wN(n),i=SN(e,0),i.length=$N(i,e,e,t,0,1,n,arguments.length>1?arguments[1]:void 0),i}});var ON=nt;ON("Array","flatMap");var TN=He,Eg=Dt,IN=pf,Ww=function(r,n,e){var t,i;Eg(r);try{if(t=IN(r,"return"),!t){if(n==="throw")throw e;return e}t=TN(t,r)}catch(a){i=!0,t=a}if(n==="throw")throw e;if(i)throw t;return Eg(t),e},kN=Dt,PN=Ww,CN=function(r,n,e,t){try{return t?n(kN(e)[0],e[1]):n(e)}catch(i){PN(r,"throw",i)}},xN=be,RN=ra,AN=xN("iterator"),DN=Array.prototype,Uw=function(r){return r!==void 0&&(RN.Array===r||DN[AN]===r)},MN=Dr,Sg=pf,NN=Kn,FN=ra,BN=be,LN=BN("iterator"),tu=function(r){if(!NN(r))return Sg(r,LN)||Sg(r,"@@iterator")||FN[MN(r)]},jN=He,zN=Et,HN=Dt,WN=Xn,UN=tu,VN=TypeError,Af=function(r,n){var e=arguments.length<2?UN(r):n;if(zN(e))return HN(jN(e,r));throw new VN(WN(r)+" is not iterable")},GN=ai,KN=He,qN=St,YN=CN,XN=Uw,ZN=zl,QN=Mt,Og=Qn,JN=Af,e2=tu,Tg=Array,t2=function(n){var e=qN(n),t=ZN(this),i=arguments.length,a=i>1?arguments[1]:void 0,o=a!==void 0;o&&(a=GN(a,i>2?arguments[2]:void 0));var s=e2(e),l=0,u,d,h,c,f,v;if(s&&!(this===Tg&&XN(s)))for(c=JN(e,s),f=c.next,d=t?new this:[];!(h=KN(f,c)).done;l++)v=o?YN(c,a,[h.value,l],!0):h.value,Og(d,l,v);else for(u=QN(e),d=t?new this(u):Tg(u);u>l;l++)v=o?a(e[l],l):e[l],Og(d,l,v);return d.length=l,d},r2=be,Vw=r2("iterator"),Gw=!1;try{var i2=0,Ig={next:function(){return{done:!!i2++}},return:function(){Gw=!0}};Ig[Vw]=function(){return this},Array.from(Ig,function(){throw 2})}catch{}var Kw=function(r,n){try{if(!n&&!Gw)return!1}catch{return!1}var e=!1;try{var t={};t[Vw]=function(){return{next:function(){return{done:e=!0}}}},r(t)}catch{}return e},n2=W,a2=t2,o2=Kw,s2=!o2(function(r){Array.from(r)});n2({target:"Array",stat:!0,forced:s2},{from:a2});var l2=ye,u2=l2.Array.from,d2=u2,qw=d2,h2=qw,Df=G(h2),c2=tu,f2=c2,v2=f2,p2=v2,g2=p2,y2=g2,m2=y2,b2=m2,Yw=b2,Xw=G(Yw),$2=Yw,Mf=G($2),w2=W,_2=oi;w2({target:"Array",stat:!0},{isArray:_2});var E2=ye,S2=E2.Array.isArray,O2=S2,Zw=O2,T2=Zw,I2=T2,k2=I2,P2=k2,C2=P2,Qw=G(C2);function x2(r){if(Qw(r))return r}var R2=ze,A2=oi,D2=TypeError,M2=Object.getOwnPropertyDescriptor,N2=R2&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}(),Jw=N2?function(r,n){if(A2(r)&&!M2(r,"length").writable)throw new D2("Cannot set read only .length");return r.length=n}:function(r,n){return r.length=n},F2=W,B2=St,L2=Mt,j2=Jw,z2=jl,H2=oe,W2=H2(function(){return[].push.call({length:4294967296},1)!==4294967297}),U2=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}},V2=W2||!U2();F2({target:"Array",proto:!0,arity:1,forced:V2},{push:function(n){var e=B2(this),t=L2(e),i=arguments.length;z2(t+i);for(var a=0;a<i;a++)e[t]=arguments[a],t++;return j2(e,t),t}});var G2=nt,K2=G2("Array","push"),q2=Ne,Y2=K2,gd=Array.prototype,X2=function(r){var n=r.push;return r===gd||q2(gd,r)&&n===gd.push?Y2:n},Z2=X2,Q2=Z2,J2=Q2,eF=J2,tF=eF,rF=tF,e0=rF,iF=G(e0);function nF(r,n){var e=r==null?null:typeof yn<"u"&&Xw(r)||r["@@iterator"];if(e!=null){var t,i,a,o,s=[],l=!0,u=!1;try{if(a=(e=e.call(r)).next,n===0){if(Object(e)!==e)return;l=!1}else for(;!(l=(t=a.call(e)).done)&&(iF(s).call(s,t.value),s.length!==n);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}var aF=W,kg=oi,oF=zl,sF=Qe,Pg=Ul,lF=Mt,uF=fr,dF=Qn,hF=be,cF=uo,fF=yo,vF=cF("slice"),pF=hF("species"),yd=Array,gF=Math.max;aF({target:"Array",proto:!0,forced:!vF},{slice:function(n,e){var t=uF(this),i=lF(t),a=Pg(n,i),o=Pg(e===void 0?i:e,i),s,l,u;if(kg(t)&&(s=t.constructor,oF(s)&&(s===yd||kg(s.prototype))?s=void 0:sF(s)&&(s=s[pF],s===null&&(s=void 0)),s===yd||s===void 0))return fF(t,a,o);for(l=new(s===void 0?yd:s)(gF(o-a,0)),u=0;a<o;a++,u++)a in t&&dF(l,u,t[a]);return l.length=u,l}});var yF=nt,mF=yF("Array","slice"),bF=Ne,$F=mF,md=Array.prototype,wF=function(r){var n=r.slice;return r===md||bF(md,r)&&n===md.slice?$F:n},_F=wF,t0=_F,EF=t0,SF=EF,OF=SF,TF=OF,r0=TF,IF=G(r0),kF=qw,PF=kF,CF=PF,xF=CF,RF=xF,i0=G(RF);function fc(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}function n0(r,n){var e;if(r){if(typeof r=="string")return fc(r,n);var t=IF(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return i0(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fc(r,n)}}function AF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vt(r,n){return x2(r)||nF(r,n)||n0(r,n)||AF()}function DF(r){if(Qw(r))return fc(r)}function MF(r){if(typeof yn<"u"&&Xw(r)!=null||r["@@iterator"]!=null)return i0(r)}function NF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mt(r){return DF(r)||MF(r)||n0(r)||NF()}var FF=Iw,ru=G(FF),BF=nt,LF=BF("Array","concat"),jF=Ne,zF=LF,bd=Array.prototype,HF=function(r){var n=r.concat;return r===bd||jF(bd,r)&&n===bd.concat?zF:n},WF=HF,UF=WF,VF=UF,iu=G(VF),GF=t0,nu=G(GF),KF=ct,qF=pe,YF=co,XF=fo,ZF=Dt,QF=qF([].concat),Nf=KF("Reflect","ownKeys")||function(n){var e=YF.f(ZF(n)),t=XF.f;return t?QF(e,t(n)):e},JF=W,eB=Nf;JF({target:"Reflect",stat:!0},{ownKeys:eB});var tB=ye,rB=tB.Reflect.ownKeys,iB=rB,nB=iB,aB=nB,oB=G(aB),sB=Zw,Rt=G(sB),lB=W,uB=St,a0=Vl,dB=oe,hB=dB(function(){a0(1)});lB({target:"Object",stat:!0,forced:hB},{keys:function(n){return a0(uB(n))}});var cB=ye,fB=cB.Object.keys,vB=fB,pB=vB,gB=pB,Ff=G(gB),yB=ta.forEach,mB=eu,bB=mB("forEach"),$B=bB?[].forEach:function(n){return yB(this,n,arguments.length>1?arguments[1]:void 0)},wB=W,Cg=$B;wB({target:"Array",proto:!0,forced:[].forEach!==Cg},{forEach:Cg});var _B=nt,EB=_B("Array","forEach"),SB=EB,OB=SB,TB=Dr,IB=Fe,kB=Ne,PB=OB,$d=Array.prototype,CB={DOMTokenList:!0,NodeList:!0},o0=function(r){var n=r.forEach;return r===$d||kB($d,r)&&n===$d.forEach||IB(CB,TB(r))?PB:n},xB=o0,Ci=G(xB),RB=W,AB=pe,DB=oi,MB=AB([].reverse),xg=[1,2];RB({target:"Array",proto:!0,forced:String(xg)===String(xg.reverse())},{reverse:function(){return DB(this)&&(this.length=this.length),MB(this)}});var NB=nt,FB=NB("Array","reverse"),BB=Ne,LB=FB,wd=Array.prototype,jB=function(r){var n=r.reverse;return r===wd||BB(wd,r)&&n===wd.reverse?LB:n},zB=jB,s0=zB,HB=s0,WB=G(HB),Rg=Xn,UB=TypeError,l0=function(r,n){if(!delete r[n])throw new UB("Cannot delete property "+Rg(n)+" of "+Rg(r))},VB=W,GB=St,KB=Ul,qB=Ll,YB=Mt,XB=Jw,ZB=jl,QB=Hl,JB=Qn,_d=l0,eL=uo,tL=eL("splice"),rL=Math.max,iL=Math.min;VB({target:"Array",proto:!0,forced:!tL},{splice:function(n,e){var t=GB(this),i=YB(t),a=KB(n,i),o=arguments.length,s,l,u,d,h,c;for(o===0?s=l=0:o===1?(s=0,l=i-a):(s=o-2,l=iL(rL(qB(e),0),i-a)),ZB(i+s-l),u=QB(t,l),d=0;d<l;d++)h=a+d,h in t&&JB(u,d,t[h]);if(u.length=l,s<l){for(d=a;d<i-l;d++)h=d+l,c=d+s,h in t?t[c]=t[h]:_d(t,c);for(d=i;d>i-l+s;d--)_d(t,d-1)}else if(s>l)for(d=i-l;d>a;d--)h=d+l-1,c=d+s-1,h in t?t[c]=t[h]:_d(t,c);for(d=0;d<s;d++)t[d+a]=arguments[d+2];return XB(t,i-l+s),u}});var nL=nt,aL=nL("Array","splice"),oL=Ne,sL=aL,Ed=Array.prototype,lL=function(r){var n=r.splice;return r===Ed||oL(Ed,r)&&n===Ed.splice?sL:n},uL=lL,dL=uL,hL=dL,u0=G(hL),Ag=ze,cL=pe,fL=He,vL=oe,Sd=Vl,pL=fo,gL=Dl,yL=St,mL=Ml,on=Object.assign,Dg=Object.defineProperty,bL=cL([].concat),$L=!on||vL(function(){if(Ag&&on({b:1},on(Dg({},"a",{enumerable:!0,get:function(){Dg(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},n={},e=Symbol("assign detection"),t="abcdefghijklmnopqrst";return r[e]=7,t.split("").forEach(function(i){n[i]=i}),on({},r)[e]!==7||Sd(on({},n)).join("")!==t})?function(n,e){for(var t=yL(n),i=arguments.length,a=1,o=pL.f,s=gL.f;i>a;)for(var l=mL(arguments[a++]),u=o?bL(Sd(l),o(l)):Sd(l),d=u.length,h=0,c;d>h;)c=u[h++],(!Ag||fL(s,l,c))&&(t[c]=l[c]);return t}:on,wL=W,Mg=$L;wL({target:"Object",stat:!0,arity:2,forced:Object.assign!==Mg},{assign:Mg});var _L=ye,EL=_L.Object.assign,SL=EL,OL=SL,TL=OL,IL=G(TL),kL=W,PL=oe,CL=St,d0=Ql,xL=ww,RL=PL(function(){d0(1)});kL({target:"Object",stat:!0,forced:RL,sham:!xL},{getPrototypeOf:function(n){return d0(CL(n))}});var AL=ye,DL=AL.Object.getPrototypeOf,ML=DL,NL=ML,FL=W,BL=ze,LL=Hi;FL({target:"Object",stat:!0,sham:!BL},{create:LL});var jL=ye,zL=jL.Object,HL=function(n,e){return zL.create(n,e)},WL=HL,h0=WL,UL=h0,VL=G(UL),vc=ye,GL=Gn;vc.JSON||(vc.JSON={stringify:JSON.stringify});var KL=function(n,e,t){return GL(vc.JSON.stringify,null,arguments)},qL=KL,YL=qL,XL=YL,ZL=G(XL),QL=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",JL=TypeError,c0=function(r,n){if(r<n)throw new JL("Not enough arguments");return r},f0=ge,ej=Gn,tj=_e,rj=QL,ij=ni,nj=yo,aj=c0,oj=f0.Function,sj=/MSIE .\./.test(ij)||rj&&function(){var r=f0.Bun.version.split(".");return r.length<3||r[0]==="0"&&(r[1]<3||r[1]==="3"&&r[2]==="0")}(),v0=function(r,n){var e=n?2:1;return sj?function(t,i){var a=aj(arguments.length,1)>e,o=tj(t)?t:oj(t),s=a?nj(arguments,e):[],l=a?function(){ej(o,this,s)}:o;return n?r(l,i):r(l)}:r},lj=W,p0=ge,uj=v0,Ng=uj(p0.setInterval,!0);lj({global:!0,bind:!0,forced:p0.setInterval!==Ng},{setInterval:Ng});var dj=W,g0=ge,hj=v0,Fg=hj(g0.setTimeout,!0);dj({global:!0,bind:!0,forced:g0.setTimeout!==Fg},{setTimeout:Fg});var cj=ye,fj=cj.setTimeout,vj=fj,pj=G(vj),y0={exports:{}};(function(r){function n(t){if(t)return e(t);this._callbacks=new Map}function e(t){return Object.assign(t,n.prototype),t._callbacks=new Map,t}n.prototype.on=function(t,i){const a=this._callbacks.get(t)??[];return a.push(i),this._callbacks.set(t,a),this},n.prototype.once=function(t,i){const a=(...o)=>{this.off(t,a),i.apply(this,o)};return a.fn=i,this.on(t,a),this},n.prototype.off=function(t,i){if(t===void 0&&i===void 0)return this._callbacks.clear(),this;if(i===void 0)return this._callbacks.delete(t),this;const a=this._callbacks.get(t);if(a){for(const[o,s]of a.entries())if(s===i||s.fn===i){a.splice(o,1);break}a.length===0?this._callbacks.delete(t):this._callbacks.set(t,a)}return this},n.prototype.emit=function(t,...i){const a=this._callbacks.get(t);if(a){const o=[...a];for(const s of o)s.apply(this,i)}return this},n.prototype.listeners=function(t){return this._callbacks.get(t)??[]},n.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let i=0;for(const a of this._callbacks.values())i+=a.length;return i},n.prototype.hasListeners=function(t){return this.listenerCount(t)>0},n.prototype.addEventListener=n.prototype.on,n.prototype.removeListener=n.prototype.off,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeAllListeners=n.prototype.off,r.exports=n})(y0);var gj=y0.exports,yj=G(gj);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
 * http://naver.github.io/egjs
 *
 * Forked By Naver egjs
 * Copyright (c) hammerjs
 * Licensed under the MIT license */function er(){return er=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},er.apply(this,arguments)}function Ut(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}function fs(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var pc;typeof Object.assign!="function"?pc=function(n){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(n),t=1;t<arguments.length;t++){var i=arguments[t];if(i!=null)for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}:pc=Object.assign;var xi=pc,Bg=["","webkit","Moz","MS","ms","o"],mj=typeof document>"u"?{style:{}}:document.createElement("div"),bj="function",bn=Math.round,Ri=Math.abs,Bf=Date.now;function au(r,n){for(var e,t,i=n[0].toUpperCase()+n.slice(1),a=0;a<Bg.length;){if(e=Bg[a],t=e?e+i:n,t in r)return t;a++}}var wr;typeof window>"u"?wr={}:wr=window;var m0=au(mj.style,"touchAction"),b0=m0!==void 0;function $j(){if(!b0)return!1;var r={},n=wr.CSS&&wr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return r[e]=n?wr.CSS.supports("touch-action",e):!0}),r}var $0="compute",w0="auto",gc="manipulation",_i="none",Ga="pan-x",Ka="pan-y",vs=$j(),wj=/mobile|tablet|ip(ad|hone|od)|android/i,_0="ontouchstart"in wr,_j=au(wr,"PointerEvent")!==void 0,Ej=_0&&wj.test(navigator.userAgent),$o="touch",Sj="pen",Lf="mouse",Oj="kinect",Tj=25,dt=1,Ui=2,Ae=4,wt=8,hl=1,wo=2,_o=4,Eo=8,Mn=16,dr=wo|_o,Ei=Eo|Mn,E0=dr|Ei,S0=["x","y"],cl=["clientX","clientY"];function _r(r,n,e){var t;if(r)if(r.forEach)r.forEach(n,e);else if(r.length!==void 0)for(t=0;t<r.length;)n.call(e,r[t],t,r),t++;else for(t in r)r.hasOwnProperty(t)&&n.call(e,r[t],t,r)}function ou(r,n){return typeof r===bj?r.apply(n&&n[0]||void 0,n):r}function yi(r,n){return r.indexOf(n)>-1}function Ij(r){if(yi(r,_i))return _i;var n=yi(r,Ga),e=yi(r,Ka);return n&&e?_i:n||e?n?Ga:Ka:yi(r,gc)?gc:w0}var O0=function(){function r(e,t){this.manager=e,this.set(t)}var n=r.prototype;return n.set=function(t){t===$0&&(t=this.compute()),b0&&this.manager.element.style&&vs[t]&&(this.manager.element.style[m0]=t),this.actions=t.toLowerCase().trim()},n.update=function(){this.set(this.manager.options.touchAction)},n.compute=function(){var t=[];return _r(this.manager.recognizers,function(i){ou(i.options.enable,[i])&&(t=t.concat(i.getTouchAction()))}),Ij(t.join(" "))},n.preventDefaults=function(t){var i=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){i.preventDefault();return}var o=this.actions,s=yi(o,_i)&&!vs[_i],l=yi(o,Ka)&&!vs[Ka],u=yi(o,Ga)&&!vs[Ga];if(s){var d=t.pointers.length===1,h=t.distance<2,c=t.deltaTime<250;if(d&&h&&c)return}if(!(u&&l)&&(s||l&&a&dr||u&&a&Ei))return this.preventSrc(i)},n.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},r}();function jf(r,n){for(;r;){if(r===n)return!0;r=r.parentNode}return!1}function T0(r){var n=r.length;if(n===1)return{x:bn(r[0].clientX),y:bn(r[0].clientY)};for(var e=0,t=0,i=0;i<n;)e+=r[i].clientX,t+=r[i].clientY,i++;return{x:bn(e/n),y:bn(t/n)}}function Lg(r){for(var n=[],e=0;e<r.pointers.length;)n[e]={clientX:bn(r.pointers[e].clientX),clientY:bn(r.pointers[e].clientY)},e++;return{timeStamp:Bf(),pointers:n,center:T0(n),deltaX:r.deltaX,deltaY:r.deltaY}}function fl(r,n,e){e||(e=S0);var t=n[e[0]]-r[e[0]],i=n[e[1]]-r[e[1]];return Math.sqrt(t*t+i*i)}function yc(r,n,e){e||(e=S0);var t=n[e[0]]-r[e[0]],i=n[e[1]]-r[e[1]];return Math.atan2(i,t)*180/Math.PI}function I0(r,n){return r===n?hl:Ri(r)>=Ri(n)?r<0?wo:_o:n<0?Eo:Mn}function kj(r,n){var e=n.center,t=r.offsetDelta||{},i=r.prevDelta||{},a=r.prevInput||{};(n.eventType===dt||a.eventType===Ae)&&(i=r.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=r.offsetDelta={x:e.x,y:e.y}),n.deltaX=i.x+(e.x-t.x),n.deltaY=i.y+(e.y-t.y)}function k0(r,n,e){return{x:n/r||0,y:e/r||0}}function Pj(r,n){return fl(n[0],n[1],cl)/fl(r[0],r[1],cl)}function Cj(r,n){return yc(n[1],n[0],cl)+yc(r[1],r[0],cl)}function xj(r,n){var e=r.lastInterval||n,t=n.timeStamp-e.timeStamp,i,a,o,s;if(n.eventType!==wt&&(t>Tj||e.velocity===void 0)){var l=n.deltaX-e.deltaX,u=n.deltaY-e.deltaY,d=k0(t,l,u);a=d.x,o=d.y,i=Ri(d.x)>Ri(d.y)?d.x:d.y,s=I0(l,u),r.lastInterval=n}else i=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;n.velocity=i,n.velocityX=a,n.velocityY=o,n.direction=s}function Rj(r,n){var e=r.session,t=n.pointers,i=t.length;e.firstInput||(e.firstInput=Lg(n)),i>1&&!e.firstMultiple?e.firstMultiple=Lg(n):i===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,l=n.center=T0(t);n.timeStamp=Bf(),n.deltaTime=n.timeStamp-a.timeStamp,n.angle=yc(s,l),n.distance=fl(s,l),kj(e,n),n.offsetDirection=I0(n.deltaX,n.deltaY);var u=k0(n.deltaTime,n.deltaX,n.deltaY);n.overallVelocityX=u.x,n.overallVelocityY=u.y,n.overallVelocity=Ri(u.x)>Ri(u.y)?u.x:u.y,n.scale=o?Pj(o.pointers,t):1,n.rotation=o?Cj(o.pointers,t):0,n.maxPointers=e.prevInput?n.pointers.length>e.prevInput.maxPointers?n.pointers.length:e.prevInput.maxPointers:n.pointers.length,xj(e,n);var d=r.element,h=n.srcEvent,c;h.composedPath?c=h.composedPath()[0]:h.path?c=h.path[0]:c=h.target,jf(c,d)&&(d=c),n.target=d}function Aj(r,n,e){var t=e.pointers.length,i=e.changedPointers.length,a=n&dt&&t-i===0,o=n&(Ae|wt)&&t-i===0;e.isFirst=!!a,e.isFinal=!!o,a&&(r.session={}),e.eventType=n,Rj(r,e),r.emit("hammer.input",e),r.recognize(e),r.session.prevInput=e}function qa(r){return r.trim().split(/\s+/g)}function Ra(r,n,e){_r(qa(n),function(t){r.addEventListener(t,e,!1)})}function Aa(r,n,e){_r(qa(n),function(t){r.removeEventListener(t,e,!1)})}function jg(r){var n=r.ownerDocument||r;return n.defaultView||n.parentWindow||window}var ia=function(){function r(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){ou(e.options.enable,[e])&&i.handler(a)},this.init()}var n=r.prototype;return n.handler=function(){},n.init=function(){this.evEl&&Ra(this.element,this.evEl,this.domHandler),this.evTarget&&Ra(this.target,this.evTarget,this.domHandler),this.evWin&&Ra(jg(this.element),this.evWin,this.domHandler)},n.destroy=function(){this.evEl&&Aa(this.element,this.evEl,this.domHandler),this.evTarget&&Aa(this.target,this.evTarget,this.domHandler),this.evWin&&Aa(jg(this.element),this.evWin,this.domHandler)},r}();function Ai(r,n,e){if(r.indexOf&&!e)return r.indexOf(n);for(var t=0;t<r.length;){if(e&&r[t][e]==n||!e&&r[t]===n)return t;t++}return-1}var Dj={pointerdown:dt,pointermove:Ui,pointerup:Ae,pointercancel:wt,pointerout:wt},Mj={2:$o,3:Sj,4:Lf,5:Oj},P0="pointerdown",C0="pointermove pointerup pointercancel";wr.MSPointerEvent&&!wr.PointerEvent&&(P0="MSPointerDown",C0="MSPointerMove MSPointerUp MSPointerCancel");var x0=function(r){Ut(n,r);function n(){var t,i=n.prototype;return i.evEl=P0,i.evWin=C0,t=r.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var e=n.prototype;return e.handler=function(i){var a=this.store,o=!1,s=i.type.toLowerCase().replace("ms",""),l=Dj[s],u=Mj[i.pointerType]||i.pointerType,d=u===$o,h=Ai(a,i.pointerId,"pointerId");l&dt&&(i.button===0||d)?h<0&&(a.push(i),h=a.length-1):l&(Ae|wt)&&(o=!0),!(h<0)&&(a[h]=i,this.callback(this.manager,l,{pointers:a,changedPointers:[i],pointerType:u,srcEvent:i}),o&&a.splice(h,1))},n}(ia);function Ya(r){return Array.prototype.slice.call(r,0)}function zf(r,n,e){for(var t=[],i=[],a=0;a<r.length;){var o=n?r[a][n]:r[a];Ai(i,o)<0&&t.push(r[a]),i[a]=o,a++}return e&&(n?t=t.sort(function(s,l){return s[n]>l[n]}):t=t.sort()),t}var Nj={touchstart:dt,touchmove:Ui,touchend:Ae,touchcancel:wt},Fj="touchstart touchmove touchend touchcancel",Hf=function(r){Ut(n,r);function n(){var t;return n.prototype.evTarget=Fj,t=r.apply(this,arguments)||this,t.targetIds={},t}var e=n.prototype;return e.handler=function(i){var a=Nj[i.type],o=Bj.call(this,i,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:$o,srcEvent:i})},n}(ia);function Bj(r,n){var e=Ya(r.touches),t=this.targetIds;if(n&(dt|Ui)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var i,a,o=Ya(r.changedTouches),s=[],l=this.target;if(a=e.filter(function(u){return jf(u.target,l)}),n===dt)for(i=0;i<a.length;)t[a[i].identifier]=!0,i++;for(i=0;i<o.length;)t[o[i].identifier]&&s.push(o[i]),n&(Ae|wt)&&delete t[o[i].identifier],i++;if(s.length)return[zf(a.concat(s),"identifier",!0),s]}var Lj={mousedown:dt,mousemove:Ui,mouseup:Ae},jj="mousedown",zj="mousemove mouseup",Wf=function(r){Ut(n,r);function n(){var t,i=n.prototype;return i.evEl=jj,i.evWin=zj,t=r.apply(this,arguments)||this,t.pressed=!1,t}var e=n.prototype;return e.handler=function(i){var a=Lj[i.type];a&dt&&i.button===0&&(this.pressed=!0),a&Ui&&i.which!==1&&(a=Ae),this.pressed&&(a&Ae&&(this.pressed=!1),this.callback(this.manager,a,{pointers:[i],changedPointers:[i],pointerType:Lf,srcEvent:i}))},n}(ia),Hj=2500,zg=25;function Hg(r){var n=r.changedPointers,e=n[0];if(e.identifier===this.primaryTouch){var t={x:e.clientX,y:e.clientY},i=this.lastTouches;this.lastTouches.push(t);var a=function(){var s=i.indexOf(t);s>-1&&i.splice(s,1)};setTimeout(a,Hj)}}function Wj(r,n){r&dt?(this.primaryTouch=n.changedPointers[0].identifier,Hg.call(this,n)):r&(Ae|wt)&&Hg.call(this,n)}function Uj(r){for(var n=r.srcEvent.clientX,e=r.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var i=this.lastTouches[t],a=Math.abs(n-i.x),o=Math.abs(e-i.y);if(a<=zg&&o<=zg)return!0}return!1}var R0=function(){var r=function(n){Ut(e,n);function e(i,a){var o;return o=n.call(this,i,a)||this,o.handler=function(s,l,u){var d=u.pointerType===$o,h=u.pointerType===Lf;if(!(h&&u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents)){if(d)Wj.call(fs(fs(o)),l,u);else if(h&&Uj.call(fs(fs(o)),u))return;o.callback(s,l,u)}},o.touch=new Hf(o.manager,o.handler),o.mouse=new Wf(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var t=e.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(ia);return r}();function Vj(r){var n,e=r.options.inputClass;return e?n=e:_j?n=x0:Ej?n=Hf:_0?n=R0:n=Wf,new n(r,Aj)}function $n(r,n,e){return Array.isArray(r)?(_r(r,e[n],e),!0):!1}var Vs=1,Ht=2,Nn=4,qr=8,Er=qr,Xa=16,sr=32,Gj=1;function Kj(){return Gj++}function ps(r,n){var e=n.manager;return e?e.get(r):r}function Wg(r){return r&Xa?"cancel":r&qr?"end":r&Nn?"move":r&Ht?"start":""}var So=function(){function r(e){e===void 0&&(e={}),this.options=er({enable:!0},e),this.id=Kj(),this.manager=null,this.state=Vs,this.simultaneous={},this.requireFail=[]}var n=r.prototype;return n.set=function(t){return xi(this.options,t),this.manager&&this.manager.touchAction.update(),this},n.recognizeWith=function(t){if($n(t,"recognizeWith",this))return this;var i=this.simultaneous;return t=ps(t,this),i[t.id]||(i[t.id]=t,t.recognizeWith(this)),this},n.dropRecognizeWith=function(t){return $n(t,"dropRecognizeWith",this)?this:(t=ps(t,this),delete this.simultaneous[t.id],this)},n.requireFailure=function(t){if($n(t,"requireFailure",this))return this;var i=this.requireFail;return t=ps(t,this),Ai(i,t)===-1&&(i.push(t),t.requireFailure(this)),this},n.dropRequireFailure=function(t){if($n(t,"dropRequireFailure",this))return this;t=ps(t,this);var i=Ai(this.requireFail,t);return i>-1&&this.requireFail.splice(i,1),this},n.hasRequireFailures=function(){return this.requireFail.length>0},n.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},n.emit=function(t){var i=this,a=this.state;function o(s){i.manager.emit(s,t)}a<qr&&o(i.options.event+Wg(a)),o(i.options.event),t.additionalEvent&&o(t.additionalEvent),a>=qr&&o(i.options.event+Wg(a))},n.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=sr},n.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(sr|Vs)))return!1;t++}return!0},n.recognize=function(t){var i=xi({},t);if(!ou(this.options.enable,[this,i])){this.reset(),this.state=sr;return}this.state&(Er|Xa|sr)&&(this.state=Vs),this.state=this.process(i),this.state&(Ht|Nn|qr|Xa)&&this.tryEmit(i)},n.process=function(t){},n.getTouchAction=function(){},n.reset=function(){},r}(),mc=function(r){Ut(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,er({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,i.pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}var e=n.prototype;return e.getTouchAction=function(){return[gc]},e.process=function(i){var a=this,o=this.options,s=i.pointers.length===o.pointers,l=i.distance<o.threshold,u=i.deltaTime<o.time;if(this.reset(),i.eventType&dt&&this.count===0)return this.failTimeout();if(l&&u&&s){if(i.eventType!==Ae)return this.failTimeout();var d=this.pTime?i.timeStamp-this.pTime<o.interval:!0,h=!this.pCenter||fl(this.pCenter,i.center)<o.posThreshold;this.pTime=i.timeStamp,this.pCenter=i.center,!h||!d?this.count=1:this.count+=1,this._input=i;var c=this.count%o.taps;if(c===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){a.state=Er,a.tryEmit()},o.interval),Ht):Er}return sr},e.failTimeout=function(){var i=this;return this._timer=setTimeout(function(){i.state=sr},this.options.interval),sr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){this.state===Er&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},n}(So),Fn=function(r){Ut(n,r);function n(t){return t===void 0&&(t={}),r.call(this,er({pointers:1},t))||this}var e=n.prototype;return e.attrTest=function(i){var a=this.options.pointers;return a===0||i.pointers.length===a},e.process=function(i){var a=this.state,o=i.eventType,s=a&(Ht|Nn),l=this.attrTest(i);return s&&(o&wt||!l)?a|Xa:s||l?o&Ae?a|qr:a&Ht?a|Nn:Ht:sr},n}(So);function A0(r){return r===Mn?"down":r===Eo?"up":r===wo?"left":r===_o?"right":""}var Uf=function(r){Ut(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,er({event:"pan",threshold:10,pointers:1,direction:E0},t))||this,i.pX=null,i.pY=null,i}var e=n.prototype;return e.getTouchAction=function(){var i=this.options.direction,a=[];return i&dr&&a.push(Ka),i&Ei&&a.push(Ga),a},e.directionTest=function(i){var a=this.options,o=!0,s=i.distance,l=i.direction,u=i.deltaX,d=i.deltaY;return l&a.direction||(a.direction&dr?(l=u===0?hl:u<0?wo:_o,o=u!==this.pX,s=Math.abs(i.deltaX)):(l=d===0?hl:d<0?Eo:Mn,o=d!==this.pY,s=Math.abs(i.deltaY))),i.direction=l,o&&s>a.threshold&&l&a.direction},e.attrTest=function(i){return Fn.prototype.attrTest.call(this,i)&&(this.state&Ht||!(this.state&Ht)&&this.directionTest(i))},e.emit=function(i){this.pX=i.deltaX,this.pY=i.deltaY;var a=A0(i.direction);a&&(i.additionalEvent=this.options.event+a),r.prototype.emit.call(this,i)},n}(Fn),D0=function(r){Ut(n,r);function n(t){return t===void 0&&(t={}),r.call(this,er({event:"swipe",threshold:10,velocity:.3,direction:dr|Ei,pointers:1},t))||this}var e=n.prototype;return e.getTouchAction=function(){return Uf.prototype.getTouchAction.call(this)},e.attrTest=function(i){var a=this.options.direction,o;return a&(dr|Ei)?o=i.overallVelocity:a&dr?o=i.overallVelocityX:a&Ei&&(o=i.overallVelocityY),r.prototype.attrTest.call(this,i)&&a&i.offsetDirection&&i.distance>this.options.threshold&&i.maxPointers===this.options.pointers&&Ri(o)>this.options.velocity&&i.eventType&Ae},e.emit=function(i){var a=A0(i.offsetDirection);a&&this.manager.emit(this.options.event+a,i),this.manager.emit(this.options.event,i)},n}(Fn),M0=function(r){Ut(n,r);function n(t){return t===void 0&&(t={}),r.call(this,er({event:"pinch",threshold:0,pointers:2},t))||this}var e=n.prototype;return e.getTouchAction=function(){return[_i]},e.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.scale-1)>this.options.threshold||this.state&Ht)},e.emit=function(i){if(i.scale!==1){var a=i.scale<1?"in":"out";i.additionalEvent=this.options.event+a}r.prototype.emit.call(this,i)},n}(Fn),N0=function(r){Ut(n,r);function n(t){return t===void 0&&(t={}),r.call(this,er({event:"rotate",threshold:0,pointers:2},t))||this}var e=n.prototype;return e.getTouchAction=function(){return[_i]},e.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.rotation)>this.options.threshold||this.state&Ht)},n}(Fn),F0=function(r){Ut(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,er({event:"press",pointers:1,time:251,threshold:9},t))||this,i._timer=null,i._input=null,i}var e=n.prototype;return e.getTouchAction=function(){return[w0]},e.process=function(i){var a=this,o=this.options,s=i.pointers.length===o.pointers,l=i.distance<o.threshold,u=i.deltaTime>o.time;if(this._input=i,!l||!s||i.eventType&(Ae|wt)&&!u)this.reset();else if(i.eventType&dt)this.reset(),this._timer=setTimeout(function(){a.state=Er,a.tryEmit()},o.time);else if(i.eventType&Ae)return Er;return sr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(i){this.state===Er&&(i&&i.eventType&Ae?this.manager.emit(this.options.event+"up",i):(this._input.timeStamp=Bf(),this.manager.emit(this.options.event,this._input)))},n}(So),B0={domEvents:!1,touchAction:$0,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ug=[[N0,{enable:!1}],[M0,{enable:!1},["rotate"]],[D0,{direction:dr}],[Uf,{direction:dr},["swipe"]],[mc],[mc,{event:"doubletap",taps:2},["tap"]],[F0]],qj=1,Vg=2;function Gg(r,n){var e=r.element;if(e.style){var t;_r(r.options.cssProps,function(i,a){t=au(e.style,a),n?(r.oldCssProps[t]=e.style[t],e.style[t]=i):e.style[t]=r.oldCssProps[t]||""}),n||(r.oldCssProps={})}}function Yj(r,n){var e=document.createEvent("Event");e.initEvent(r,!0,!0),e.gesture=n,n.target.dispatchEvent(e)}var Kg=function(){function r(e,t){var i=this;this.options=xi({},B0,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=Vj(this),this.touchAction=new O0(this,this.options.touchAction),Gg(this,!0),_r(this.options.recognizers,function(a){var o=i.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var n=r.prototype;return n.set=function(t){return xi(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},n.stop=function(t){this.session.stopped=t?Vg:qj},n.recognize=function(t){var i=this.session;if(!i.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=i.curRecognizer;(!s||s&&s.state&Er)&&(i.curRecognizer=null,s=null);for(var l=0;l<o.length;)a=o[l],i.stopped!==Vg&&(!s||a===s||a.canRecognizeWith(s))?a.recognize(t):a.reset(),!s&&a.state&(Ht|Nn|qr)&&(i.curRecognizer=a,s=a),l++}},n.get=function(t){if(t instanceof So)return t;for(var i=this.recognizers,a=0;a<i.length;a++)if(i[a].options.event===t)return i[a];return null},n.add=function(t){if($n(t,"add",this))return this;var i=this.get(t.options.event);return i&&this.remove(i),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},n.remove=function(t){if($n(t,"remove",this))return this;var i=this.get(t);if(t){var a=this.recognizers,o=Ai(a,i);o!==-1&&(a.splice(o,1),this.touchAction.update())}return this},n.on=function(t,i){if(t===void 0||i===void 0)return this;var a=this.handlers;return _r(qa(t),function(o){a[o]=a[o]||[],a[o].push(i)}),this},n.off=function(t,i){if(t===void 0)return this;var a=this.handlers;return _r(qa(t),function(o){i?a[o]&&a[o].splice(Ai(a[o],i),1):delete a[o]}),this},n.emit=function(t,i){this.options.domEvents&&Yj(t,i);var a=this.handlers[t]&&this.handlers[t].slice();if(!(!a||!a.length)){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var o=0;o<a.length;)a[o](i),o++}},n.destroy=function(){this.element&&Gg(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},r}(),Xj={touchstart:dt,touchmove:Ui,touchend:Ae,touchcancel:wt},Zj="touchstart",Qj="touchstart touchmove touchend touchcancel",Jj=function(r){Ut(n,r);function n(){var t,i=n.prototype;return i.evTarget=Zj,i.evWin=Qj,t=r.apply(this,arguments)||this,t.started=!1,t}var e=n.prototype;return e.handler=function(i){var a=Xj[i.type];if(a===dt&&(this.started=!0),!!this.started){var o=ez.call(this,i,a);a&(Ae|wt)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:$o,srcEvent:i})}},n}(ia);function ez(r,n){var e=Ya(r.touches),t=Ya(r.changedTouches);return n&(Ae|wt)&&(e=zf(e.concat(t),"identifier",!0)),[e,t]}function L0(r,n,e){var t="DEPRECATED METHOD: "+n+`
`+e+` AT 
`;return function(){var i=new Error("get-stack-trace"),a=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),r.apply(this,arguments)}}var j0=L0(function(r,n,e){for(var t=Object.keys(n),i=0;i<t.length;)(!e||e&&r[t[i]]===void 0)&&(r[t[i]]=n[t[i]]),i++;return r},"extend","Use `assign`."),tz=L0(function(r,n){return j0(r,n,!0)},"merge","Use `assign`.");function rz(r,n,e){var t=n.prototype,i;i=r.prototype=Object.create(t),i.constructor=r,i._super=t,e&&xi(i,e)}function qg(r,n){return function(){return r.apply(n,arguments)}}var iz=function(){var r=function(e,t){return t===void 0&&(t={}),new Kg(e,er({recognizers:Ug.concat()},t))};return r.VERSION="2.0.17-rc",r.DIRECTION_ALL=E0,r.DIRECTION_DOWN=Mn,r.DIRECTION_LEFT=wo,r.DIRECTION_RIGHT=_o,r.DIRECTION_UP=Eo,r.DIRECTION_HORIZONTAL=dr,r.DIRECTION_VERTICAL=Ei,r.DIRECTION_NONE=hl,r.DIRECTION_DOWN=Mn,r.INPUT_START=dt,r.INPUT_MOVE=Ui,r.INPUT_END=Ae,r.INPUT_CANCEL=wt,r.STATE_POSSIBLE=Vs,r.STATE_BEGAN=Ht,r.STATE_CHANGED=Nn,r.STATE_ENDED=qr,r.STATE_RECOGNIZED=Er,r.STATE_CANCELLED=Xa,r.STATE_FAILED=sr,r.Manager=Kg,r.Input=ia,r.TouchAction=O0,r.TouchInput=Hf,r.MouseInput=Wf,r.PointerEventInput=x0,r.TouchMouseInput=R0,r.SingleTouchInput=Jj,r.Recognizer=So,r.AttrRecognizer=Fn,r.Tap=mc,r.Pan=Uf,r.Swipe=D0,r.Pinch=M0,r.Rotate=N0,r.Press=F0,r.on=Ra,r.off=Aa,r.each=_r,r.merge=tz,r.extend=j0,r.bindFn=qg,r.assign=xi,r.inherit=rz,r.bindFn=qg,r.prefixed=au,r.toArray=Ya,r.inArray=Ai,r.uniqueArray=zf,r.splitStr=qa,r.boolOrFn=ou,r.hasParent=jf,r.addEventListeners=Ra,r.removeEventListeners=Aa,r.defaults=xi({},B0,{preset:Ug}),r}(),nz=iz;function z0(r,n){var e=typeof ru<"u"&&Mf(r)||r["@@iterator"];if(!e){if(Rt(r)||(e=az(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function az(r,n){var e;if(r){if(typeof r=="string")return Yg(r,n);var t=nu(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Df(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Yg(r,n)}}function Yg(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var H0=ru("DELETE");function oz(r){for(var n,e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return W0.apply(void 0,iu(n=[{},r]).call(n,t))}function W0(){var r=vl.apply(void 0,arguments);return V0(r),r}function vl(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];if(n.length<2)return n[0];if(n.length>2){var t;return vl.apply(void 0,iu(t=[W0(n[0],n[1])]).call(t,mt(nu(n).call(n,2))))}var i=n[0],a=n[1];if(i instanceof Date&&a instanceof Date)return i.setTime(a.getTime()),i;var o=z0(oB(a)),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;Object.prototype.propertyIsEnumerable.call(a,l)&&(a[l]===H0?delete i[l]:i[l]!==null&&a[l]!==null&&typeof i[l]=="object"&&typeof a[l]=="object"&&!Rt(i[l])&&!Rt(a[l])?i[l]=vl(i[l],a[l]):i[l]=U0(a[l]))}}catch(u){o.e(u)}finally{o.f()}return i}function U0(r){return Rt(r)?Yt(r).call(r,function(n){return U0(n)}):typeof r=="object"&&r!==null?r instanceof Date?new Date(r.getTime()):vl({},r):r}function V0(r){for(var n=0,e=Ff(r);n<e.length;n++){var t=e[n];r[t]===H0?delete r[t]:typeof r[t]=="object"&&r[t]!==null&&V0(r[t])}}function sz(){var r=function(){};return{on:r,off:r,destroy:r,emit:r,get(){return{set:r}}}}var lz=typeof window<"u"?window.Hammer||nz:function(){return sz()};function br(r){var n=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:r,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)});var t=lz(this._dom.overlay);t.on("tap",zw(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){t.destroy()});var i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Ci(i).call(i,function(a){t.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){uz(a.target,r)||n.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",n._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&n.deactivate()}}yj(br.prototype);br.current=null;br.prototype.destroy=function(){var r,n;this.deactivate();var e=z0(WB(r=u0(n=this._cleanupQueue).call(n,0)).call(r)),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i()}}catch(a){e.e(a)}finally{e.f()}};br.prototype.activate=function(){br.current&&br.current.deactivate(),br.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)};br.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")};br.prototype._onTapOverlay=function(r){this.activate(),r.srcEvent.stopPropagation()};function uz(r,n){for(;r;){if(r===n)return!0;r=r.parentNode}return!1}var dz=zl,hz=Xn,cz=TypeError,G0=function(r){if(dz(r))return r;throw new cz(hz(r)+" is not a constructor")},fz=W,vz=ct,Od=Gn,pz=Lw,Xg=G0,gz=Dt,Zg=Qe,yz=Hi,K0=oe,Vf=vz("Reflect","construct"),mz=Object.prototype,bz=[].push,q0=K0(function(){function r(){}return!(Vf(function(){},[],r)instanceof r)}),Y0=!K0(function(){Vf(function(){})}),Qg=q0||Y0;fz({target:"Reflect",stat:!0,forced:Qg,sham:Qg},{construct:function(n,e){Xg(n),gz(e);var t=arguments.length<3?n:Xg(arguments[2]);if(Y0&&!q0)return Vf(n,e,t);if(n===t){switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3])}var i=[null];return Od(bz,i,e),new(Od(pz,n,i))}var a=t.prototype,o=yz(Zg(a)?a:mz),s=Od(n,o,e);return Zg(s)?s:o}});var $z=ye,wz=$z.Reflect.construct,_z=wz,Ez=_z,Sz=Ez,Gs=G(Sz),Oz=ye,Tz=Oz.Object.getOwnPropertySymbols,Iz=Tz,kz=Iz,Pz=kz,Jg=G(Pz),X0={exports:{}},Cz=W,xz=oe,Rz=fr,Z0=Li.f,Q0=ze,Az=!Q0||xz(function(){Z0(1)});Cz({target:"Object",stat:!0,forced:Az,sham:!Q0},{getOwnPropertyDescriptor:function(n,e){return Z0(Rz(n),e)}});var Dz=ye,J0=Dz.Object,Mz=X0.exports=function(n,e){return J0.getOwnPropertyDescriptor(n,e)};J0.getOwnPropertyDescriptor.sham&&(Mz.sham=!0);var Nz=X0.exports,Fz=Nz,Bz=Fz,Lz=Bz,e_=G(Lz),jz=W,zz=ze,Hz=Nf,Wz=fr,Uz=Li,Vz=Qn;jz({target:"Object",stat:!0,sham:!zz},{getOwnPropertyDescriptors:function(n){for(var e=Wz(n),t=Uz.f,i=Hz(e),a={},o=0,s,l;i.length>o;)l=t(e,s=i[o++]),l!==void 0&&Vz(a,s,l);return a}});var Gz=ye,Kz=Gz.Object.getOwnPropertyDescriptors,qz=Kz,Yz=qz,Xz=Yz,ey=G(Xz),t_={exports:{}},Zz=W,Qz=ze,ty=Wl.f;Zz({target:"Object",stat:!0,forced:Object.defineProperties!==ty,sham:!Qz},{defineProperties:ty});var Jz=ye,r_=Jz.Object,e3=t_.exports=function(n,e){return r_.defineProperties(n,e)};r_.defineProperties.sham&&(e3.sham=!0);var t3=t_.exports,r3=t3,i3=r3,n3=i3,a3=G(n3),o3=D1,s3=G(o3);function i_(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var l3=h0,u3=l3,d3=u3,h3=d3,n_=h3,c3=G(n_),f3=W,v3=Sw;f3({target:"Object",stat:!0},{setPrototypeOf:v3});var p3=ye,g3=p3.Object.setPrototypeOf,y3=g3,m3=y3,b3=m3,$3=b3,w3=$3,_3=w3,a_=_3,bc=G(a_),E3=jw,S3=E3,O3=S3,T3=O3,I3=T3,o_=G(I3);function $c(r,n){var e;return $c=bc?o_(e=bc).call(e):function(i,a){return i.__proto__=a,i},$c(r,n)}function k3(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=c3(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Bl(r,"prototype",{writable:!1}),n&&$c(r,n)}function P3(r,n){if(n&&(Dn(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i_(r)}var C3=NL,x3=C3,R3=x3,A3=R3,s_=A3,ry=G(s_);function pl(r){var n;return pl=bc?o_(n=ry).call(n):function(t){return t.__proto__||ry(t)},pl(r)}var l_={exports:{}},u_={exports:{}};(function(r){var n=xf,e=Mw;function t(i){"@babel/helpers - typeof";return r.exports=t=typeof n=="function"&&typeof e=="symbol"?function(a){return typeof a}:function(a){return a&&typeof n=="function"&&a.constructor===n&&a!==n.prototype?"symbol":typeof a},r.exports.__esModule=!0,r.exports.default=r.exports,t(i)}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(u_);var D3=u_.exports,M3=o0,N3=M3,F3=N3,B3=F3,L3=B3,iy=Fe,j3=Nf,z3=Li,H3=Ot,W3=function(r,n,e){for(var t=j3(n),i=H3.f,a=z3.f,o=0;o<t.length;o++){var s=t[o];!iy(r,s)&&!(e&&iy(e,s))&&i(r,s,a(n,s))}},U3=Qe,V3=Ar,G3=function(r,n){U3(n)&&"cause"in n&&V3(r,"cause",n.cause)},K3=pe,d_=Error,q3=K3("".replace),Y3=function(r){return String(new d_(r).stack)}("zxcasd"),h_=/\n\s*at [^:]*:[^\n]*/,X3=h_.test(Y3),Z3=function(r,n){if(X3&&typeof r=="string"&&!d_.prepareStackTrace)for(;n--;)r=q3(r,h_,"");return r},Q3=oe,J3=ji,e5=!Q3(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",J3(1,7)),r.stack!==7):!0}),t5=Ar,r5=Z3,i5=e5,ny=Error.captureStackTrace,n5=function(r,n,e,t){i5&&(ny?ny(r,n):t5(r,"stack",r5(e,t)))},a5=ai,o5=He,s5=Dt,l5=Xn,u5=Uw,d5=Mt,ay=Ne,h5=Af,c5=tu,oy=Ww,f5=TypeError,Ks=function(r,n){this.stopped=r,this.result=n},sy=Ks.prototype,Vi=function(r,n,e){var t=e&&e.that,i=!!(e&&e.AS_ENTRIES),a=!!(e&&e.IS_RECORD),o=!!(e&&e.IS_ITERATOR),s=!!(e&&e.INTERRUPTED),l=a5(n,t),u,d,h,c,f,v,p,g=function(m){return u&&oy(u,"normal",m),new Ks(!0,m)},y=function(m){return i?(s5(m),s?l(m[0],m[1],g):l(m[0],m[1])):s?l(m,g):l(m)};if(a)u=r.iterator;else if(o)u=r;else{if(d=c5(r),!d)throw new f5(l5(r)+" is not iterable");if(u5(d)){for(h=0,c=d5(r);c>h;h++)if(f=y(r[h]),f&&ay(sy,f))return f;return new Ks(!1)}u=h5(r,d)}for(v=a?r.next:u.next;!(p=o5(v,u)).done;){try{f=y(p.value)}catch(m){oy(u,"throw",m)}if(typeof f=="object"&&f&&ay(sy,f))return f}return new Ks(!1)},v5=zi,p5=function(r,n){return r===void 0?arguments.length<2?"":n:v5(r)},g5=W,y5=Ne,m5=Ql,gl=Sw,b5=W3,c_=Hi,Td=Ar,Id=ji,$5=G3,w5=n5,_5=Vi,E5=p5,S5=be,O5=S5("toStringTag"),yl=Error,T5=[].push,Bn=function(n,e){var t=y5(kd,this),i;gl?i=gl(new yl,t?m5(this):kd):(i=t?this:c_(kd),Td(i,O5,"Error")),e!==void 0&&Td(i,"message",E5(e)),w5(i,Bn,i.stack,1),arguments.length>2&&$5(i,arguments[2]);var a=[];return _5(n,T5,{that:a}),Td(i,"errors",a),i};gl?gl(Bn,yl):b5(Bn,yl,{name:!0});var kd=Bn.prototype=c_(yl.prototype,{constructor:Id(1,Bn),message:Id(1,""),name:Id(1,"AggregateError")});g5({global:!0,constructor:!0,arity:2},{AggregateError:Bn});var I5=ct,k5=_f,P5=be,C5=ze,ly=P5("species"),f_=function(r){var n=I5(r);C5&&n&&!n[ly]&&k5(n,ly,{configurable:!0,get:function(){return this}})},x5=Ne,R5=TypeError,Gf=function(r,n){if(x5(n,r))return r;throw new R5("Incorrect invocation")},uy=Dt,A5=G0,D5=Kn,M5=be,N5=M5("species"),v_=function(r,n){var e=uy(r).constructor,t;return e===void 0||D5(t=uy(e)[N5])?n:A5(t)},F5=ni,p_=/(?:ipad|iphone|ipod).*applewebkit/i.test(F5),At=ge,B5=Gn,L5=ai,dy=_e,j5=Fe,g_=oe,hy=U1,z5=yo,cy=yf,H5=c0,W5=p_,U5=bo,wc=At.setImmediate,_c=At.clearImmediate,V5=At.process,Pd=At.Dispatch,G5=At.Function,fy=At.MessageChannel,K5=At.String,Cd=0,Da={},vy="onreadystatechange",Za,vi,xd,Rd;g_(function(){Za=At.location});var Kf=function(r){if(j5(Da,r)){var n=Da[r];delete Da[r],n()}},Ad=function(r){return function(){Kf(r)}},py=function(r){Kf(r.data)},gy=function(r){At.postMessage(K5(r),Za.protocol+"//"+Za.host)};(!wc||!_c)&&(wc=function(n){H5(arguments.length,1);var e=dy(n)?n:G5(n),t=z5(arguments,1);return Da[++Cd]=function(){B5(e,void 0,t)},vi(Cd),Cd},_c=function(n){delete Da[n]},U5?vi=function(r){V5.nextTick(Ad(r))}:Pd&&Pd.now?vi=function(r){Pd.now(Ad(r))}:fy&&!W5?(xd=new fy,Rd=xd.port2,xd.port1.onmessage=py,vi=L5(Rd.postMessage,Rd)):At.addEventListener&&dy(At.postMessage)&&!At.importScripts&&Za&&Za.protocol!=="file:"&&!g_(gy)?(vi=gy,At.addEventListener("message",py,!1)):vy in cy("script")?vi=function(r){hy.appendChild(cy("script"))[vy]=function(){hy.removeChild(this),Kf(r)}}:vi=function(r){setTimeout(Ad(r),0)});var y_={set:wc,clear:_c},m_=function(){this.head=null,this.tail=null};m_.prototype={add:function(r){var n={item:r,next:null},e=this.tail;e?e.next=n:this.head=n,this.tail=n},get:function(){var r=this.head;if(r){var n=this.head=r.next;return n===null&&(this.tail=null),r.item}}};var b_=m_,q5=ni,Y5=/ipad|iphone|ipod/i.test(q5)&&typeof Pebble<"u",X5=ni,Z5=/web0s(?!.*chrome)/i.test(X5),Di=ge,yy=ai,Q5=Li.f,Dd=y_.set,J5=b_,eH=p_,tH=Y5,rH=Z5,Md=bo,my=Di.MutationObserver||Di.WebKitMutationObserver,by=Di.document,$y=Di.process,gs=Di.Promise,wy=Q5(Di,"queueMicrotask"),Ec=wy&&wy.value,sn,Nd,Fd,ys,_y;if(!Ec){var ms=new J5,bs=function(){var r,n;for(Md&&(r=$y.domain)&&r.exit();n=ms.get();)try{n()}catch(e){throw ms.head&&sn(),e}r&&r.enter()};!eH&&!Md&&!rH&&my&&by?(Nd=!0,Fd=by.createTextNode(""),new my(bs).observe(Fd,{characterData:!0}),sn=function(){Fd.data=Nd=!Nd}):!tH&&gs&&gs.resolve?(ys=gs.resolve(void 0),ys.constructor=gs,_y=yy(ys.then,ys),sn=function(){_y(bs)}):Md?sn=function(){$y.nextTick(bs)}:(Dd=yy(Dd,Di),sn=function(){Dd(bs)}),Ec=function(r){ms.head||sn(),ms.add(r)}}var iH=Ec,nH=function(r,n){try{arguments.length===1?console.error(r):console.error(r,n)}catch{}},na=function(r){try{return{error:!1,value:r()}}catch(n){return{error:!0,value:n}}},aH=ge,aa=aH.Promise,$_=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",oH=$_,sH=bo,lH=!oH&&!sH&&typeof window=="object"&&typeof document=="object",uH=ge,Ma=aa,dH=_e,hH=x1,cH=F1,fH=be,vH=lH,pH=$_,Bd=qn,Ey=Ma&&Ma.prototype,gH=fH("species"),Sc=!1,w_=dH(uH.PromiseRejectionEvent),yH=hH("Promise",function(){var r=cH(Ma),n=r!==String(Ma);if(!n&&Bd===66||!(Ey.catch&&Ey.finally))return!0;if(!Bd||Bd<51||!/native code/.test(r)){var e=new Ma(function(a){a(1)}),t=function(a){a(function(){},function(){})},i=e.constructor={};if(i[gH]=t,Sc=e.then(function(){})instanceof t,!Sc)return!0}return!n&&(vH||pH)&&!w_}),Oo={CONSTRUCTOR:yH,REJECTION_EVENT:w_,SUBCLASSING:Sc},vr={},Sy=Et,mH=TypeError,bH=function(r){var n,e;this.promise=new r(function(t,i){if(n!==void 0||e!==void 0)throw new mH("Bad Promise constructor");n=t,e=i}),this.resolve=Sy(n),this.reject=Sy(e)};vr.f=function(r){return new bH(r)};var $H=W,ml=bo,Jr=ge,To=He,wH=Jn,_H=Wi,EH=f_,SH=Et,Oc=_e,OH=Qe,TH=Gf,IH=v_,__=y_.set,qf=iH,kH=nH,PH=na,CH=b_,E_=ea,Tc=aa,S_=Oo,O_=vr,su="Promise",T_=S_.CONSTRUCTOR,xH=S_.REJECTION_EVENT,Ld=E_.getterFor(su),RH=E_.set,AH=Tc&&Tc.prototype,wn=Tc,jd=AH,I_=Jr.TypeError,Ic=Jr.document,Yf=Jr.process,kc=O_.f,DH=kc,MH=!!(Ic&&Ic.createEvent&&Jr.dispatchEvent),k_="unhandledrejection",NH="rejectionhandled",Oy=0,P_=1,FH=2,Xf=1,C_=2,$s,Ty,BH,x_=function(r){var n;return OH(r)&&Oc(n=r.then)?n:!1},R_=function(r,n){var e=n.value,t=n.state===P_,i=t?r.ok:r.fail,a=r.resolve,o=r.reject,s=r.domain,l,u,d;try{i?(t||(n.rejection===C_&&jH(n),n.rejection=Xf),i===!0?l=e:(s&&s.enter(),l=i(e),s&&(s.exit(),d=!0)),l===r.promise?o(new I_("Promise-chain cycle")):(u=x_(l))?To(u,l,a,o):a(l)):o(e)}catch(h){s&&!d&&s.exit(),o(h)}},A_=function(r,n){r.notified||(r.notified=!0,qf(function(){for(var e=r.reactions,t;t=e.get();)R_(t,r);r.notified=!1,n&&!r.rejection&&LH(r)}))},D_=function(r,n,e){var t,i;MH?(t=Ic.createEvent("Event"),t.promise=n,t.reason=e,t.initEvent(r,!1,!0),Jr.dispatchEvent(t)):t={promise:n,reason:e},!xH&&(i=Jr["on"+r])?i(t):r===k_&&kH("Unhandled promise rejection",e)},LH=function(r){To(__,Jr,function(){var n=r.facade,e=r.value,t=Iy(r),i;if(t&&(i=PH(function(){ml?Yf.emit("unhandledRejection",e,n):D_(k_,n,e)}),r.rejection=ml||Iy(r)?C_:Xf,i.error))throw i.value})},Iy=function(r){return r.rejection!==Xf&&!r.parent},jH=function(r){To(__,Jr,function(){var n=r.facade;ml?Yf.emit("rejectionHandled",n):D_(NH,n,r.value)})},_n=function(r,n,e){return function(t){r(n,t,e)}},kn=function(r,n,e){r.done||(r.done=!0,e&&(r=e),r.value=n,r.state=FH,A_(r,!0))},Pc=function(r,n,e){if(!r.done){r.done=!0,e&&(r=e);try{if(r.facade===n)throw new I_("Promise can't be resolved itself");var t=x_(n);t?qf(function(){var i={done:!1};try{To(t,n,_n(Pc,i,r),_n(kn,i,r))}catch(a){kn(i,a,r)}}):(r.value=n,r.state=P_,A_(r,!1))}catch(i){kn({done:!1},i,r)}}};T_&&(wn=function(n){TH(this,jd),SH(n),To($s,this);var e=Ld(this);try{n(_n(Pc,e),_n(kn,e))}catch(t){kn(e,t)}},jd=wn.prototype,$s=function(n){RH(this,{type:su,done:!1,notified:!1,parent:!1,reactions:new CH,rejection:!1,state:Oy,value:void 0})},$s.prototype=wH(jd,"then",function(n,e){var t=Ld(this),i=kc(IH(this,wn));return t.parent=!0,i.ok=Oc(n)?n:!0,i.fail=Oc(e)&&e,i.domain=ml?Yf.domain:void 0,t.state===Oy?t.reactions.add(i):qf(function(){R_(i,t)}),i.promise}),Ty=function(){var r=new $s,n=Ld(r);this.promise=r,this.resolve=_n(Pc,n),this.reject=_n(kn,n)},O_.f=kc=function(r){return r===wn||r===BH?new Ty(r):DH(r)});$H({global:!0,constructor:!0,wrap:!0,forced:T_},{Promise:wn});_H(wn,su,!1,!0);EH(su);var zH=aa,HH=Kw,WH=Oo.CONSTRUCTOR,lu=WH||!HH(function(r){zH.all(r).then(void 0,function(){})}),UH=W,VH=He,GH=Et,KH=vr,qH=na,YH=Vi,XH=lu;UH({target:"Promise",stat:!0,forced:XH},{all:function(n){var e=this,t=KH.f(e),i=t.resolve,a=t.reject,o=qH(function(){var s=GH(e.resolve),l=[],u=0,d=1;YH(n,function(h){var c=u++,f=!1;d++,VH(s,e,h).then(function(v){f||(f=!0,l[c]=v,--d||i(l))},a)}),--d||i(l)});return o.error&&a(o.value),t.promise}});var ZH=W,QH=Oo.CONSTRUCTOR,ky=aa;ky&&ky.prototype;ZH({target:"Promise",proto:!0,forced:QH,real:!0},{catch:function(r){return this.then(void 0,r)}});var JH=W,eW=He,tW=Et,rW=vr,iW=na,nW=Vi,aW=lu;JH({target:"Promise",stat:!0,forced:aW},{race:function(n){var e=this,t=rW.f(e),i=t.reject,a=iW(function(){var o=tW(e.resolve);nW(n,function(s){eW(o,e,s).then(t.resolve,i)})});return a.error&&i(a.value),t.promise}});var oW=W,sW=He,lW=vr,uW=Oo.CONSTRUCTOR;oW({target:"Promise",stat:!0,forced:uW},{reject:function(n){var e=lW.f(this);return sW(e.reject,void 0,n),e.promise}});var dW=Dt,hW=Qe,cW=vr,M_=function(r,n){if(dW(r),hW(n)&&n.constructor===r)return n;var e=cW.f(r),t=e.resolve;return t(n),e.promise},fW=W,vW=ct,pW=SI,gW=aa,yW=Oo.CONSTRUCTOR,mW=M_,bW=vW("Promise"),$W=!yW;fW({target:"Promise",stat:!0,forced:pW},{resolve:function(n){return mW($W&&this===bW?gW:this,n)}});var wW=W,_W=He,EW=Et,SW=vr,OW=na,TW=Vi,IW=lu;wW({target:"Promise",stat:!0,forced:IW},{allSettled:function(n){var e=this,t=SW.f(e),i=t.resolve,a=t.reject,o=OW(function(){var s=EW(e.resolve),l=[],u=0,d=1;TW(n,function(h){var c=u++,f=!1;d++,_W(s,e,h).then(function(v){f||(f=!0,l[c]={status:"fulfilled",value:v},--d||i(l))},function(v){f||(f=!0,l[c]={status:"rejected",reason:v},--d||i(l))})}),--d||i(l)});return o.error&&a(o.value),t.promise}});var kW=W,PW=He,CW=Et,xW=ct,RW=vr,AW=na,DW=Vi,MW=lu,Py="No one promise resolved";kW({target:"Promise",stat:!0,forced:MW},{any:function(n){var e=this,t=xW("AggregateError"),i=RW.f(e),a=i.resolve,o=i.reject,s=AW(function(){var l=CW(e.resolve),u=[],d=0,h=1,c=!1;DW(n,function(f){var v=d++,p=!1;h++,PW(l,e,f).then(function(g){p||c||(c=!0,a(g))},function(g){p||c||(p=!0,u[v]=g,--h||o(new t(u,Py)))})}),--h||o(new t(u,Py))});return s.error&&o(s.value),i.promise}});var NW=W,Cc=aa,FW=oe,BW=ct,LW=_e,jW=v_,Cy=M_,zW=Cc&&Cc.prototype,HW=!!Cc&&FW(function(){zW.finally.call({then:function(){}},function(){})});NW({target:"Promise",proto:!0,real:!0,forced:HW},{finally:function(r){var n=jW(this,BW("Promise")),e=LW(r);return this.then(e?function(t){return Cy(n,r()).then(function(){return t})}:r,e?function(t){return Cy(n,r()).then(function(){throw t})}:r)}});var WW=ye,UW=WW.Promise,VW=UW,GW=VW,KW=W,qW=vr;KW({target:"Promise",stat:!0},{withResolvers:function(){var n=qW.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}});var YW=GW,XW=YW,ZW=W,QW=vr,JW=na;ZW({target:"Promise",stat:!0,forced:!0},{try:function(r){var n=QW.f(this),e=JW(r);return(e.error?n.reject:n.resolve)(e.value),n.promise}});var e4=XW,t4=e4,r4=t4,i4=s0,n4=i4,a4=n4,o4=a4,s4=o4;(function(r){var n=D3.default,e=M1,t=xf,i=n_,a=s_,o=L3,s=e0,l=a_,u=r4,d=s4,h=r0;function c(){r.exports=c=function(){return v},r.exports.__esModule=!0,r.exports.default=r.exports;var f,v={},p=Object.prototype,g=p.hasOwnProperty,y=e||function(A,I,k){A[I]=k.value},m=typeof t=="function"?t:{},$=m.iterator||"@@iterator",b=m.asyncIterator||"@@asyncIterator",E=m.toStringTag||"@@toStringTag";function T(A,I,k){return e(A,I,{value:k,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{T({},"")}catch{T=function(k,H,q){return k[H]=q}}function N(A,I,k,H){var q=I&&I.prototype instanceof me?I:me,K=i(q.prototype),ke=new Pt(H||[]);return y(K,"_invoke",{value:Re(A,k,ke)}),K}function M(A,I,k){try{return{type:"normal",arg:A.call(I,k)}}catch(H){return{type:"throw",arg:H}}}v.wrap=N;var R="suspendedStart",D="suspendedYield",z="executing",Z="completed",Y={};function me(){}function qe(){}function xe(){}var It={};T(It,$,function(){return this});var at=a,Je=at&&at(at(rt([])));Je&&Je!==p&&g.call(Je,$)&&(It=Je);var kt=xe.prototype=me.prototype=i(It);function et(A){var I;o(I=["next","throw","return"]).call(I,function(k){T(A,k,function(H){return this._invoke(k,H)})})}function ve(A,I){function k(q,K,ke,ot){var ft=M(A[q],A,K);if(ft.type!=="throw"){var hi=ft.arg,Nr=hi.value;return Nr&&n(Nr)=="object"&&g.call(Nr,"__await")?I.resolve(Nr.__await).then(function(ci){k("next",ci,ke,ot)},function(ci){k("throw",ci,ke,ot)}):I.resolve(Nr).then(function(ci){hi.value=ci,ke(hi)},function(ci){return k("throw",ci,ke,ot)})}ot(ft.arg)}var H;y(this,"_invoke",{value:function(K,ke){function ot(){return new I(function(ft,hi){k(K,ke,ft,hi)})}return H=H?H.then(ot,ot):ot()}})}function Re(A,I,k){var H=R;return function(q,K){if(H===z)throw new Error("Generator is already running");if(H===Z){if(q==="throw")throw K;return{value:f,done:!0}}for(k.method=q,k.arg=K;;){var ke=k.delegate;if(ke){var ot=Ie(ke,k);if(ot){if(ot===Y)continue;return ot}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(H===R)throw H=Z,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);H=z;var ft=M(A,I,k);if(ft.type==="normal"){if(H=k.done?Z:D,ft.arg===Y)continue;return{value:ft.arg,done:k.done}}ft.type==="throw"&&(H=Z,k.method="throw",k.arg=ft.arg)}}}function Ie(A,I){var k=I.method,H=A.iterator[k];if(H===f)return I.delegate=null,k==="throw"&&A.iterator.return&&(I.method="return",I.arg=f,Ie(A,I),I.method==="throw")||k!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+k+"' method")),Y;var q=M(H,A.iterator,I.arg);if(q.type==="throw")return I.method="throw",I.arg=q.arg,I.delegate=null,Y;var K=q.arg;return K?K.done?(I[A.resultName]=K.value,I.next=A.nextLoc,I.method!=="return"&&(I.method="next",I.arg=f),I.delegate=null,Y):K:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,Y)}function tt(A){var I,k={tryLoc:A[0]};1 in A&&(k.catchLoc=A[1]),2 in A&&(k.finallyLoc=A[2],k.afterLoc=A[3]),s(I=this.tryEntries).call(I,k)}function yr(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function Pt(A){this.tryEntries=[{tryLoc:"root"}],o(A).call(A,tt,this),this.reset(!0)}function rt(A){if(A||A===""){var I=A[$];if(I)return I.call(A);if(typeof A.next=="function")return A;if(!isNaN(A.length)){var k=-1,H=function q(){for(;++k<A.length;)if(g.call(A,k))return q.value=A[k],q.done=!1,q;return q.value=f,q.done=!0,q};return H.next=H}}throw new TypeError(n(A)+" is not iterable")}return qe.prototype=xe,y(kt,"constructor",{value:xe,configurable:!0}),y(xe,"constructor",{value:qe,configurable:!0}),qe.displayName=T(xe,E,"GeneratorFunction"),v.isGeneratorFunction=function(A){var I=typeof A=="function"&&A.constructor;return!!I&&(I===qe||(I.displayName||I.name)==="GeneratorFunction")},v.mark=function(A){return l?l(A,xe):(A.__proto__=xe,T(A,E,"GeneratorFunction")),A.prototype=i(kt),A},v.awrap=function(A){return{__await:A}},et(ve.prototype),T(ve.prototype,b,function(){return this}),v.AsyncIterator=ve,v.async=function(A,I,k,H,q){q===void 0&&(q=u);var K=new ve(N(A,I,k,H),q);return v.isGeneratorFunction(I)?K:K.next().then(function(ke){return ke.done?ke.value:K.next()})},et(kt),T(kt,E,"Generator"),T(kt,$,function(){return this}),T(kt,"toString",function(){return"[object Generator]"}),v.keys=function(A){var I=Object(A),k=[];for(var H in I)s(k).call(k,H);return d(k).call(k),function q(){for(;k.length;){var K=k.pop();if(K in I)return q.value=K,q.done=!1,q}return q.done=!0,q}},v.values=rt,Pt.prototype={constructor:Pt,reset:function(I){var k;if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,o(k=this.tryEntries).call(k,yr),!I)for(var H in this)H.charAt(0)==="t"&&g.call(this,H)&&!isNaN(+h(H).call(H,1))&&(this[H]=f)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var k=this;function H(hi,Nr){return ke.type="throw",ke.arg=I,k.next=hi,Nr&&(k.method="next",k.arg=f),!!Nr}for(var q=this.tryEntries.length-1;q>=0;--q){var K=this.tryEntries[q],ke=K.completion;if(K.tryLoc==="root")return H("end");if(K.tryLoc<=this.prev){var ot=g.call(K,"catchLoc"),ft=g.call(K,"finallyLoc");if(ot&&ft){if(this.prev<K.catchLoc)return H(K.catchLoc,!0);if(this.prev<K.finallyLoc)return H(K.finallyLoc)}else if(ot){if(this.prev<K.catchLoc)return H(K.catchLoc,!0)}else{if(!ft)throw new Error("try statement without catch or finally");if(this.prev<K.finallyLoc)return H(K.finallyLoc)}}}},abrupt:function(I,k){for(var H=this.tryEntries.length-1;H>=0;--H){var q=this.tryEntries[H];if(q.tryLoc<=this.prev&&g.call(q,"finallyLoc")&&this.prev<q.finallyLoc){var K=q;break}}K&&(I==="break"||I==="continue")&&K.tryLoc<=k&&k<=K.finallyLoc&&(K=null);var ke=K?K.completion:{};return ke.type=I,ke.arg=k,K?(this.method="next",this.next=K.finallyLoc,Y):this.complete(ke)},complete:function(I,k){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&k&&(this.next=k),Y},finish:function(I){for(var k=this.tryEntries.length-1;k>=0;--k){var H=this.tryEntries[k];if(H.finallyLoc===I)return this.complete(H.completion,H.afterLoc),yr(H),Y}},catch:function(I){for(var k=this.tryEntries.length-1;k>=0;--k){var H=this.tryEntries[k];if(H.tryLoc===I){var q=H.completion;if(q.type==="throw"){var K=q.arg;yr(H)}return K}}throw new Error("illegal catch attempt")},delegateYield:function(I,k,H){return this.delegate={iterator:rt(I),resultName:k,nextLoc:H},this.method==="next"&&(this.arg=f),Y}},v}r.exports=c,r.exports.__esModule=!0,r.exports.default=r.exports})(l_);var l4=l_.exports,qs=l4(),u4=qs;try{regeneratorRuntime=qs}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=qs:Function("r","regeneratorRuntime = r")(qs)}var pt=G(u4),N_={exports:{}},d4=oe,h4=d4(function(){if(typeof ArrayBuffer=="function"){var r=new ArrayBuffer(8);Object.isExtensible(r)&&Object.defineProperty(r,"a",{value:8})}}),c4=oe,f4=Qe,v4=ii,xy=h4,Ys=Object.isExtensible,p4=c4(function(){Ys(1)}),g4=p4||xy?function(n){return!f4(n)||xy&&v4(n)==="ArrayBuffer"?!1:Ys?Ys(n):!0}:Ys,y4=oe,m4=!y4(function(){return Object.isExtensible(Object.preventExtensions({}))}),b4=W,$4=pe,w4=ho,_4=Qe,Zf=Fe,E4=Ot.f,Ry=co,S4=wf,Qf=g4,O4=Nl,T4=m4,F_=!1,Cr=O4("meta"),I4=0,Jf=function(r){E4(r,Cr,{value:{objectID:"O"+I4++,weakData:{}}})},k4=function(r,n){if(!_4(r))return typeof r=="symbol"?r:(typeof r=="string"?"S":"P")+r;if(!Zf(r,Cr)){if(!Qf(r))return"F";if(!n)return"E";Jf(r)}return r[Cr].objectID},P4=function(r,n){if(!Zf(r,Cr)){if(!Qf(r))return!0;if(!n)return!1;Jf(r)}return r[Cr].weakData},C4=function(r){return T4&&F_&&Qf(r)&&!Zf(r,Cr)&&Jf(r),r},x4=function(){R4.enable=function(){},F_=!0;var r=Ry.f,n=$4([].splice),e={};e[Cr]=1,r(e).length&&(Ry.f=function(t){for(var i=r(t),a=0,o=i.length;a<o;a++)if(i[a]===Cr){n(i,a,1);break}return i},b4({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:S4.f}))},R4=N_.exports={enable:x4,fastKey:k4,getWeakData:P4,onFreeze:C4};w4[Cr]=!0;var B_=N_.exports,A4=W,D4=ge,M4=B_,N4=oe,F4=Ar,B4=Vi,L4=Gf,j4=_e,z4=Qe,H4=Kn,W4=Wi,U4=Ot.f,V4=ta.forEach,G4=ze,L_=ea,K4=L_.set,q4=L_.getterFor,j_=function(r,n,e){var t=r.indexOf("Map")!==-1,i=r.indexOf("Weak")!==-1,a=t?"set":"add",o=D4[r],s=o&&o.prototype,l={},u;if(!G4||!j4(o)||!(i||s.forEach&&!N4(function(){new o().entries().next()})))u=e.getConstructor(n,r,t,a),M4.enable();else{u=n(function(c,f){K4(L4(c,d),{type:r,collection:new o}),H4(f)||B4(f,c[a],{that:c,AS_ENTRIES:t})});var d=u.prototype,h=q4(r);V4(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in s&&!(i&&c==="clear")&&F4(d,c,function(v,p){var g=h(this).collection;if(!f&&i&&!z4(v))return c==="get"?void 0:!1;var y=g[c](v===0?0:v,p);return f?this:y})}),i||U4(d,"size",{configurable:!0,get:function(){return h(this).collection.size}})}return W4(u,r,!1,!0),l[r]=u,A4({global:!0,forced:!0},l),i||e.setStrong(u,r,t),u},Y4=Jn,X4=function(r,n,e){for(var t in n)e&&e.unsafe&&r[t]?r[t]=n[t]:Y4(r,t,n[t],e);return r},Z4=Hi,Q4=_f,Ay=X4,J4=ai,e6=Gf,t6=Kn,r6=Vi,i6=kf,ws=Pf,n6=f_,_a=ze,Dy=B_.fastKey,z_=ea,My=z_.set,zd=z_.getterFor,H_={getConstructor:function(r,n,e,t){var i=r(function(u,d){e6(u,a),My(u,{type:n,index:Z4(null),first:void 0,last:void 0,size:0}),_a||(u.size=0),t6(d)||r6(d,u[t],{that:u,AS_ENTRIES:e})}),a=i.prototype,o=zd(n),s=function(u,d,h){var c=o(u),f=l(u,d),v,p;return f?f.value=h:(c.last=f={index:p=Dy(d,!0),key:d,value:h,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),_a?c.size++:u.size++,p!=="F"&&(c.index[p]=f)),u},l=function(u,d){var h=o(u),c=Dy(d),f;if(c!=="F")return h.index[c];for(f=h.first;f;f=f.next)if(f.key===d)return f};return Ay(a,{clear:function(){for(var d=this,h=o(d),c=h.index,f=h.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;h.first=h.last=void 0,_a?h.size=0:d.size=0},delete:function(u){var d=this,h=o(d),c=l(d,u);if(c){var f=c.next,v=c.previous;delete h.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),h.first===c&&(h.first=f),h.last===c&&(h.last=v),_a?h.size--:d.size--}return!!c},forEach:function(d){for(var h=o(this),c=J4(d,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:h.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(d){return!!l(this,d)}}),Ay(a,e?{get:function(d){var h=l(this,d);return h&&h.value},set:function(d,h){return s(this,d===0?0:d,h)}}:{add:function(d){return s(this,d=d===0?0:d,d)}}),_a&&Q4(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(r,n,e){var t=n+" Iterator",i=zd(n),a=zd(t);i6(r,n,function(o,s){My(this,{type:t,target:o,state:i(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,l=o.last;l&&l.removed;)l=l.previous;return!o.target||!(o.last=l=l?l.next:o.state.first)?(o.target=void 0,ws(void 0,!0)):ws(s==="keys"?l.key:s==="values"?l.value:[l.key,l.value],!1)},e?"entries":"values",!e,!0),n6(n)}},a6=j_,o6=H_;a6("Map",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},o6);var s6=ye,l6=s6.Map,u6=l6,d6=u6,h6=d6,W_=G(h6),c6=W,f6=ta.some,v6=eu,p6=v6("some");c6({target:"Array",proto:!0,forced:!p6},{some:function(n){return f6(this,n,arguments.length>1?arguments[1]:void 0)}});var g6=nt,y6=g6("Array","some"),m6=Ne,b6=y6,Hd=Array.prototype,$6=function(r){var n=r.some;return r===Hd||m6(Hd,r)&&n===Hd.some?b6:n},w6=$6,_6=w6,E6=_6,S6=G(E6),O6=nt,T6=O6("Array","keys"),I6=T6,k6=I6,P6=Dr,C6=Fe,x6=Ne,R6=k6,Wd=Array.prototype,A6={DOMTokenList:!0,NodeList:!0},D6=function(r){var n=r.keys;return r===Wd||x6(Wd,r)&&n===Wd.keys||C6(A6,P6(r))?R6:n},M6=D6,ln=G(M6),Ny=K1,N6=Math.floor,xc=function(r,n){var e=r.length,t=N6(e/2);return e<8?F6(r,n):B6(r,xc(Ny(r,0,t),n),xc(Ny(r,t),n),n)},F6=function(r,n){for(var e=r.length,t=1,i,a;t<e;){for(a=t,i=r[t];a&&n(r[a-1],i)>0;)r[a]=r[--a];a!==t++&&(r[a]=i)}return r},B6=function(r,n,e,t){for(var i=n.length,a=e.length,o=0,s=0;o<i||s<a;)r[o+s]=o<i&&s<a?t(n[o],e[s])<=0?n[o++]:e[s++]:o<i?n[o++]:e[s++];return r},L6=xc,j6=ni,Fy=j6.match(/firefox\/(\d+)/i),z6=!!Fy&&+Fy[1],H6=ni,W6=/MSIE|Trident/.test(H6),U6=ni,By=U6.match(/AppleWebKit\/(\d+)\./),V6=!!By&&+By[1],G6=W,U_=pe,K6=Et,q6=St,Ly=Mt,Y6=l0,jy=zi,ev=oe,X6=L6,Z6=eu,zy=z6,Q6=W6,Hy=qn,Wy=V6,Wr=[],Uy=U_(Wr.sort),J6=U_(Wr.push),eU=ev(function(){Wr.sort(void 0)}),tU=ev(function(){Wr.sort(null)}),rU=Z6("sort"),V_=!ev(function(){if(Hy)return Hy<70;if(!(zy&&zy>3)){if(Q6)return!0;if(Wy)return Wy<603;var r="",n,e,t,i;for(n=65;n<76;n++){switch(e=String.fromCharCode(n),n){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(i=0;i<47;i++)Wr.push({k:e+i,v:t})}for(Wr.sort(function(a,o){return o.v-a.v}),i=0;i<Wr.length;i++)e=Wr[i].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return r!=="DGBEFHACIJK"}}),iU=eU||!tU||!rU||!V_,nU=function(r){return function(n,e){return e===void 0?-1:n===void 0?1:r!==void 0?+r(n,e)||0:jy(n)>jy(e)?1:-1}};G6({target:"Array",proto:!0,forced:iU},{sort:function(n){n!==void 0&&K6(n);var e=q6(this);if(V_)return n===void 0?Uy(e):Uy(e,n);var t=[],i=Ly(e),a,o;for(o=0;o<i;o++)o in e&&J6(t,e[o]);for(X6(t,nU(n)),a=Ly(t),o=0;o<a;)e[o]=t[o++];for(;o<i;)Y6(e,o++);return e}});var aU=nt,oU=aU("Array","sort"),sU=Ne,lU=oU,Ud=Array.prototype,uU=function(r){var n=r.sort;return r===Ud||sU(Ud,r)&&n===Ud.sort?lU:n},dU=uU,hU=dU,cU=hU,Rc=G(cU),fU=nt,vU=fU("Array","values"),pU=vU,gU=pU,yU=Dr,mU=Fe,bU=Ne,$U=gU,Vd=Array.prototype,wU={DOMTokenList:!0,NodeList:!0},_U=function(r){var n=r.values;return r===Vd||bU(Vd,r)&&n===Vd.values||mU(wU,yU(r))?$U:n},EU=_U,Vy=G(EU),SU=Dw,En=G(SU),OU=nt,TU=OU("Array","entries"),IU=TU,kU=IU,PU=Dr,CU=Fe,xU=Ne,RU=kU,Gd=Array.prototype,AU={DOMTokenList:!0,NodeList:!0},DU=function(r){var n=r.entries;return r===Gd||xU(Gd,r)&&n===Gd.entries||CU(AU,PU(r))?RU:n},MU=DU,NU=G(MU);let _s;const FU=new Uint8Array(16);function BU(){if(!_s&&(_s=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _s(FU)}const Ye=[];for(let r=0;r<256;++r)Ye.push((r+256).toString(16).slice(1));function LU(r,n=0){return Ye[r[n+0]]+Ye[r[n+1]]+Ye[r[n+2]]+Ye[r[n+3]]+"-"+Ye[r[n+4]]+Ye[r[n+5]]+"-"+Ye[r[n+6]]+Ye[r[n+7]]+"-"+Ye[r[n+8]]+Ye[r[n+9]]+"-"+Ye[r[n+10]]+Ye[r[n+11]]+Ye[r[n+12]]+Ye[r[n+13]]+Ye[r[n+14]]+Ye[r[n+15]]}const jU=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var Gy={randomUUID:jU};function zU(r,n,e){if(Gy.randomUUID&&!n&&!r)return Gy.randomUUID();r=r||{};const t=r.random||(r.rng||BU)();return t[6]=t[6]&15|64,t[8]=t[8]&63|128,LU(t)}function Ky(r){return typeof r=="string"||typeof r=="number"}var HU=function(){function r(n){Al(this,r),Kr(this,"_queue",[]),Kr(this,"_timeout",null),Kr(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(n)}return Jl(r,[{key:"setOptions",value:function(e){e&&typeof e.delay<"u"&&(this.delay=e.delay),e&&typeof e.max<"u"&&(this.max=e.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,i=0;i<t.length;i++){var a=t[i];a.original?e[a.name]=a.original:delete e[a.name]}this._extended=null}}},{key:"replace",value:function(e,t){var i=this,a=e[t];if(!a)throw new Error("Method "+t+" undefined");e[t]=function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];i.queue({args:s,fn:a,context:this})}}},{key:"queue",value:function(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var e=this;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=pj(function(){e.flush()},this.delay))}},{key:"flush",value:function(){var e,t;Ci(e=u0(t=this._queue).call(t,0)).call(e,function(i){i.fn.apply(i.context||i.fn,i.args||[])})}}],[{key:"extend",value:function(e,t){var i=new r(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=function(){i.flush()};var a=[{name:"flush",original:void 0}];if(t&&t.replace)for(var o=0;o<t.replace.length;o++){var s=t.replace[o];a.push({name:s,original:e[s]}),i.replace(e,s)}return i._extended={object:e,methods:a},i}}]),r}(),WU=function(){function r(){Al(this,r),Kr(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Kr(this,"subscribe",r.prototype.on),Kr(this,"unsubscribe",r.prototype.off)}return Jl(r,[{key:"_trigger",value:function(e,t,i){var a,o;if(e==="*")throw new Error("Cannot trigger event *");Ci(a=iu(o=[]).call(o,mt(this._subscribers[e]),mt(this._subscribers["*"]))).call(a,function(s){s(e,t,i??null)})}},{key:"on",value:function(e,t){typeof t=="function"&&this._subscribers[e].push(t)}},{key:"off",value:function(e,t){var i;this._subscribers[e]=mn(i=this._subscribers[e]).call(i,function(a){return a!==t})}}]),r}(),UU=j_,VU=H_;UU("Set",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},VU);var GU=ye,KU=GU.Set,qU=KU,YU=qU,XU=YU,Kd=G(XU),ZU=Af,QU=ZU,JU=QU,eV=JU,tV=eV,rV=tV,iV=rV,nV=iV,aV=nV,oV=aV,qd=G(oV);function nr(r,n){var e=typeof ru<"u"&&Mf(r)||r["@@iterator"];if(!e){if(Rt(r)||(e=sV(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function sV(r,n){var e;if(r){if(typeof r=="string")return qy(r,n);var t=nu(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Df(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qy(r,n)}}function qy(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var Yy=function(r){function n(e){Al(this,n),this._pairs=e}return Jl(n,[{key:r,value:pt.mark(function e(){var t,i,a,o,s;return pt.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=nr(this._pairs),u.prev=1,t.s();case 3:if((i=t.n()).done){u.next=9;break}return a=vt(i.value,2),o=a[0],s=a[1],u.next=7,[o,s];case 7:u.next=3;break;case 9:u.next=14;break;case 11:u.prev=11,u.t0=u.catch(1),t.e(u.t0);case 14:return u.prev=14,t.f(),u.finish(14);case 17:case"end":return u.stop()}},e,this,[[1,11,14,17]])})},{key:"entries",value:pt.mark(function e(){var t,i,a,o,s;return pt.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:t=nr(this._pairs),u.prev=1,t.s();case 3:if((i=t.n()).done){u.next=9;break}return a=vt(i.value,2),o=a[0],s=a[1],u.next=7,[o,s];case 7:u.next=3;break;case 9:u.next=14;break;case 11:u.prev=11,u.t0=u.catch(1),t.e(u.t0);case 14:return u.prev=14,t.f(),u.finish(14);case 17:case"end":return u.stop()}},e,this,[[1,11,14,17]])})},{key:"keys",value:pt.mark(function e(){var t,i,a,o;return pt.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:t=nr(this._pairs),l.prev=1,t.s();case 3:if((i=t.n()).done){l.next=9;break}return a=vt(i.value,1),o=a[0],l.next=7,o;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),t.e(l.t0);case 14:return l.prev=14,t.f(),l.finish(14);case 17:case"end":return l.stop()}},e,this,[[1,11,14,17]])})},{key:"values",value:pt.mark(function e(){var t,i,a,o;return pt.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:t=nr(this._pairs),l.prev=1,t.s();case 3:if((i=t.n()).done){l.next=9;break}return a=vt(i.value,2),o=a[1],l.next=7,o;case 7:l.next=3;break;case 9:l.next=14;break;case 11:l.prev=11,l.t0=l.catch(1),t.e(l.t0);case 14:return l.prev=14,t.f(),l.finish(14);case 17:case"end":return l.stop()}},e,this,[[1,11,14,17]])})},{key:"toIdArray",value:function(){var t;return Yt(t=mt(this._pairs)).call(t,function(i){return i[0]})}},{key:"toItemArray",value:function(){var t;return Yt(t=mt(this._pairs)).call(t,function(i){return i[1]})}},{key:"toEntryArray",value:function(){return mt(this._pairs)}},{key:"toObjectMap",value:function(){var t=VL(null),i=nr(this._pairs),a;try{for(i.s();!(a=i.n()).done;){var o=vt(a.value,2),s=o[0],l=o[1];t[s]=l}}catch(u){i.e(u)}finally{i.f()}return t}},{key:"toMap",value:function(){return new W_(this._pairs)}},{key:"toIdSet",value:function(){return new Kd(this.toIdArray())}},{key:"toItemSet",value:function(){return new Kd(this.toItemArray())}},{key:"cache",value:function(){return new n(mt(this._pairs))}},{key:"distinct",value:function(t){var i=new Kd,a=nr(this._pairs),o;try{for(a.s();!(o=a.n()).done;){var s=vt(o.value,2),l=s[0],u=s[1];i.add(t(u,l))}}catch(d){a.e(d)}finally{a.f()}return i}},{key:"filter",value:function(t){var i=this._pairs;return new n({[En](){return pt.mark(function a(){var o,s,l,u,d;return pt.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=nr(i),c.prev=1,o.s();case 3:if((s=o.n()).done){c.next=10;break}if(l=vt(s.value,2),u=l[0],d=l[1],!t(d,u)){c.next=8;break}return c.next=8,[u,d];case 8:c.next=3;break;case 10:c.next=15;break;case 12:c.prev=12,c.t0=c.catch(1),o.e(c.t0);case 15:return c.prev=15,o.f(),c.finish(15);case 18:case"end":return c.stop()}},a,null,[[1,12,15,18]])})()}})}},{key:"forEach",value:function(t){var i=nr(this._pairs),a;try{for(i.s();!(a=i.n()).done;){var o=vt(a.value,2),s=o[0],l=o[1];t(l,s)}}catch(u){i.e(u)}finally{i.f()}}},{key:"map",value:function(t){var i=this._pairs;return new n({[En](){return pt.mark(function a(){var o,s,l,u,d;return pt.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=nr(i),c.prev=1,o.s();case 3:if((s=o.n()).done){c.next=9;break}return l=vt(s.value,2),u=l[0],d=l[1],c.next=7,[u,t(d,u)];case 7:c.next=3;break;case 9:c.next=14;break;case 11:c.prev=11,c.t0=c.catch(1),o.e(c.t0);case 14:return c.prev=14,o.f(),c.finish(14);case 17:case"end":return c.stop()}},a,null,[[1,11,14,17]])})()}})}},{key:"max",value:function(t){var i=qd(this._pairs),a=i.next();if(a.done)return null;for(var o=a.value[1],s=t(a.value[1],a.value[0]);!(a=i.next()).done;){var l=vt(a.value,2),u=l[0],d=l[1],h=t(d,u);h>s&&(s=h,o=d)}return o}},{key:"min",value:function(t){var i=qd(this._pairs),a=i.next();if(a.done)return null;for(var o=a.value[1],s=t(a.value[1],a.value[0]);!(a=i.next()).done;){var l=vt(a.value,2),u=l[0],d=l[1],h=t(d,u);h<s&&(s=h,o=d)}return o}},{key:"reduce",value:function(t,i){var a=nr(this._pairs),o;try{for(a.s();!(o=a.n()).done;){var s=vt(o.value,2),l=s[0],u=s[1];i=t(i,u,l)}}catch(d){a.e(d)}finally{a.f()}return i}},{key:"sort",value:function(t){var i=this;return new n({[En]:function(){var a;return qd(Rc(a=mt(i._pairs)).call(a,function(o,s){var l=vt(o,2),u=l[0],d=l[1],h=vt(s,2),c=h[0],f=h[1];return t(d,f,u,c)}))}})}}]),n}(En);function Xy(r,n){var e=Ff(r);if(Jg){var t=Jg(r);n&&(t=mn(t).call(t,function(i){return e_(r,i).enumerable})),e.push.apply(e,t)}return e}function Zy(r){for(var n=1;n<arguments.length;n++){var e,t,i=arguments[n]!=null?arguments[n]:{};n%2?Ci(e=Xy(Object(i),!0)).call(e,function(a){Kr(r,a,i[a])}):ey?a3(r,ey(i)):Ci(t=Xy(Object(i))).call(t,function(a){s3(r,a,e_(i,a))})}return r}function Yd(r,n){var e=typeof ru<"u"&&Mf(r)||r["@@iterator"];if(!e){if(Rt(r)||(e=lV(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function lV(r,n){var e;if(r){if(typeof r=="string")return Qy(r,n);var t=nu(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Df(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qy(r,n)}}function Qy(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}function uV(r){var n=dV();return function(){var t=pl(r),i;if(n){var a=pl(this).constructor;i=Gs(t,arguments,a)}else i=t.apply(this,arguments);return P3(this,i)}}function dV(){if(typeof Reflect>"u"||!Gs||Gs.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Gs(Boolean,[],function(){})),!0}catch{return!1}}function hV(r,n){return r[n]==null&&(r[n]=zU()),r}var bl=function(r){k3(e,r);var n=uV(e);function e(t,i){var a;return Al(this,e),a=n.call(this),Kr(i_(a),"_queue",null),t&&!Rt(t)&&(i=t,t=[]),a._options=i||{},a._data=new W_,a.length=0,a._idProp=a._options.fieldId||"id",t&&t.length&&a.add(t),a.setOptions(i),a}return Jl(e,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(i){i&&i.queue!==void 0&&(i.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=HU.extend(this,{replace:["add","update","remove"]})),i.queue&&typeof i.queue=="object"&&this._queue.setOptions(i.queue)))}},{key:"add",value:function(i,a){var o=this,s=[],l;if(Rt(i)){var u=Yt(i).call(i,function(c){return c[o._idProp]});if(S6(u).call(u,function(c){return o._data.has(c)}))throw new Error("A duplicate id was found in the parameter array.");for(var d=0,h=i.length;d<h;d++)l=this._addItem(i[d]),s.push(l)}else if(i&&typeof i=="object")l=this._addItem(i),s.push(l);else throw new Error("Unknown dataType");return s.length&&this._trigger("add",{items:s},a),s}},{key:"update",value:function(i,a){var o=this,s=[],l=[],u=[],d=[],h=this._idProp,c=function(y){var m=y[h];if(m!=null&&o._data.has(m)){var $=y,b=IL({},o._data.get(m)),E=o._updateItem($);l.push(E),d.push($),u.push(b)}else{var T=o._addItem(y);s.push(T)}};if(Rt(i))for(var f=0,v=i.length;f<v;f++)i[f]&&typeof i[f]=="object"?c(i[f]):console.warn("Ignoring input item, which is not an object at index "+f);else if(i&&typeof i=="object")c(i);else throw new Error("Unknown dataType");if(s.length&&this._trigger("add",{items:s},a),l.length){var p={items:l,oldData:u,data:d};this._trigger("update",p,a)}return iu(s).call(s,l)}},{key:"updateOnly",value:function(i,a){var o,s=this;Rt(i)||(i=[i]);var l=Yt(o=Yt(i).call(i,function(d){var h=s._data.get(d[s._idProp]);if(h==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:h,update:d}})).call(o,function(d){var h=d.oldData,c=d.update,f=h[s._idProp],v=oz(h,c);return s._data.set(f,v),{id:f,oldData:h,updatedData:v}});if(l.length){var u={items:Yt(l).call(l,function(d){return d.id}),oldData:Yt(l).call(l,function(d){return d.oldData}),data:Yt(l).call(l,function(d){return d.updatedData})};return this._trigger("update",u,a),u.items}else return[]}},{key:"get",value:function(i,a){var o=void 0,s=void 0,l=void 0;Ky(i)?(o=i,l=a):Rt(i)?(s=i,l=a):l=i;var u=l&&l.returnType==="Object"?"Object":"Array",d=l&&mn(l),h=[],c=void 0,f=void 0,v=void 0;if(o!=null)c=this._data.get(o),c&&d&&!d(c)&&(c=void 0);else if(s!=null)for(var p=0,g=s.length;p<g;p++)c=this._data.get(s[p]),c!=null&&(!d||d(c))&&h.push(c);else{var y;f=mt(ln(y=this._data).call(y));for(var m=0,$=f.length;m<$;m++)v=f[m],c=this._data.get(v),c!=null&&(!d||d(c))&&h.push(c)}if(l&&l.order&&o==null&&this._sort(h,l.order),l&&l.fields){var b=l.fields;if(o!=null&&c!=null)c=this._filterFields(c,b);else for(var E=0,T=h.length;E<T;E++)h[E]=this._filterFields(h[E],b)}if(u=="Object"){for(var N={},M=0,R=h.length;M<R;M++){var D=h[M],z=D[this._idProp];N[z]=D}return N}else if(o!=null){var Z;return(Z=c)!==null&&Z!==void 0?Z:null}else return h}},{key:"getIds",value:function(i){var a=this._data,o=i&&mn(i),s=i&&i.order,l=mt(ln(a).call(a)),u=[];if(o)if(s){for(var d=[],h=0,c=l.length;h<c;h++){var f=l[h],v=this._data.get(f);v!=null&&o(v)&&d.push(v)}this._sort(d,s);for(var p=0,g=d.length;p<g;p++)u.push(d[p][this._idProp])}else for(var y=0,m=l.length;y<m;y++){var $=l[y],b=this._data.get($);b!=null&&o(b)&&u.push(b[this._idProp])}else if(s){for(var E=[],T=0,N=l.length;T<N;T++){var M=l[T];E.push(a.get(M))}this._sort(E,s);for(var R=0,D=E.length;R<D;R++)u.push(E[R][this._idProp])}else for(var z=0,Z=l.length;z<Z;z++){var Y=l[z],me=a.get(Y);me!=null&&u.push(me[this._idProp])}return u}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(i,a){var o=a&&mn(a),s=this._data,l=mt(ln(s).call(s));if(a&&a.order)for(var u=this.get(a),d=0,h=u.length;d<h;d++){var c=u[d],f=c[this._idProp];i(c,f)}else for(var v=0,p=l.length;v<p;v++){var g=l[v],y=this._data.get(g);y!=null&&(!o||o(y))&&i(y,g)}}},{key:"map",value:function(i,a){for(var o=a&&mn(a),s=[],l=this._data,u=mt(ln(l).call(l)),d=0,h=u.length;d<h;d++){var c=u[d],f=this._data.get(c);f!=null&&(!o||o(f))&&s.push(i(f,c))}return a&&a.order&&this._sort(s,a.order),s}},{key:"_filterFields",value:function(i,a){var o;return i&&WM(o=Rt(a)?a:Ff(a)).call(o,function(s,l){return s[l]=i[l],s},{})}},{key:"_sort",value:function(i,a){if(typeof a=="string"){var o=a;Rc(i).call(i,function(s,l){var u=s[o],d=l[o];return u>d?1:u<d?-1:0})}else if(typeof a=="function")Rc(i).call(i,a);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(i,a){for(var o=[],s=[],l=Rt(i)?i:[i],u=0,d=l.length;u<d;u++){var h=this._remove(l[u]);if(h){var c=h[this._idProp];c!=null&&(o.push(c),s.push(h))}}return o.length&&this._trigger("remove",{items:o,oldData:s},a),o}},{key:"_remove",value:function(i){var a;if(Ky(i)?a=i:i&&typeof i=="object"&&(a=i[this._idProp]),a!=null&&this._data.has(a)){var o=this._data.get(a)||null;return this._data.delete(a),--this.length,o}return null}},{key:"clear",value:function(i){for(var a,o=mt(ln(a=this._data).call(a)),s=[],l=0,u=o.length;l<u;l++)s.push(this._data.get(o[l]));return this._data.clear(),this.length=0,this._trigger("remove",{items:o,oldData:s},i),o}},{key:"max",value:function(i){var a,o=null,s=null,l=Yd(Vy(a=this._data).call(a)),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,h=d[i];typeof h=="number"&&(s==null||h>s)&&(o=d,s=h)}}catch(c){l.e(c)}finally{l.f()}return o||null}},{key:"min",value:function(i){var a,o=null,s=null,l=Yd(Vy(a=this._data).call(a)),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,h=d[i];typeof h=="number"&&(s==null||h<s)&&(o=d,s=h)}}catch(c){l.e(c)}finally{l.f()}return o||null}},{key:"distinct",value:function(i){for(var a=this._data,o=mt(ln(a).call(a)),s=[],l=0,u=0,d=o.length;u<d;u++){for(var h=o[u],c=a.get(h),f=c[i],v=!1,p=0;p<l;p++)if(s[p]==f){v=!0;break}!v&&f!==void 0&&(s[l]=f,l++)}return s}},{key:"_addItem",value:function(i){var a=hV(i,this._idProp),o=a[this._idProp];if(this._data.has(o))throw new Error("Cannot add item: item with id "+o+" already exists");return this._data.set(o,a),++this.length,o}},{key:"_updateItem",value:function(i){var a=i[this._idProp];if(a==null)throw new Error("Cannot update item: item has no id (item: "+ZL(i)+")");var o=this._data.get(a);if(!o)throw new Error("Cannot update item: no item with id "+a+" found");return this._data.set(a,Zy(Zy({},o),i)),a}},{key:"stream",value:function(i){if(i){var a=this._data;return new Yy({[En](){return pt.mark(function s(){var l,u,d,h;return pt.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:l=Yd(i),f.prev=1,l.s();case 3:if((u=l.n()).done){f.next=11;break}if(d=u.value,h=a.get(d),h==null){f.next=9;break}return f.next=9,[d,h];case 9:f.next=3;break;case 11:f.next=16;break;case 13:f.prev=13,f.t0=f.catch(1),l.e(f.t0);case 16:return f.prev=16,l.f(),f.finish(16);case 19:case"end":return f.stop()}},s,null,[[1,13,16,19]])})()}})}else{var o;return new Yy({[En]:zw(o=NU(this._data)).call(o,this._data)})}}}]),e}(WU);function cV(r,n){return typeof n=="object"&&n!==null&&r===n.idProp&&typeof n.add=="function"&&typeof n.clear=="function"&&typeof n.distinct=="function"&&typeof Ci(n)=="function"&&typeof n.get=="function"&&typeof n.getDataSet=="function"&&typeof n.getIds=="function"&&typeof n.length=="number"&&typeof Yt(n)=="function"&&typeof n.max=="function"&&typeof n.min=="function"&&typeof n.off=="function"&&typeof n.on=="function"&&typeof n.remove=="function"&&typeof n.setOptions=="function"&&typeof n.stream=="function"&&typeof n.update=="function"&&typeof n.updateOnly=="function"}function G_(r,n){return typeof n=="object"&&n!==null&&r===n.idProp&&typeof Ci(n)=="function"&&typeof n.get=="function"&&typeof n.getDataSet=="function"&&typeof n.getIds=="function"&&typeof n.length=="number"&&typeof Yt(n)=="function"&&typeof n.off=="function"&&typeof n.on=="function"&&typeof n.stream=="function"&&cV(r,n.getDataSet())}/**
 * vis-network
 * https://visjs.github.io/vis-network/
 *
 * A dynamic, browser-based visualization library.
 *
 * @version 9.1.9
 * @date    2023-11-03T01:42:27.418Z
 *
 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
 *
 * @license
 * vis.js is dual licensed under both
 *
 *   1. The Apache 2.0 License
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   and
 *
 *   2. The MIT License
 *      http://opensource.org/licenses/MIT
 *
 * vis.js may be distributed under either license.
 */var Xd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Es=function(r){return r&&r.Math===Math&&r},Se=Es(typeof globalThis=="object"&&globalThis)||Es(typeof window=="object"&&window)||Es(typeof self=="object"&&self)||Es(typeof Xd=="object"&&Xd)||function(){return this}()||Xd||Function("return this")(),re=function(r){try{return!!r()}catch{return!0}},fV=re,Io=!fV(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),vV=Io,K_=Function.prototype,Jy=K_.apply,em=K_.call,ko=typeof Reflect=="object"&&Reflect.apply||(vV?em.bind(Jy):function(){return em.apply(Jy,arguments)}),q_=Io,Y_=Function.prototype,Ac=Y_.call,pV=q_&&Y_.bind.bind(Ac,Ac),ne=q_?pV:function(r){return function(){return Ac.apply(r,arguments)}},X_=ne,gV=X_({}.toString),yV=X_("".slice),Mr=function(r){return yV(gV(r),8,-1)},mV=Mr,bV=ne,tv=function(r){if(mV(r)==="Function")return bV(r)},Dc=typeof document=="object"&&document.all,$V=typeof Dc>"u"&&Dc!==void 0,Z_={all:Dc,IS_HTMLDDA:$V},Q_=Z_,wV=Q_.all,We=Q_.IS_HTMLDDA?function(r){return typeof r=="function"||r===wV}:function(r){return typeof r=="function"},oa={},_V=re,Ue=!_V(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),EV=Io,Ss=Function.prototype.call,Nt=EV?Ss.bind(Ss):function(){return Ss.apply(Ss,arguments)},uu={},J_={}.propertyIsEnumerable,eE=Object.getOwnPropertyDescriptor,SV=eE&&!J_.call({1:2},1);uu.f=SV?function(n){var e=eE(this,n);return!!e&&e.enumerable}:J_;var Po=function(r,n){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:n}},OV=ne,TV=re,IV=Mr,Zd=Object,kV=OV("".split),du=TV(function(){return!Zd("z").propertyIsEnumerable(0)})?function(r){return IV(r)==="String"?kV(r,""):Zd(r)}:Zd,sa=function(r){return r==null},PV=sa,CV=TypeError,Co=function(r){if(PV(r))throw new CV("Can't call method on "+r);return r},xV=du,RV=Co,pr=function(r){return xV(RV(r))},tm=We,tE=Z_,AV=tE.all,Ve=tE.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:tm(r)||r===AV}:function(r){return typeof r=="object"?r!==null:tm(r)},ie={},Qd=ie,Jd=Se,DV=We,rm=function(r){return DV(r)?r:void 0},Vt=function(r,n){return arguments.length<2?rm(Qd[r])||rm(Jd[r]):Qd[r]&&Qd[r][n]||Jd[r]&&Jd[r][n]},MV=ne,Ce=MV({}.isPrototypeOf),xo=typeof navigator<"u"&&String(navigator.userAgent)||"",rE=Se,eh=xo,im=rE.process,nm=rE.Deno,am=im&&im.versions||nm&&nm.version,om=am&&am.v8,Xt,$l;om&&(Xt=om.split("."),$l=Xt[0]>0&&Xt[0]<4?1:+(Xt[0]+Xt[1]));!$l&&eh&&(Xt=eh.match(/Edge\/(\d+)/),(!Xt||Xt[1]>=74)&&(Xt=eh.match(/Chrome\/(\d+)/),Xt&&($l=+Xt[1])));var Ro=$l,sm=Ro,NV=re,FV=Se,BV=FV.String,la=!!Object.getOwnPropertySymbols&&!NV(function(){var r=Symbol("symbol detection");return!BV(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&sm&&sm<41}),LV=la,iE=LV&&!Symbol.sham&&typeof Symbol.iterator=="symbol",jV=Vt,zV=We,HV=Ce,WV=iE,UV=Object,Ao=WV?function(r){return typeof r=="symbol"}:function(r){var n=jV("Symbol");return zV(n)&&HV(n.prototype,UV(r))},VV=String,ua=function(r){try{return VV(r)}catch{return"Object"}},GV=We,KV=ua,qV=TypeError,Gi=function(r){if(GV(r))return r;throw new qV(KV(r)+" is not a function")},YV=Gi,XV=sa,rv=function(r,n){var e=r[n];return XV(e)?void 0:YV(e)},th=Nt,rh=We,ih=Ve,ZV=TypeError,QV=function(r,n){var e,t;if(n==="string"&&rh(e=r.toString)&&!ih(t=th(e,r))||rh(e=r.valueOf)&&!ih(t=th(e,r))||n!=="string"&&rh(e=r.toString)&&!ih(t=th(e,r)))return t;throw new ZV("Can't convert object to primitive value")},nE={exports:{}},lm=Se,JV=Object.defineProperty,e8=function(r,n){try{JV(lm,r,{value:n,configurable:!0,writable:!0})}catch{lm[r]=n}return n},t8=Se,r8=e8,um="__core-js_shared__",i8=t8[um]||r8(um,{}),iv=i8,dm=iv;(nE.exports=function(r,n){return dm[r]||(dm[r]=n!==void 0?n:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 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 da=nE.exports,n8=Co,a8=Object,Tt=function(r){return a8(n8(r))},o8=ne,s8=Tt,l8=o8({}.hasOwnProperty),Ge=Object.hasOwn||function(n,e){return l8(s8(n),e)},u8=ne,d8=0,h8=Math.random(),c8=u8(1 .toString),hu=function(r){return"Symbol("+(r===void 0?"":r)+")_"+c8(++d8+h8,36)},f8=Se,v8=da,hm=Ge,p8=hu,g8=la,y8=iE,Sn=f8.Symbol,nh=v8("wks"),m8=y8?Sn.for||Sn:Sn&&Sn.withoutSetter||p8,Oe=function(r){return hm(nh,r)||(nh[r]=g8&&hm(Sn,r)?Sn[r]:m8("Symbol."+r)),nh[r]},b8=Nt,cm=Ve,fm=Ao,$8=rv,w8=QV,_8=Oe,E8=TypeError,S8=_8("toPrimitive"),O8=function(r,n){if(!cm(r)||fm(r))return r;var e=$8(r,S8),t;if(e){if(n===void 0&&(n="default"),t=b8(e,r,n),!cm(t)||fm(t))return t;throw new E8("Can't convert object to primitive value")}return n===void 0&&(n="number"),w8(r,n)},T8=O8,I8=Ao,cu=function(r){var n=T8(r,"string");return I8(n)?n:n+""},k8=Se,vm=Ve,Mc=k8.document,P8=vm(Mc)&&vm(Mc.createElement),aE=function(r){return P8?Mc.createElement(r):{}},C8=Ue,x8=re,R8=aE,oE=!C8&&!x8(function(){return Object.defineProperty(R8("div"),"a",{get:function(){return 7}}).a!==7}),A8=Ue,D8=Nt,M8=uu,N8=Po,F8=pr,B8=cu,L8=Ge,j8=oE,pm=Object.getOwnPropertyDescriptor;oa.f=A8?pm:function(n,e){if(n=F8(n),e=B8(e),j8)try{return pm(n,e)}catch{}if(L8(n,e))return N8(!D8(M8.f,n,e),n[e])};var z8=re,H8=We,W8=/#|\.prototype\./,Do=function(r,n){var e=V8[U8(r)];return e===K8?!0:e===G8?!1:H8(n)?z8(n):!!n},U8=Do.normalize=function(r){return String(r).replace(W8,".").toLowerCase()},V8=Do.data={},G8=Do.NATIVE="N",K8=Do.POLYFILL="P",q8=Do,gm=tv,Y8=Gi,X8=Io,Z8=gm(gm.bind),Mo=function(r,n){return Y8(r),n===void 0?r:X8?Z8(r,n):function(){return r.apply(n,arguments)}},Ft={},Q8=Ue,J8=re,sE=Q8&&J8(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),e9=Ve,t9=String,r9=TypeError,Bt=function(r){if(e9(r))return r;throw new r9(t9(r)+" is not an object")},i9=Ue,n9=oE,a9=sE,Os=Bt,ym=cu,o9=TypeError,ah=Object.defineProperty,s9=Object.getOwnPropertyDescriptor,oh="enumerable",sh="configurable",lh="writable";Ft.f=i9?a9?function(n,e,t){if(Os(n),e=ym(e),Os(t),typeof n=="function"&&e==="prototype"&&"value"in t&&lh in t&&!t[lh]){var i=s9(n,e);i&&i[lh]&&(n[e]=t.value,t={configurable:sh in t?t[sh]:i[sh],enumerable:oh in t?t[oh]:i[oh],writable:!1})}return ah(n,e,t)}:ah:function(n,e,t){if(Os(n),e=ym(e),Os(t),n9)try{return ah(n,e,t)}catch{}if("get"in t||"set"in t)throw new o9("Accessors not supported");return"value"in t&&(n[e]=t.value),n};var l9=Ue,u9=Ft,d9=Po,ha=l9?function(r,n,e){return u9.f(r,n,d9(1,e))}:function(r,n,e){return r[n]=e,r},Ts=Se,h9=ko,c9=tv,f9=We,v9=oa.f,p9=q8,un=ie,g9=Mo,dn=ha,mm=Ge,y9=function(r){var n=function(e,t,i){if(this instanceof n){switch(arguments.length){case 0:return new r;case 1:return new r(e);case 2:return new r(e,t)}return new r(e,t,i)}return h9(r,this,arguments)};return n.prototype=r.prototype,n},V=function(r,n){var e=r.target,t=r.global,i=r.stat,a=r.proto,o=t?Ts:i?Ts[e]:(Ts[e]||{}).prototype,s=t?un:un[e]||dn(un,e,{})[e],l=s.prototype,u,d,h,c,f,v,p,g,y;for(c in n)u=p9(t?c:e+(i?".":"#")+c,r.forced),d=!u&&o&&mm(o,c),v=s[c],d&&(r.dontCallGetSet?(y=v9(o,c),p=y&&y.value):p=o[c]),f=d&&p?p:n[c],!(d&&typeof v==typeof f)&&(r.bind&&d?g=g9(f,Ts):r.wrap&&d?g=y9(f):a&&f9(f)?g=c9(f):g=f,(r.sham||f&&f.sham||v&&v.sham)&&dn(g,"sham",!0),dn(s,c,g),a&&(h=e+"Prototype",mm(un,h)||dn(un,h,{}),dn(un[h],c,f),r.real&&l&&(u||!l[c])&&dn(l,c,f)))},m9=Math.ceil,b9=Math.floor,$9=Math.trunc||function(n){var e=+n;return(e>0?b9:m9)(e)},w9=$9,fu=function(r){var n=+r;return n!==n||n===0?0:w9(n)},_9=fu,E9=Math.max,S9=Math.min,No=function(r,n){var e=_9(r);return e<0?E9(e+n,0):S9(e,n)},O9=fu,T9=Math.min,I9=function(r){return r>0?T9(O9(r),9007199254740991):0},k9=I9,Gt=function(r){return k9(r.length)},P9=pr,C9=No,x9=Gt,bm=function(r){return function(n,e,t){var i=P9(n),a=x9(i),o=C9(t,a),s;if(r&&e!==e){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((r||o in i)&&i[o]===e)return r||o||0;return!r&&-1}},nv={includes:bm(!0),indexOf:bm(!1)},Fo={},R9=ne,uh=Ge,A9=pr,D9=nv.indexOf,M9=Fo,$m=R9([].push),lE=function(r,n){var e=A9(r),t=0,i=[],a;for(a in e)!uh(M9,a)&&uh(e,a)&&$m(i,a);for(;n.length>t;)uh(e,a=n[t++])&&(~D9(i,a)||$m(i,a));return i},av=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],N9=lE,F9=av,vu=Object.keys||function(n){return N9(n,F9)},Bo={};Bo.f=Object.getOwnPropertySymbols;var wm=Ue,B9=ne,L9=Nt,j9=re,dh=vu,z9=Bo,H9=uu,W9=Tt,U9=du,hn=Object.assign,_m=Object.defineProperty,V9=B9([].concat),G9=!hn||j9(function(){if(wm&&hn({b:1},hn(_m({},"a",{enumerable:!0,get:function(){_m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},n={},e=Symbol("assign detection"),t="abcdefghijklmnopqrst";return r[e]=7,t.split("").forEach(function(i){n[i]=i}),hn({},r)[e]!==7||dh(hn({},n)).join("")!==t})?function(n,e){for(var t=W9(n),i=arguments.length,a=1,o=z9.f,s=H9.f;i>a;)for(var l=U9(arguments[a++]),u=o?V9(dh(l),o(l)):dh(l),d=u.length,h=0,c;d>h;)c=u[h++],(!wm||L9(s,l,c))&&(t[c]=l[c]);return t}:hn,K9=V,Em=G9;K9({target:"Object",stat:!0,arity:2,forced:Object.assign!==Em},{assign:Em});var q9=ie,Y9=q9.Object.assign,X9=Y9,Z9=X9,Q9=Z9,De=j(Q9),J9=ne,pu=J9([].slice),uE=ne,eG=Gi,tG=Ve,rG=Ge,Sm=pu,iG=Io,dE=Function,nG=uE([].concat),aG=uE([].join),hh={},oG=function(r,n,e){if(!rG(hh,n)){for(var t=[],i=0;i<n;i++)t[i]="a["+i+"]";hh[n]=dE("C,a","return new C("+aG(t,",")+")")}return hh[n](r,e)},hE=iG?dE.bind:function(n){var e=eG(this),t=e.prototype,i=Sm(arguments,1),a=function(){var s=nG(i,Sm(arguments));return this instanceof a?oG(e,s.length,s):e.apply(n,s)};return tG(t)&&(a.prototype=t),a},sG=V,Om=hE;sG({target:"Function",proto:!0,forced:Function.bind!==Om},{bind:Om});var lG=ie,Ke=function(r){return lG[r+"Prototype"]},uG=Ke,dG=uG("Function").bind,hG=Ce,cG=dG,ch=Function.prototype,fG=function(r){var n=r.bind;return r===ch||hG(ch,r)&&n===ch.bind?cG:n},vG=fG,cE=vG,pG=cE,O=j(pG);function ov(r,n,e,t){r.beginPath(),r.arc(n,e,t,0,2*Math.PI,!1),r.closePath()}function gG(r,n,e,t){r.beginPath(),r.rect(n-t,e-t,t*2,t*2),r.closePath()}function yG(r,n,e,t){r.beginPath(),t*=1.15,e+=.275*t;var i=t*2,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);r.moveTo(n,e-(s-o)),r.lineTo(n+a,e+o),r.lineTo(n-a,e+o),r.lineTo(n,e-(s-o)),r.closePath()}function mG(r,n,e,t){r.beginPath(),t*=1.15,e-=.275*t;var i=t*2,a=i/2,o=Math.sqrt(3)/6*i,s=Math.sqrt(i*i-a*a);r.moveTo(n,e+(s-o)),r.lineTo(n+a,e-o),r.lineTo(n-a,e-o),r.lineTo(n,e+(s-o)),r.closePath()}function bG(r,n,e,t){r.beginPath(),t*=.82,e+=.1*t;for(var i=0;i<10;i++){var a=i%2===0?t*1.3:t*.5;r.lineTo(n+a*Math.sin(i*2*Math.PI/10),e-a*Math.cos(i*2*Math.PI/10))}r.closePath()}function $G(r,n,e,t){r.beginPath(),r.lineTo(n,e+t),r.lineTo(n+t,e),r.lineTo(n,e-t),r.lineTo(n-t,e),r.closePath()}function fE(r,n,e,t,i,a){var o=Math.PI/180;t-2*a<0&&(a=t/2),i-2*a<0&&(a=i/2),r.beginPath(),r.moveTo(n+a,e),r.lineTo(n+t-a,e),r.arc(n+t-a,e+a,a,o*270,o*360,!1),r.lineTo(n+t,e+i-a),r.arc(n+t-a,e+i-a,a,0,o*90,!1),r.lineTo(n+a,e+i),r.arc(n+a,e+i-a,a,o*90,o*180,!1),r.lineTo(n,e+a),r.arc(n+a,e+a,a,o*180,o*270,!1),r.closePath()}function Nc(r,n,e,t,i){var a=.5522848,o=t/2*a,s=i/2*a,l=n+t,u=e+i,d=n+t/2,h=e+i/2;r.beginPath(),r.moveTo(n,h),r.bezierCurveTo(n,h-s,d-o,e,d,e),r.bezierCurveTo(d+o,e,l,h-s,l,h),r.bezierCurveTo(l,h+s,d+o,u,d,u),r.bezierCurveTo(d-o,u,n,h+s,n,h),r.closePath()}function vE(r,n,e,t,i){var a=.3333333333333333,o=t,s=i*a,l=.5522848,u=o/2*l,d=s/2*l,h=n+o,c=e+s,f=n+o/2,v=e+s/2,p=e+(i-s/2),g=e+i;r.beginPath(),r.moveTo(h,v),r.bezierCurveTo(h,v+d,f+u,c,f,c),r.bezierCurveTo(f-u,c,n,v+d,n,v),r.bezierCurveTo(n,v-d,f-u,e,f,e),r.bezierCurveTo(f+u,e,h,v-d,h,v),r.lineTo(h,p),r.bezierCurveTo(h,p+d,f+u,g,f,g),r.bezierCurveTo(f-u,g,n,p+d,n,p),r.lineTo(n,v)}function pE(r,n,e,t,i,a){r.beginPath(),r.moveTo(n,e);for(var o=a.length,s=t-n,l=i-e,u=l/s,d=Math.sqrt(s*s+l*l),h=0,c=!0,f=0,v=+a[0];d>=.1;)v=+a[h++%o],v>d&&(v=d),f=Math.sqrt(v*v/(1+u*u)),f=s<0?-f:f,n+=f,e+=u*f,c===!0?r.lineTo(n,e):r.moveTo(n,e),d-=v,c=!c}function wG(r,n,e,t){r.beginPath();var i=6,a=Math.PI*2/i;r.moveTo(n+t,e);for(var o=1;o<i;o++)r.lineTo(n+t*Math.cos(a*o),e+t*Math.sin(a*o));r.closePath()}var Tm={circle:ov,dashedLine:pE,database:vE,diamond:$G,ellipse:Nc,ellipse_vis:Nc,hexagon:wG,roundRect:fE,square:gG,star:bG,triangle:yG,triangleDown:mG};function _G(r){return Object.prototype.hasOwnProperty.call(Tm,r)?Tm[r]:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];CanvasRenderingContext2D.prototype[r].call(n,t)}}var gE={exports:{}};(function(r){r.exports=n;function n(t){if(t)return e(t)}function e(t){for(var i in n.prototype)t[i]=n.prototype[i];return t}n.prototype.on=n.prototype.addEventListener=function(t,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(i),this},n.prototype.once=function(t,i){function a(){this.off(t,a),i.apply(this,arguments)}return a.fn=i,this.on(t,a),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+t];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var o,s=0;s<a.length;s++)if(o=a[s],o===i||o.fn===i){a.splice(s,1);break}return a.length===0&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),a=this._callbacks["$"+t],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(a){a=a.slice(0);for(var o=0,s=a.length;o<s;++o)a[o].apply(this,i)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}})(gE);var EG=gE.exports,yE=j(EG),SG=Oe,OG=SG("toStringTag"),mE={};mE[OG]="z";var sv=String(mE)==="[object z]",TG=sv,IG=We,Xs=Mr,kG=Oe,PG=kG("toStringTag"),CG=Object,xG=Xs(function(){return arguments}())==="Arguments",RG=function(r,n){try{return r[n]}catch{}},Ki=TG?Xs:function(r){var n,e,t;return r===void 0?"Undefined":r===null?"Null":typeof(e=RG(n=CG(r),PG))=="string"?e:xG?Xs(n):(t=Xs(n))==="Object"&&IG(n.callee)?"Arguments":t},AG=Ki,DG=String,gr=function(r){if(AG(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return DG(r)},lv=ne,MG=fu,NG=gr,FG=Co,BG=lv("".charAt),Im=lv("".charCodeAt),LG=lv("".slice),km=function(r){return function(n,e){var t=NG(FG(n)),i=MG(e),a=t.length,o,s;return i<0||i>=a?r?"":void 0:(o=Im(t,i),o<55296||o>56319||i+1===a||(s=Im(t,i+1))<56320||s>57343?r?BG(t,i):o:r?LG(t,i,i+2):(o-55296<<10)+(s-56320)+65536)}},jG={codeAt:km(!1),charAt:km(!0)},zG=Se,HG=We,Pm=zG.WeakMap,bE=HG(Pm)&&/native code/.test(String(Pm)),WG=da,UG=hu,Cm=WG("keys"),gu=function(r){return Cm[r]||(Cm[r]=UG(r))},VG=bE,$E=Se,GG=Ve,KG=ha,fh=Ge,vh=iv,qG=gu,YG=Fo,xm="Object already initialized",Fc=$E.TypeError,XG=$E.WeakMap,wl,Qa,_l,ZG=function(r){return _l(r)?Qa(r):wl(r,{})},QG=function(r){return function(n){var e;if(!GG(n)||(e=Qa(n)).type!==r)throw new Fc("Incompatible receiver, "+r+" required");return e}};if(VG||vh.state){var ar=vh.state||(vh.state=new XG);ar.get=ar.get,ar.has=ar.has,ar.set=ar.set,wl=function(r,n){if(ar.has(r))throw new Fc(xm);return n.facade=r,ar.set(r,n),n},Qa=function(r){return ar.get(r)||{}},_l=function(r){return ar.has(r)}}else{var cn=qG("state");YG[cn]=!0,wl=function(r,n){if(fh(r,cn))throw new Fc(xm);return n.facade=r,KG(r,cn,n),n},Qa=function(r){return fh(r,cn)?r[cn]:{}},_l=function(r){return fh(r,cn)}}var qi={set:wl,get:Qa,has:_l,enforce:ZG,getterFor:QG},Bc=Ue,JG=Ge,wE=Function.prototype,e7=Bc&&Object.getOwnPropertyDescriptor,uv=JG(wE,"name"),t7=uv&&(function(){}).name==="something",r7=uv&&(!Bc||Bc&&e7(wE,"name").configurable),i7={EXISTS:uv,PROPER:t7,CONFIGURABLE:r7},yu={},n7=Ue,a7=sE,o7=Ft,s7=Bt,l7=pr,u7=vu;yu.f=n7&&!a7?Object.defineProperties:function(n,e){s7(n);for(var t=l7(e),i=u7(e),a=i.length,o=0,s;a>o;)o7.f(n,s=i[o++],t[s]);return n};var d7=Vt,h7=d7("document","documentElement"),c7=Bt,f7=yu,Rm=av,v7=Fo,p7=h7,g7=aE,y7=gu,Am=">",Dm="<",Lc="prototype",jc="script",_E=y7("IE_PROTO"),ph=function(){},EE=function(r){return Dm+jc+Am+r+Dm+"/"+jc+Am},Mm=function(r){r.write(EE("")),r.close();var n=r.parentWindow.Object;return r=null,n},m7=function(){var r=g7("iframe"),n="java"+jc+":",e;return r.style.display="none",p7.appendChild(r),r.src=String(n),e=r.contentWindow.document,e.open(),e.write(EE("document.F=Object")),e.close(),e.F},Is,Zs=function(){try{Is=new ActiveXObject("htmlfile")}catch{}Zs=typeof document<"u"?document.domain&&Is?Mm(Is):m7():Mm(Is);for(var r=Rm.length;r--;)delete Zs[Lc][Rm[r]];return Zs()};v7[_E]=!0;var ca=Object.create||function(n,e){var t;return n!==null?(ph[Lc]=c7(n),t=new ph,ph[Lc]=null,t[_E]=n):t=Zs(),e===void 0?t:f7.f(t,e)},b7=re,SE=!b7(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),$7=Ge,w7=We,_7=Tt,E7=gu,S7=SE,Nm=E7("IE_PROTO"),zc=Object,O7=zc.prototype,mu=S7?zc.getPrototypeOf:function(r){var n=_7(r);if($7(n,Nm))return n[Nm];var e=n.constructor;return w7(e)&&n instanceof e?e.prototype:n instanceof zc?O7:null},T7=ha,Lo=function(r,n,e,t){return t&&t.enumerable?r[n]=e:T7(r,n,e),r},I7=re,k7=We,P7=Ve,C7=ca,Fm=mu,x7=Lo,R7=Oe,Hc=R7("iterator"),OE=!1,Sr,gh,yh;[].keys&&(yh=[].keys(),"next"in yh?(gh=Fm(Fm(yh)),gh!==Object.prototype&&(Sr=gh)):OE=!0);var A7=!P7(Sr)||I7(function(){var r={};return Sr[Hc].call(r)!==r});A7?Sr={}:Sr=C7(Sr);k7(Sr[Hc])||x7(Sr,Hc,function(){return this});var TE={IteratorPrototype:Sr,BUGGY_SAFARI_ITERATORS:OE},D7=sv,M7=Ki,N7=D7?{}.toString:function(){return"[object "+M7(this)+"]"},F7=sv,B7=Ft.f,L7=ha,j7=Ge,z7=N7,H7=Oe,Bm=H7("toStringTag"),fa=function(r,n,e,t){if(r){var i=e?r:r.prototype;j7(i,Bm)||B7(i,Bm,{configurable:!0,value:n}),t&&!F7&&L7(i,"toString",z7)}},va={},W7=TE.IteratorPrototype,U7=ca,V7=Po,G7=fa,K7=va,q7=function(){return this},Y7=function(r,n,e,t){var i=n+" Iterator";return r.prototype=U7(W7,{next:V7(+!t,e)}),G7(r,i,!1,!0),K7[i]=q7,r},X7=ne,Z7=Gi,Q7=function(r,n,e){try{return X7(Z7(Object.getOwnPropertyDescriptor(r,n)[e]))}catch{}},J7=We,eK=String,tK=TypeError,rK=function(r){if(typeof r=="object"||J7(r))return r;throw new tK("Can't set "+eK(r)+" as a prototype")},iK=Q7,nK=Bt,aK=rK,oK=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,n={},e;try{e=iK(Object.prototype,"__proto__","set"),e(n,[]),r=n instanceof Array}catch{}return function(i,a){return nK(i),aK(a),r?e(i,a):i.__proto__=a,i}}():void 0),sK=V,lK=Nt,uK=i7,dK=Y7,hK=mu,cK=fa,Lm=Lo,fK=Oe,jm=va,vK=TE,pK=uK.PROPER,ks=vK.BUGGY_SAFARI_ITERATORS,mh=fK("iterator"),zm="keys",Ps="values",Hm="entries",gK=function(){return this},dv=function(r,n,e,t,i,a,o){dK(e,n,t);var s=function(y){if(y===i&&c)return c;if(!ks&&y&&y in d)return d[y];switch(y){case zm:return function(){return new e(this,y)};case Ps:return function(){return new e(this,y)};case Hm:return function(){return new e(this,y)}}return function(){return new e(this)}},l=n+" Iterator",u=!1,d=r.prototype,h=d[mh]||d["@@iterator"]||i&&d[i],c=!ks&&h||s(i),f=n==="Array"&&d.entries||h,v,p,g;if(f&&(v=hK(f.call(new r)),v!==Object.prototype&&v.next&&(cK(v,l,!0,!0),jm[l]=gK)),pK&&i===Ps&&h&&h.name!==Ps&&(u=!0,c=function(){return lK(h,this)}),i)if(p={values:s(Ps),keys:a?c:s(zm),entries:s(Hm)},o)for(g in p)(ks||u||!(g in d))&&Lm(d,g,p[g]);else sK({target:n,proto:!0,forced:ks||u},p);return o&&d[mh]!==c&&Lm(d,mh,c,{name:i}),jm[n]=c,p},hv=function(r,n){return{value:r,done:n}},yK=jG.charAt,mK=gr,IE=qi,bK=dv,Wm=hv,kE="String Iterator",$K=IE.set,wK=IE.getterFor(kE);bK(String,"String",function(r){$K(this,{type:kE,string:mK(r),index:0})},function(){var n=wK(this),e=n.string,t=n.index,i;return t>=e.length?Wm(void 0,!0):(i=yK(e,t),n.index+=i.length,Wm(i,!1))});var _K=Nt,Um=Bt,EK=rv,PE=function(r,n,e){var t,i;Um(r);try{if(t=EK(r,"return"),!t){if(n==="throw")throw e;return e}t=_K(t,r)}catch(a){i=!0,t=a}if(n==="throw")throw e;if(i)throw t;return Um(t),e},SK=Bt,OK=PE,TK=function(r,n,e,t){try{return t?n(SK(e)[0],e[1]):n(e)}catch(i){OK(r,"throw",i)}},IK=Oe,kK=va,PK=IK("iterator"),CK=Array.prototype,CE=function(r){return r!==void 0&&(kK.Array===r||CK[PK]===r)},xK=ne,RK=We,Wc=iv,AK=xK(Function.toString);RK(Wc.inspectSource)||(Wc.inspectSource=function(r){return AK(r)});var DK=Wc.inspectSource,MK=ne,NK=re,xE=We,FK=Ki,BK=Vt,LK=DK,RE=function(){},jK=[],AE=BK("Reflect","construct"),cv=/^\s*(?:class|function)\b/,zK=MK(cv.exec),HK=!cv.test(RE),Ea=function(n){if(!xE(n))return!1;try{return AE(RE,jK,n),!0}catch{return!1}},DE=function(n){if(!xE(n))return!1;switch(FK(n)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return HK||!!zK(cv,LK(n))}catch{return!0}};DE.sham=!0;var bu=!AE||NK(function(){var r;return Ea(Ea.call)||!Ea(Object)||!Ea(function(){r=!0})||r})?DE:Ea,WK=cu,UK=Ft,VK=Po,pa=function(r,n,e){var t=WK(n);t in r?UK.f(r,t,VK(0,e)):r[t]=e},GK=Ki,Vm=rv,KK=sa,qK=va,YK=Oe,XK=YK("iterator"),$u=function(r){if(!KK(r))return Vm(r,XK)||Vm(r,"@@iterator")||qK[GK(r)]},ZK=Nt,QK=Gi,JK=Bt,eq=ua,tq=$u,rq=TypeError,ME=function(r,n){var e=arguments.length<2?tq(r):n;if(QK(e))return JK(ZK(e,r));throw new rq(eq(r)+" is not iterable")},iq=Mo,nq=Nt,aq=Tt,oq=TK,sq=CE,lq=bu,uq=Gt,Gm=pa,dq=ME,hq=$u,Km=Array,cq=function(n){var e=aq(n),t=lq(this),i=arguments.length,a=i>1?arguments[1]:void 0,o=a!==void 0;o&&(a=iq(a,i>2?arguments[2]:void 0));var s=hq(e),l=0,u,d,h,c,f,v;if(s&&!(this===Km&&sq(s)))for(c=dq(e,s),f=c.next,d=t?new this:[];!(h=nq(f,c)).done;l++)v=o?oq(c,a,[h.value,l],!0):h.value,Gm(d,l,v);else for(u=uq(e),d=t?new this(u):Km(u);u>l;l++)v=o?a(e[l],l):e[l],Gm(d,l,v);return d.length=l,d},fq=Oe,NE=fq("iterator"),FE=!1;try{var vq=0,qm={next:function(){return{done:!!vq++}},return:function(){FE=!0}};qm[NE]=function(){return this},Array.from(qm,function(){throw 2})}catch{}var pq=function(r,n){try{if(!n&&!FE)return!1}catch{return!1}var e=!1;try{var t={};t[NE]=function(){return{next:function(){return{done:e=!0}}}},r(t)}catch{}return e},gq=V,yq=cq,mq=pq,bq=!mq(function(r){Array.from(r)});gq({target:"Array",stat:!0,forced:bq},{from:yq});var $q=ie,wq=$q.Array.from,_q=wq,BE=_q,Eq=BE,Yi=j(Eq),Sq=pr,Ym=va,LE=qi;Ft.f;var Oq=dv,Cs=hv,jE="Array Iterator",Tq=LE.set,Iq=LE.getterFor(jE);Oq(Array,"Array",function(r,n){Tq(this,{type:jE,target:Sq(r),index:0,kind:n})},function(){var r=Iq(this),n=r.target,e=r.kind,t=r.index++;if(!n||t>=n.length)return r.target=void 0,Cs(void 0,!0);switch(e){case"keys":return Cs(t,!1);case"values":return Cs(n[t],!1)}return Cs([t,n[t]],!1)},"values");Ym.Arguments=Ym.Array;var kq=$u,Pq=kq,Cq={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},xq=Cq,Rq=Se,Aq=Ki,Dq=ha,Xm=va,Mq=Oe,Zm=Mq("toStringTag");for(var bh in xq){var Qm=Rq[bh],$h=Qm&&Qm.prototype;$h&&Aq($h)!==Zm&&Dq($h,Zm,bh),Xm[bh]=Xm.Array}var Nq=Pq,Fq=Nq,Bq=Fq,Lq=Bq,jq=Lq,zq=jq,zE=zq,HE=j(zE),Hq=zE,Xi=j(Hq);function C(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var WE={exports:{}},Wq=V,Uq=Ue,Jm=Ft.f;Wq({target:"Object",stat:!0,forced:Object.defineProperty!==Jm,sham:!Uq},{defineProperty:Jm});var Vq=ie,UE=Vq.Object,Gq=WE.exports=function(n,e,t){return UE.defineProperty(n,e,t)};UE.defineProperty.sham&&(Gq.sham=!0);var Kq=WE.exports,qq=Kq,VE=qq,Yq=VE,Xq=Yq,Zq=Xq,Qq=Zq,Jq=Qq,wu=j(Jq),eY=Mr,Zi=Array.isArray||function(n){return eY(n)==="Array"},tY=TypeError,rY=9007199254740991,fv=function(r){if(r>rY)throw tY("Maximum allowed index exceeded");return r},eb=Zi,iY=bu,nY=Ve,aY=Oe,oY=aY("species"),tb=Array,sY=function(r){var n;return eb(r)&&(n=r.constructor,iY(n)&&(n===tb||eb(n.prototype))?n=void 0:nY(n)&&(n=n[oY],n===null&&(n=void 0))),n===void 0?tb:n},lY=sY,vv=function(r,n){return new(lY(r))(n===0?0:n)},uY=re,dY=Oe,hY=Ro,cY=dY("species"),jo=function(r){return hY>=51||!uY(function(){var n=[],e=n.constructor={};return e[cY]=function(){return{foo:1}},n[r](Boolean).foo!==1})},fY=V,vY=re,pY=Zi,gY=Ve,yY=Tt,mY=Gt,rb=fv,ib=pa,bY=vv,$Y=jo,wY=Oe,_Y=Ro,GE=wY("isConcatSpreadable"),EY=_Y>=51||!vY(function(){var r=[];return r[GE]=!1,r.concat()[0]!==r}),SY=function(r){if(!gY(r))return!1;var n=r[GE];return n!==void 0?!!n:pY(r)},OY=!EY||!$Y("concat");fY({target:"Array",proto:!0,arity:1,forced:OY},{concat:function(n){var e=yY(this),t=bY(e,0),i=0,a,o,s,l,u;for(a=-1,s=arguments.length;a<s;a++)if(u=a===-1?e:arguments[a],SY(u))for(l=mY(u),rb(i+l),o=0;o<l;o++,i++)o in u&&ib(t,i,u[o]);else rb(i+1),ib(t,i++,u);return t.length=i,t}});var zo={},TY=lE,IY=av,kY=IY.concat("length","prototype");zo.f=Object.getOwnPropertyNames||function(n){return TY(n,kY)};var _u={},nb=No,PY=Gt,CY=pa,xY=Array,RY=Math.max,KE=function(r,n,e){for(var t=PY(r),i=nb(n,t),a=nb(e===void 0?t:e,t),o=xY(RY(a-i,0)),s=0;i<a;i++,s++)CY(o,s,r[i]);return o.length=s,o},AY=Mr,DY=pr,qE=zo.f,MY=KE,YE=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],NY=function(r){try{return qE(r)}catch{return MY(YE)}};_u.f=function(n){return YE&&AY(n)==="Window"?NY(n):qE(DY(n))};var FY=Ft,pv=function(r,n,e){return FY.f(r,n,e)},Ho={},BY=Oe;Ho.f=BY;var ab=ie,LY=Ge,jY=Ho,zY=Ft.f,Te=function(r){var n=ab.Symbol||(ab.Symbol={});LY(n,r)||zY(n,r,{value:jY.f(r)})},HY=Nt,WY=Vt,UY=Oe,VY=Lo,XE=function(){var r=WY("Symbol"),n=r&&r.prototype,e=n&&n.valueOf,t=UY("toPrimitive");n&&!n[t]&&VY(n,t,function(i){return HY(e,this)},{arity:1})},GY=Mo,KY=ne,qY=du,YY=Tt,XY=Gt,ZY=vv,ob=KY([].push),Br=function(r){var n=r===1,e=r===2,t=r===3,i=r===4,a=r===6,o=r===7,s=r===5||a;return function(l,u,d,h){for(var c=YY(l),f=qY(c),v=GY(u,d),p=XY(f),g=0,y=h||ZY,m=n?y(l,p):e||o?y(l,0):void 0,$,b;p>g;g++)if((s||g in f)&&($=f[g],b=v($,g,c),r))if(n)m[g]=b;else if(b)switch(r){case 3:return!0;case 5:return $;case 6:return g;case 2:ob(m,$)}else switch(r){case 4:return!1;case 7:ob(m,$)}return a?-1:t||i?i:m}},si={forEach:Br(0),map:Br(1),filter:Br(2),some:Br(3),every:Br(4),find:Br(5),findIndex:Br(6),filterReject:Br(7)},Eu=V,Su=Se,gv=Nt,QY=ne,Ln=Ue,jn=la,JY=re,je=Ge,eX=Ce,Uc=Bt,Ou=pr,yv=cu,tX=gr,Vc=Po,Ja=ca,ZE=vu,rX=zo,QE=_u,iX=Bo,JE=oa,eS=Ft,nX=yu,tS=uu,sb=Lo,aX=pv,mv=da,oX=gu,rS=Fo,lb=hu,sX=Oe,lX=Ho,uX=Te,dX=XE,hX=fa,iS=qi,Tu=si.forEach,bt=oX("hidden"),Iu="Symbol",eo="prototype",cX=iS.set,ub=iS.getterFor(Iu),Jt=Object[eo],Si=Su.Symbol,Pa=Si&&Si[eo],fX=Su.RangeError,vX=Su.TypeError,wh=Su.QObject,nS=JE.f,Oi=eS.f,aS=QE.f,pX=tS.f,oS=QY([].push),xr=mv("symbols"),Wo=mv("op-symbols"),gX=mv("wks"),Gc=!wh||!wh[eo]||!wh[eo].findChild,sS=function(r,n,e){var t=nS(Jt,n);t&&delete Jt[n],Oi(r,n,e),t&&r!==Jt&&Oi(Jt,n,t)},Kc=Ln&&JY(function(){return Ja(Oi({},"a",{get:function(){return Oi(this,"a",{value:7}).a}})).a!==7})?sS:Oi,_h=function(r,n){var e=xr[r]=Ja(Pa);return cX(e,{type:Iu,tag:r,description:n}),Ln||(e.description=n),e},ku=function(n,e,t){n===Jt&&ku(Wo,e,t),Uc(n);var i=yv(e);return Uc(t),je(xr,i)?(t.enumerable?(je(n,bt)&&n[bt][i]&&(n[bt][i]=!1),t=Ja(t,{enumerable:Vc(0,!1)})):(je(n,bt)||Oi(n,bt,Vc(1,{})),n[bt][i]=!0),Kc(n,i,t)):Oi(n,i,t)},bv=function(n,e){Uc(n);var t=Ou(e),i=ZE(t).concat(hS(t));return Tu(i,function(a){(!Ln||gv(lS,t,a))&&ku(n,a,t[a])}),n},yX=function(n,e){return e===void 0?Ja(n):bv(Ja(n),e)},lS=function(n){var e=yv(n),t=gv(pX,this,e);return this===Jt&&je(xr,e)&&!je(Wo,e)?!1:t||!je(this,e)||!je(xr,e)||je(this,bt)&&this[bt][e]?t:!0},uS=function(n,e){var t=Ou(n),i=yv(e);if(!(t===Jt&&je(xr,i)&&!je(Wo,i))){var a=nS(t,i);return a&&je(xr,i)&&!(je(t,bt)&&t[bt][i])&&(a.enumerable=!0),a}},dS=function(n){var e=aS(Ou(n)),t=[];return Tu(e,function(i){!je(xr,i)&&!je(rS,i)&&oS(t,i)}),t},hS=function(r){var n=r===Jt,e=aS(n?Wo:Ou(r)),t=[];return Tu(e,function(i){je(xr,i)&&(!n||je(Jt,i))&&oS(t,xr[i])}),t};jn||(Si=function(){if(eX(Pa,this))throw new vX("Symbol is not a constructor");var n=!arguments.length||arguments[0]===void 0?void 0:tX(arguments[0]),e=lb(n),t=function(i){this===Jt&&gv(t,Wo,i),je(this,bt)&&je(this[bt],e)&&(this[bt][e]=!1);var a=Vc(1,i);try{Kc(this,e,a)}catch(o){if(!(o instanceof fX))throw o;sS(this,e,a)}};return Ln&&Gc&&Kc(Jt,e,{configurable:!0,set:t}),_h(e,n)},Pa=Si[eo],sb(Pa,"toString",function(){return ub(this).tag}),sb(Si,"withoutSetter",function(r){return _h(lb(r),r)}),tS.f=lS,eS.f=ku,nX.f=bv,JE.f=uS,rX.f=QE.f=dS,iX.f=hS,lX.f=function(r){return _h(sX(r),r)},Ln&&aX(Pa,"description",{configurable:!0,get:function(){return ub(this).description}}));Eu({global:!0,constructor:!0,wrap:!0,forced:!jn,sham:!jn},{Symbol:Si});Tu(ZE(gX),function(r){uX(r)});Eu({target:Iu,stat:!0,forced:!jn},{useSetter:function(){Gc=!0},useSimple:function(){Gc=!1}});Eu({target:"Object",stat:!0,forced:!jn,sham:!Ln},{create:yX,defineProperty:ku,defineProperties:bv,getOwnPropertyDescriptor:uS});Eu({target:"Object",stat:!0,forced:!jn},{getOwnPropertyNames:dS});dX();hX(Si,Iu);rS[bt]=!0;var mX=la,cS=mX&&!!Symbol.for&&!!Symbol.keyFor,bX=V,$X=Vt,wX=Ge,_X=gr,fS=da,EX=cS,Eh=fS("string-to-symbol-registry"),SX=fS("symbol-to-string-registry");bX({target:"Symbol",stat:!0,forced:!EX},{for:function(r){var n=_X(r);if(wX(Eh,n))return Eh[n];var e=$X("Symbol")(n);return Eh[n]=e,SX[e]=n,e}});var OX=V,TX=Ge,IX=Ao,kX=ua,PX=da,CX=cS,db=PX("symbol-to-string-registry");OX({target:"Symbol",stat:!0,forced:!CX},{keyFor:function(n){if(!IX(n))throw new TypeError(kX(n)+" is not a symbol");if(TX(db,n))return db[n]}});var xX=ne,hb=Zi,RX=We,cb=Mr,AX=gr,fb=xX([].push),DX=function(r){if(RX(r))return r;if(hb(r)){for(var n=r.length,e=[],t=0;t<n;t++){var i=r[t];typeof i=="string"?fb(e,i):(typeof i=="number"||cb(i)==="Number"||cb(i)==="String")&&fb(e,AX(i))}var a=e.length,o=!0;return function(s,l){if(o)return o=!1,l;if(hb(this))return l;for(var u=0;u<a;u++)if(e[u]===s)return l}}},MX=V,vS=Vt,pS=ko,NX=Nt,Uo=ne,gS=re,vb=We,pb=Ao,yS=pu,FX=DX,BX=la,LX=String,Yr=vS("JSON","stringify"),xs=Uo(/./.exec),gb=Uo("".charAt),jX=Uo("".charCodeAt),zX=Uo("".replace),HX=Uo(1 .toString),WX=/[\uD800-\uDFFF]/g,yb=/^[\uD800-\uDBFF]$/,mb=/^[\uDC00-\uDFFF]$/,bb=!BX||gS(function(){var r=vS("Symbol")("stringify detection");return Yr([r])!=="[null]"||Yr({a:r})!=="{}"||Yr(Object(r))!=="{}"}),$b=gS(function(){return Yr("\uDF06\uD834")!=='"\\udf06\\ud834"'||Yr("\uDEAD")!=='"\\udead"'}),UX=function(r,n){var e=yS(arguments),t=FX(n);if(!(!vb(t)&&(r===void 0||pb(r))))return e[1]=function(i,a){if(vb(t)&&(a=NX(t,this,LX(i),a)),!pb(a))return a},pS(Yr,null,e)},VX=function(r,n,e){var t=gb(e,n-1),i=gb(e,n+1);return xs(yb,r)&&!xs(mb,i)||xs(mb,r)&&!xs(yb,t)?"\\u"+HX(jX(r,0),16):r};Yr&&MX({target:"JSON",stat:!0,arity:3,forced:bb||$b},{stringify:function(n,e,t){var i=yS(arguments),a=pS(bb?UX:Yr,null,i);return $b&&typeof a=="string"?zX(a,WX,VX):a}});var GX=V,KX=la,qX=re,mS=Bo,YX=Tt,XX=!KX||qX(function(){mS.f(1)});GX({target:"Object",stat:!0,forced:XX},{getOwnPropertySymbols:function(n){var e=mS.f;return e?e(YX(n)):[]}});var ZX=Te;ZX("asyncIterator");var QX=Te;QX("hasInstance");var JX=Te;JX("isConcatSpreadable");var eZ=Te;eZ("iterator");var tZ=Te;tZ("match");var rZ=Te;rZ("matchAll");var iZ=Te;iZ("replace");var nZ=Te;nZ("search");var aZ=Te;aZ("species");var oZ=Te;oZ("split");var sZ=Te,lZ=XE;sZ("toPrimitive");lZ();var uZ=Vt,dZ=Te,hZ=fa;dZ("toStringTag");hZ(uZ("Symbol"),"Symbol");var cZ=Te;cZ("unscopables");var fZ=Se,vZ=fa;vZ(fZ.JSON,"JSON",!0);var pZ=ie,gZ=pZ.Symbol,yZ=gZ,bS=yZ,mZ=Oe,bZ=Ft.f,wb=mZ("metadata"),_b=Function.prototype;_b[wb]===void 0&&bZ(_b,wb,{value:null});var $Z=Te;$Z("asyncDispose");var wZ=Te;wZ("dispose");var _Z=Te;_Z("metadata");var EZ=bS,SZ=EZ,OZ=Vt,TZ=ne,$v=OZ("Symbol"),IZ=$v.keyFor,kZ=TZ($v.prototype.valueOf),$S=$v.isRegisteredSymbol||function(n){try{return IZ(kZ(n))!==void 0}catch{return!1}},PZ=V,CZ=$S;PZ({target:"Symbol",stat:!0},{isRegisteredSymbol:CZ});var xZ=da,wS=Vt,RZ=ne,AZ=Ao,DZ=Oe,El=wS("Symbol"),Eb=El.isWellKnownSymbol,_S=wS("Object","getOwnPropertyNames"),MZ=RZ(El.prototype.valueOf),Sb=xZ("wks");for(var Sh=0,Ob=_S(El),NZ=Ob.length;Sh<NZ;Sh++)try{var Tb=Ob[Sh];AZ(El[Tb])&&DZ(Tb)}catch{}var ES=function(n){if(Eb&&Eb(n))return!0;try{for(var e=MZ(n),t=0,i=_S(Sb),a=i.length;t<a;t++)if(Sb[i[t]]==e)return!0}catch{}return!1},FZ=V,BZ=ES;FZ({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:BZ});var LZ=Te;LZ("matcher");var jZ=Te;jZ("observable");var zZ=V,HZ=$S;zZ({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:HZ});var WZ=V,UZ=ES;WZ({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:UZ});var VZ=Te;VZ("metadataKey");var GZ=Te;GZ("patternMatch");var KZ=Te;KZ("replaceAll");var qZ=SZ,YZ=qZ,XZ=YZ,On=j(XZ),ZZ=Ho,QZ=ZZ.f("iterator"),JZ=QZ,eQ=JZ,tQ=eQ,rQ=tQ,iQ=rQ,nQ=iQ,aQ=nQ,oQ=j(aQ);function ue(r){"@babel/helpers - typeof";return ue=typeof On=="function"&&typeof oQ=="symbol"?function(n){return typeof n}:function(n){return n&&typeof On=="function"&&n.constructor===On&&n!==On.prototype?"symbol":typeof n},ue(r)}var sQ=Ho,lQ=sQ.f("toPrimitive"),uQ=lQ,dQ=uQ,hQ=dQ,cQ=hQ,fQ=cQ,vQ=fQ,pQ=vQ,gQ=j(pQ);function yQ(r,n){if(ue(r)!=="object"||r===null)return r;var e=r[gQ];if(e!==void 0){var t=e.call(r,n||"default");if(ue(t)!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function SS(r){var n=yQ(r,"string");return ue(n)==="symbol"?n:String(n)}function Ib(r,n){for(var e=0;e<n.length;e++){var t=n[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),wu(r,SS(t.key),t)}}function x(r,n,e){return n&&Ib(r.prototype,n),e&&Ib(r,e),wu(r,"prototype",{writable:!1}),r}var mQ=V,bQ=Zi;mQ({target:"Array",stat:!0},{isArray:bQ});var $Q=ie,wQ=$Q.Array.isArray,_Q=wQ,OS=_Q,EQ=OS,SQ=EQ,OQ=SQ,TQ=OQ,IQ=TQ,TS=j(IQ);function kQ(r){if(TS(r))return r}var PQ=Ue,CQ=Zi,xQ=TypeError,RQ=Object.getOwnPropertyDescriptor,AQ=PQ&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}(),IS=AQ?function(r,n){if(CQ(r)&&!RQ(r,"length").writable)throw new xQ("Cannot set read only .length");return r.length=n}:function(r,n){return r.length=n},DQ=V,MQ=Tt,NQ=Gt,FQ=IS,BQ=fv,LQ=re,jQ=LQ(function(){return[].push.call({length:4294967296},1)!==4294967297}),zQ=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}},HQ=jQ||!zQ();DQ({target:"Array",proto:!0,arity:1,forced:HQ},{push:function(n){var e=MQ(this),t=NQ(e),i=arguments.length;BQ(t+i);for(var a=0;a<i;a++)e[t]=arguments[a],t++;return FQ(e,t),t}});var WQ=Ke,UQ=WQ("Array").push,VQ=Ce,GQ=UQ,Oh=Array.prototype,KQ=function(r){var n=r.push;return r===Oh||VQ(Oh,r)&&n===Oh.push?GQ:n},qQ=KQ,YQ=qQ,XQ=YQ,ZQ=XQ,QQ=ZQ,JQ=QQ,eJ=JQ,tJ=j(eJ);function rJ(r,n){var e=r==null?null:typeof On<"u"&&HE(r)||r["@@iterator"];if(e!=null){var t,i,a,o,s=[],l=!0,u=!1;try{if(a=(e=e.call(r)).next,n===0){if(Object(e)!==e)return;l=!1}else for(;!(l=(t=a.call(e)).done)&&(tJ(s).call(s,t.value),s.length!==n);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&e.return!=null&&(o=e.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}var iJ=V,kb=Zi,nJ=bu,aJ=Ve,Pb=No,oJ=Gt,sJ=pr,lJ=pa,uJ=Oe,dJ=jo,hJ=pu,cJ=dJ("slice"),fJ=uJ("species"),Th=Array,vJ=Math.max;iJ({target:"Array",proto:!0,forced:!cJ},{slice:function(n,e){var t=sJ(this),i=oJ(t),a=Pb(n,i),o=Pb(e===void 0?i:e,i),s,l,u;if(kb(t)&&(s=t.constructor,nJ(s)&&(s===Th||kb(s.prototype))?s=void 0:aJ(s)&&(s=s[fJ],s===null&&(s=void 0)),s===Th||s===void 0))return hJ(t,a,o);for(l=new(s===void 0?Th:s)(vJ(o-a,0)),u=0;a<o;a++,u++)a in t&&lJ(l,u,t[a]);return l.length=u,l}});var pJ=Ke,gJ=pJ("Array").slice,yJ=Ce,mJ=gJ,Ih=Array.prototype,bJ=function(r){var n=r.slice;return r===Ih||yJ(Ih,r)&&n===Ih.slice?mJ:n},$J=bJ,kS=$J,wJ=kS,_J=wJ,EJ=_J,SJ=EJ,OJ=SJ,TJ=j(OJ),IJ=BE,kJ=IJ,PJ=kJ,CJ=PJ,xJ=CJ,PS=j(xJ);function qc(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}function CS(r,n){var e;if(r){if(typeof r=="string")return qc(r,n);var t=TJ(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return PS(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qc(r,n)}}function RJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function we(r,n){return kQ(r)||rJ(r,n)||CS(r,n)||RJ()}function AJ(r){if(TS(r))return qc(r)}function DJ(r){if(typeof On<"u"&&HE(r)!=null||r["@@iterator"]!=null)return PS(r)}function MJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function or(r){return AJ(r)||DJ(r)||CS(r)||MJ()}var NJ=bS,li=j(NJ),FJ=Ke,BJ=FJ("Array").concat,LJ=Ce,jJ=BJ,kh=Array.prototype,zJ=function(r){var n=r.concat;return r===kh||LJ(kh,r)&&n===kh.concat?jJ:n},HJ=zJ,WJ=HJ,UJ=WJ,wv=j(UJ),VJ=kS,Ze=j(VJ),GJ=Vt,KJ=ne,qJ=zo,YJ=Bo,XJ=Bt,ZJ=KJ([].concat),QJ=GJ("Reflect","ownKeys")||function(n){var e=qJ.f(XJ(n)),t=YJ.f;return t?ZJ(e,t(n)):e},JJ=OS,se=j(JJ),eee=V,tee=si.map,ree=jo,iee=ree("map");eee({target:"Array",proto:!0,forced:!iee},{map:function(n){return tee(this,n,arguments.length>1?arguments[1]:void 0)}});var nee=Ke,aee=nee("Array").map,oee=Ce,see=aee,Ph=Array.prototype,lee=function(r){var n=r.map;return r===Ph||oee(Ph,r)&&n===Ph.map?see:n},uee=lee,dee=uee,hee=dee,zn=j(hee),cee=V,fee=Tt,xS=vu,vee=re,pee=vee(function(){xS(1)});cee({target:"Object",stat:!0,forced:pee},{keys:function(n){return xS(fee(n))}});var gee=ie,yee=gee.Object.keys,mee=yee,bee=mee,$ee=bee,$e=j($ee),wee=V,_ee=ne,RS=Date,Eee=_ee(RS.prototype.getTime);wee({target:"Date",stat:!0},{now:function(){return Eee(new RS)}});var See=ie,Oee=See.Date.now,Tee=Oee,Iee=Tee,kee=Iee,Sl=j(kee),Pee=re,ga=function(r,n){var e=[][r];return!!e&&Pee(function(){e.call(null,n||function(){return 1},1)})},Cee=si.forEach,xee=ga,Ree=xee("forEach"),Aee=Ree?[].forEach:function(n){return Cee(this,n,arguments.length>1?arguments[1]:void 0)},Dee=V,Cb=Aee;Dee({target:"Array",proto:!0,forced:[].forEach!==Cb},{forEach:Cb});var Mee=Ke,Nee=Mee("Array").forEach,Fee=Nee,Bee=Fee,Lee=Ki,jee=Ge,zee=Ce,Hee=Bee,Ch=Array.prototype,Wee={DOMTokenList:!0,NodeList:!0},Uee=function(r){var n=r.forEach;return r===Ch||zee(Ch,r)&&n===Ch.forEach||jee(Wee,Lee(r))?Hee:n},Vee=Uee,de=j(Vee),Gee=V,Kee=ne,qee=Zi,Yee=Kee([].reverse),xb=[1,2];Gee({target:"Array",proto:!0,forced:String(xb)===String(xb.reverse())},{reverse:function(){return qee(this)&&(this.length=this.length),Yee(this)}});var Xee=Ke,Zee=Xee("Array").reverse,Qee=Ce,Jee=Zee,xh=Array.prototype,ete=function(r){var n=r.reverse;return r===xh||Qee(xh,r)&&n===xh.reverse?Jee:n},tte=ete,rte=tte,ite=rte,Ti=j(ite),Rb=ua,nte=TypeError,AS=function(r,n){if(!delete r[n])throw new nte("Cannot delete property "+Rb(n)+" of "+Rb(r))},ate=V,ote=Tt,ste=No,lte=fu,ute=Gt,dte=IS,hte=fv,cte=vv,fte=pa,Rh=AS,vte=jo,pte=vte("splice"),gte=Math.max,yte=Math.min;ate({target:"Array",proto:!0,forced:!pte},{splice:function(n,e){var t=ote(this),i=ute(t),a=ste(n,i),o=arguments.length,s,l,u,d,h,c;for(o===0?s=l=0:o===1?(s=0,l=i-a):(s=o-2,l=yte(gte(lte(e),0),i-a)),hte(i+s-l),u=cte(t,l),d=0;d<l;d++)h=a+d,h in t&&fte(u,d,t[h]);if(u.length=l,s<l){for(d=a;d<i-l;d++)h=d+l,c=d+s,h in t?t[c]=t[h]:Rh(t,c);for(d=i;d>i-l+s;d--)Rh(t,d-1)}else if(s>l)for(d=i-l;d>a;d--)h=d+l-1,c=d+s-1,h in t?t[c]=t[h]:Rh(t,c);for(d=0;d<s;d++)t[d+a]=arguments[d+2];return dte(t,i-l+s),u}});var mte=Ke,bte=mte("Array").splice,$te=Ce,wte=bte,Ah=Array.prototype,_te=function(r){var n=r.splice;return r===Ah||$te(Ah,r)&&n===Ah.splice?wte:n},Ete=_te,Ste=Ete,Ote=Ste,Or=j(Ote),Tte=V,Ite=nv.includes,kte=re,Pte=kte(function(){return!Array(1).includes()});Tte({target:"Array",proto:!0,forced:Pte},{includes:function(n){return Ite(this,n,arguments.length>1?arguments[1]:void 0)}});var Cte=Ke,xte=Cte("Array").includes,Rte=Ve,Ate=Mr,Dte=Oe,Mte=Dte("match"),Nte=function(r){var n;return Rte(r)&&((n=r[Mte])!==void 0?!!n:Ate(r)==="RegExp")},Fte=Nte,Bte=TypeError,Lte=function(r){if(Fte(r))throw new Bte("The method doesn't accept regular expressions");return r},jte=Oe,zte=jte("match"),Hte=function(r){var n=/./;try{"/./"[r](n)}catch{try{return n[zte]=!1,"/./"[r](n)}catch{}}return!1},Wte=V,Ute=ne,Vte=Lte,Gte=Co,Ab=gr,Kte=Hte,qte=Ute("".indexOf);Wte({target:"String",proto:!0,forced:!Kte("includes")},{includes:function(n){return!!~qte(Ab(Gte(this)),Ab(Vte(n)),arguments.length>1?arguments[1]:void 0)}});var Yte=Ke,Xte=Yte("String").includes,Db=Ce,Zte=xte,Qte=Xte,Dh=Array.prototype,Mh=String.prototype,Jte=function(r){var n=r.includes;return r===Dh||Db(Dh,r)&&n===Dh.includes?Zte:typeof r=="string"||r===Mh||Db(Mh,r)&&n===Mh.includes?Qte:n},ere=Jte,tre=ere,rre=tre,Xr=j(rre),ire=V,nre=re,are=Tt,DS=mu,ore=SE,sre=nre(function(){DS(1)});ire({target:"Object",stat:!0,forced:sre,sham:!ore},{getPrototypeOf:function(n){return DS(are(n))}});var lre=ie,ure=lre.Object.getPrototypeOf,dre=ure,MS=dre,hre=MS,Mb=j(hre),cre=V,fre=si.filter,vre=jo,pre=vre("filter");cre({target:"Array",proto:!0,forced:!pre},{filter:function(n){return fre(this,n,arguments.length>1?arguments[1]:void 0)}});var gre=Ke,yre=gre("Array").filter,mre=Ce,bre=yre,Nh=Array.prototype,$re=function(r){var n=r.filter;return r===Nh||mre(Nh,r)&&n===Nh.filter?bre:n},wre=$re,_re=wre,Ere=_re,$t=j(Ere),_v=`	
\v\f\r                 \u2028\u2029\uFEFF`,Sre=ne,Ore=Co,Tre=gr,Yc=_v,Nb=Sre("".replace),Ire=RegExp("^["+Yc+"]+"),kre=RegExp("(^|[^"+Yc+"])["+Yc+"]+$"),Fh=function(r){return function(n){var e=Tre(Ore(n));return r&1&&(e=Nb(e,Ire,"")),r&2&&(e=Nb(e,kre,"$1")),e}},NS={start:Fh(1),end:Fh(2),trim:Fh(3)},FS=Se,Pre=re,Cre=ne,xre=gr,Rre=NS.trim,Fb=_v,Na=FS.parseInt,Bb=FS.Symbol,Lb=Bb&&Bb.iterator,BS=/^[+-]?0x/i,Are=Cre(BS.exec),Dre=Na(Fb+"08")!==8||Na(Fb+"0x16")!==22||Lb&&!Pre(function(){Na(Object(Lb))}),Mre=Dre?function(n,e){var t=Rre(xre(n));return Na(t,e>>>0||(Are(BS,t)?16:10))}:Na,Nre=V,jb=Mre;Nre({global:!0,forced:parseInt!==jb},{parseInt:jb});var Fre=ie,Bre=Fre.parseInt,Lre=Bre,jre=Lre,zre=jre,Zt=j(zre),Hre=V,Wre=tv,Ure=nv.indexOf,Vre=ga,Xc=Wre([].indexOf),LS=!!Xc&&1/Xc([1],1,-0)<0,Gre=LS||!Vre("indexOf");Hre({target:"Array",proto:!0,forced:Gre},{indexOf:function(n){var e=arguments.length>1?arguments[1]:void 0;return LS?Xc(this,n,e)||0:Ure(this,n,e)}});var Kre=Ke,qre=Kre("Array").indexOf,Yre=Ce,Xre=qre,Bh=Array.prototype,Zre=function(r){var n=r.indexOf;return r===Bh||Yre(Bh,r)&&n===Bh.indexOf?Xre:n},Qre=Zre,Jre=Qre,eie=Jre,te=j(eie),tie=V,rie=Ue,iie=ca;tie({target:"Object",stat:!0,sham:!rie},{create:iie});var nie=ie,aie=nie.Object,oie=function(n,e){return aie.create(n,e)},sie=oie,jS=sie,lie=jS,Ii=j(lie),Zc=ie,uie=ko;Zc.JSON||(Zc.JSON={stringify:JSON.stringify});var die=function(n,e,t){return uie(Zc.JSON.stringify,null,arguments)},hie=die,cie=hie,fie=cie,Vo=j(fie),vie=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",pie=TypeError,gie=function(r,n){if(r<n)throw new pie("Not enough arguments");return r},zS=Se,yie=ko,mie=We,bie=vie,$ie=xo,wie=pu,_ie=gie,Eie=zS.Function,Sie=/MSIE .\./.test($ie)||bie&&function(){var r=zS.Bun.version.split(".");return r.length<3||r[0]==="0"&&(r[1]<3||r[1]==="3"&&r[2]==="0")}(),HS=function(r,n){var e=n?2:1;return Sie?function(t,i){var a=_ie(arguments.length,1)>e,o=mie(t)?t:Eie(t),s=a?wie(arguments,e):[],l=a?function(){yie(o,this,s)}:o;return n?r(l,i):r(l)}:r},Oie=V,WS=Se,Tie=HS,zb=Tie(WS.setInterval,!0);Oie({global:!0,bind:!0,forced:WS.setInterval!==zb},{setInterval:zb});var Iie=V,US=Se,kie=HS,Hb=kie(US.setTimeout,!0);Iie({global:!0,bind:!0,forced:US.setTimeout!==Hb},{setTimeout:Hb});var Pie=ie,Cie=Pie.setTimeout,xie=Cie,hr=j(xie),Rie=Tt,Wb=No,Aie=Gt,Die=function(n){for(var e=Rie(this),t=Aie(e),i=arguments.length,a=Wb(i>1?arguments[1]:void 0,t),o=i>2?arguments[2]:void 0,s=o===void 0?t:Wb(o,t);s>a;)e[a++]=n;return e},Mie=V,Nie=Die;Mie({target:"Array",proto:!0},{fill:Nie});var Fie=Ke,Bie=Fie("Array").fill,Lie=Ce,jie=Bie,Lh=Array.prototype,zie=function(r){var n=r.fill;return r===Lh||Lie(Lh,r)&&n===Lh.fill?jie:n},Hie=zie,Wie=Hie,Uie=Wie,Go=j(Uie);/*! Hammer.JS - v2.0.17-rc - 2019-12-16
 * http://naver.github.io/egjs
 *
 * Forked By Naver egjs
 * Copyright (c) hammerjs
 * Licensed under the MIT license */function tr(){return tr=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},tr.apply(this,arguments)}function Kt(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n}function Rs(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}var Qc;typeof Object.assign!="function"?Qc=function(n){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(n),t=1;t<arguments.length;t++){var i=arguments[t];if(i!=null)for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}:Qc=Object.assign;var Mi=Qc,Ub=["","webkit","Moz","MS","ms","o"],Vie=typeof document>"u"?{style:{}}:document.createElement("div"),Gie="function",Tn=Math.round,Ni=Math.abs,Ev=Date.now;function Pu(r,n){for(var e,t,i=n[0].toUpperCase()+n.slice(1),a=0;a<Ub.length;){if(e=Ub[a],t=e?e+i:n,t in r)return t;a++}}var Tr;typeof window>"u"?Tr={}:Tr=window;var VS=Pu(Vie.style,"touchAction"),GS=VS!==void 0;function Kie(){if(!GS)return!1;var r={},n=Tr.CSS&&Tr.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return r[e]=n?Tr.CSS.supports("touch-action",e):!0}),r}var KS="compute",qS="auto",Jc="manipulation",ki="none",to="pan-x",ro="pan-y",As=Kie(),qie=/mobile|tablet|ip(ad|hone|od)|android/i,YS="ontouchstart"in Tr,Yie=Pu(Tr,"PointerEvent")!==void 0,Xie=YS&&qie.test(navigator.userAgent),Ko="touch",Zie="pen",Sv="mouse",Qie="kinect",Jie=25,ht=1,Qi=2,Me=4,_t=8,Ol=1,qo=2,Yo=4,Xo=8,Hn=16,cr=qo|Yo,Pi=Xo|Hn,XS=cr|Pi,ZS=["x","y"],Tl=["clientX","clientY"];function Ir(r,n,e){var t;if(r)if(r.forEach)r.forEach(n,e);else if(r.length!==void 0)for(t=0;t<r.length;)n.call(e,r[t],t,r),t++;else for(t in r)r.hasOwnProperty(t)&&n.call(e,r[t],t,r)}function Cu(r,n){return typeof r===Gie?r.apply(n&&n[0]||void 0,n):r}function mi(r,n){return r.indexOf(n)>-1}function ene(r){if(mi(r,ki))return ki;var n=mi(r,to),e=mi(r,ro);return n&&e?ki:n||e?n?to:ro:mi(r,Jc)?Jc:qS}var QS=function(){function r(e,t){this.manager=e,this.set(t)}var n=r.prototype;return n.set=function(t){t===KS&&(t=this.compute()),GS&&this.manager.element.style&&As[t]&&(this.manager.element.style[VS]=t),this.actions=t.toLowerCase().trim()},n.update=function(){this.set(this.manager.options.touchAction)},n.compute=function(){var t=[];return Ir(this.manager.recognizers,function(i){Cu(i.options.enable,[i])&&(t=t.concat(i.getTouchAction()))}),ene(t.join(" "))},n.preventDefaults=function(t){var i=t.srcEvent,a=t.offsetDirection;if(this.manager.session.prevented){i.preventDefault();return}var o=this.actions,s=mi(o,ki)&&!As[ki],l=mi(o,ro)&&!As[ro],u=mi(o,to)&&!As[to];if(s){var d=t.pointers.length===1,h=t.distance<2,c=t.deltaTime<250;if(d&&h&&c)return}if(!(u&&l)&&(s||l&&a&cr||u&&a&Pi))return this.preventSrc(i)},n.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},r}();function Ov(r,n){for(;r;){if(r===n)return!0;r=r.parentNode}return!1}function JS(r){var n=r.length;if(n===1)return{x:Tn(r[0].clientX),y:Tn(r[0].clientY)};for(var e=0,t=0,i=0;i<n;)e+=r[i].clientX,t+=r[i].clientY,i++;return{x:Tn(e/n),y:Tn(t/n)}}function Vb(r){for(var n=[],e=0;e<r.pointers.length;)n[e]={clientX:Tn(r.pointers[e].clientX),clientY:Tn(r.pointers[e].clientY)},e++;return{timeStamp:Ev(),pointers:n,center:JS(n),deltaX:r.deltaX,deltaY:r.deltaY}}function Il(r,n,e){e||(e=ZS);var t=n[e[0]]-r[e[0]],i=n[e[1]]-r[e[1]];return Math.sqrt(t*t+i*i)}function ef(r,n,e){e||(e=ZS);var t=n[e[0]]-r[e[0]],i=n[e[1]]-r[e[1]];return Math.atan2(i,t)*180/Math.PI}function eO(r,n){return r===n?Ol:Ni(r)>=Ni(n)?r<0?qo:Yo:n<0?Xo:Hn}function tne(r,n){var e=n.center,t=r.offsetDelta||{},i=r.prevDelta||{},a=r.prevInput||{};(n.eventType===ht||a.eventType===Me)&&(i=r.prevDelta={x:a.deltaX||0,y:a.deltaY||0},t=r.offsetDelta={x:e.x,y:e.y}),n.deltaX=i.x+(e.x-t.x),n.deltaY=i.y+(e.y-t.y)}function tO(r,n,e){return{x:n/r||0,y:e/r||0}}function rne(r,n){return Il(n[0],n[1],Tl)/Il(r[0],r[1],Tl)}function ine(r,n){return ef(n[1],n[0],Tl)+ef(r[1],r[0],Tl)}function nne(r,n){var e=r.lastInterval||n,t=n.timeStamp-e.timeStamp,i,a,o,s;if(n.eventType!==_t&&(t>Jie||e.velocity===void 0)){var l=n.deltaX-e.deltaX,u=n.deltaY-e.deltaY,d=tO(t,l,u);a=d.x,o=d.y,i=Ni(d.x)>Ni(d.y)?d.x:d.y,s=eO(l,u),r.lastInterval=n}else i=e.velocity,a=e.velocityX,o=e.velocityY,s=e.direction;n.velocity=i,n.velocityX=a,n.velocityY=o,n.direction=s}function ane(r,n){var e=r.session,t=n.pointers,i=t.length;e.firstInput||(e.firstInput=Vb(n)),i>1&&!e.firstMultiple?e.firstMultiple=Vb(n):i===1&&(e.firstMultiple=!1);var a=e.firstInput,o=e.firstMultiple,s=o?o.center:a.center,l=n.center=JS(t);n.timeStamp=Ev(),n.deltaTime=n.timeStamp-a.timeStamp,n.angle=ef(s,l),n.distance=Il(s,l),tne(e,n),n.offsetDirection=eO(n.deltaX,n.deltaY);var u=tO(n.deltaTime,n.deltaX,n.deltaY);n.overallVelocityX=u.x,n.overallVelocityY=u.y,n.overallVelocity=Ni(u.x)>Ni(u.y)?u.x:u.y,n.scale=o?rne(o.pointers,t):1,n.rotation=o?ine(o.pointers,t):0,n.maxPointers=e.prevInput?n.pointers.length>e.prevInput.maxPointers?n.pointers.length:e.prevInput.maxPointers:n.pointers.length,nne(e,n);var d=r.element,h=n.srcEvent,c;h.composedPath?c=h.composedPath()[0]:h.path?c=h.path[0]:c=h.target,Ov(c,d)&&(d=c),n.target=d}function one(r,n,e){var t=e.pointers.length,i=e.changedPointers.length,a=n&ht&&t-i===0,o=n&(Me|_t)&&t-i===0;e.isFirst=!!a,e.isFinal=!!o,a&&(r.session={}),e.eventType=n,ane(r,e),r.emit("hammer.input",e),r.recognize(e),r.session.prevInput=e}function io(r){return r.trim().split(/\s+/g)}function Fa(r,n,e){Ir(io(n),function(t){r.addEventListener(t,e,!1)})}function Ba(r,n,e){Ir(io(n),function(t){r.removeEventListener(t,e,!1)})}function Gb(r){var n=r.ownerDocument||r;return n.defaultView||n.parentWindow||window}var ya=function(){function r(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){Cu(e.options.enable,[e])&&i.handler(a)},this.init()}var n=r.prototype;return n.handler=function(){},n.init=function(){this.evEl&&Fa(this.element,this.evEl,this.domHandler),this.evTarget&&Fa(this.target,this.evTarget,this.domHandler),this.evWin&&Fa(Gb(this.element),this.evWin,this.domHandler)},n.destroy=function(){this.evEl&&Ba(this.element,this.evEl,this.domHandler),this.evTarget&&Ba(this.target,this.evTarget,this.domHandler),this.evWin&&Ba(Gb(this.element),this.evWin,this.domHandler)},r}();function Fi(r,n,e){if(r.indexOf&&!e)return r.indexOf(n);for(var t=0;t<r.length;){if(e&&r[t][e]==n||!e&&r[t]===n)return t;t++}return-1}var sne={pointerdown:ht,pointermove:Qi,pointerup:Me,pointercancel:_t,pointerout:_t},lne={2:Ko,3:Zie,4:Sv,5:Qie},rO="pointerdown",iO="pointermove pointerup pointercancel";Tr.MSPointerEvent&&!Tr.PointerEvent&&(rO="MSPointerDown",iO="MSPointerMove MSPointerUp MSPointerCancel");var nO=function(r){Kt(n,r);function n(){var t,i=n.prototype;return i.evEl=rO,i.evWin=iO,t=r.apply(this,arguments)||this,t.store=t.manager.session.pointerEvents=[],t}var e=n.prototype;return e.handler=function(i){var a=this.store,o=!1,s=i.type.toLowerCase().replace("ms",""),l=sne[s],u=lne[i.pointerType]||i.pointerType,d=u===Ko,h=Fi(a,i.pointerId,"pointerId");l&ht&&(i.button===0||d)?h<0&&(a.push(i),h=a.length-1):l&(Me|_t)&&(o=!0),!(h<0)&&(a[h]=i,this.callback(this.manager,l,{pointers:a,changedPointers:[i],pointerType:u,srcEvent:i}),o&&a.splice(h,1))},n}(ya);function no(r){return Array.prototype.slice.call(r,0)}function Tv(r,n,e){for(var t=[],i=[],a=0;a<r.length;){var o=n?r[a][n]:r[a];Fi(i,o)<0&&t.push(r[a]),i[a]=o,a++}return e&&(n?t=t.sort(function(s,l){return s[n]>l[n]}):t=t.sort()),t}var une={touchstart:ht,touchmove:Qi,touchend:Me,touchcancel:_t},dne="touchstart touchmove touchend touchcancel",Iv=function(r){Kt(n,r);function n(){var t;return n.prototype.evTarget=dne,t=r.apply(this,arguments)||this,t.targetIds={},t}var e=n.prototype;return e.handler=function(i){var a=une[i.type],o=hne.call(this,i,a);o&&this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:Ko,srcEvent:i})},n}(ya);function hne(r,n){var e=no(r.touches),t=this.targetIds;if(n&(ht|Qi)&&e.length===1)return t[e[0].identifier]=!0,[e,e];var i,a,o=no(r.changedTouches),s=[],l=this.target;if(a=e.filter(function(u){return Ov(u.target,l)}),n===ht)for(i=0;i<a.length;)t[a[i].identifier]=!0,i++;for(i=0;i<o.length;)t[o[i].identifier]&&s.push(o[i]),n&(Me|_t)&&delete t[o[i].identifier],i++;if(s.length)return[Tv(a.concat(s),"identifier",!0),s]}var cne={mousedown:ht,mousemove:Qi,mouseup:Me},fne="mousedown",vne="mousemove mouseup",kv=function(r){Kt(n,r);function n(){var t,i=n.prototype;return i.evEl=fne,i.evWin=vne,t=r.apply(this,arguments)||this,t.pressed=!1,t}var e=n.prototype;return e.handler=function(i){var a=cne[i.type];a&ht&&i.button===0&&(this.pressed=!0),a&Qi&&i.which!==1&&(a=Me),this.pressed&&(a&Me&&(this.pressed=!1),this.callback(this.manager,a,{pointers:[i],changedPointers:[i],pointerType:Sv,srcEvent:i}))},n}(ya),pne=2500,Kb=25;function qb(r){var n=r.changedPointers,e=n[0];if(e.identifier===this.primaryTouch){var t={x:e.clientX,y:e.clientY},i=this.lastTouches;this.lastTouches.push(t);var a=function(){var s=i.indexOf(t);s>-1&&i.splice(s,1)};setTimeout(a,pne)}}function gne(r,n){r&ht?(this.primaryTouch=n.changedPointers[0].identifier,qb.call(this,n)):r&(Me|_t)&&qb.call(this,n)}function yne(r){for(var n=r.srcEvent.clientX,e=r.srcEvent.clientY,t=0;t<this.lastTouches.length;t++){var i=this.lastTouches[t],a=Math.abs(n-i.x),o=Math.abs(e-i.y);if(a<=Kb&&o<=Kb)return!0}return!1}var aO=function(){var r=function(n){Kt(e,n);function e(i,a){var o;return o=n.call(this,i,a)||this,o.handler=function(s,l,u){var d=u.pointerType===Ko,h=u.pointerType===Sv;if(!(h&&u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents)){if(d)gne.call(Rs(Rs(o)),l,u);else if(h&&yne.call(Rs(Rs(o)),u))return;o.callback(s,l,u)}},o.touch=new Iv(o.manager,o.handler),o.mouse=new kv(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}var t=e.prototype;return t.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(ya);return r}();function mne(r){var n,e=r.options.inputClass;return e?n=e:Yie?n=nO:Xie?n=Iv:YS?n=aO:n=kv,new n(r,one)}function In(r,n,e){return Array.isArray(r)?(Ir(r,e[n],e),!0):!1}var Qs=1,Wt=2,Wn=4,Zr=8,kr=Zr,ao=16,lr=32,bne=1;function $ne(){return bne++}function Ds(r,n){var e=n.manager;return e?e.get(r):r}function Yb(r){return r&ao?"cancel":r&Zr?"end":r&Wn?"move":r&Wt?"start":""}var Zo=function(){function r(e){e===void 0&&(e={}),this.options=tr({enable:!0},e),this.id=$ne(),this.manager=null,this.state=Qs,this.simultaneous={},this.requireFail=[]}var n=r.prototype;return n.set=function(t){return Mi(this.options,t),this.manager&&this.manager.touchAction.update(),this},n.recognizeWith=function(t){if(In(t,"recognizeWith",this))return this;var i=this.simultaneous;return t=Ds(t,this),i[t.id]||(i[t.id]=t,t.recognizeWith(this)),this},n.dropRecognizeWith=function(t){return In(t,"dropRecognizeWith",this)?this:(t=Ds(t,this),delete this.simultaneous[t.id],this)},n.requireFailure=function(t){if(In(t,"requireFailure",this))return this;var i=this.requireFail;return t=Ds(t,this),Fi(i,t)===-1&&(i.push(t),t.requireFailure(this)),this},n.dropRequireFailure=function(t){if(In(t,"dropRequireFailure",this))return this;t=Ds(t,this);var i=Fi(this.requireFail,t);return i>-1&&this.requireFail.splice(i,1),this},n.hasRequireFailures=function(){return this.requireFail.length>0},n.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},n.emit=function(t){var i=this,a=this.state;function o(s){i.manager.emit(s,t)}a<Zr&&o(i.options.event+Yb(a)),o(i.options.event),t.additionalEvent&&o(t.additionalEvent),a>=Zr&&o(i.options.event+Yb(a))},n.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=lr},n.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(lr|Qs)))return!1;t++}return!0},n.recognize=function(t){var i=Mi({},t);if(!Cu(this.options.enable,[this,i])){this.reset(),this.state=lr;return}this.state&(kr|ao|lr)&&(this.state=Qs),this.state=this.process(i),this.state&(Wt|Wn|Zr|ao)&&this.tryEmit(i)},n.process=function(t){},n.getTouchAction=function(){},n.reset=function(){},r}(),tf=function(r){Kt(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,tr({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,i.pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}var e=n.prototype;return e.getTouchAction=function(){return[Jc]},e.process=function(i){var a=this,o=this.options,s=i.pointers.length===o.pointers,l=i.distance<o.threshold,u=i.deltaTime<o.time;if(this.reset(),i.eventType&ht&&this.count===0)return this.failTimeout();if(l&&u&&s){if(i.eventType!==Me)return this.failTimeout();var d=this.pTime?i.timeStamp-this.pTime<o.interval:!0,h=!this.pCenter||Il(this.pCenter,i.center)<o.posThreshold;this.pTime=i.timeStamp,this.pCenter=i.center,!h||!d?this.count=1:this.count+=1,this._input=i;var c=this.count%o.taps;if(c===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){a.state=kr,a.tryEmit()},o.interval),Wt):kr}return lr},e.failTimeout=function(){var i=this;return this._timer=setTimeout(function(){i.state=lr},this.options.interval),lr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(){this.state===kr&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},n}(Zo),Un=function(r){Kt(n,r);function n(t){return t===void 0&&(t={}),r.call(this,tr({pointers:1},t))||this}var e=n.prototype;return e.attrTest=function(i){var a=this.options.pointers;return a===0||i.pointers.length===a},e.process=function(i){var a=this.state,o=i.eventType,s=a&(Wt|Wn),l=this.attrTest(i);return s&&(o&_t||!l)?a|ao:s||l?o&Me?a|Zr:a&Wt?a|Wn:Wt:lr},n}(Zo);function oO(r){return r===Hn?"down":r===Xo?"up":r===qo?"left":r===Yo?"right":""}var Pv=function(r){Kt(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,tr({event:"pan",threshold:10,pointers:1,direction:XS},t))||this,i.pX=null,i.pY=null,i}var e=n.prototype;return e.getTouchAction=function(){var i=this.options.direction,a=[];return i&cr&&a.push(ro),i&Pi&&a.push(to),a},e.directionTest=function(i){var a=this.options,o=!0,s=i.distance,l=i.direction,u=i.deltaX,d=i.deltaY;return l&a.direction||(a.direction&cr?(l=u===0?Ol:u<0?qo:Yo,o=u!==this.pX,s=Math.abs(i.deltaX)):(l=d===0?Ol:d<0?Xo:Hn,o=d!==this.pY,s=Math.abs(i.deltaY))),i.direction=l,o&&s>a.threshold&&l&a.direction},e.attrTest=function(i){return Un.prototype.attrTest.call(this,i)&&(this.state&Wt||!(this.state&Wt)&&this.directionTest(i))},e.emit=function(i){this.pX=i.deltaX,this.pY=i.deltaY;var a=oO(i.direction);a&&(i.additionalEvent=this.options.event+a),r.prototype.emit.call(this,i)},n}(Un),sO=function(r){Kt(n,r);function n(t){return t===void 0&&(t={}),r.call(this,tr({event:"swipe",threshold:10,velocity:.3,direction:cr|Pi,pointers:1},t))||this}var e=n.prototype;return e.getTouchAction=function(){return Pv.prototype.getTouchAction.call(this)},e.attrTest=function(i){var a=this.options.direction,o;return a&(cr|Pi)?o=i.overallVelocity:a&cr?o=i.overallVelocityX:a&Pi&&(o=i.overallVelocityY),r.prototype.attrTest.call(this,i)&&a&i.offsetDirection&&i.distance>this.options.threshold&&i.maxPointers===this.options.pointers&&Ni(o)>this.options.velocity&&i.eventType&Me},e.emit=function(i){var a=oO(i.offsetDirection);a&&this.manager.emit(this.options.event+a,i),this.manager.emit(this.options.event,i)},n}(Un),lO=function(r){Kt(n,r);function n(t){return t===void 0&&(t={}),r.call(this,tr({event:"pinch",threshold:0,pointers:2},t))||this}var e=n.prototype;return e.getTouchAction=function(){return[ki]},e.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.scale-1)>this.options.threshold||this.state&Wt)},e.emit=function(i){if(i.scale!==1){var a=i.scale<1?"in":"out";i.additionalEvent=this.options.event+a}r.prototype.emit.call(this,i)},n}(Un),uO=function(r){Kt(n,r);function n(t){return t===void 0&&(t={}),r.call(this,tr({event:"rotate",threshold:0,pointers:2},t))||this}var e=n.prototype;return e.getTouchAction=function(){return[ki]},e.attrTest=function(i){return r.prototype.attrTest.call(this,i)&&(Math.abs(i.rotation)>this.options.threshold||this.state&Wt)},n}(Un),dO=function(r){Kt(n,r);function n(t){var i;return t===void 0&&(t={}),i=r.call(this,tr({event:"press",pointers:1,time:251,threshold:9},t))||this,i._timer=null,i._input=null,i}var e=n.prototype;return e.getTouchAction=function(){return[qS]},e.process=function(i){var a=this,o=this.options,s=i.pointers.length===o.pointers,l=i.distance<o.threshold,u=i.deltaTime>o.time;if(this._input=i,!l||!s||i.eventType&(Me|_t)&&!u)this.reset();else if(i.eventType&ht)this.reset(),this._timer=setTimeout(function(){a.state=kr,a.tryEmit()},o.time);else if(i.eventType&Me)return kr;return lr},e.reset=function(){clearTimeout(this._timer)},e.emit=function(i){this.state===kr&&(i&&i.eventType&Me?this.manager.emit(this.options.event+"up",i):(this._input.timeStamp=Ev(),this.manager.emit(this.options.event,this._input)))},n}(Zo),hO={domEvents:!1,touchAction:KS,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xb=[[uO,{enable:!1}],[lO,{enable:!1},["rotate"]],[sO,{direction:cr}],[Pv,{direction:cr},["swipe"]],[tf],[tf,{event:"doubletap",taps:2},["tap"]],[dO]],wne=1,Zb=2;function Qb(r,n){var e=r.element;if(e.style){var t;Ir(r.options.cssProps,function(i,a){t=Pu(e.style,a),n?(r.oldCssProps[t]=e.style[t],e.style[t]=i):e.style[t]=r.oldCssProps[t]||""}),n||(r.oldCssProps={})}}function _ne(r,n){var e=document.createEvent("Event");e.initEvent(r,!0,!0),e.gesture=n,n.target.dispatchEvent(e)}var Jb=function(){function r(e,t){var i=this;this.options=Mi({},hO,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=mne(this),this.touchAction=new QS(this,this.options.touchAction),Qb(this,!0),Ir(this.options.recognizers,function(a){var o=i.add(new a[0](a[1]));a[2]&&o.recognizeWith(a[2]),a[3]&&o.requireFailure(a[3])},this)}var n=r.prototype;return n.set=function(t){return Mi(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},n.stop=function(t){this.session.stopped=t?Zb:wne},n.recognize=function(t){var i=this.session;if(!i.stopped){this.touchAction.preventDefaults(t);var a,o=this.recognizers,s=i.curRecognizer;(!s||s&&s.state&kr)&&(i.curRecognizer=null,s=null);for(var l=0;l<o.length;)a=o[l],i.stopped!==Zb&&(!s||a===s||a.canRecognizeWith(s))?a.recognize(t):a.reset(),!s&&a.state&(Wt|Wn|Zr)&&(i.curRecognizer=a,s=a),l++}},n.get=function(t){if(t instanceof Zo)return t;for(var i=this.recognizers,a=0;a<i.length;a++)if(i[a].options.event===t)return i[a];return null},n.add=function(t){if(In(t,"add",this))return this;var i=this.get(t.options.event);return i&&this.remove(i),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},n.remove=function(t){if(In(t,"remove",this))return this;var i=this.get(t);if(t){var a=this.recognizers,o=Fi(a,i);o!==-1&&(a.splice(o,1),this.touchAction.update())}return this},n.on=function(t,i){if(t===void 0||i===void 0)return this;var a=this.handlers;return Ir(io(t),function(o){a[o]=a[o]||[],a[o].push(i)}),this},n.off=function(t,i){if(t===void 0)return this;var a=this.handlers;return Ir(io(t),function(o){i?a[o]&&a[o].splice(Fi(a[o],i),1):delete a[o]}),this},n.emit=function(t,i){this.options.domEvents&&_ne(t,i);var a=this.handlers[t]&&this.handlers[t].slice();if(!(!a||!a.length)){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var o=0;o<a.length;)a[o](i),o++}},n.destroy=function(){this.element&&Qb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},r}(),Ene={touchstart:ht,touchmove:Qi,touchend:Me,touchcancel:_t},Sne="touchstart",One="touchstart touchmove touchend touchcancel",Tne=function(r){Kt(n,r);function n(){var t,i=n.prototype;return i.evTarget=Sne,i.evWin=One,t=r.apply(this,arguments)||this,t.started=!1,t}var e=n.prototype;return e.handler=function(i){var a=Ene[i.type];if(a===ht&&(this.started=!0),!!this.started){var o=Ine.call(this,i,a);a&(Me|_t)&&o[0].length-o[1].length===0&&(this.started=!1),this.callback(this.manager,a,{pointers:o[0],changedPointers:o[1],pointerType:Ko,srcEvent:i})}},n}(ya);function Ine(r,n){var e=no(r.touches),t=no(r.changedTouches);return n&(Me|_t)&&(e=Tv(e.concat(t),"identifier",!0)),[e,t]}function cO(r,n,e){var t="DEPRECATED METHOD: "+n+`
`+e+` AT 
`;return function(){var i=new Error("get-stack-trace"),a=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,t,a),r.apply(this,arguments)}}var fO=cO(function(r,n,e){for(var t=Object.keys(n),i=0;i<t.length;)(!e||e&&r[t[i]]===void 0)&&(r[t[i]]=n[t[i]]),i++;return r},"extend","Use `assign`."),kne=cO(function(r,n){return fO(r,n,!0)},"merge","Use `assign`.");function Pne(r,n,e){var t=n.prototype,i;i=r.prototype=Object.create(t),i.constructor=r,i._super=t,e&&Mi(i,e)}function e$(r,n){return function(){return r.apply(n,arguments)}}var vO=function(){var r=function(e,t){return t===void 0&&(t={}),new Jb(e,tr({recognizers:Xb.concat()},t))};return r.VERSION="2.0.17-rc",r.DIRECTION_ALL=XS,r.DIRECTION_DOWN=Hn,r.DIRECTION_LEFT=qo,r.DIRECTION_RIGHT=Yo,r.DIRECTION_UP=Xo,r.DIRECTION_HORIZONTAL=cr,r.DIRECTION_VERTICAL=Pi,r.DIRECTION_NONE=Ol,r.DIRECTION_DOWN=Hn,r.INPUT_START=ht,r.INPUT_MOVE=Qi,r.INPUT_END=Me,r.INPUT_CANCEL=_t,r.STATE_POSSIBLE=Qs,r.STATE_BEGAN=Wt,r.STATE_CHANGED=Wn,r.STATE_ENDED=Zr,r.STATE_RECOGNIZED=kr,r.STATE_CANCELLED=ao,r.STATE_FAILED=lr,r.Manager=Jb,r.Input=ya,r.TouchAction=QS,r.TouchInput=Iv,r.MouseInput=kv,r.PointerEventInput=nO,r.TouchMouseInput=aO,r.SingleTouchInput=Tne,r.Recognizer=Zo,r.AttrRecognizer=Un,r.Tap=tf,r.Pan=Pv,r.Swipe=sO,r.Pinch=lO,r.Rotate=uO,r.Press=dO,r.on=Fa,r.off=Ba,r.each=Ir,r.merge=kne,r.extend=fO,r.bindFn=e$,r.assign=Mi,r.inherit=Pne,r.bindFn=e$,r.prefixed=Pu,r.toArray=no,r.inArray=Fi,r.uniqueArray=Tv,r.splitStr=io,r.boolOrFn=Cu,r.hasParent=Ov,r.addEventListeners=Fa,r.removeEventListeners=Ba,r.defaults=Mi({},hO,{preset:Xb}),r}();vO.defaults;var Cne=vO;function pO(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=xne(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function xne(r,n){var e;if(r){if(typeof r=="string")return t$(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return t$(r,n)}}function t$(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}li("DELETE");function xu(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return Rne(n.length?n:[Sl()])}function Rne(r){var n=Ane(r),e=we(n,3),t=e[0],i=e[1],a=e[2],o=1,s=function(){var u=2091639*t+o*23283064365386963e-26;return t=i,i=a,a=u-(o=u|0)};return s.uint32=function(){return s()*4294967296},s.fract53=function(){return s()+(s()*2097152|0)*11102230246251565e-32},s.algorithm="Alea",s.seed=r,s.version="0.9",s}function Ane(){for(var r=Dne(),n=r(" "),e=r(" "),t=r(" "),i=0;i<arguments.length;i++)n-=r(i<0||arguments.length<=i?void 0:arguments[i]),n<0&&(n+=1),e-=r(i<0||arguments.length<=i?void 0:arguments[i]),e<0&&(e+=1),t-=r(i<0||arguments.length<=i?void 0:arguments[i]),t<0&&(t+=1);return[n,e,t]}function Dne(){var r=4022871197;return function(n){for(var e=n.toString(),t=0;t<e.length;t++){r+=e.charCodeAt(t);var i=.02519603282416938*r;r=i>>>0,i-=r,i*=r,r=i>>>0,i-=r,r+=i*4294967296}return(r>>>0)*23283064365386963e-26}}function Mne(){var r=function(){};return{on:r,off:r,destroy:r,emit:r,get:function(){return{set:r}}}}var Cv=typeof window<"u"?window.Hammer||Cne:function(){return Mne()};function ur(r){var n=this,e;this._cleanupQueue=[],this.active=!1,this._dom={container:r,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)});var t=Cv(this._dom.overlay);t.on("tap",O(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(function(){t.destroy()});var i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];de(i).call(i,function(a){t.on(a,function(o){o.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=function(a){Nne(a.target,r)||n.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(function(){document.body.removeEventListener("click",n._onClick)})),this._escListener=function(a){("key"in a?a.key==="Escape":a.keyCode===27)&&n.deactivate()}}yE(ur.prototype);ur.current=null;ur.prototype.destroy=function(){var r,n;this.deactivate();var e=pO(Ti(r=Or(n=this._cleanupQueue).call(n,0)).call(r)),t;try{for(e.s();!(t=e.n()).done;){var i=t.value;i()}}catch(a){e.e(a)}finally{e.f()}};ur.prototype.activate=function(){ur.current&&ur.current.deactivate(),ur.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)};ur.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")};ur.prototype._onTapOverlay=function(r){this.activate(),r.srcEvent.stopPropagation()};function Nne(r,n){for(;r;){if(r===n)return!0;r=r.parentNode}return!1}var Fne=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bne=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Lne=/^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,jne=/^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 zr(r){if(r)for(;r.hasChildNodes()===!0;){var n=r.firstChild;n&&(zr(n),r.removeChild(n))}}function Pn(r){return r instanceof String||typeof r=="string"}function r$(r){return ue(r)==="object"&&r!==null}function Bi(r,n,e,t){var i=!1;t===!0&&(i=n[e]===null&&r[e]!==void 0),i?delete r[e]:r[e]=n[e]}function gO(r,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var t in r)if(n[t]!==void 0)if(n[t]===null||ue(n[t])!=="object")Bi(r,n,t,e);else{var i=r[t],a=n[t];r$(i)&&r$(a)&&gO(i,a,e)}}function ma(r,n,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(se(e))throw new TypeError("Arrays are not supported by deepExtend");for(var i=0;i<r.length;i++){var a=r[i];if(Object.prototype.hasOwnProperty.call(e,a))if(e[a]&&e[a].constructor===Object)n[a]===void 0&&(n[a]={}),n[a].constructor===Object?ce(n[a],e[a],!1,t):Bi(n,e,a,t);else{if(se(e[a]))throw new TypeError("Arrays are not supported by deepExtend");Bi(n,e,a,t)}}return n}function kl(r,n,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(se(e))throw new TypeError("Arrays are not supported by deepExtend");for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&!Xr(r).call(r,i))if(e[i]&&e[i].constructor===Object)n[i]===void 0&&(n[i]={}),n[i].constructor===Object?ce(n[i],e[i]):Bi(n,e,i,t);else if(se(e[i])){n[i]=[];for(var a=0;a<e[i].length;a++)n[i].push(e[i][a])}else Bi(n,e,i,t);return n}function ce(r,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)||e===!0)if(ue(n[i])==="object"&&n[i]!==null&&Mb(n[i])===Object.prototype)r[i]===void 0?r[i]=ce({},n[i],e):ue(r[i])==="object"&&r[i]!==null&&Mb(r[i])===Object.prototype?ce(r[i],n[i],e):Bi(r,n,i,t);else if(se(n[i])){var a;r[i]=Ze(a=n[i]).call(a)}else Bi(r,n,i,t);return r}function Pl(r,n){var e;return wv(e=[]).call(e,or(r),[n])}function zne(r){return Ze(r).call(r)}function Hne(r){return r.getBoundingClientRect().left}function Wne(r){return r.getBoundingClientRect().top}function J(r,n){if(se(r))for(var e=r.length,t=0;t<e;t++)n(r[t],t,r);else for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&n(r[i],i,r)}function xv(r){var n;switch(r.length){case 3:case 4:return n=Bne.exec(r),n?{r:Zt(n[1]+n[1],16),g:Zt(n[2]+n[2],16),b:Zt(n[3]+n[3],16)}:null;case 6:case 7:return n=Fne.exec(r),n?{r:Zt(n[1],16),g:Zt(n[2],16),b:Zt(n[3],16)}:null;default:return null}}function zt(r,n){if(Xr(r).call(r,"rgba"))return r;if(Xr(r).call(r,"rgb")){var e=r.substr(te(r).call(r,"(")+1).replace(")","").split(",");return"rgba("+e[0]+","+e[1]+","+e[2]+","+n+")"}else{var t=xv(r);return t==null?r:"rgba("+t.r+","+t.g+","+t.b+","+n+")"}}function yO(r,n,e){var t;return"#"+Ze(t=((1<<24)+(r<<16)+(n<<8)+e).toString(16)).call(t,1)}function rf(r,n){if(Pn(r)){var e=r;if(bO(e)){var t,i=zn(t=e.substr(4).substr(0,e.length-5).split(",")).call(t,function(h){return Zt(h)});e=yO(i[0],i[1],i[2])}if(mO(e)===!0){var a=Une(e),o={h:a.h,s:a.s*.8,v:Math.min(1,a.v*1.02)},s={h:a.h,s:Math.min(1,a.s*1.25),v:a.v*.8},l=nf(s.h,s.s,s.v),u=nf(o.h,o.s,o.v);return{background:e,border:l,highlight:{background:u,border:l},hover:{background:u,border:l}}}else return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}else{var d={background:r.background||void 0,border:r.border||void 0,highlight:Pn(r.highlight)?{border:r.highlight,background:r.highlight}:{background:r.highlight&&r.highlight.background||void 0,border:r.highlight&&r.highlight.border||void 0},hover:Pn(r.hover)?{border:r.hover,background:r.hover}:{border:r.hover&&r.hover.border||void 0,background:r.hover&&r.hover.background||void 0}};return d}}function Ca(r,n,e){r=r/255,n=n/255,e=e/255;var t=Math.min(r,Math.min(n,e)),i=Math.max(r,Math.max(n,e));if(t===i)return{h:0,s:0,v:t};var a=r===t?n-e:e===t?r-n:e-r,o=r===t?3:e===t?1:5,s=60*(o-a/(i-t))/360,l=(i-t)/i,u=i;return{h:s,s:l,v:u}}function Js(r,n,e){var t,i,a,o=Math.floor(r*6),s=r*6-o,l=e*(1-n),u=e*(1-s*n),d=e*(1-(1-s)*n);switch(o%6){case 0:t=e,i=d,a=l;break;case 1:t=u,i=e,a=l;break;case 2:t=l,i=e,a=d;break;case 3:t=l,i=u,a=e;break;case 4:t=d,i=l,a=e;break;case 5:t=e,i=l,a=u;break}return{r:Math.floor(t*255),g:Math.floor(i*255),b:Math.floor(a*255)}}function nf(r,n,e){var t=Js(r,n,e);return yO(t.r,t.g,t.b)}function Une(r){var n=xv(r);if(!n)throw new TypeError("'".concat(r,"' is not a valid color."));return Ca(n.r,n.g,n.b)}function mO(r){var n=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r);return n}function bO(r){return Lne.test(r)}function Vne(r){return jne.test(r)}function Qr(r){if(r===null||ue(r)!=="object")return null;if(r instanceof Element)return r;var n=Ii(r);for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&ue(r[e])=="object"&&(n[e]=Qr(r[e]));return n}function jt(r,n,e){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=function(v){return v!=null},a=function(v){return v!==null&&ue(v)==="object"},o=function(v){for(var p in v)if(Object.prototype.hasOwnProperty.call(v,p))return!1;return!0};if(!a(r))throw new Error("Parameter mergeTarget must be an object");if(!a(n))throw new Error("Parameter options must be an object");if(!i(e))throw new Error("Parameter option must have a value");if(!a(t))throw new Error("Parameter globalOptions must be an object");var s=function(v,p,g){a(v[g])||(v[g]={});var y=p[g],m=v[g];for(var $ in y)Object.prototype.hasOwnProperty.call(y,$)&&(m[$]=y[$])},l=n[e],u=a(t)&&!o(t),d=u?t[e]:void 0,h=d?d.enabled:void 0;if(l!==void 0){if(typeof l=="boolean"){a(r[e])||(r[e]={}),r[e].enabled=l;return}if(l===null&&!a(r[e]))if(i(d))r[e]=Ii(d);else return;if(a(l)){var c=!0;l.enabled!==void 0?c=l.enabled:h!==void 0&&(c=d.enabled),s(r,n,e),r[e].enabled=c}}}var Gne={linear:function(n){return n},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return n*(2-n)},easeInOutQuad:function(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return--n*n*n+1},easeInOutCubic:function(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1- --n*n*n*n},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1+--n*n*n*n*n},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function Hr(r,n){var e;se(n)||(n=[n]);var t=pO(r),i;try{for(t.s();!(i=t.n()).done;){var a=i.value;if(a){e=a[n[0]];for(var o=1;o<n.length;o++)e&&(e=e[n[o]]);if(typeof e<"u")break}}}catch(s){t.e(s)}finally{t.f()}return e}var Kne={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"},qne=function(){function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;C(this,r),this.pixelRatio=n,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=function(){},this.closeCallback=function(){},this._create()}return x(r,[{key:"insertTo",value:function(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if(typeof e=="string")return Kne[e]}},{key:"setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e!=="none"){var i,a=this._isColorString(e);if(a!==void 0&&(e=a),Pn(e)===!0){if(bO(e)===!0){var o=e.substr(4).substr(0,e.length-5).split(",");i={r:o[0],g:o[1],b:o[2],a:1}}else if(Vne(e)===!0){var s=e.substr(5).substr(0,e.length-6).split(",");i={r:s[0],g:s[1],b:s[2],a:s[3]}}else if(mO(e)===!0){var l=xv(e);i={r:l.r,g:l.g,b:l.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){var u=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:u}}if(i===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: "+Vo(e));this._setColor(i,t)}}},{key:"show",value:function(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;t===!0&&(this.previousColor=De({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",hr(function(){e.closeCallback!==void 0&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t===!0&&(this.initialColor=De({},e)),this.color=e;var i=Ca(e.r,e.g,e.b),a=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(a*i.h),l=this.centerCoordinates.y+o*Math.cos(a*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=l-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=Ca(this.color.r,this.color.g,this.color.b);t.v=e/100;var i=Js(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color,t=Ca(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var a=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,a,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Go(i).call(i),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+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var e,t,i,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){var s=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(s.webkitBackingStorePixelRatio||s.mozBackingStorePixelRatio||s.msBackingStorePixelRatio||s.oBackingStorePixelRatio||s.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}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{}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{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var l=this;this.opacityRange.onchange=function(){l._setOpacity(this.value)},this.opacityRange.oninput=function(){l._setOpacity(this.value)},this.brightnessRange.onchange=function(){l._setBrightness(this.value)},this.brightnessRange.oninput=function(){l._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=O(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=O(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=O(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=O(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)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new Cv(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",function(t){t.isFirst&&e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(this.generated===!1){var 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);var t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);var a,o,s,l;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;var u=2*Math.PI/360,d=1/360,h=1/this.r,c;for(s=0;s<360;s++)for(l=0;l<this.r;l++)a=this.centerCoordinates.x+l*Math.sin(u*s),o=this.centerCoordinates.y+l*Math.cos(u*s),c=Js(s*d,l*h,1),e.fillStyle="rgb("+c.r+","+c.g+","+c.b+")",e.fillRect(a-.5,o-.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,i)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),i=e.center.x-t.left,a=e.center.y-t.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,l=i-s,u=a-o,d=Math.atan2(l,u),h=.98*Math.min(Math.sqrt(l*l+u*u),s),c=Math.cos(d)*h+o,f=Math.sin(d)*h+s;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=f-.5*this.colorPickerSelector.clientWidth+"px";var v=d/(2*Math.PI);v=v<0?v+1:v;var p=h/this.r,g=Ca(this.color.r,this.color.g,this.color.b);g.h=v,g.s=p;var y=Js(g.h,g.s,g.v);y.a=this.color.a,this.color=y,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+")"}}]),r}();function af(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];if(n.length<1)throw new TypeError("Invalid arguments.");if(n.length===1)return document.createTextNode(n[0]);var t=document.createElement(n[0]);return t.appendChild(af.apply(void 0,or(Ze(n).call(n,1)))),t}var Yne=function(){function r(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return!1};C(this,r),this.parent=n,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=a,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},De(this.options,this.defaultOptions),this.configureOptions=t,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new qne(i),this.wrapper=void 0}return x(r,[{key:"setOptions",value:function(e){if(e!==void 0){this.popupHistory={},this._removePopup();var t=!0;if(typeof e=="string")this.options.filter=e;else if(se(e))this.options.filter=e.join();else if(ue(e)==="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),$t(e)!==void 0&&(this.options.filter=$t(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);$t(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=$t(this.options),t=0,i=!1;for(var a in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,a)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(a,[]),i=i||this._handleObject(this.configureOptions[a],[a],!0)):(e===!0||te(e).call(e,a)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(a),this._handleObject(this.configureOptions[a],[a])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var 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()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,i=0;i<e.length;i++)if(t[e[i]]!==void 0)t=t[e[i]];else{t=void 0;break}return t}},{key:"_makeItem",value:function(e){if(this.allowCreation===!0){var t=document.createElement("div");t.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return de(a).call(a,function(s){t.appendChild(s)}),this.domElements.push(t),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var i=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,i===!0){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(af("i","b",e))}else a.innerText=e+":";return a}},{key:"_makeDropdown",value:function(e,t,i){var a=document.createElement("select");a.className="vis-configuration vis-config-select";var o=0;t!==void 0&&te(e).call(e,t)!==-1&&(o=te(e).call(e,t));for(var s=0;s<e.length;s++){var l=document.createElement("option");l.value=e[s],s===o&&(l.selected="selected"),l.innerText=e[s],a.appendChild(l)}var u=this;a.onchange=function(){u._update(this.value,i)};var d=this._makeLabel(i[i.length-1],i);this._makeItem(i,d,a)}},{key:"_makeRange",value:function(e,t,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=document.createElement("input");u.className="vis-configuration vis-config-range";try{u.type="range",u.min=o,u.max=s}catch{}u.step=l;var d="",h=0;if(t!==void 0){var c=1.2;t<0&&t*c<o?(u.min=Math.ceil(t*c),h=u.min,d="range increased"):t/c<o&&(u.min=Math.ceil(t/c),h=u.min,d="range increased"),t*c>s&&s!==1&&(u.max=Math.ceil(t*c),h=u.max,d="range increased"),u.value=t}else u.value=a;var f=document.createElement("input");f.className="vis-configuration vis-config-rangeinput",f.value=u.value;var v=this;u.onchange=function(){f.value=this.value,v._update(Number(this.value),i)},u.oninput=function(){f.value=this.value};var p=this._makeLabel(i[i.length-1],i),g=this._makeItem(i,p,u,f);d!==""&&this.popupHistory[g]!==h&&(this.popupHistory[g]=h,this._setupPopup(d,g))}},{key:"_makeButton",value:function(){var e=this;if(this.options.showButton===!0){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.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(t)}}},{key:"_setupPopup",value:function(e,t){var i=this;if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter<this.popupLimit){var a=document.createElement("div");a.id="vis-configuration-popup",a.className="vis-configuration-popup",a.innerText=e,a.onclick=function(){i._removePopup()},this.popupCounter+=1,this.popupDiv={html:a,index:t}}}},{key:"_removePopup",value:function(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(this.popupDiv.html!==void 0){var t=this.domElements[this.popupDiv.index],i=t.getBoundingClientRect();this.popupDiv.html.style.left=i.left+"px",this.popupDiv.html.style.top=i.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=hr(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=hr(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,i){var 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&&(ue(e)==="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));var o=this;a.onchange=function(){o._update(this.checked,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,a)}},{key:"_makeTextInput",value:function(e,t,i){var a=document.createElement("input");a.type="text",a.className="vis-configuration vis-config-text",a.value=t,t!==e&&this.changedOptions.push({path:i,value:t});var o=this;a.onchange=function(){o._update(this.value,i)};var s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,a)}},{key:"_makeColorField",value:function(e,t,i){var a=this,o=e[1],s=document.createElement("div");t=t===void 0?o:t,t!=="none"?(s.className="vis-configuration vis-config-colorBlock",s.style.backgroundColor=t):s.className="vis-configuration vis-config-colorBlock none",t=t===void 0?o:t,s.onclick=function(){a._showColorPicker(t,s,i)};var l=this._makeLabel(i[i.length-1],i);this._makeItem(i,l,s)}},{key:"_showColorPicker",value:function(e,t,i){var a=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(o){var s="rgba("+o.r+","+o.g+","+o.b+","+o.a+")";t.style.backgroundColor=s,a._update(s,i)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){a._showColorPicker(e,t,i)}})}},{key:"_handleObject",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=!1,o=$t(this.options),s=!1;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){a=!0;var u=e[l],d=Pl(t,l);if(typeof o=="function"&&(a=o(l,t),a===!1&&!se(u)&&typeof u!="string"&&typeof u!="boolean"&&u instanceof Object&&(this.allowCreation=!1,a=this._handleObject(u,d,!0),this.allowCreation=i===!1)),a!==!1){s=!0;var h=this._getValue(d);if(se(u))this._handleArray(u,h,d);else if(typeof u=="string")this._makeTextInput(u,h,d);else if(typeof u=="boolean")this._makeCheckbox(u,h,d);else if(u instanceof Object){if(!this.hideOption(t,l,this.moduleOptions))if(u.enabled!==void 0){var c=Pl(d,"enabled"),f=this._getValue(c);if(f===!0){var v=this._makeLabel(l,d,!0);this._makeItem(d,v),s=this._handleObject(u,d)||s}else this._makeCheckbox(u,f,d)}else{var p=this._makeLabel(l,d,!0);this._makeItem(d,p),s=this._handleObject(u,d)||s}}else console.error("dont know how to handle",u,l,d)}}return s}},{key:"_handleArray",value:function(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}},{key:"_update",value:function(e,t){var i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}},{key:"_constructOptions",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(var o=0;o<t.length;o++)t[o]!=="global"&&(a[t[o]]===void 0&&(a[t[o]]={}),o!==t.length-1?a=a[t[o]]:a[t[o]]=e);return i}},{key:"_printOptions",value:function(){for(var e=this.getOptions();this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(af("pre","const options = "+Vo(e,null,2)))}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),r}(),Xne=function(){function r(n,e){C(this,r),this.container=n,this.overflowMethod=e||"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)}return x(r,[{key:"setPosition",value:function(e,t){this.x=Zt(e),this.y=Zt(t)}},{key:"setText",value:function(e){if(e instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(e)}else this.frame.innerText=e}},{key:"show",value:function(e){if(e===void 0&&(e=!0),e===!0){var t=this.frame.clientHeight,i=this.frame.clientWidth,a=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,l=0;if(this.overflowMethod=="flip"){var u=!1,d=!0;this.y-t<this.padding&&(d=!1),this.x+i>o-this.padding&&(u=!0),u?s=this.x-i:s=this.x,d?l=this.y-t:l=this.y}else l=this.y-t,l+t+this.padding>a&&(l=a-t-this.padding),l<this.padding&&(l=this.padding),s=this.x,s+i+this.padding>o&&(s=o-i-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=l+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),r}(),Sa=!1,i$,of="background: #FFeeee; color: #dd0000",Zne=function(){function r(){C(this,r)}return x(r,null,[{key:"validate",value:function(e,t,i){Sa=!1,i$=t;var a=t;return i!==void 0&&(a=t[i]),r.parse(e,a,[]),Sa}},{key:"parse",value:function(e,t,i){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.check(a,e,t,i)}},{key:"check",value:function(e,t,i,a){if(i[e]===void 0&&i.__any__===void 0){r.getSuggestion(e,i,a);return}var o=e,s=!0;i[e]===void 0&&i.__any__!==void 0&&(o="__any__",s=r.getType(t[e])==="object");var l=i[o];s&&l.__type__!==void 0&&(l=l.__type__),r.checkFields(e,t,i,o,l,a)}},{key:"checkFields",value:function(e,t,i,a,o,s){var l=function(c){console.error("%c"+c+r.printLocation(s,e),of)},u=r.getType(t[e]),d=o[u];d!==void 0?r.getType(d)==="array"&&te(d).call(d,t[e])===-1?(l('Invalid option detected in "'+e+'". Allowed values are:'+r.print(d)+' not "'+t[e]+'". '),Sa=!0):u==="object"&&a!=="__any__"&&(s=Pl(s,e),r.parse(t[e],i[a],s)):o.any===void 0&&(l('Invalid type received for "'+e+'". Expected: '+r.print($e(o))+". Received ["+u+'] "'+t[e]+'"'),Sa=!0)}},{key:"getType",value:function(e){var t=ue(e);return t==="object"?e===null?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":se(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}},{key:"getSuggestion",value:function(e,t,i){var a=r.findInOptions(e,t,i,!1),o=r.findInOptions(e,i$,[],!0),s=8,l=4,u;a.indexMatch!==void 0?u=" in "+r.printLocation(a.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+a.indexMatch+`"?

`:o.distance<=l&&a.distance>o.distance?u=" in "+r.printLocation(a.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+r.printLocation(o.path,o.closestMatch,""):a.distance<=s?u='. Did you mean "'+a.closestMatch+'"?'+r.printLocation(a.path,e):u=". Did you mean one of these: "+r.print($e(t))+r.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+u,of),Sa=!0}},{key:"findInOptions",value:function(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=1e9,s="",l=[],u=e.toLowerCase(),d=void 0;for(var h in t){var c=void 0;if(t[h].__type__!==void 0&&a===!0){var f=r.findInOptions(e,t[h],Pl(i,h));o>f.distance&&(s=f.closestMatch,l=f.path,o=f.distance,d=f.indexMatch)}else{var v;te(v=h.toLowerCase()).call(v,u)!==-1&&(d=h),c=r.levenshteinDistance(e,h),o>c&&(s=h,l=zne(i),o=c)}}return{closestMatch:s,path:l,distance:o,indexMatch:d}}},{key:"printLocation",value:function(e,t){for(var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: 
`,a=`

`+i+`options = {
`,o=0;o<e.length;o++){for(var s=0;s<o+1;s++)a+="  ";a+=e[o]+`: {
`}for(var l=0;l<e.length+1;l++)a+="  ";a+=t+`
`;for(var u=0;u<e.length+1;u++){for(var d=0;d<e.length-u;d++)a+="  ";a+=`}
`}return a+`

`}},{key:"print",value:function(e){return Vo(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;var i=[],a;for(a=0;a<=t.length;a++)i[a]=[a];var o;for(o=0;o<=e.length;o++)i[0][o]=o;for(a=1;a<=t.length;a++)for(o=1;o<=e.length;o++)t.charAt(a-1)==e.charAt(o-1)?i[a][o]=i[a-1][o-1]:i[a][o]=Math.min(i[a-1][o-1]+1,Math.min(i[a][o-1]+1,i[a-1][o]+1));return i[t.length][e.length]}}]),r}(),Qne=ur,Jne=Yne,Cn=Cv,eae=Xne,$O=of,tae=Zne;function rae(r){return Ur=r,oae()}var wO={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},Rv=Ii(wO);Rv.color="color.color";Rv.style="dashes";var st={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},n$={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Ur="",Vn=0,Q="",U="",gt=st.NULL;function iae(){Vn=0,Q=Ur.charAt(0)}function Be(){Vn++,Q=Ur.charAt(Vn)}function fn(){return Ur.charAt(Vn+1)}function a$(r){var n=r.charCodeAt(0);return n<47?n===35||n===46:n<59?n>47:n<91?n>64:n<96?n===95:n<123?n>96:!1}function ei(r,n){if(r||(r={}),n)for(var e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);return r}function nae(r,n,e){for(var t=n.split("."),i=r;t.length;){var a=t.shift();t.length?(i[a]||(i[a]={}),i=i[a]):i[a]=e}}function _O(r,n){for(var e,t,i=null,a=[r],o=r;o.parent;)a.push(o.parent),o=o.parent;if(o.nodes){for(e=0,t=o.nodes.length;e<t;e++)if(n.id===o.nodes[e].id){i=o.nodes[e];break}}for(i||(i={id:n.id},r.node&&(i.attr=ei(i.attr,r.node))),e=a.length-1;e>=0;e--){var s,l=a[e];l.nodes||(l.nodes=[]),te(s=l.nodes).call(s,i)===-1&&l.nodes.push(i)}n.attr&&(i.attr=ei(i.attr,n.attr))}function aae(r,n){if(r.edges||(r.edges=[]),r.edges.push(n),r.edge){var e=ei({},r.edge);n.attr=ei(e,n.attr)}}function EO(r,n,e,t,i){var a={from:n,to:e,type:t};return r.edge&&(a.attr=ei({},r.edge)),a.attr=ei(a.attr||{},i),i!=null&&i.hasOwnProperty("arrows")&&i.arrows!=null&&(a.arrows={to:{enabled:!0,type:i.arrows.type}},i.arrows=null),a}function fe(){for(gt=st.NULL,U="";Q===" "||Q==="	"||Q===`
`||Q==="\r";)Be();do{var r=!1;if(Q==="#"){for(var n=Vn-1;Ur.charAt(n)===" "||Ur.charAt(n)==="	";)n--;if(Ur.charAt(n)===`
`||Ur.charAt(n)===""){for(;Q!=""&&Q!=`
`;)Be();r=!0}}if(Q==="/"&&fn()==="/"){for(;Q!=""&&Q!=`
`;)Be();r=!0}if(Q==="/"&&fn()==="*"){for(;Q!="";)if(Q==="*"&&fn()==="/"){Be(),Be();break}else Be();r=!0}for(;Q===" "||Q==="	"||Q===`
`||Q==="\r";)Be()}while(r);if(Q===""){gt=st.DELIMITER;return}var e=Q+fn();if(n$[e]){gt=st.DELIMITER,U=e,Be(),Be();return}if(n$[Q]){gt=st.DELIMITER,U=Q,Be();return}if(a$(Q)||Q==="-"){for(U+=Q,Be();a$(Q);)U+=Q,Be();U==="false"?U=!1:U==="true"?U=!0:isNaN(Number(U))||(U=Number(U)),gt=st.IDENTIFIER;return}if(Q==='"'){for(Be();Q!=""&&(Q!='"'||Q==='"'&&fn()==='"');)Q==='"'?(U+=Q,Be()):Q==="\\"&&fn()==="n"?(U+=`
`,Be()):U+=Q,Be();if(Q!='"')throw lt('End of string " expected');Be(),gt=st.IDENTIFIER;return}for(gt=st.UNKNOWN;Q!="";)U+=Q,Be();throw new SyntaxError('Syntax error in part "'+IO(U,30)+'"')}function oae(){var r={};if(iae(),fe(),U==="strict"&&(r.strict=!0,fe()),(U==="graph"||U==="digraph")&&(r.type=U,fe()),gt===st.IDENTIFIER&&(r.id=U,fe()),U!="{")throw lt("Angle bracket { expected");if(fe(),SO(r),U!="}")throw lt("Angle bracket } expected");if(fe(),U!=="")throw lt("End of file expected");return fe(),delete r.node,delete r.edge,delete r.graph,r}function SO(r){for(;U!==""&&U!="}";)sae(r),U===";"&&fe()}function sae(r){var n=OO(r);if(n){TO(r,n);return}var e=lae(r);if(!e){if(gt!=st.IDENTIFIER)throw lt("Identifier expected");var t=U;if(fe(),U==="="){if(fe(),gt!=st.IDENTIFIER)throw lt("Identifier expected");r[t]=U,fe()}else uae(r,t)}}function OO(r){var n=null;if(U==="subgraph"&&(n={},n.type="subgraph",fe(),gt===st.IDENTIFIER&&(n.id=U,fe())),U==="{"){if(fe(),n||(n={}),n.parent=r,n.node=r.node,n.edge=r.edge,n.graph=r.graph,SO(n),U!="}")throw lt("Angle bracket } expected");fe(),delete n.node,delete n.edge,delete n.graph,delete n.parent,r.subgraphs||(r.subgraphs=[]),r.subgraphs.push(n)}return n}function lae(r){return U==="node"?(fe(),r.node=La(),"node"):U==="edge"?(fe(),r.edge=La(),"edge"):U==="graph"?(fe(),r.graph=La(),"graph"):null}function uae(r,n){var e={id:n},t=La();t&&(e.attr=t),_O(r,e),TO(r,n)}function TO(r,n){for(;U==="->"||U==="--";){var e,t=U;fe();var i=OO(r);if(i)e=i;else{if(gt!=st.IDENTIFIER)throw lt("Identifier or subgraph expected");e=U,_O(r,{id:e}),fe()}var a=La(),o=EO(r,n,e,t,a);aae(r,o),n=e}}function La(){for(var r,n=null,e={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"},i=new Array,a=new Array;U==="[";){for(fe(),n={};U!==""&&U!="]";){if(gt!=st.IDENTIFIER)throw lt("Attribute name expected");var o=U;if(fe(),U!="=")throw lt("Equal sign = expected");if(fe(),gt!=st.IDENTIFIER)throw lt("Attribute value expected");var s=U;o==="style"&&(s=e[s]);var l;o==="arrowhead"&&(l=t[s],o="arrows",s={to:{enabled:!0,type:l}}),o==="arrowtail"&&(l=t[s],o="arrows",s={from:{enabled:!0,type:l}}),i.push({attr:n,name:o,value:s}),a.push(o),fe(),U==","&&fe()}if(U!="]")throw lt("Bracket ] expected");fe()}if(Xr(a).call(a,"dir")){var u={};for(u.arrows={},r=0;r<i.length;r++)if(i[r].name==="arrows")if(i[r].value.to!=null)u.arrows.to=r;else if(i[r].value.from!=null)u.arrows.from=r;else throw lt("Invalid value of arrows");else i[r].name==="dir"&&(u.dir=r);var d=i[u.dir].value;if(!Xr(a).call(a,"arrows"))if(d==="both")i.push({attr:i[u.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),u.arrows.to=i.length-1,i.push({attr:i[u.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),u.arrows.from=i.length-1;else if(d==="forward")i.push({attr:i[u.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),u.arrows.to=i.length-1;else if(d==="back")i.push({attr:i[u.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),u.arrows.from=i.length-1;else if(d==="none")i.push({attr:i[u.dir].attr,name:"arrows",value:""}),u.arrows.to=i.length-1;else throw lt('Invalid dir type "'+d+'"');var h,c;if(d==="both")u.arrows.to&&u.arrows.from?(c=i[u.arrows.to].value.to.type,h=i[u.arrows.from].value.from.type,i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}},Or(i).call(i,u.arrows.from,1)):u.arrows.to?(c=i[u.arrows.to].value.to.type,h="arrow",i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}):u.arrows.from&&(c="arrow",h=i[u.arrows.from].value.from.type,i[u.arrows.from]={attr:i[u.arrows.from].attr,name:i[u.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}});else if(d==="back")u.arrows.to&&u.arrows.from?(c="",h=i[u.arrows.from].value.from.type,i[u.arrows.from]={attr:i[u.arrows.from].attr,name:i[u.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}):u.arrows.to?(c="",h="arrow",u.arrows.from=u.arrows.to,i[u.arrows.from]={attr:i[u.arrows.from].attr,name:i[u.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}):u.arrows.from&&(c="",h=i[u.arrows.from].value.from.type,i[u.arrows.to]={attr:i[u.arrows.from].attr,name:i[u.arrows.from].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}),i[u.arrows.from]={attr:i[u.arrows.from].attr,name:i[u.arrows.from].name,value:{from:{enabled:!0,type:i[u.arrows.from].value.from.type}}};else if(d==="none"){var f;u.arrows.to?f=u.arrows.to:f=u.arrows.from,i[f]={attr:i[f].attr,name:i[f].name,value:""}}else if(d==="forward")u.arrows.to&&u.arrows.from?(c=i[u.arrows.to].value.to.type,h="",i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}):u.arrows.to?(c=i[u.arrows.to].value.to.type,h="",i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}):u.arrows.from&&(c="arrow",h="",u.arrows.to=u.arrows.from,i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:c},from:{enabled:!0,type:h}}}),i[u.arrows.to]={attr:i[u.arrows.to].attr,name:i[u.arrows.to].name,value:{to:{enabled:!0,type:i[u.arrows.to].value.to.type}}};else throw lt('Invalid dir type "'+d+'"');Or(i).call(i,u.dir,1)}var v;if(Xr(a).call(a,"penwidth")){var p=[];for(v=i.length,r=0;r<v;r++)i[r].name!=="width"&&(i[r].name==="penwidth"&&(i[r].name="width"),p.push(i[r]));i=p}for(v=i.length,r=0;r<v;r++)nae(i[r].attr,i[r].name,i[r].value);return n}function lt(r){return new SyntaxError(r+', got "'+IO(U,30)+'" (char '+Vn+")")}function IO(r,n){return r.length<=n?r:r.substr(0,27)+"..."}function dae(r,n,e){se(r)?de(r).call(r,function(t){se(n)?de(n).call(n,function(i){e(t,i)}):e(t,n)}):se(n)?de(n).call(n,function(t){e(r,t)}):e(r,n)}function jh(r,n,e){for(var t=n.split("."),i=t.pop(),a=r,o=0;o<t.length;o++){var s=t[o];s in a||(a[s]={}),a=a[s]}return a[i]=e,r}function o$(r,n){var e={};for(var t in r)if(r.hasOwnProperty(t)){var i=n[t];se(i)?de(i).call(i,function(a){jh(e,a,r[t])}):typeof i=="string"?jh(e,i,r[t]):jh(e,t,r[t])}return e}function hae(r){var n=rae(r),e={nodes:[],edges:[],options:{}};if(n.nodes){var t;de(t=n.nodes).call(t,function(o){var s={id:o.id,label:String(o.label||o.id)};ei(s,o$(o.attr,wO)),s.image&&(s.shape="image"),e.nodes.push(s)})}if(n.edges){var i,a=function(s){var l={from:s.from,to:s.to};return ei(l,o$(s.attr,Rv)),l.arrows==null&&s.type==="->"&&(l.arrows="to"),l};de(i=n.edges).call(i,function(o){var s,l;if(o.from instanceof Object?s=o.from.nodes:s={id:o.from},o.to instanceof Object?l=o.to.nodes:l={id:o.to},o.from instanceof Object&&o.from.edges){var u;de(u=o.from.edges).call(u,function(h){var c=a(h);e.edges.push(c)})}if(dae(s,l,function(h,c){var f=EO(e,h.id,c.id,o.type,o.attr),v=a(f);e.edges.push(v)}),o.to instanceof Object&&o.to.edges){var d;de(d=o.to.edges).call(d,function(h){var c=a(h);e.edges.push(c)})}})}return n.attr&&(e.options=n.attr),e}function cae(r,n){var e,t={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};n!=null&&(n.fixed!=null&&(t.nodes.fixed=n.fixed),n.parseColor!=null&&(t.nodes.parseColor=n.parseColor),n.inheritColor!=null&&(t.edges.inheritColor=n.inheritColor));var i=r.edges,a=zn(i).call(i,function(s){var l={from:s.source,id:s.id,to:s.target};return s.attributes!=null&&(l.attributes=s.attributes),s.label!=null&&(l.label=s.label),s.attributes!=null&&s.attributes.title!=null&&(l.title=s.attributes.title),s.type==="Directed"&&(l.arrows="to"),s.color&&t.edges.inheritColor===!1&&(l.color=s.color),l}),o=zn(e=r.nodes).call(e,function(s){var l={id:s.id,fixed:t.nodes.fixed&&s.x!=null&&s.y!=null};return s.attributes!=null&&(l.attributes=s.attributes),s.label!=null&&(l.label=s.label),s.size!=null&&(l.size=s.size),s.attributes!=null&&s.attributes.title!=null&&(l.title=s.attributes.title),s.title!=null&&(l.title=s.title),s.x!=null&&(l.x=s.x),s.y!=null&&(l.y=s.y),s.color!=null&&(t.nodes.parseColor===!0?l.color=s.color:l.color={background:s.color,border:s.color,highlight:{background:s.color,border:s.color},hover:{background:s.color,border:s.color}}),l});return{nodes:o,edges:a}}var fae={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"},vae={addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},pae={addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",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"},gae={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"},yae={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"},mae={addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},bae={addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},$ae={addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},wae={addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"},_ae={addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},Eae={addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},Sae=Object.freeze({__proto__:null,cn:$ae,cs:Eae,de:vae,en:fae,es:pae,fr:_ae,it:gae,nl:yae,pt:mae,ru:bae,uk:wae});function Oae(r,n){try{var e=n.split(/[-_ /]/,2),t=we(e,2),i=t[0],a=t[1],o=i!=null?i.toLowerCase():null,s=a!=null?a.toUpperCase():null;if(o&&s){var l=o+"-"+s;if(Object.prototype.hasOwnProperty.call(r,l))return l;var u;console.warn(wv(u="Unknown variant ".concat(s," of language ")).call(u,o,"."))}if(o){var d=o;if(Object.prototype.hasOwnProperty.call(r,d))return d;console.warn("Unknown language ".concat(o))}return console.warn("Unknown locale ".concat(n,", falling back to English.")),"en"}catch(h){return console.error(h),console.warn("Unexpected error while normalizing locale ".concat(n,", falling back to English.")),"en"}}var Tae=function(){function r(){C(this,r),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return x(r,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var i=Math.floor(t/2),a=Math.floor(t/4),o=Math.floor(t/8),s=Math.floor(t/16),l=Math.floor(e/2),u=Math.floor(e/4),d=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*u,this.canvas.height=i,this.coordinates=[[0,0,l,i],[l,0,u,a],[l,a,d,o],[5*d,a,h,s]],this._fillMipMap()}}},{key:"initialized",value:function(){return this.coordinates!==void 0}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var i=1;i<this.NUM_ITERATIONS;i++){var a=this.coordinates[i-1],o=this.coordinates[i];e.drawImage(this.canvas,a[0],a[1],a[2],a[3],o[0],o[1],o[2],o[3])}}},{key:"drawImageAtPosition",value:function(e,t,i,a,o,s){if(this.initialized())if(t>2){t*=.5;for(var l=0;t>2&&l<this.NUM_ITERATIONS;)t*=.5,l+=1;l>=this.NUM_ITERATIONS&&(l=this.NUM_ITERATIONS-1);var u=this.coordinates[l];e.drawImage(this.canvas,u[0],u[1],u[2],u[3],i,a,o,s)}else e.drawImage(this.image,i,a,o,s)}}]),r}(),Iae=function(){function r(n){C(this,r),this.images={},this.imageBroken={},this.callback=n}return x(r,[{key:"_tryloadBrokenUrl",value:function(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=function(){console.error("Could not load brokenImage:",t)},i.image.src=t}}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var i=this,a=this.images[e];if(a)return a;var o=new Tae;return this.images[e]=o,o.image.onload=function(){i._fixImageCoordinates(o.image),o.init(),i._redrawWithImage(o)},o.image.onerror=function(){console.error("Could not load image:",e),i._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}},{key:"_fixImageCoordinates",value:function(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),r}(),kO={exports:{}},kae=re,Pae=kae(function(){if(typeof ArrayBuffer=="function"){var r=new ArrayBuffer(8);Object.isExtensible(r)&&Object.defineProperty(r,"a",{value:8})}}),Cae=re,xae=Ve,Rae=Mr,s$=Pae,el=Object.isExtensible,Aae=Cae(function(){el(1)}),Dae=Aae||s$?function(n){return!xae(n)||s$&&Rae(n)==="ArrayBuffer"?!1:el?el(n):!0}:el,Mae=re,PO=!Mae(function(){return Object.isExtensible(Object.preventExtensions({}))}),Nae=V,Fae=ne,Bae=Fo,Lae=Ve,Av=Ge,jae=Ft.f,l$=zo,zae=_u,Dv=Dae,Hae=hu,Wae=PO,CO=!1,Rr=Hae("meta"),Uae=0,Mv=function(r){jae(r,Rr,{value:{objectID:"O"+Uae++,weakData:{}}})},Vae=function(r,n){if(!Lae(r))return typeof r=="symbol"?r:(typeof r=="string"?"S":"P")+r;if(!Av(r,Rr)){if(!Dv(r))return"F";if(!n)return"E";Mv(r)}return r[Rr].objectID},Gae=function(r,n){if(!Av(r,Rr)){if(!Dv(r))return!0;if(!n)return!1;Mv(r)}return r[Rr].weakData},Kae=function(r){return Wae&&CO&&Dv(r)&&!Av(r,Rr)&&Mv(r),r},qae=function(){Yae.enable=function(){},CO=!0;var r=l$.f,n=Fae([].splice),e={};e[Rr]=1,r(e).length&&(l$.f=function(t){for(var i=r(t),a=0,o=i.length;a<o;a++)if(i[a]===Rr){n(i,a,1);break}return i},Nae({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:zae.f}))},Yae=kO.exports={enable:qae,fastKey:Vae,getWeakData:Gae,onFreeze:Kae};Bae[Rr]=!0;var Ru=kO.exports,Xae=Mo,Zae=Nt,Qae=Bt,Jae=ua,eoe=CE,toe=Gt,u$=Ce,roe=ME,ioe=$u,d$=PE,noe=TypeError,tl=function(r,n){this.stopped=r,this.result=n},h$=tl.prototype,Nv=function(r,n,e){var t=e&&e.that,i=!!(e&&e.AS_ENTRIES),a=!!(e&&e.IS_RECORD),o=!!(e&&e.IS_ITERATOR),s=!!(e&&e.INTERRUPTED),l=Xae(n,t),u,d,h,c,f,v,p,g=function(m){return u&&d$(u,"normal",m),new tl(!0,m)},y=function(m){return i?(Qae(m),s?l(m[0],m[1],g):l(m[0],m[1])):s?l(m,g):l(m)};if(a)u=r.iterator;else if(o)u=r;else{if(d=ioe(r),!d)throw new noe(Jae(r)+" is not iterable");if(eoe(d)){for(h=0,c=toe(r);c>h;h++)if(f=y(r[h]),f&&u$(h$,f))return f;return new tl(!1)}u=roe(r,d)}for(v=a?r.next:u.next;!(p=Zae(v,u)).done;){try{f=y(p.value)}catch(m){d$(u,"throw",m)}if(typeof f=="object"&&f&&u$(h$,f))return f}return new tl(!1)},aoe=Ce,ooe=TypeError,Fv=function(r,n){if(aoe(n,r))return r;throw new ooe("Incorrect invocation")},soe=V,loe=Se,uoe=Ru,doe=re,hoe=ha,coe=Nv,foe=Fv,voe=We,poe=Ve,goe=sa,yoe=fa,moe=Ft.f,boe=si.forEach,$oe=Ue,xO=qi,woe=xO.set,_oe=xO.getterFor,Bv=function(r,n,e){var t=r.indexOf("Map")!==-1,i=r.indexOf("Weak")!==-1,a=t?"set":"add",o=loe[r],s=o&&o.prototype,l={},u;if(!$oe||!voe(o)||!(i||s.forEach&&!doe(function(){new o().entries().next()})))u=e.getConstructor(n,r,t,a),uoe.enable();else{u=n(function(c,f){woe(foe(c,d),{type:r,collection:new o}),goe(f)||coe(f,c[a],{that:c,AS_ENTRIES:t})});var d=u.prototype,h=_oe(r);boe(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(c){var f=c==="add"||c==="set";c in s&&!(i&&c==="clear")&&hoe(d,c,function(v,p){var g=h(this).collection;if(!f&&i&&!poe(v))return c==="get"?void 0:!1;var y=g[c](v===0?0:v,p);return f?this:y})}),i||moe(d,"size",{configurable:!0,get:function(){return h(this).collection.size}})}return yoe(u,r,!1,!0),l[r]=u,soe({global:!0,forced:!0},l),i||e.setStrong(u,r,t),u},Eoe=Lo,Lv=function(r,n,e){for(var t in n)e&&e.unsafe&&r[t]?r[t]=n[t]:Eoe(r,t,n[t],e);return r},Soe=Vt,Ooe=pv,Toe=Oe,Ioe=Ue,c$=Toe("species"),koe=function(r){var n=Soe(r);Ioe&&n&&!n[c$]&&Ooe(n,c$,{configurable:!0,get:function(){return this}})},Poe=ca,Coe=pv,f$=Lv,xoe=Mo,Roe=Fv,Aoe=sa,Doe=Nv,Moe=dv,Ms=hv,Noe=koe,Oa=Ue,v$=Ru.fastKey,RO=qi,p$=RO.set,zh=RO.getterFor,AO={getConstructor:function(r,n,e,t){var i=r(function(u,d){Roe(u,a),p$(u,{type:n,index:Poe(null),first:void 0,last:void 0,size:0}),Oa||(u.size=0),Aoe(d)||Doe(d,u[t],{that:u,AS_ENTRIES:e})}),a=i.prototype,o=zh(n),s=function(u,d,h){var c=o(u),f=l(u,d),v,p;return f?f.value=h:(c.last=f={index:p=v$(d,!0),key:d,value:h,previous:v=c.last,next:void 0,removed:!1},c.first||(c.first=f),v&&(v.next=f),Oa?c.size++:u.size++,p!=="F"&&(c.index[p]=f)),u},l=function(u,d){var h=o(u),c=v$(d),f;if(c!=="F")return h.index[c];for(f=h.first;f;f=f.next)if(f.key===d)return f};return f$(a,{clear:function(){for(var d=this,h=o(d),c=h.index,f=h.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),delete c[f.index],f=f.next;h.first=h.last=void 0,Oa?h.size=0:d.size=0},delete:function(u){var d=this,h=o(d),c=l(d,u);if(c){var f=c.next,v=c.previous;delete h.index[c.index],c.removed=!0,v&&(v.next=f),f&&(f.previous=v),h.first===c&&(h.first=f),h.last===c&&(h.last=v),Oa?h.size--:d.size--}return!!c},forEach:function(d){for(var h=o(this),c=xoe(d,arguments.length>1?arguments[1]:void 0),f;f=f?f.next:h.first;)for(c(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(d){return!!l(this,d)}}),f$(a,e?{get:function(d){var h=l(this,d);return h&&h.value},set:function(d,h){return s(this,d===0?0:d,h)}}:{add:function(d){return s(this,d=d===0?0:d,d)}}),Oa&&Coe(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(r,n,e){var t=n+" Iterator",i=zh(n),a=zh(t);Moe(r,n,function(o,s){p$(this,{type:t,target:o,state:i(o),kind:s,last:void 0})},function(){for(var o=a(this),s=o.kind,l=o.last;l&&l.removed;)l=l.previous;return!o.target||!(o.last=l=l?l.next:o.state.first)?(o.target=void 0,Ms(void 0,!0)):Ms(s==="keys"?l.key:s==="values"?l.value:[l.key,l.value],!1)},e?"entries":"values",!e,!0),Noe(n)}},Foe=Bv,Boe=AO;Foe("Map",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},Boe);var Loe=ie,joe=Loe.Map,zoe=joe,Hoe=zoe,Woe=Hoe,DO=j(Woe),Uoe=function(){function r(){C(this,r),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},De(this.options,this.defaultOptions)}return x(r,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(e!==void 0){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&te(t).call(t,i)===-1){var a=e[i];this.add(i,a)}}}},{key:"clear",value:function(){this._groups=new DO,this._groupNames=[]}},{key:"get",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){var a=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[a]),this._groups.set(e,i)}else{var o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[o],this._groups.set(e,i)}return i}},{key:"add",value:function(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}]),r}(),Voe=V;Voe({target:"Number",stat:!0},{isNaN:function(n){return n!==n}});var Goe=ie,Koe=Goe.Number.isNaN,qoe=Koe,Yoe=qoe,Xoe=Yoe,sf=j(Xoe),Zoe=Se,Qoe=Zoe.isFinite,Joe=Number.isFinite||function(n){return typeof n=="number"&&Qoe(n)},ese=V,tse=Joe;ese({target:"Number",stat:!0},{isFinite:tse});var rse=ie,ise=rse.Number.isFinite,nse=ise,ase=nse,ose=ase,bi=j(ose),sse=V,lse=si.some,use=ga,dse=use("some");sse({target:"Array",proto:!0,forced:!dse},{some:function(n){return lse(this,n,arguments.length>1?arguments[1]:void 0)}});var hse=Ke,cse=hse("Array").some,fse=Ce,vse=cse,Hh=Array.prototype,pse=function(r){var n=r.some;return r===Hh||fse(Hh,r)&&n===Hh.some?vse:n},gse=pse,yse=gse,mse=yse,bse=j(mse),$se=ie,wse=$se.Object.getOwnPropertySymbols,_se=wse,Ese=_se,Sse=Ese,ti=j(Sse),MO={exports:{}},Ose=V,Tse=re,Ise=pr,NO=oa.f,FO=Ue,kse=!FO||Tse(function(){NO(1)});Ose({target:"Object",stat:!0,forced:kse,sham:!FO},{getOwnPropertyDescriptor:function(n,e){return NO(Ise(n),e)}});var Pse=ie,BO=Pse.Object,Cse=MO.exports=function(n,e){return BO.getOwnPropertyDescriptor(n,e)};BO.getOwnPropertyDescriptor.sham&&(Cse.sham=!0);var xse=MO.exports,Rse=xse,LO=Rse,Ase=LO,ui=j(Ase),Dse=V,Mse=Ue,Nse=QJ,Fse=pr,Bse=oa,Lse=pa;Dse({target:"Object",stat:!0,sham:!Mse},{getOwnPropertyDescriptors:function(n){for(var e=Fse(n),t=Bse.f,i=Nse(e),a={},o=0,s,l;i.length>o;)l=t(e,s=i[o++]),l!==void 0&&Lse(a,s,l);return a}});var jse=ie,zse=jse.Object.getOwnPropertyDescriptors,Hse=zse,Wse=Hse,Use=Wse,ri=j(Use),jO={exports:{}},Vse=V,Gse=Ue,g$=yu.f;Vse({target:"Object",stat:!0,forced:Object.defineProperties!==g$,sham:!Gse},{defineProperties:g$});var Kse=ie,zO=Kse.Object,qse=jO.exports=function(n,e){return zO.defineProperties(n,e)};zO.defineProperties.sham&&(qse.sham=!0);var Yse=jO.exports,Xse=Yse,Zse=Xse,Qse=Zse,Au=j(Qse),Jse=VE,Du=j(Jse);function Mu(r,n,e){return n=SS(n),n in r?wu(r,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[n]=e,r}var HO=Se,ele=re,tle=ne,rle=gr,ile=NS.trim,nle=_v,ale=tle("".charAt),Cl=HO.parseFloat,y$=HO.Symbol,m$=y$&&y$.iterator,ole=1/Cl(nle+"-0")!==-1/0||m$&&!ele(function(){Cl(Object(m$))}),sle=ole?function(n){var e=ile(rle(n)),t=Cl(e);return t===0&&ale(e,0)==="-"?-0:t}:Cl,lle=V,b$=sle;lle({global:!0,forced:parseFloat!==b$},{parseFloat:b$});var ule=ie,dle=ule.parseFloat,hle=dle,cle=hle,fle=cle,WO=j(fle),vle=V,ple=re,gle=_u.f,yle=ple(function(){return!Object.getOwnPropertyNames(1)});vle({target:"Object",stat:!0,forced:yle},{getOwnPropertyNames:gle});var mle=ie,ble=mle.Object,$le=function(n){return ble.getOwnPropertyNames(n)},wle=$le,_le=wle,Ele=_le,Sle=j(Ele);function jv(r,n){var e=["node","edge","label"],t=!0,i=Hr(n,"chosen");if(typeof i=="boolean")t=i;else if(ue(i)==="object"){if(te(e).call(e,r)===-1)throw new Error("choosify: subOption '"+r+"' should be one of '"+e.join("', '")+"'");var a=Hr(n,["chosen",r]);(typeof a=="boolean"||typeof a=="function")&&(t=a)}return t}function lf(r,n,e){if(r.width<=0||r.height<=0)return!1;if(e!==void 0){var t={x:n.x-e.x,y:n.y-e.y};if(e.angle!==0){var i=-e.angle,a={x:Math.cos(i)*t.x-Math.sin(i)*t.y,y:Math.sin(i)*t.x+Math.cos(i)*t.y};n=a}else n=t}var o=r.x+r.width,s=r.y+r.width;return r.left<n.x&&o>n.x&&r.top<n.y&&s>n.y}function xl(r){return typeof r=="string"&&r!==""}function UO(r,n,e,t){var i=t.x,a=t.y;if(typeof t.distanceToBorder=="function"){var o=t.distanceToBorder(r,n),s=Math.sin(n)*o,l=Math.cos(n)*o;l===o?(i+=o,a=t.y):s===o?(i=t.x,a-=o):(i+=l,a-=s)}else t.shape.width>t.shape.height?(i=t.x+t.shape.width*.5,a=t.y-e):(i=t.x+e,a=t.y-t.shape.height*.5);return{x:i,y:a}}var Ole=Ke,Tle=Ole("Array").values,Ile=Tle,kle=Ile,Ple=Ki,Cle=Ge,xle=Ce,Rle=kle,Wh=Array.prototype,Ale={DOMTokenList:!0,NodeList:!0},Dle=function(r){var n=r.values;return r===Wh||xle(Wh,r)&&n===Wh.values||Cle(Ale,Ple(r))?Rle:n},Mle=Dle,VO=j(Mle),Nle=function(){function r(n){C(this,r),this.measureText=n,this.current=0,this.width=0,this.height=0,this.lines=[]}return x(r,[{key:"_add",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});var a=t;(t===void 0||t==="")&&(a=" ");var o=this.measureText(a,i),s=De({},VO(o));s.text=t,s.width=o.width,s.mod=i,(t===void 0||t==="")&&(s.width=0),this.lines[e].blocks.push(s),this.lines[e].width+=s.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return e===void 0?0:e.width}},{key:"append",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e],i=0;if(t.blocks!==void 0)for(var a=0;a<t.blocks.length;a++){var o=t.blocks[a];i<o.height&&(i=o.height)}t.height=i}}},{key:"determineLabelSize",value:function(){for(var e=0,t=0,i=0;i<this.lines.length;i++){var a=this.lines[i];a.width>e&&(e=a.width),t+=a.height}this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0;t<this.lines.length;t++){var i=this.lines[t];if(i.blocks.length!==0&&!(t===this.lines.length-1&&i.width===0)){var a={};De(a,i),a.blocks=[];for(var o=void 0,s=[],l=0;l<i.blocks.length;l++){var u=i.blocks[l];u.width!==0?s.push(u):o===void 0&&(o=u)}s.length===0&&o!==void 0&&s.push(o),a.blocks=s,e.push(a)}}return e}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),r}(),Fle={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/},$$=function(){function r(n){C(this,r),this.text=n,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return x(r,[{key:"mod",value:function(){return this.modStack.length===0?"normal":this.modStack[0]}},{key:"modName",value:function(){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"}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}},{key:"match",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.prepareRegExp(e),a=we(i,2),o=a[0],s=a[1],l=o.test(this.text.substr(this.position,s));return l&&t&&(this.position+=s-1),l}},{key:"parseEndTag",value:function(e,t,i){var a=this.mod()===e;return e==="mono"?a=a&&this.mono:a=a&&!this.mono,a&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}},{key:"replace",value:function(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}},{key:"prepareRegExp",value:function(e){var t,i;if(e instanceof RegExp)i=e,t=1;else{var a=Fle[e];a!==void 0?i=a:i=new RegExp(e),t=e.length}return[i,t]}}]),r}(),Ble=function(){function r(n,e,t,i){var a=this;C(this,r),this.ctx=n,this.parent=e,this.selected=t,this.hover=i;var o=function(l,u){if(l===void 0)return 0;var d=a.parent.getFormattingValues(n,t,i,u),h=0;if(l!==""){var c=a.ctx.measureText(l);h=c.width}return{width:h,values:d}};this.lines=new Nle(o)}return x(r,[{key:"process",value:function(e){if(!xl(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,`
`),e=e.replace(/\r/g,`
`);var i=String(e).split(`
`),a=i.length;if(t.multi)for(var o=0;o<a;o++){var s=this.splitBlocks(i[o],t.multi);if(s!==void 0){if(s.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(var l=0;l<s.length;l++){var u=s[l].mod,d=s[l].text;this.splitStringIntoLines(d,u,!0)}else for(var h=0;h<s.length;h++){var c=s[h].mod,f=s[h].text;this.lines.append(f,c)}this.lines.newLine()}}else if(t.maxWdt>0)for(var v=0;v<a;v++)this.splitStringIntoLines(i[v]);else for(var p=0;p<a;p++)this.lines.newLine(i[p]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}},{key:"splitHtmlBlocks",value:function(e){for(var t=new $$(e),i=function(l){if(/&/.test(l)){var u=t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&");return u||t.add("&"),!0}return!1};t.position<t.text.length;){var a=t.text.charAt(t.position),o=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>"))||i(a);o||t.add(a),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,i=new $$(e),a=!0,o=function(d){return/\\/.test(d)?(i.position<t.text.length+1&&(i.position++,d=t.text.charAt(i.position),/ \t/.test(d)?i.spacing=!0:(i.add(d),a=!1)),!0):!1};i.position<i.text.length;){var s=i.text.charAt(i.position),l=i.parseWS(s)||o(s)||(a||i.spacing)&&(i.parseStartTag("bold","*")||i.parseStartTag("ital","_")||i.parseStartTag("mono","`"))||i.parseEndTag("bold","*","afterBold")||i.parseEndTag("ital","_","afterItal")||i.parseEndTag("mono","`","afterMono");l||(i.add(s),a=!1),i.position++}return i.emitBlock(),i.blocks}},{key:"splitBlocks",value:function(e,t){var i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}},{key:"overMaxWidth",value:function(e){var t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",i=0;i<e.length;){var a=t===""?"":" ",o=t+a+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}},{key:"getLongestFitWord",value:function(e){for(var t=0;t<e.length&&!this.overMaxWidth(Ze(e).call(e,0,t));)t++;return t}},{key:"splitStringIntoLines",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal",i=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");for(var a=e.split("\r");a.length>0;){var o=this.getLongestFit(a);if(o===0){var s=a[0],l=this.getLongestFitWord(s);this.lines.newLine(Ze(s).call(s,0,l),t),a[0]=Ze(s).call(s,l)}else{var u=o;a[o-1]===" "?o--:a[u]===" "&&u++;var d=Ze(a).call(a,0,o).join("");o==a.length&&i?this.lines.append(d,t):this.lines.newLine(d,t),a=Ze(a).call(a,u)}}}}]),r}(),Ta=["bold","ital","boldital","mono"],GO=function(){function r(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;C(this,r),this.body=n,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(e),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=t}return x(r,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),xl(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(ue(e.font)==="object"){var t=e.font.size;t!==void 0&&(this.baseSize=t)}}}},{key:"initFontOptions",value:function(e){var t=this;if(J(Ta,function(i){t.fontOptions[i]={}}),r.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}J(e,function(i,a){i!=null&&ue(i)!=="object"&&(t.fontOptions[a]=i)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=Hr(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(ue(i)==="object"){var a=Hr(e,["widthConstraint","maximum"]);typeof a=="number"&&(t.maxWdt=Number(a));var o=Hr(e,["widthConstraint","minimum"]);typeof o=="number"&&(t.minWdt=Number(o))}var s=Hr(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(ue(s)==="object"){var l=Hr(e,["heightConstraint","minimum"]);typeof l=="number"&&(t.minHgt=Number(l));var u=Hr(e,["heightConstraint","valign"]);typeof u=="string"&&(u==="top"||u==="bottom")&&(t.valign=u)}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),ce(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=jv("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}},{key:"addFontOptionsToPile",value:function(e,t){for(var i=0;i<t.length;++i)this.addFontToPile(e,t[i])}},{key:"addFontToPile",value:function(e,t){if(t!==void 0&&!(t.font===void 0||t.font===null)){var i=t.font;e.push(i)}}},{key:"getBasicOptions",value:function(e){for(var t={},i=0;i<e.length;++i){var a=e[i],o={};r.parseFontString(o,a)&&(a=o),J(a,function(s,l){s!==void 0&&(Object.prototype.hasOwnProperty.call(t,l)||(te(Ta).call(Ta,l)!==-1?t[l]={}:t[l]=s))})}return t}},{key:"getFontOption",value:function(e,t,i){for(var a,o=0;o<e.length;++o){var s=e[o];if(Object.prototype.hasOwnProperty.call(s,t)){if(a=s[t],a==null)continue;var l={};if(r.parseFontString(l,a)&&(a=l),Object.prototype.hasOwnProperty.call(a,i))return a[i]}}if(Object.prototype.hasOwnProperty.call(this.fontOptions,i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}},{key:"getFontOptions",value:function(e,t){for(var i={},a=["color","size","face","mod","vadjust"],o=0;o<a.length;++o){var s=a[o];i[s]=this.getFontOption(e,t,s)}return i}},{key:"propagateFonts",value:function(e){var t=this,i=[];this.addFontOptionsToPile(i,e),this.fontOptions=this.getBasicOptions(i);for(var a=function(){var l=Ta[o],u=t.fontOptions[l],d=t.getFontOptions(i,l);J(d,function(h,c){u[c]=h}),u.size=Number(u.size),u.vadjust=Number(u.vadjust)},o=0;o<Ta.length;++o)a()}},{key:"draw",value:function(e,t,i,a,o){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label!==void 0){var l=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&l<this.elementOptions.scaling.label.drawThreshold-1||(l>=this.elementOptions.scaling.label.maxVisible&&(l=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,a,o,t,i,s),this._drawBackground(e),this._drawText(e,t,this.size.yLine,s,l))}}},{key:"_drawBackground",value:function(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",o=arguments.length>4?arguments[4]:void 0,s=this._setAlignment(e,t,i,a),l=we(s,2);t=l[0],i=l[1],e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(var u=0;u<this.lineCount;u++){var d=this.lines[u];if(d&&d.blocks){var h=0;this.isEdgeLabel||this.fontOptions.align==="center"?h+=(this.size.width-d.width)/2:this.fontOptions.align==="right"&&(h+=this.size.width-d.width);for(var c=0;c<d.blocks.length;c++){var f=d.blocks[c];e.font=f.font;var v=this._getColor(f.color,o,f.strokeColor),p=we(v,2),g=p[0],y=p[1];f.strokeWidth>0&&(e.lineWidth=f.strokeWidth,e.strokeStyle=y,e.lineJoin="round"),e.fillStyle=g,f.strokeWidth>0&&e.strokeText(f.text,t+h,i+f.vadjust),e.fillText(f.text,t+h,i+f.vadjust),h+=f.width}i+=d.height}}}},{key:"_setAlignment",value:function(e,t,i,a){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;var o=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*o):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*o):e.textBaseline="middle"}else e.textBaseline=a;return[t,i]}},{key:"_getColor",value:function(e,t,i){var a=e||"#000000",o=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var s=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));a=zt(a,s),o=zt(o,s)}return[a,o]}},{key:"getTextSize",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=2,t=this.size.left,i=this.size.top-.5*e;if(this.isEdgeLabel){var a=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=a,i=-this.size.height*.5;break;case"top":t=a,i=-(this.size.height+e);break;case"bottom":t=a,i=e;break}}var o={left:t,top:i,width:this.size.width,height:this.size.height};return o}},{key:"calculateLabelSize",value:function(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=a-this.size.width*.5,this.size.top=o-this.size.height*.5,this.size.yLine=o+(1-this.lineCount)*.5*this.fontOptions.size,s==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,i,a){var o=function(d,h,c){return h==="normal"?c==="mod"?"":d[c]:d[h][c]!==void 0?d[h][c]:d[c]},s={color:o(this.fontOptions,a,"color"),size:o(this.fontOptions,a,"size"),face:o(this.fontOptions,a,"face"),mod:o(this.fontOptions,a,"mod"),vadjust:o(this.fontOptions,a,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(a==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?s.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(s,this.elementOptions.id,t,i));var l="";return s.mod!==void 0&&s.mod!==""&&(l+=s.mod+" "),l+=s.size+"px "+s.face,e.font=l.replace(/"/g,""),s.font=e.font,s.height=s.size,s}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,i,a){var o=new Ble(e,this,t,i);return o.process(a)}},{key:"_processLabel",value:function(e,t,i){if(!(this.labelDirty===!1&&!this.differentState(t,i))){var a=this._processLabelText(e,t,i,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=i,this.labelDirty=!1}}},{key:"visible",value:function(){if(this.size.width===0||this.size.height===0||this.elementOptions.label===void 0)return!1;var e=this.fontOptions.size*this.body.view.scale;return!(e<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,t){if(!t||typeof t!="string")return!1;var i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}}]),r}(),Lle=bu,jle=ua,zle=TypeError,Hle=function(r){if(Lle(r))return r;throw new zle(jle(r)+" is not a constructor")},Wle=V,Ule=Vt,Uh=ko,Vle=hE,w$=Hle,Gle=Bt,_$=Ve,Kle=ca,KO=re,zv=Ule("Reflect","construct"),qle=Object.prototype,Yle=[].push,qO=KO(function(){function r(){}return!(zv(function(){},[],r)instanceof r)}),YO=!KO(function(){zv(function(){})}),E$=qO||YO;Wle({target:"Reflect",stat:!0,forced:E$,sham:E$},{construct:function(n,e){w$(n),Gle(e);var t=arguments.length<3?n:w$(arguments[2]);if(YO&&!qO)return zv(n,e,t);if(n===t){switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3])}var i=[null];return Uh(Yle,i,e),new(Uh(Vle,n,i))}var a=t.prototype,o=Kle(_$(a)?a:qle),s=Uh(n,o,e);return _$(s)?s:o}});var Xle=ie,Zle=Xle.Reflect.construct,Qle=Zle,Jle=Qle,eue=Jle,_=j(eue),tue=jS,rue=tue,iue=rue,nue=iue,aue=nue,oue=j(aue),sue=V,lue=oK;sue({target:"Object",stat:!0},{setPrototypeOf:lue});var uue=ie,due=uue.Object.setPrototypeOf,hue=due,cue=hue,fue=cue,vue=fue,pue=vue,gue=pue,yue=gue,uf=j(yue),mue=cE,bue=mue,$ue=bue,wue=$ue,_ue=wue,Hv=j(_ue);function df(r,n){var e;return df=uf?Hv(e=uf).call(e):function(i,a){return i.__proto__=a,i},df(r,n)}function ae(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=oue(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),wu(r,"prototype",{writable:!1}),n&&df(r,n)}function Eue(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function le(r,n){if(n&&(ue(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eue(r)}var Sue=MS,Oue=Sue,Tue=Oue,Iue=Tue,kue=Iue,S$=j(kue);function F(r){var n;return F=uf?Hv(n=S$).call(n):function(t){return t.__proto__||S$(t)},F(r)}var Ji=function(){function r(n,e,t){C(this,r),this.body=e,this.labelModule=t,this.setOptions(n),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}}return x(r,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&(ue(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)}},{key:"_distanceToBorder",value:function(e,t){var i=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)))+i}},{key:"enableShadow",value:function(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,t){if(t.borderDashes!==!1)if(e.setLineDash!==void 0){var i=t.borderDashes;i===!0&&(i=[5,15]),e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}},{key:"disableBorderDashes",value:function(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))}},{key:"needsRefresh",value:function(e,t){return this.refreshNeeded===!0?(this.refreshNeeded=!1,!0):this.width===void 0||this.labelModule.differentState(e,t)}},{key:"initContextForDraw",value:function(e,t){var i=t.borderWidth/this.body.view.scale;e.lineWidth=Math.min(this.width,i),e.strokeStyle=t.borderColor,e.fillStyle=t.color}},{key:"performStroke",value:function(e,t){var i=t.borderWidth/this.body.view.scale;e.save(),i>0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),Go(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,i,a,o){i!==void 0&&this.resize(i,a,o),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}},{key:"updateBoundingBox",value:function(e,t,i,a,o){this._updateBoundingBox(e,t,i,a,o)}},{key:"getDimensionsFromLabel",value:function(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);var a=this.textSize.width,o=this.textSize.height,s=14;return a===0&&(a=s,o=s),{width:a,height:o}}}]),r}();function Pue(r){var n=Cue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Cue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var xue=function(r){ae(e,r);var n=Pue(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._setMargins(a),o}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(i,a,o);this.width=s.width+this.margin.right+this.margin.left,this.height=s.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(i,u),fE(i,this.left,this.top,this.width,this.height,u.borderRadius),this.performFill(i,u),this.updateBoundingBox(a,o,i,s,l),this.labelModule.draw(i,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,l)}},{key:"updateBoundingBox",value:function(i,a,o,s,l){this._updateBoundingBox(i,a,o,s,l);var u=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(u)}},{key:"distanceToBorder",value:function(i,a){i&&this.resize(i);var o=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(a)),Math.abs(this.height/2/Math.sin(a)))+o}}]),e}(Ji);function Rue(r){var n=Aue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Aue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Wv=function(r){ae(e,r);var n=Rue(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o.labelOffset=0,o.selected=!1,o}return x(e,[{key:"setOptions",value:function(i,a,o){this.options=i,a===void 0&&o===void 0||this.setImages(a,o)}},{key:"setImages",value:function(i,a){a&&this.selected?(this.imageObj=a,this.imageObjAlt=i):(this.imageObj=i,this.imageObjAlt=a)}},{key:"switchImages",value:function(i){var a=i&&!this.selected||!i&&this.selected;if(this.selected=i,this.imageObjAlt!==void 0&&a){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_getImagePadding",value:function(){var i={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){var a=this.options.imagePadding;ue(a)=="object"?(i.top=a.top,i.right=a.right,i.bottom=a.bottom,i.left=a.left):(i.top=a,i.right=a,i.bottom=a,i.left=a)}return i}},{key:"_resizeImage",value:function(){var i,a;if(this.options.shapeProperties.useImageSize===!1){var o=1,s=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:s=this.imageObj.height/this.imageObj.width),i=this.options.size*2*o,a=this.options.size*2*s}else{var l=this._getImagePadding();i=this.imageObj.width+l.left+l.right,a=this.imageObj.height+l.top+l.bottom}this.width=i,this.height=a,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(i,a,o,s){this.initContextForDraw(i,s),ov(i,a,o,s.size),this.performFill(i,s)}},{key:"_drawImageAtPosition",value:function(i,a){if(this.imageObj.width!=0){i.globalAlpha=a.opacity!==void 0?a.opacity:1,this.enableShadow(i,a);var o=1;this.options.shapeProperties.interpolation===!0&&(o=this.imageObj.width/this.width/this.body.view.scale);var s=this._getImagePadding(),l=this.left+s.left,u=this.top+s.top,d=this.width-s.left-s.right,h=this.height-s.top-s.bottom;this.imageObj.drawImageAtPosition(i,o,l,u,d,h),this.disableShadow(i,a)}}},{key:"_drawImageLabel",value:function(i,a,o,s,l){var u=0;if(this.height!==void 0){u=this.height*.5;var d=this.labelModule.getTextSize(i,s,l);d.lineCount>=1&&(u+=d.height/2)}var h=o+u;this.options.label&&(this.labelOffset=u),this.labelModule.draw(i,a,h,s,l,"hanging")}}]),e}(Ji);function Due(r){var n=Mue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Mue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Nue=function(r){ae(e,r);var n=Due(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._setMargins(a),o}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(i,a,o),l=Math.max(s.width+this.margin.right+this.margin.left,s.height+this.margin.top+this.margin.bottom);this.options.size=l/2,this.width=l,this.height=l,this.radius=this.width/2}}},{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l),this.left=a-this.width/2,this.top=o-this.height/2,this._drawRawCircle(i,a,o,u),this.updateBoundingBox(a,o),this.labelModule.draw(i,this.left+this.textSize.width/2+this.margin.left,o,s,l)}},{key:"updateBoundingBox",value:function(i,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=i-this.options.size,this.boundingBox.right=i+this.options.size,this.boundingBox.bottom=a+this.options.size}},{key:"distanceToBorder",value:function(i){return i&&this.resize(i),this.width*.5}}]),e}(Wv);function Fue(r){var n=Bue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Bue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Lue=function(r){ae(e,r);var n=Fue(e);function e(t,i,a,o,s){var l;return C(this,e),l=n.call(this,t,i,a),l.setImages(o,s),l}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var l=this.options.size*2;this.width=l,this.height=l,this.radius=.5*this.width;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(i,a,o,s,l,u){this.switchImages(s),this.resize();var d=a,h=o;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,d+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this._drawRawCircle(i,d,h,u),i.save(),i.clip(),this._drawImageAtPosition(i,u),i.restore(),this._drawImageLabel(i,d,h,s,l),this.updateBoundingBox(a,o)}},{key:"updateBoundingBox",value:function(i,a){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=a,this.boundingBox.left=i,this.boundingBox.right=i+this.options.size*2,this.boundingBox.bottom=a+this.options.size*2):(this.boundingBox.top=a-this.options.size,this.boundingBox.left=i-this.options.size,this.boundingBox.right=i+this.options.size,this.boundingBox.bottom=a+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)}},{key:"distanceToBorder",value:function(i){return i&&this.resize(i),this.width*.5}}]),e}(Wv);function jue(r){var n=zue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function zue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var di=function(r){ae(e,r);var n=jue(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(a,o)){var l,u;this.labelModule.getTextSize(i,a,o);var d=2*s.size;this.width=(l=this.customSizeWidth)!==null&&l!==void 0?l:d,this.height=(u=this.customSizeHeight)!==null&&u!==void 0?u:d,this.radius=.5*this.width}}},{key:"_drawShape",value:function(i,a,o,s,l,u,d,h){var c=this;return this.resize(i,u,d,h),this.left=s-this.width/2,this.top=l-this.height/2,this.initContextForDraw(i,h),_G(a)(i,s,l,h.size),this.performFill(i,h),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(i.font=(u?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),i.fillStyle=this.options.icon.color||"black",i.textAlign="center",i.textBaseline="middle",i.fillText(this.options.icon.code,s,l)),{drawExternalLabel:function(){if(c.options.label!==void 0){c.labelModule.calculateLabelSize(i,u,d,s,l,"hanging");var v=l+.5*c.height+.5*c.labelModule.size.height;c.labelModule.draw(i,s,v,u,d,"hanging")}c.updateBoundingBox(s,l)}}}},{key:"updateBoundingBox",value:function(i,a){this.boundingBox.top=a-this.options.size,this.boundingBox.left=i-this.options.size,this.boundingBox.right=i+this.options.size,this.boundingBox.bottom=a+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))}}]),e}(Ji);function O$(r,n){var e=$e(r);if(ti){var t=ti(r);n&&(t=$t(t).call(t,function(i){return ui(r,i).enumerable})),e.push.apply(e,t)}return e}function Hue(r){for(var n=1;n<arguments.length;n++){var e,t,i=arguments[n]!=null?arguments[n]:{};n%2?de(e=O$(Object(i),!0)).call(e,function(a){Mu(r,a,i[a])}):ri?Au(r,ri(i)):de(t=O$(Object(i))).call(t,function(a){Du(r,a,ui(i,a))})}return r}function Wue(r){var n=Uue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Uue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Vue=function(r){ae(e,r);var n=Wue(e);function e(t,i,a,o){var s;return C(this,e),s=n.call(this,t,i,a,o),s.ctxRenderer=o,s}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l,u),this.left=a-this.width/2,this.top=o-this.height/2,i.save();var d=this.ctxRenderer({ctx:i,id:this.options.id,x:a,y:o,state:{selected:s,hover:l},style:Hue({},u),label:this.options.label});if(d.drawNode!=null&&d.drawNode(),i.restore(),d.drawExternalLabel){var h=d.drawExternalLabel;d.drawExternalLabel=function(){i.save(),h(),i.restore()}}return d.nodeDimensions&&(this.customSizeWidth=d.nodeDimensions.width,this.customSizeHeight=d.nodeDimensions.height),d}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function Gue(r){var n=Kue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Kue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var que=function(r){ae(e,r);var n=Gue(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._setMargins(a),o}return x(e,[{key:"resize",value:function(i,a,o){if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(i,a,o),l=s.width+this.margin.right+this.margin.left;this.width=l,this.height=l,this.radius=this.width/2}}},{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l),this.left=a-this.width/2,this.top=o-this.height/2,this.initContextForDraw(i,u),vE(i,a-this.width/2,o-this.height/2,this.width,this.height),this.performFill(i,u),this.updateBoundingBox(a,o,i,s,l),this.labelModule.draw(i,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,l)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(Ji);function Yue(r){var n=Xue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Xue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Zue=function(r){ae(e,r);var n=Yue(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"diamond",4,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function Que(r){var n=Jue();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Jue(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var ede=function(r){ae(e,r);var n=Que(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"circle",2,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i){return i&&this.resize(i),this.options.size}}]),e}(di);function tde(r){var n=rde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function rde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var T$=function(r){ae(e,r);var n=tde(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(a,o)){var s=this.getDimensionsFromLabel(i,a,o);this.height=s.height*2,this.width=s.width+s.height,this.radius=.5*this.width}}},{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l),this.left=a-this.width*.5,this.top=o-this.height*.5,this.initContextForDraw(i,u),Nc(i,this.left,this.top,this.width,this.height),this.performFill(i,u),this.updateBoundingBox(a,o,i,s,l),this.labelModule.draw(i,a,o,s,l)}},{key:"distanceToBorder",value:function(i,a){i&&this.resize(i);var o=this.width*.5,s=this.height*.5,l=Math.sin(a)*o,u=Math.cos(a)*s;return o*s/Math.sqrt(l*l+u*u)}}]),e}(Ji);function ide(r){var n=nde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function nde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var ade=function(r){ae(e,r);var n=ide(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._setMargins(a),o}return x(e,[{key:"resize",value:function(i,a,o){this.needsRefresh(a,o)&&(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)}},{key:"draw",value:function(i,a,o,s,l,u){var d=this;return this.resize(i,s,l),this.options.icon.size=this.options.icon.size||50,this.left=a-this.width/2,this.top=o-this.height/2,this._icon(i,a,o,s,l,u),{drawExternalLabel:function(){if(d.options.label!==void 0){var c=5;d.labelModule.draw(i,d.left+d.iconSize.width/2+d.margin.left,o+d.height/2+c,s)}d.updateBoundingBox(a,o)}}}},{key:"updateBoundingBox",value:function(i,a){if(this.boundingBox.top=a-this.options.icon.size*.5,this.boundingBox.left=i-this.options.icon.size*.5,this.boundingBox.right=i+this.options.icon.size*.5,this.boundingBox.bottom=a+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0){var o=5;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+o)}}},{key:"_icon",value:function(i,a,o,s,l,u){var d=Number(this.options.icon.size);this.options.icon.code!==void 0?(i.font=[this.options.icon.weight!=null?this.options.icon.weight:s?"bold":"",(this.options.icon.weight!=null&&s?5:0)+d+"px",this.options.icon.face].join(" "),i.fillStyle=this.options.icon.color||"black",i.textAlign="center",i.textBaseline="middle",this.enableShadow(i,u),i.fillText(this.options.icon.code,a,o),this.disableShadow(i,u)):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.")}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(Ji);function ode(r){var n=sde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function sde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var lde=function(r){ae(e,r);var n=ode(e);function e(t,i,a,o,s){var l;return C(this,e),l=n.call(this,t,i,a),l.setImages(o,s),l}return x(e,[{key:"resize",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,s=this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0;if(s){var l=this.options.size*2;this.width=l,this.height=l;return}this.needsRefresh(a,o)&&this._resizeImage()}},{key:"draw",value:function(i,a,o,s,l,u){i.save(),this.switchImages(s),this.resize();var d=a,h=o;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=a,this.top=o,d+=this.width/2,h+=this.height/2):(this.left=a-this.width/2,this.top=o-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){var c=this.options.borderWidth,f=this.options.borderWidthSelected||2*this.options.borderWidth,v=(s?f:c)/this.body.view.scale;i.lineWidth=Math.min(this.width,v),i.beginPath();var p=s?this.options.color.highlight.border:l?this.options.color.hover.border:this.options.color.border,g=s?this.options.color.highlight.background:l?this.options.color.hover.background:this.options.color.background;u.opacity!==void 0&&(p=zt(p,u.opacity),g=zt(g,u.opacity)),i.strokeStyle=p,i.fillStyle=g,i.rect(this.left-.5*i.lineWidth,this.top-.5*i.lineWidth,this.width+i.lineWidth,this.height+i.lineWidth),Go(i).call(i),this.performStroke(i,u),i.closePath()}this._drawImageAtPosition(i,u),this._drawImageLabel(i,d,h,s,l),this.updateBoundingBox(a,o),i.restore()}},{key:"updateBoundingBox",value:function(i,a){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=i,this.top=a):(this.left=i-this.width/2,this.top=a-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))}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(Wv);function ude(r){var n=dde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function dde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var hde=function(r){ae(e,r);var n=ude(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"square",2,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function cde(r){var n=fde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function fde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var vde=function(r){ae(e,r);var n=cde(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"hexagon",4,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function pde(r){var n=gde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function gde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var yde=function(r){ae(e,r);var n=pde(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"star",4,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function mde(r){var n=bde();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function bde(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var $de=function(r){ae(e,r);var n=mde(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._setMargins(a),o}return x(e,[{key:"resize",value:function(i,a,o){this.needsRefresh(a,o)&&(this.textSize=this.labelModule.getTextSize(i,a,o),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)}},{key:"draw",value:function(i,a,o,s,l,u){this.resize(i,s,l),this.left=a-this.width/2,this.top=o-this.height/2,this.enableShadow(i,u),this.labelModule.draw(i,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,s,l),this.disableShadow(i,u),this.updateBoundingBox(a,o,i,s,l)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(Ji);function wde(r){var n=_de();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function _de(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Ede=function(r){ae(e,r);var n=wde(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"triangle",3,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function Sde(r){var n=Ode();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Ode(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Tde=function(r){ae(e,r);var n=Sde(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"draw",value:function(i,a,o,s,l,u){return this._drawShape(i,"triangleDown",3,a,o,s,l,u)}},{key:"distanceToBorder",value:function(i,a){return this._distanceToBorder(i,a)}}]),e}(di);function I$(r,n){var e=$e(r);if(ti){var t=ti(r);n&&(t=$t(t).call(t,function(i){return ui(r,i).enumerable})),e.push.apply(e,t)}return e}function k$(r){for(var n=1;n<arguments.length;n++){var e,t,i=arguments[n]!=null?arguments[n]:{};n%2?de(e=I$(Object(i),!0)).call(e,function(a){Mu(r,a,i[a])}):ri?Au(r,ri(i)):de(t=I$(Object(i))).call(t,function(a){Du(r,a,ui(i,a))})}return r}var xt=function(){function r(n,e,t,i,a,o){C(this,r),this.options=Qr(a),this.globalOptions=a,this.defaultOptions=o,this.body=e,this.edges=[],this.id=void 0,this.imagelist=t,this.grouplist=i,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 GO(this.body,this.options,!1),this.setOptions(n)}return x(r,[{key:"attachEdge",value:function(e){var t;te(t=this.edges).call(t,e)===-1&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t,i=te(t=this.edges).call(t,e);if(i!=-1){var a;Or(a=this.edges).call(a,i,1)}}},{key:"setOptions",value:function(e){var t=this.options.shape;if(e){if(typeof e.color<"u"&&(this._localColor=e.color),e.id!==void 0&&(this.id=e.id),this.id===void 0)throw new Error("Node must have an id");r.checkMass(e,this.id),e.x!==void 0&&(e.x===null?(this.x=void 0,this.predefinedPosition=!1):(this.x=Zt(e.x),this.predefinedPosition=!0)),e.y!==void 0&&(e.y===null?(this.y=void 0,this.predefinedPosition=!1):(this.y=Zt(e.y),this.predefinedPosition=!0)),e.size!==void 0&&(this.baseSize=e.size),e.value!==void 0&&(e.value=WO(e.value)),r.parseOptions(this.options,e,!0,this.globalOptions,this.grouplist);var i=[e,this.options,this.defaultOptions];return this.chooser=jv("node",i),this._load_images(),this.updateLabelModule(e),e.opacity!==void 0&&r.checkOpacity(e.opacity)&&(this.options.opacity=e.opacity),this.updateShape(t),e.hidden!==void 0||e.physics!==void 0}}},{key:"_load_images",value:function(){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}}}},{key:"getFormattingValues",value:function(){var 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){var t=this.options.opacity;e.borderColor=zt(e.borderColor,t),e.color=zt(e.color,t),e.shadowColor=zt(e.shadowColor,t)}return e}},{key:"updateLabelModule",value:function(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),r.updateGroupOptions(this.options,k$(k$({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);var t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(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 xue(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Nue(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Lue(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new Vue(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new que(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Zue(this.options,this.body,this.labelModule);break;case"dot":this.shape=new ede(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new T$(this.options,this.body,this.labelModule);break;case"icon":this.shape=new ade(this.options,this.body,this.labelModule);break;case"image":this.shape=new lde(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new hde(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new vde(this.options,this.body,this.labelModule);break;case"star":this.shape=new yde(this.options,this.body,this.labelModule);break;case"text":this.shape=new $de(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Ede(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Tde(this.options,this.body,this.labelModule);break;default:this.shape=new T$(this.options,this.body,this.labelModule);break}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,t,i){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.size=this.options.scaling.min+a*o}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}},{key:"getItemsOnPoint",value:function(e){var t=[];return this.labelModule.visible()&&lf(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),lf(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}},{key:"isOverlappingWith",value:function(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}},{key:"isBoundingBoxOverlappingWith",value:function(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}}],[{key:"checkOpacity",value:function(e){return 0<=e&&e<=1}},{key:"checkCoordinateOrigin",value:function(e){return e===void 0||e==="center"||e==="top-left"}},{key:"updateGroupOptions",value:function(e,t,i){var a;if(i!==void 0){var o=e.group;if(t!==void 0&&t.group!==void 0&&o!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");var s=typeof o=="number"||typeof o=="string"&&o!="";if(s){var l=i.get(o);l.opacity!==void 0&&t.opacity===void 0&&(r.checkOpacity(l.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+l.opacity),l.opacity=void 0));var u=$t(a=Sle(t)).call(a,function(d){return t[d]!=null});u.push("font"),kl(u,e,l),e.color=rf(e.color)}}}},{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0,s=["color","fixed","shadow"];if(kl(s,e,t,i),r.checkMass(t),e.opacity!==void 0&&(r.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&&(r.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&&!r.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),jt(e,t,"shadow",a),t.color!==void 0&&t.color!==null){var l=rf(t.color);gO(e.color,l)}else i===!0&&t.color===null&&(e.color=Qr(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))),i===!0&&t.font===null&&(e.font=Qr(a.font)),r.updateGroupOptions(e,t,o),t.scaling!==void 0&&jt(e.scaling,t.scaling,"label",a.scaling)}},{key:"checkMass",value:function(e,t){if(e.mass!==void 0&&e.mass<=0){var i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",$O),e.mass=1}}}]),r}();function Ide(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=kde(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function kde(r,n){var e;if(r){if(typeof r=="string")return P$(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return P$(r,n)}}function P$(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var Pde=function(){function r(n,e,t,i){var a,o=this;if(C(this,r),this.body=n,this.images=e,this.groups=t,this.layoutEngine=i,this.body.functions.createNode=O(a=this.create).call(a,this),this.nodesListeners={add:function(l,u){o.add(u.items)},update:function(l,u){o.update(u.items,u.data,u.oldData)},remove:function(l,u){o.remove(u.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(l,u,d,h){if(u===l)return .5;var c=1/(u-l);return Math.max(0,(h-l)*c)}},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=Qr(this.defaultOptions),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e,t,i=this;this.body.emitter.on("refreshNodes",O(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",O(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",function(){J(i.nodesListeners,function(a,o){i.body.data.nodes&&i.body.data.nodes.off(o,a)}),delete i.body.functions.createNode,delete i.nodesListeners.add,delete i.nodesListeners.update,delete i.nodesListeners.remove,delete i.nodesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){if(xt.parseOptions(this.options,e),e.opacity!==void 0&&(sf(e.opacity)||!bi(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(var t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(var i=0,a=$e(this.body.nodes);i<a.length;i++){var o=a[i];this.body.nodes[o].updateLabelModule(),this.body.nodes[o].needsRefresh()}if(e.size!==void 0)for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.body.nodes[s].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.body.data.nodes;if(G_("id",e))this.body.data.nodes=e;else if(se(e))this.body.data.nodes=new bl,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new bl;else throw new TypeError("Array or DataSet expected");if(i&&J(this.nodesListeners,function(s,l){i.off(l,s)}),this.body.nodes={},this.body.data.nodes){var a=this;J(this.nodesListeners,function(s,l){a.body.data.nodes.on(l,s)});var o=this.body.data.nodes.getIds();this.add(o,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i,a=[],o=0;o<e.length;o++){i=e[o];var s=this.body.data.nodes.get(i),l=this.create(s);a.push(l),this.body.nodes[i]=l}this.layoutEngine.positionInitially(a),t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t,i){for(var a=this.body.nodes,o=!1,s=0;s<e.length;s++){var l=e[s],u=a[l],d=t[s];u!==void 0?u.setOptions(d)&&(o=!0):(o=!0,u=this.create(d),a[l]=u)}!o&&i!==void 0&&(o=bse(t).call(t,function(h,c){var f=i[c];return f&&f.level!==h.level})),o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,i=0;i<e.length;i++){var a=e[i];delete t[a]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xt;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;J(this.body.nodes,function(i,a){var o=e.body.data.nodes.get(a);o!==void 0&&(t===!0&&i.setOptions({x:null,y:null}),i.setOptions({fixed:!1}),i.setOptions(o))})}},{key:"getPositions",value:function(e){var t={};if(e!==void 0){if(se(e)===!0){for(var i=0;i<e.length;i++)if(this.body.nodes[e[i]]!==void 0){var a=this.body.nodes[e[i]];t[e[i]]={x:Math.round(a.x),y:Math.round(a.y)}}}else if(this.body.nodes[e]!==void 0){var o=this.body.nodes[e];t[e]={x:Math.round(o.x),y:Math.round(o.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var l=this.body.nodes[this.body.nodeIndices[s]];t[this.body.nodeIndices[s]]={x:Math.round(l.x),y:Math.round(l.y)}}return t}},{key:"getPosition",value:function(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)}}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet(),i=Ide(t.get()),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.id,l=this.body.nodes[s],u=Math.round(l.x),d=Math.round(l.y);(o.x!==u||o.y!==d)&&e.push({id:s,x:u,y:d})}}catch(h){i.e(h)}finally{i.f()}t.update(e)}},{key:"getBoundingBox",value:function(e){if(this.body.nodes[e]!==void 0)return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,t){var i=[];if(this.body.nodes[e]!==void 0)for(var a=this.body.nodes[e],o={},s=0;s<a.edges.length;s++){var l=a.edges[s];t!=="to"&&l.toId==a.id?o[l.fromId]===void 0&&(i.push(l.fromId),o[l.fromId]=!0):t!=="from"&&l.fromId==a.id&&o[l.toId]===void 0&&(i.push(l.toId),o[l.toId]=!0)}return i}},{key:"getConnectedEdges",value:function(e){var t=[];if(this.body.nodes[e]!==void 0)for(var i=this.body.nodes[e],a=0;a<i.edges.length;a++)t.push(i.edges[a].id);else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,i){var a=this;this.body.nodes[e]!==void 0?(this.body.nodes[e].x=Number(t),this.body.nodes[e].y=Number(i),hr(function(){a.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}]),r}(),C$=Ge,Cde=function(r){return r!==void 0&&(C$(r,"value")||C$(r,"writable"))},xde=V,Rde=Nt,Ade=Ve,Dde=Bt,Mde=Cde,Nde=oa,Fde=mu;function XO(r,n){var e=arguments.length<3?r:arguments[2],t,i;if(Dde(r)===e)return r[n];if(t=Nde.f(r,n),t)return Mde(t)?t.value:t.get===void 0?void 0:Rde(t.get,e);if(Ade(i=Fde(r)))return XO(i,n,e)}xde({target:"Reflect",stat:!0},{get:XO});var Bde=ie,Lde=Bde.Reflect.get,jde=Lde,zde=jde,Hde=zde,Wde=Hde,Ude=Wde,Vde=Ude,Gde=Vde,x$=j(Gde),Kde=LO,qde=Kde,Yde=qde,Xde=Yde,Zde=Xde,Qde=j(Zde);function Jde(r,n){for(;!Object.prototype.hasOwnProperty.call(r,n)&&(r=F(r),r!==null););return r}function rl(){if(typeof Reflect<"u"&&x$){var r;rl=Hv(r=x$).call(r)}else rl=function(e,t,i){var a=Jde(e,t);if(a){var o=Qde(a,t);return o.get?o.get.call(arguments.length<3?e:i):o.value}};return rl.apply(this,arguments)}var ehe=V,R$=Math.hypot,the=Math.abs,rhe=Math.sqrt,ihe=!!R$&&R$(1/0,NaN)!==1/0;ehe({target:"Math",stat:!0,arity:2,forced:ihe},{hypot:function(n,e){for(var t=0,i=0,a=arguments.length,o=0,s,l;i<a;)s=the(arguments[i++]),o<s?(l=o/s,t=t*l*l+1,o=s):s>0?(l=s/o,t+=l*l):t+=s;return o===1/0?1/0:o*rhe(t)}});var nhe=ie,ahe=nhe.Math.hypot,ohe=ahe,she=ohe,lhe=she,uhe=j(lhe);function ZO(r){var n=dhe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function dhe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Pe=function(){function r(){C(this,r)}return x(r,null,[{key:"transform",value:function(e,t){se(e)||(e=[e]);for(var i=t.point.x,a=t.point.y,o=t.angle,s=t.length,l=0;l<e.length;++l){var u=e[l],d=u.x*Math.cos(o)-u.y*Math.sin(o),h=u.x*Math.sin(o)+u.y*Math.cos(o);u.x=i+s*d,u.y=a+s*h}}},{key:"drawPath",value:function(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var i=1;i<t.length;++i)e.lineTo(t[i].x,t[i].y);e.closePath()}}]),r}(),hhe=function(r){ae(e,r);var n=ZO(e);function e(){return C(this,e),n.apply(this,arguments)}return x(e,null,[{key:"draw",value:function(i,a){if(a.image){i.save(),i.translate(a.point.x,a.point.y),i.rotate(Math.PI/2+a.angle);var o=a.imageWidth!=null?a.imageWidth:a.image.width,s=a.imageHeight!=null?a.imageHeight:a.image.height;a.image.drawImageAtPosition(i,1,-o/2,0,o,s),i.restore()}return!1}}]),e}(Pe),che=function(r){ae(e,r);var n=ZO(e);function e(){return C(this,e),n.apply(this,arguments)}return x(e,null,[{key:"draw",value:function(i,a){var o=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];return Pe.transform(o,a),Pe.drawPath(i,o),!0}}]),e}(Pe),fhe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),vhe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i={x:-.4,y:0};Pe.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=t.angle-a/2,s=t.angle+a/2;return e.beginPath(),e.arc(i.x,i.y,t.length*.4,o,s,!1),e.stroke(),!0}}]),r}(),phe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i={x:-.3,y:0};Pe.transform(i,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var a=Math.PI,o=t.angle+a/2,s=t.angle+3*a/2;return e.beginPath(),e.arc(i.x,i.y,t.length*.4,o,s,!1),e.stroke(),!0}}]),r}(),ghe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),yhe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),mhe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i={x:-.4,y:0};return Pe.transform(i,t),ov(e,i.x,i.y,t.length*.4),!0}}]),r}(),bhe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),$he=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),whe=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),_he=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];return Pe.transform(i,t),Pe.drawPath(e,i),!0}}]),r}(),QO=function(){function r(){C(this,r)}return x(r,null,[{key:"draw",value:function(e,t){var i;switch(t.type&&(i=t.type.toLowerCase()),i){case"image":return hhe.draw(e,t);case"circle":return mhe.draw(e,t);case"box":return $he.draw(e,t);case"crow":return fhe.draw(e,t);case"curve":return vhe.draw(e,t);case"diamond":return whe.draw(e,t);case"inv_curve":return phe.draw(e,t);case"triangle":return ghe.draw(e,t);case"inv_triangle":return yhe.draw(e,t);case"bar":return bhe.draw(e,t);case"vee":return _he.draw(e,t);case"arrow":default:return che.draw(e,t)}}}]),r}();function A$(r,n){var e=$e(r);if(ti){var t=ti(r);n&&(t=$t(t).call(t,function(i){return ui(r,i).enumerable})),e.push.apply(e,t)}return e}function D$(r){for(var n=1;n<arguments.length;n++){var e,t,i=arguments[n]!=null?arguments[n]:{};n%2?de(e=A$(Object(i),!0)).call(e,function(a){Mu(r,a,i[a])}):ri?Au(r,ri(i)):de(t=A$(Object(i))).call(t,function(a){Du(r,a,ui(i,a))})}return r}var JO=function(){function r(n,e,t){C(this,r),this._body=e,this._labelModule=t,this.color={},this.colorDirty=!0,this.hoverWidth=1.5,this.selectionWidth=2,this.setOptions(n),this.fromPoint=this.from,this.toPoint=this.to}return x(r,[{key:"connect",value:function(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(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}},{key:"drawLine",value:function(e,t,i,a){var o=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,o):this._drawLine(e,t,o)}},{key:"_drawLine",value:function(e,t,i,a,o){if(this.from!=this.to)this._line(e,t,i,a,o);else{var s=this._getCircleData(e),l=we(s,3),u=l[0],d=l[1],h=l[2];this._circle(e,t,u,d,h)}}},{key:"_drawDashedLine",value:function(e,t,i,a,o){e.lineCap="round";var s=se(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(s),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{var l=this._getCircleData(e),u=we(l,3),d=u[0],h=u[1],c=u[2];this._circle(e,t,d,h,c)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)pE(e,this.from.x,this.from.y,this.to.x,this.to.y,s);else{var f=this._getCircleData(e),v=we(f,3),p=v[0],g=v[1],y=v[2];this._circle(e,t,p,g,y)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}},{key:"findBorderPositions",value:function(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};var t,i=Ze(t=this._getCircleData(e)).call(t,0,2),a=we(i,2),o=a[0],s=a[1];return{from:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:o,y:s,low:.6,high:.8,direction:1})}}},{key:"_getCircleData",value:function(e){var t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);var i=UO(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}},{key:"_pointOnCircle",value:function(e,t,i,a){var o=a*2*Math.PI;return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}},{key:"_findBorderPositionCircle",value:function(e,t,i){var a=i.x,o=i.y,s=i.low,l=i.high,u=i.direction,d=10,h=this.options.selfReference.size,c=.05,f,v=(s+l)*.5,p=0;this.options.arrowStrikethrough===!0&&(u===-1?p=this.options.endPointOffset.from:u===1&&(p=this.options.endPointOffset.to));var g=0;do{v=(s+l)*.5,f=this._pointOnCircle(a,o,h,v);var y=Math.atan2(e.y-f.y,e.x-f.x),m=e.distanceToBorder(t,y)+p,$=Math.sqrt(Math.pow(f.x-e.x,2)+Math.pow(f.y-e.y,2)),b=m-$;if(Math.abs(b)<c)break;b>0?u>0?s=v:l=v:u>0?l=v:s=v,++g}while(s<=l&&g<d);return D$(D$({},f),{},{t:v})}},{key:"getLineWidth",value:function(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)}},{key:"getColor",value:function(e,t){if(t.inheritsColor!==!1){if(t.inheritsColor==="both"&&this.from.id!==this.to.id){var i=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),a=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border;return this.from.selected===!1&&this.to.selected===!1?(a=zt(this.from.options.color.border,t.opacity),o=zt(this.to.options.color.border,t.opacity)):this.from.selected===!0&&this.to.selected===!1?o=this.to.options.color.border:this.from.selected===!1&&this.to.selected===!0&&(a=this.from.options.color.border),i.addColorStop(0,a),i.addColorStop(1,o),i}return t.inheritsColor==="to"?zt(this.to.options.color.border,t.opacity):zt(this.from.options.color.border,t.opacity)}else return zt(t.color,t.opacity)}},{key:"_circle",value:function(e,t,i,a,o){this.enableShadow(e,t);var s=0,l=Math.PI*2;if(!this.options.selfReference.renderBehindTheNode){var u=this.options.selfReference.angle,d=this.options.selfReference.angle+Math.PI,h=this._findBorderPositionCircle(this.from,e,{x:i,y:a,low:u,high:d,direction:-1}),c=this._findBorderPositionCircle(this.from,e,{x:i,y:a,low:u,high:d,direction:1});s=Math.atan2(h.y-a,h.x-i),l=Math.atan2(c.y-a,c.x-i)}e.beginPath(),e.arc(i,a,o,s,l,!1),e.stroke(),this.disableShadow(e,t)}},{key:"getDistanceToEdge",value:function(e,t,i,a,o,s){if(this.from!=this.to)return this._getDistanceToEdge(e,t,i,a,o,s);var l=this._getCircleData(void 0),u=we(l,3),d=u[0],h=u[1],c=u[2],f=d-o,v=h-s;return Math.abs(Math.sqrt(f*f+v*v)-c)}},{key:"_getDistanceToLine",value:function(e,t,i,a,o,s){var l=i-e,u=a-t,d=l*l+u*u,h=((o-e)*l+(s-t)*u)/d;h>1?h=1:h<0&&(h=0);var c=e+h*l,f=t+h*u,v=c-o,p=f-s;return Math.sqrt(v*v+p*p)}},{key:"getArrowData",value:function(e,t,i,a,o,s){var l,u,d,h,c,f,v,p=s.width;t==="from"?(d=this.from,h=this.to,c=s.fromArrowScale<0,f=Math.abs(s.fromArrowScale),v=s.fromArrowType):t==="to"?(d=this.to,h=this.from,c=s.toArrowScale<0,f=Math.abs(s.toArrowScale),v=s.toArrowType):(d=this.to,h=this.from,c=s.middleArrowScale<0,f=Math.abs(s.middleArrowScale),v=s.middleArrowType);var g=15*f+3*p;if(d!=h){var y=uhe(d.x-h.x,d.y-h.y),m=g/y;if(t!=="middle")if(this.options.smooth.enabled===!0){var $=this._findBorderPosition(d,e,{via:i}),b=this.getPoint($.t+m*(t==="from"?1:-1),i);l=Math.atan2($.y-b.y,$.x-b.x),u=$}else l=Math.atan2(d.y-h.y,d.x-h.x),u=this._findBorderPosition(d,e);else{var E=(c?-m:m)/2,T=this.getPoint(.5+E,i),N=this.getPoint(.5-E,i);l=Math.atan2(T.y-N.y,T.x-N.x),u=this.getPoint(.5,i)}}else{var M=this._getCircleData(e),R=we(M,3),D=R[0],z=R[1],Z=R[2];if(t==="from"){var Y=this.options.selfReference.angle,me=this.options.selfReference.angle+Math.PI,qe=this._findBorderPositionCircle(this.from,e,{x:D,y:z,low:Y,high:me,direction:-1});l=qe.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,u=qe}else if(t==="to"){var xe=this.options.selfReference.angle,It=this.options.selfReference.angle+Math.PI,at=this._findBorderPositionCircle(this.from,e,{x:D,y:z,low:xe,high:It,direction:1});l=at.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,u=at}else{var Je=this.options.selfReference.angle/(2*Math.PI);u=this._pointOnCircle(D,z,Z,Je),l=Je*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}var kt=u.x-g*.9*Math.cos(l),et=u.y-g*.9*Math.sin(l),ve={x:kt,y:et};return{point:u,core:ve,angle:l,length:g,type:v}}},{key:"drawArrowHead",value:function(e,t,i,a,o){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width;var s=QO.draw(e,o);s&&(this.enableShadow(e,t),Go(e).call(e),this.disableShadow(e,t))}},{key:"enableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,t){if(t.background!==!1){var i={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=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(t!==!1)if(e.setLineDash!==void 0){var i=se(t)?t:[5,5];e.setLineDash(i)}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.")}}]),r}();function M$(r,n){var e=$e(r);if(ti){var t=ti(r);n&&(t=$t(t).call(t,function(i){return ui(r,i).enumerable})),e.push.apply(e,t)}return e}function N$(r){for(var n=1;n<arguments.length;n++){var e,t,i=arguments[n]!=null?arguments[n]:{};n%2?de(e=M$(Object(i),!0)).call(e,function(a){Mu(r,a,i[a])}):ri?Au(r,ri(i)):de(t=M$(Object(i))).call(t,function(a){Du(r,a,ui(i,a))})}return r}function Ehe(r){var n=She();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function She(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Uv=function(r){ae(e,r);var n=Ehe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_findBorderPositionBezier",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates(),s=10,l=.2,u=!1,d=1,h=0,c=this.to,f,v,p=this.options.endPointOffset?this.options.endPointOffset.to:0;i.id===this.from.id&&(c=this.from,u=!0,p=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(p=0);var g=0;do{v=(h+d)*.5,f=this.getPoint(v,o);var y=Math.atan2(c.y-f.y,c.x-f.x),m=c.distanceToBorder(a,y)+p,$=Math.sqrt(Math.pow(f.x-c.x,2)+Math.pow(f.y-c.y,2)),b=m-$;if(Math.abs(b)<l)break;b<0?u===!1?h=v:d=v:u===!1?d=v:h=v,++g}while(h<=d&&g<s);return N$(N$({},f),{},{t:v})}},{key:"_getDistanceToBezierEdge",value:function(i,a,o,s,l,u,d){var h=1e9,c,f,v,p,g,y=i,m=a;for(f=1;f<10;f++)v=.1*f,p=Math.pow(1-v,2)*i+2*v*(1-v)*d.x+Math.pow(v,2)*o,g=Math.pow(1-v,2)*a+2*v*(1-v)*d.y+Math.pow(v,2)*s,f>0&&(c=this._getDistanceToLine(y,m,p,g,l,u),h=c<h?c:h),y=p,m=g;return h}},{key:"_bezierCurve",value:function(i,a,o,s){i.beginPath(),i.moveTo(this.fromPoint.x,this.fromPoint.y),o!=null&&o.x!=null?s!=null&&s.x!=null?i.bezierCurveTo(o.x,o.y,s.x,s.y,this.toPoint.x,this.toPoint.y):i.quadraticCurveTo(o.x,o.y,this.toPoint.x,this.toPoint.y):i.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(i,a),this.enableShadow(i,a),i.stroke(),this.disableShadow(i,a)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),e}(JO);function Ohe(r){var n=The();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function The(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var F$=function(r){ae(e,r);var n=Ohe(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o.via=o.via,o._boundFunction=function(){o.positionBezierNode()},o._body.emitter.on("_repositionBezierNodes",o._boundFunction),o}return x(e,[{key:"setOptions",value:function(i){rl(F(e.prototype),"setOptions",this).call(this,i);var a=!1;this.options.physics!==i.physics&&(a=!0),this.options=i,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(),a===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){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})}},{key:"cleanup",value:function(){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}},{key:"setupSupportNode",value:function(){if(this.via===void 0){var i="edgeId:"+this.id,a=this._body.functions.createNode({id:i,shape:"circle",physics:!0,hidden:!0});this._body.nodes[i]=a,this.via=a,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){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)}},{key:"_line",value:function(i,a,o){this._bezierCurve(i,a,o)}},{key:"_getViaCoordinates",value:function(){return this.via}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){var o=this._getCircleData(),s=we(o,3),l=s[0],u=s[1],d=s[2],h=2*Math.PI*(1-i);return{x:l+d*Math.sin(h),y:u+d-d*(1-Math.cos(h))}}else return{x:Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*a.x+Math.pow(i,2)*this.toPoint.x,y:Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*a.y+Math.pow(i,2)*this.toPoint.y}}},{key:"_findBorderPosition",value:function(i,a){return this._findBorderPositionBezier(i,a,this.via)}},{key:"_getDistanceToEdge",value:function(i,a,o,s,l,u){return this._getDistanceToBezierEdge(i,a,o,s,l,u,this.via)}}]),e}(Uv);function Ihe(r){var n=khe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function khe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var B$=function(r){ae(e,r);var n=Ihe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_line",value:function(i,a,o){this._bezierCurve(i,a,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var i=this.options.smooth.roundness,a=this.options.smooth.type,o=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if(a==="discrete"||a==="diagonalCross"){var l,u;o<=s?l=u=i*s:l=u=i*o,this.from.x>this.to.x&&(l=-l),this.from.y>=this.to.y&&(u=-u);var d=this.from.x+l,h=this.from.y+u;return a==="discrete"&&(o<=s?d=o<i*s?this.from.x:d:h=s<i*o?this.from.y:h),{x:d,y:h}}else if(a==="straightCross"){var c=(1-i)*o,f=(1-i)*s;return o<=s?(c=0,this.from.y<this.to.y&&(f=-f)):(this.from.x<this.to.x&&(c=-c),f=0),{x:this.to.x+c,y:this.to.y+f}}else if(a==="horizontal"){var v=(1-i)*o;return this.from.x<this.to.x&&(v=-v),{x:this.to.x+v,y:this.from.y}}else if(a==="vertical"){var p=(1-i)*s;return this.from.y<this.to.y&&(p=-p),{x:this.from.x,y:this.to.y+p}}else if(a==="curvedCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var g=Math.sqrt(o*o+s*s),y=Math.PI,m=Math.atan2(s,o),$=(m+(i*.5+.5)*y)%(2*y);return{x:this.from.x+(i*.5+.5)*g*Math.sin($),y:this.from.y+(i*.5+.5)*g*Math.cos($)}}else if(a==="curvedCCW"){o=this.to.x-this.from.x,s=this.from.y-this.to.y;var b=Math.sqrt(o*o+s*s),E=Math.PI,T=Math.atan2(s,o),N=(T+(-i*.5+.5)*E)%(2*E);return{x:this.from.x+(i*.5+.5)*b*Math.sin(N),y:this.from.y+(i*.5+.5)*b*Math.cos(N)}}else{var M,R;o<=s?M=R=i*s:M=R=i*o,this.from.x>this.to.x&&(M=-M),this.from.y>=this.to.y&&(R=-R);var D=this.from.x+M,z=this.from.y+R;return o<=s?this.from.x<=this.to.x?D=this.to.x<D?this.to.x:D:D=this.to.x>D?this.to.x:D:this.from.y>=this.to.y?z=this.to.y>z?this.to.y:z:z=this.to.y<z?this.to.y:z,{x:D,y:z}}}},{key:"_findBorderPosition",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(i,a,o.via)}},{key:"_getDistanceToEdge",value:function(i,a,o,s,l,u){var d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(i,a,o,s,l,u,d)}},{key:"getPoint",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=i,s=Math.pow(1-o,2)*this.fromPoint.x+2*o*(1-o)*a.x+Math.pow(o,2)*this.toPoint.x,l=Math.pow(1-o,2)*this.fromPoint.y+2*o*(1-o)*a.y+Math.pow(o,2)*this.toPoint.y;return{x:s,y:l}}}]),e}(Uv);function Phe(r){var n=Che();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Che(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var xhe=function(r){ae(e,r);var n=Phe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_getDistanceToBezierEdge2",value:function(i,a,o,s,l,u,d,h){for(var c=1e9,f=i,v=a,p=[0,0,0,0],g=1;g<10;g++){var y=.1*g;p[0]=Math.pow(1-y,3),p[1]=3*y*Math.pow(1-y,2),p[2]=3*Math.pow(y,2)*(1-y),p[3]=Math.pow(y,3);var m=p[0]*i+p[1]*d.x+p[2]*h.x+p[3]*o,$=p[0]*a+p[1]*d.y+p[2]*h.y+p[3]*s;if(g>0){var b=this._getDistanceToLine(f,v,m,$,l,u);c=b<c?b:c}f=m,v=$}return c}}]),e}(Uv);function Rhe(r){var n=Ahe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Ahe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var L$=function(r){ae(e,r);var n=Rhe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_line",value:function(i,a,o){var s=o[0],l=o[1];this._bezierCurve(i,a,s,l)}},{key:"_getViaCoordinates",value:function(){var i=this.from.x-this.to.x,a=this.from.y-this.to.y,o,s,l,u,d=this.options.smooth.roundness;return(Math.abs(i)>Math.abs(a)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(s=this.from.y,u=this.to.y,o=this.from.x-d*i,l=this.to.x+d*i):(s=this.from.y-d*a,u=this.to.y+d*a,o=this.from.x,l=this.to.x),[{x:o,y:s},{x:l,y:u}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(i,a){return this._findBorderPositionBezier(i,a)}},{key:"_getDistanceToEdge",value:function(i,a,o,s,l,u){var d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates(),h=we(d,2),c=h[0],f=h[1];return this._getDistanceToBezierEdge2(i,a,o,s,l,u,c,f)}},{key:"getPoint",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates(),o=we(a,2),s=o[0],l=o[1],u=i,d=[Math.pow(1-u,3),3*u*Math.pow(1-u,2),3*Math.pow(u,2)*(1-u),Math.pow(u,3)],h=d[0]*this.fromPoint.x+d[1]*s.x+d[2]*l.x+d[3]*this.toPoint.x,c=d[0]*this.fromPoint.y+d[1]*s.y+d[2]*l.y+d[3]*this.toPoint.y;return{x:h,y:c}}}]),e}(xhe);function Dhe(r){var n=Mhe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Mhe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var j$=function(r){ae(e,r);var n=Dhe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_line",value:function(i,a){i.beginPath(),i.moveTo(this.fromPoint.x,this.fromPoint.y),i.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(i,a),i.stroke(),this.disableShadow(i,a)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(i){return{x:(1-i)*this.fromPoint.x+i*this.toPoint.x,y:(1-i)*this.fromPoint.y+i*this.toPoint.y}}},{key:"_findBorderPosition",value:function(i,a){var o=this.to,s=this.from;i.id===this.from.id&&(o=this.from,s=this.to);var l=Math.atan2(o.y-s.y,o.x-s.x),u=o.x-s.x,d=o.y-s.y,h=Math.sqrt(u*u+d*d),c=i.distanceToBorder(a,l),f=(h-c)/h;return{x:(1-f)*s.x+f*o.x,y:(1-f)*s.y+f*o.y,t:0}}},{key:"_getDistanceToEdge",value:function(i,a,o,s,l,u){return this._getDistanceToLine(i,a,o,s,l,u)}}]),e}(JO),xn=function(){function r(n,e,t,i,a){if(C(this,r),e===void 0)throw new Error("No body provided");this.options=Qr(i),this.globalOptions=i,this.defaultOptions=a,this.body=e,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 GO(this.body,this.options,!0),this.setOptions(n)}return x(r,[{key:"setOptions",value:function(e){if(e){var t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;r.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=WO(e.value));var i=[e,this.options,this.defaultOptions];return this.chooser=jv("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}}},{key:"getFormattingValues",value:function(){var e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,a=this.options.color.inherit,o={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:i,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){var s=this.options.selectionWidth;typeof s=="function"?o.width=s(o.width):typeof s=="number"&&(o.width+=s),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.highlight,o.shadow=this.options.shadow.enabled}else if(this.hover){var l=this.options.hoverWidth;typeof l=="function"?o.width=l(o.width):typeof l=="number"&&(o.width+=l),o.width=Math.max(o.width,.3/this.body.view.scale),o.color=this.options.color.hover,o.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(o,this.options.id,this.selected,this.hover),o.color!==void 0&&(o.inheritsColor=!1),o.shadow===!1&&(o.shadowColor!==this.options.shadow.color||o.shadowSize!==this.options.shadow.size||o.shadowX!==this.options.shadow.x||o.shadowY!==this.options.shadow.y)&&(o.shadow=!0));else o.shadow=this.options.shadow.enabled,o.width=Math.max(o.width,.3/this.body.view.scale);return o}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof F$&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof L$&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof B$&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof j$&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new F$(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new L$(this.options,this.body,this.labelModule):this.edgeType=new B$(this.options,this.body,this.labelModule):this.edgeType=new j$(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){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()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(this.options.value!==void 0){var a=this.options.scaling.customScalingFunction(e,t,i,this.options.value),o=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+a*s}this.options.width=this.options.scaling.min+a*o}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){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}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}}},{key:"drawArrows",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var i=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",i,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",i,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",i,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)}}},{key:"drawLabel",value:function(e,t){if(this.options.label!==void 0){var i=this.from,a=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);var o;if(i.id!=a.id){this.labelModule.pointToSelf=!1,o=this.edgeType.getPoint(.5,t),e.save();var s=this._getRotation(e);s.angle!=0&&(e.translate(s.x,s.y),e.rotate(s.angle)),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var l=UO(e,this.options.selfReference.angle,this.options.selfReference.size,i);o=this._pointOnCircle(l.x,l.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,o.x,o.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var i=this._getRotation();lf(this.labelModule.getSize(),e,i)&&t.push({edgeId:this.id,labelId:0})}var a={left:e.x,top:e.y};return this.isOverlappingWith(a)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=10,i=this.from.x,a=this.from.y,o=this.to.x,s=this.to.y,l=e.left,u=e.top,d=this.edgeType.getDistanceToEdge(i,a,o,s,l,u);return d<t}else return!1}},{key:"_getRotation",value:function(e){var t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);var a={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return a;var o=this.from.y-this.to.y,s=this.from.x-this.to.x,l=Math.atan2(o,s);return(l<-1&&s<0||l>0&&s<0)&&(l+=Math.PI),a.angle=l,a}},{key:"_pointOnCircle",value:function(e,t,i,a){return{x:e+i*Math.cos(a),y:t-i*Math.sin(a)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"];if(ma(s,e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(bi(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&&(bi(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"))),xl(t.label)?e.label=t.label:xl(e.label)||(e.label=void 0),jt(e,t,"smooth",a),jt(e,t,"shadow",a),jt(e,t,"background",a),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=Ii(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),jt(e.scaling,t.scaling,"label",a.scaling)):i===!0&&t.scaling===null&&(e.scaling=Ii(a.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){var l=t.arrows.toLowerCase();e.arrows.to.enabled=te(l).call(l,"to")!=-1,e.arrows.middle.enabled=te(l).call(l,"middle")!=-1,e.arrows.from.enabled=te(l).call(l,"from")!=-1}else if(ue(t.arrows)==="object")jt(e.arrows,t.arrows,"to",a.arrows),jt(e.arrows,t.arrows,"middle",a.arrows),jt(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:"+Vo(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=Ii(a.arrows));if(t.color!==void 0&&t.color!==null){var u=Pn(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,d=e.color;if(o)ce(d,a.color,!1,i);else for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&delete d[h];if(Pn(d))d.color=d,d.highlight=d,d.hover=d,d.inherit=!1,u.opacity===void 0&&(d.opacity=1);else{var c=!1;u.color!==void 0&&(d.color=u.color,c=!0),u.highlight!==void 0&&(d.highlight=u.highlight,c=!0),u.hover!==void 0&&(d.hover=u.hover,c=!0),u.inherit!==void 0&&(d.inherit=u.inherit),u.opacity!==void 0&&(d.opacity=Math.min(1,Math.max(0,u.opacity))),c===!0?d.inherit=!1:d.inherit===void 0&&(d.inherit="from")}}else i===!0&&t.color===null&&(e.color=Qr(a.color));i===!0&&t.font===null&&(e.font=Qr(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)}}]),r}(),Nhe=function(){function r(n,e,t){var i,a=this;C(this,r),this.body=n,this.images=e,this.groups=t,this.body.functions.createEdge=O(i=this.create).call(i,this),this.edgesListeners={add:function(s,l){a.add(l.items)},update:function(s,l){a.update(l.items)},remove:function(s,l){a.remove(l.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(s,l,u,d){if(l===s)return .5;var h=1/(l-s);return Math.max(0,(d-s)*h)}},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},ce(this.options,this.defaultOptions),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;a==="dynamic"&&(a="continuous");var s=!1;for(var l in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,l)){var u=e.body.edges[l],d=e.body.data.edges.get(l);if(d!=null){var h=d.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(a===void 0?u.setOptions({smooth:!1}):u.setOptions({smooth:{type:a}}),s=!0)}}o===!0&&s===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",O(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",O(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",function(){J(e.edgesListeners,function(a,o){e.body.data.edges&&e.body.data.edges.off(o,a)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(e!==void 0){xn.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(e.smooth!==void 0)for(var i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(var a in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,a)&&this.body.edges[a].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.body.data.edges;if(G_("id",e))this.body.data.edges=e;else if(se(e))this.body.data.edges=new bl,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new bl;else throw new TypeError("Array or DataSet expected");if(a&&J(this.edgesListeners,function(s,l){a.off(l,s)}),this.body.edges={},this.body.data.edges){J(this.edgesListeners,function(s,l){t.body.data.edges.on(l,s)});var o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.body.edges,a=this.body.data.edges,o=0;o<e.length;o++){var s=e[o],l=i[s];l&&l.disconnect();var u=a.get(s,{showInternalIds:!0});i[s]=this.create(u)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,i=this.body.data.edges,a=!1,o=0;o<e.length;o++){var s=e[o],l=i.get(s),u=t[s];u!==void 0?(u.disconnect(),a=u.setOptions(l)||a,u.connect()):(this.body.edges[s]=this.create(l),a=!0)}a===!0?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length!==0){var i=this.body.edges;J(e,function(a){var o=i[a];o!==void 0&&o.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;J(this.body.edges,function(t,i){var a=e.body.data.edges.get(i);a!==void 0&&t.setOptions(a)})}},{key:"create",value:function(e){return new xn(e,this.body,this.images,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e,t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){var a=i[e];a.from=null,a.to=null,a.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(this.body.edges[e]!==void 0){var i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];J(this.body.edges,function(i,a){var o=e.body.nodes[i.toId],s=e.body.nodes[i.fromId];o!==void 0&&o.isCluster===!0||s!==void 0&&s.isCluster===!0||(o===void 0||s===void 0)&&t.push(a)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(e!=null){var t=this.body.edges,i=[];de(e).call(e,function(a,o){var s=t[o];s===void 0&&i.push(o)}),this.add(i,!0)}}}]),r}(),eT=function(){function r(n,e,t){C(this,r),this.body=n,this.physicsBody=e,this.barnesHutTree,this.setOptions(t),this._rng=xu("BARNES HUT SOLVER")}return x(r,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}},{key:"solve",value:function(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){var e,t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,a=i.length,o=this._formBarnesHutTree(t,i);this.barnesHutTree=o;for(var s=0;s<a;s++)e=t[i[s]],e.options.mass>0&&this._getForceContributions(o.root,e)}}},{key:"_getForceContributions",value:function(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)}},{key:"_getForceContribution",value:function(e,t){if(e.childrenCount>0){var i=e.centerOfMass.x-t.x,a=e.centerOfMass.y-t.y,o=Math.sqrt(i*i+a*a);o*e.calcSize>this.thetaInversed?this._calculateForces(o,i,a,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(o,i,a,t,e)}}},{key:"_calculateForces",value:function(e,t,i,a,o){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));var s=this.options.gravitationalConstant*o.mass*a.options.mass/Math.pow(e,3),l=t*s,u=i*s;this.physicsBody.forces[a.id].x+=l,this.physicsBody.forces[a.id].y+=u}},{key:"_formBarnesHutTree",value:function(e,t){for(var i,a=t.length,o=e[t[0]].x,s=e[t[0]].y,l=e[t[0]].x,u=e[t[0]].y,d=1;d<a;d++){var h=e[t[d]],c=h.x,f=h.y;h.options.mass>0&&(c<o&&(o=c),c>l&&(l=c),f<s&&(s=f),f>u&&(u=f))}var v=Math.abs(l-o)-Math.abs(u-s);v>0?(s-=.5*v,u+=.5*v):(o+=.5*v,l-=.5*v);var p=1e-5,g=Math.max(p,Math.abs(l-o)),y=.5*g,m=.5*(o+l),$=.5*(s+u),b={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-y,maxX:m+y,minY:$-y,maxY:$+y},size:g,calcSize:1/g,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(b.root);for(var E=0;E<a;E++)i=e[t[E]],i.options.mass>0&&this._placeInTree(b.root,i);return b}},{key:"_updateBranchMass",value:function(e,t){var i=e.centerOfMass,a=e.mass+t.options.mass,o=1/a;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=o,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=o,e.mass=a;var s=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<s?s:e.maxWidth}},{key:"_placeInTree",value:function(e,t,i){(i!=!0||i===void 0)&&this._updateBranchMass(e,t);var a=e.children.NW.range,o;a.maxX>t.x?a.maxY>t.y?o="NW":o="SW":a.maxY>t.y?o="NE":o="SE",this._placeInRegion(e,t,o)}},{key:"_placeInRegion",value:function(e,t,i){var a=e.children[i];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}}},{key:"_splitBranch",value:function(e){var 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)}},{key:"_insertRegion",value:function(e,t){var i,a,o,s,l=.5*e.size;switch(t){case"NW":i=e.range.minX,a=e.range.minX+l,o=e.range.minY,s=e.range.minY+l;break;case"NE":i=e.range.minX+l,a=e.range.maxX,o=e.range.minY,s=e.range.minY+l;break;case"SW":i=e.range.minX,a=e.range.minX+l,o=e.range.minY+l,s=e.range.maxY;break;case"SE":i=e.range.minX+l,a=e.range.maxX,o=e.range.minY+l,s=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:a,minY:o,maxY:s},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,i){i===void 0&&(i="#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=i,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()}}]),r}(),Fhe=function(){function r(n,e,t){C(this,r),this._rng=xu("REPULSION SOLVER"),this.body=n,this.physicsBody=e,this.setOptions(t)}return x(r,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,a,o,s,l,u,d=this.body.nodes,h=this.physicsBody.physicsNodeIndices,c=this.physicsBody.forces,f=this.options.nodeDistance,v=-2/3/f,p=4/3,g=0;g<h.length-1;g++){l=d[h[g]];for(var y=g+1;y<h.length;y++)u=d[h[y]],e=u.x-l.x,t=u.y-l.y,i=Math.sqrt(e*e+t*t),i===0&&(i=.1*this._rng(),e=i),i<2*f&&(i<.5*f?s=1:s=v*i+p,s=s/i,a=e*s,o=t*s,c[l.id].x-=a,c[l.id].y-=o,c[u.id].x+=a,c[u.id].y+=o)}}}]),r}(),Bhe=function(){function r(n,e,t){C(this,r),this.body=n,this.physicsBody=e,this.setOptions(t)}return x(r,[{key:"setOptions",value:function(e){this.options=e,this.overlapAvoidanceFactor=Math.max(0,Math.min(1,this.options.avoidOverlap||0))}},{key:"solve",value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,i=this.physicsBody.forces,a=this.options.nodeDistance,o=0;o<t.length-1;o++)for(var s=e[t[o]],l=o+1;l<t.length;l++){var u=e[t[l]];if(s.level===u.level){var d=a+this.overlapAvoidanceFactor*((s.shape.radius||0)/2+(u.shape.radius||0)/2),h=u.x-s.x,c=u.y-s.y,f=Math.sqrt(h*h+c*c),v=.05,p=void 0;f<d?p=-Math.pow(v*f,2)+Math.pow(v*d,2):p=0,f!==0&&(p=p/f);var g=h*p,y=c*p;i[s.id].x-=g,i[s.id].y-=y,i[u.id].x+=g,i[u.id].y+=y}}}}]),r}(),Vh=function(){function r(n,e,t){C(this,r),this.body=n,this.physicsBody=e,this.setOptions(t)}return x(r,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i=this.physicsBody.physicsEdgeIndices,a=this.body.edges,o,s,l,u=0;u<i.length;u++)t=a[i[u]],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,o=t.to,s=t.edgeType.via,l=t.from,this._calculateSpringForce(o,s,.5*e),this._calculateSpringForce(s,l,.5*e)):(e=t.options.length===void 0?this.options.springLength*1.5:t.options.length,this._calculateSpringForce(t.from,t.to,e)))}},{key:"_calculateSpringForce",value:function(e,t,i){var a=e.x-t.x,o=e.y-t.y,s=Math.max(Math.sqrt(a*a+o*o),.01),l=this.options.springConstant*(i-s)/s,u=a*l,d=o*l;this.physicsBody.forces[e.id]!==void 0&&(this.physicsBody.forces[e.id].x+=u,this.physicsBody.forces[e.id].y+=d),this.physicsBody.forces[t.id]!==void 0&&(this.physicsBody.forces[t.id].x-=u,this.physicsBody.forces[t.id].y-=d)}}]),r}(),Lhe=function(){function r(n,e,t){C(this,r),this.body=n,this.physicsBody=e,this.setOptions(t)}return x(r,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,a,o,s,l,u,d=this.body.edges,h=.5,c=this.physicsBody.physicsEdgeIndices,f=this.physicsBody.physicsNodeIndices,v=this.physicsBody.forces,p=0;p<f.length;p++){var g=f[p];v[g].springFx=0,v[g].springFy=0}for(var y=0;y<c.length;y++)t=d[c[y]],t.connected===!0&&(e=t.options.length===void 0?this.options.springLength:t.options.length,i=t.from.x-t.to.x,a=t.from.y-t.to.y,u=Math.sqrt(i*i+a*a),u=u===0?.01:u,l=this.options.springConstant*(e-u)/u,o=i*l,s=a*l,t.to.level!=t.from.level?(v[t.toId]!==void 0&&(v[t.toId].springFx-=o,v[t.toId].springFy-=s),v[t.fromId]!==void 0&&(v[t.fromId].springFx+=o,v[t.fromId].springFy+=s)):(v[t.toId]!==void 0&&(v[t.toId].x-=h*o,v[t.toId].y-=h*s),v[t.fromId]!==void 0&&(v[t.fromId].x+=h*o,v[t.fromId].y+=h*s)));l=1;for(var m,$,b=0;b<f.length;b++){var E=f[b];m=Math.min(l,Math.max(-l,v[E].springFx)),$=Math.min(l,Math.max(-l,v[E].springFy)),v[E].x+=m,v[E].y+=$}for(var T=0,N=0,M=0;M<f.length;M++){var R=f[M];T+=v[R].x,N+=v[R].y}for(var D=T/f.length,z=N/f.length,Z=0;Z<f.length;Z++){var Y=f[Z];v[Y].x-=D,v[Y].y-=z}}}]),r}(),il=function(){function r(n,e,t){C(this,r),this.body=n,this.physicsBody=e,this.setOptions(t)}return x(r,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e,t,i,a,o=this.body.nodes,s=this.physicsBody.physicsNodeIndices,l=this.physicsBody.forces,u=0;u<s.length;u++){var d=s[u];a=o[d],e=-a.x,t=-a.y,i=Math.sqrt(e*e+t*t),this._calculateForces(i,e,t,l,a)}}},{key:"_calculateForces",value:function(e,t,i,a,o){var s=e===0?0:this.options.centralGravity/e;a[o.id].x=t*s,a[o.id].y=i*s}}]),r}();function jhe(r){var n=zhe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function zhe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Hhe=function(r){ae(e,r);var n=jhe(e);function e(t,i,a){var o;return C(this,e),o=n.call(this,t,i,a),o._rng=xu("FORCE ATLAS 2 BASED REPULSION SOLVER"),o}return x(e,[{key:"_calculateForces",value:function(i,a,o,s,l){i===0&&(i=.1*this._rng(),a=i),this.overlapAvoidanceFactor<1&&s.shape.radius&&(i=Math.max(.1+this.overlapAvoidanceFactor*s.shape.radius,i-s.shape.radius));var u=s.edges.length+1,d=this.options.gravitationalConstant*l.mass*s.options.mass*u/Math.pow(i,2),h=a*d,c=o*d;this.physicsBody.forces[s.id].x+=h,this.physicsBody.forces[s.id].y+=c}}]),e}(eT);function Whe(r){var n=Uhe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Uhe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Vhe=function(r){ae(e,r);var n=Whe(e);function e(t,i,a){return C(this,e),n.call(this,t,i,a)}return x(e,[{key:"_calculateForces",value:function(i,a,o,s,l){if(i>0){var u=l.edges.length+1,d=this.options.centralGravity*u*l.options.mass;s[l.id].x=a*d,s[l.id].y=o*d}}}]),e}(il),Ghe=function(){function r(n){C(this,r),this.body=n,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}},De(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(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,kl(["stabilization"],this.options,e),jt(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());var t=this.options.wind;t&&((typeof t.x!="number"||sf(t.x))&&(t.x=0),(typeof t.y!="number"||sf(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}},{key:"init",value:function(){var e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Hhe(this.body,this.physicsBody,e),this.edgesSolver=new Vh(this.body,this.physicsBody,e),this.gravitySolver=new Vhe(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new Fhe(this.body,this.physicsBody,e),this.edgesSolver=new Vh(this.body,this.physicsBody,e),this.gravitySolver=new il(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Bhe(this.body,this.physicsBody,e),this.edgesSolver=new Lhe(this.body,this.physicsBody,e),this.gravitySolver=new il(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new eT(this.body,this.physicsBody,e),this.edgesSolver=new Vh(this.body,this.physicsBody,e),this.gravitySolver=new il(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){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"))}},{key:"startSimulation",value:function(){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=O(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var 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"))}},{key:"simulationStep",value:function(){var e=Sl();this.physicsTick();var t=Sl()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&hr(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),this.stabilized!==!0){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=this.adaptiveCounter%this.adaptiveInterval===0;e?(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}else this.timestep=this.options.timestep,this.physicsStep();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&t[a].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[a].id);for(var o=0;o<this.physicsBody.physicsNodeIndices.length;o++){var s=this.physicsBody.physicsNodeIndices[o];this.physicsBody.forces[s]={x:0,y:0},this.physicsBody.velocities[s]===void 0&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var l in this.physicsBody.velocities)e[l]===void 0&&delete this.physicsBody.velocities[l]}},{key:"revert",value:function(){var e=$e(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var a=0;a<e.length;a++){var o=e[a];t[o]!==void 0?t[o].options.physics===!0&&(this.referenceState[o]={positions:{x:t[o].x,y:t[o].y}},i[o].x=this.previousStates[o].vx,i[o].y=this.previousStates[o].vy,t[o].x=this.previousStates[o].x,t[o].y=this.previousStates[o].y):delete this.previousStates[o]}}},{key:"_evaluateStepQuality",value:function(){var e,t,i,a=this.body.nodes,o=this.referenceState,s=.3;for(var l in this.referenceState)if(Object.prototype.hasOwnProperty.call(this.referenceState,l)&&a[l]!==void 0&&(e=a[l].x-o[l].positions.x,t=a[l].y-o[l].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,i=0,a=5,o=0;o<e.length;o++){var s=e[o],l=this._performStep(s);t=Math.max(t,l),i+=l}this.adaptiveTimestepEnabled=i/e.length<a,this.stabilized=t<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,t,i){var a=this.modelOptions.damping*e,o=(t-a)/i;e+=o*this.timestep;var s=this.options.maxVelocity||1e9;return Math.abs(e)>s&&(e=e>0?s:-s),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);var a=this.physicsBody.velocities[e];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,i.x,t.options.mass),t.x+=a.x*this.timestep):(i.x=0,a.x=0),t.options.fixed.y===!1?(a.y=this.calculateComponentVelocity(a.y,i.y,t.options.mass),t.y+=a.y*this.timestep):(i.y=0,a.y=0);var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return o}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){var i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var 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={}}},{key:"stabilize",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof t!="number"&&(t=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),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=t,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,hr(function(){return e._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return e.stabilized===!1&&e.stabilizationIterations<e.targetIterations},i=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&i();for(var a=0;t()&&a<this.options.stabilization.updateInterval;)this.physicsTick(),a++;if(i(),t()){var o;hr(O(o=this._stabilizationBatch).call(o,this),0)}else this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){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}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var i=this.physicsBody.physicsNodeIndices[t],a=this.body.nodes[i],o=this.physicsBody.forces[i],s=20,l=.03,u=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.x,2)),d=Math.min(Math.max(5,u),15),h=3*d,c=nf((180-Math.min(1,Math.max(0,l*u))*180)/360,1,1),f={x:a.x+s*o.x,y:a.y+s*o.y};e.lineWidth=d,e.strokeStyle=c,e.beginPath(),e.moveTo(a.x,a.y),e.lineTo(f.x,f.y),e.stroke();var v=Math.atan2(o.y,o.x);e.fillStyle=c,QO.draw(e,{type:"arrow",point:f,angle:v,length:h}),Go(e).call(e)}}}]),r}();let Ns;const Khe=new Uint8Array(16);function qhe(){if(!Ns&&(Ns=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ns))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ns(Khe)}const Xe=[];for(let r=0;r<256;++r)Xe.push((r+256).toString(16).slice(1));function Yhe(r,n=0){return Xe[r[n+0]]+Xe[r[n+1]]+Xe[r[n+2]]+Xe[r[n+3]]+"-"+Xe[r[n+4]]+Xe[r[n+5]]+"-"+Xe[r[n+6]]+Xe[r[n+7]]+"-"+Xe[r[n+8]]+Xe[r[n+9]]+"-"+Xe[r[n+10]]+Xe[r[n+11]]+Xe[r[n+12]]+Xe[r[n+13]]+Xe[r[n+14]]+Xe[r[n+15]]}const Xhe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var z$={randomUUID:Xhe};function ja(r,n,e){if(z$.randomUUID&&!n&&!r)return z$.randomUUID();r=r||{};const t=r.random||(r.rng||qhe)();return t[6]=t[6]&15|64,t[8]=t[8]&63|128,Yhe(t)}var ut=function(){function r(){C(this,r)}return x(r,null,[{key:"getRange",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,a=-1e9,o=1e9,s=-1e9,l;if(t.length>0)for(var u=0;u<t.length;u++)l=e[t[u]],o>l.shape.boundingBox.left&&(o=l.shape.boundingBox.left),s<l.shape.boundingBox.right&&(s=l.shape.boundingBox.right),i>l.shape.boundingBox.top&&(i=l.shape.boundingBox.top),a<l.shape.boundingBox.bottom&&(a=l.shape.boundingBox.bottom);return o===1e9&&s===-1e9&&i===1e9&&a===-1e9&&(i=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:i,maxY:a}}},{key:"getRangeCore",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,a=-1e9,o=1e9,s=-1e9,l;if(t.length>0)for(var u=0;u<t.length;u++)l=e[t[u]],o>l.x&&(o=l.x),s<l.x&&(s=l.x),i>l.y&&(i=l.y),a<l.y&&(a=l.y);return o===1e9&&s===-1e9&&i===1e9&&a===-1e9&&(i=0,a=0,o=0,s=0),{minX:o,maxX:s,minY:i,maxY:a}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var i={};return t===void 0||t==="node"?(ce(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):ce(i,e.options,!0),i}}]),r}();function Zhe(r){var n=Qhe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Qhe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var Jhe=function(r){ae(e,r);var n=Zhe(e);function e(t,i,a,o,s,l){var u;return C(this,e),u=n.call(this,t,i,a,o,s,l),u.isCluster=!0,u.containedNodes={},u.containedEdges={},u}return x(e,[{key:"_openChildCluster",value:function(i){var a=this,o=this.body.nodes[i];if(this.containedNodes[i]===void 0)throw new Error("node with id: "+i+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+i+" is not a cluster");delete this.containedNodes[i],J(o.edges,function(s){delete a.containedEdges[s.id]}),J(o.containedNodes,function(s,l){a.containedNodes[l]=s}),o.containedNodes={},J(o.containedEdges,function(s,l){a.containedEdges[l]=s}),o.containedEdges={},J(o.edges,function(s){J(a.edges,function(l){var u,d,h=te(u=l.clusteringEdgeReplacingIds).call(u,s.id);h!==-1&&(J(s.clusteringEdgeReplacingIds,function(c){l.clusteringEdgeReplacingIds.push(c),a.body.edges[c].edgeReplacedById=l.id}),Or(d=l.clusteringEdgeReplacingIds).call(d,h,1))})}),o.edges=[]}}]),e}(xt),ece=function(){function r(n){var e=this;C(this,r),this.body=n,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},De(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){e.clusteredNodes={},e.clusteredEdges={}})}return x(r,[{key:"clusterByHubsize",value:function(e,t){e===void 0?e=this._getHubSize():ue(e)==="object"&&(t=this._checkOptions(e),e=this._getHubSize());for(var i=[],a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodes[this.body.nodeIndices[a]];o.edges.length>=e&&i.push(o.id)}for(var s=0;s<i.length;s++)this.clusterByConnection(i[s],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var a={},o={};J(this.body.nodes,function(s,l){s.options&&t.joinCondition(s.options)===!0&&(a[l]=s,J(s.edges,function(u){e.clusteredEdges[u.id]===void 0&&(o[u.id]=u)}))}),this._cluster(a,o,t,i)}},{key:"clusterByEdgeCount",value:function(e,t){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);for(var o=[],s={},l,u,d,h=function(){var p={},g={},y=i.body.nodeIndices[c],m=i.body.nodes[y];if(s[y]===void 0){d=0,u=[];for(var $=0;$<m.edges.length;$++)l=m.edges[$],i.clusteredEdges[l.id]===void 0&&(l.toId!==l.fromId&&d++,u.push(l));if(d===e){for(var b=function(Y){if(t.joinCondition===void 0||t.joinCondition===null)return!0;var me=ut.cloneOptions(Y);return t.joinCondition(me)},E=!0,T=0;T<u.length;T++){l=u[T];var N=i._getConnectedId(l,y);if(b(m))g[l.id]=l,p[y]=m,p[N]=i.body.nodes[N],s[y]=!0;else{E=!1;break}}if($e(p).length>0&&$e(g).length>0&&E===!0){var M=function(){for(var Y=0;Y<o.length;++Y)for(var me in p)if(o[Y].nodes[me]!==void 0)return o[Y]},R=M();if(R!==void 0){for(var D in p)R.nodes[D]===void 0&&(R.nodes[D]=p[D]);for(var z in g)R.edges[z]===void 0&&(R.edges[z]=g[z])}else o.push({nodes:p,edges:g})}}}},c=0;c<this.body.nodeIndices.length;c++)h();for(var f=0;f<o.length;f++)this._cluster(o[f].nodes,o[f].edges,t,!1);a===!0&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var i,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!");var o=this.body.nodes[e];t=this._checkOptions(t,o),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=o.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=o.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=o.options.fixed.x,t.clusterNodeProperties.fixed.y=o.options.fixed.y);var s={},l={},u=o.id,d=ut.cloneOptions(o);s[u]=o;for(var h=0;h<o.edges.length;h++){var c=o.edges[h];if(this.clusteredEdges[c.id]===void 0){var f=this._getConnectedId(c,u);if(this.clusteredNodes[f]===void 0)if(f!==u)if(t.joinCondition===void 0)l[c.id]=c,s[f]=this.body.nodes[f];else{var v=ut.cloneOptions(this.body.nodes[f]);t.joinCondition(d,v)===!0&&(l[c.id]=c,s[f]=this.body.nodes[f])}else l[c.id]=c}}var p=zn(i=$e(s)).call(i,function(b){return s[b].id});for(var g in s)if(Object.prototype.hasOwnProperty.call(s,g))for(var y=s[g],m=0;m<y.edges.length;m++){var $=y.edges[m];te(p).call(p,this._getConnectedId($,y.id))>-1&&(l[$.id]=$)}this._cluster(s,l,t,a)}},{key:"_createClusterEdges",value:function(e,t,i,a){for(var o,s,l,u,d,h,c=$e(e),f=[],v=0;v<c.length;v++){s=c[v],l=e[s];for(var p=0;p<l.edges.length;p++)o=l.edges[p],this.clusteredEdges[o.id]===void 0&&(o.toId==o.fromId?t[o.id]=o:o.toId==s?(u=i.id,d=o.fromId,h=d):(u=o.toId,d=i.id,h=u),e[h]===void 0&&f.push({edge:o,fromId:d,toId:u}))}for(var g=[],y=function(N){for(var M=0;M<g.length;M++){var R=g[M],D=N.fromId===R.fromId&&N.toId===R.toId,z=N.fromId===R.toId&&N.toId===R.fromId;if(D||z)return R}return null},m=0;m<f.length;m++){var $=f[m],b=$.edge,E=y($);E===null?(E=this._createClusteredEdge($.fromId,$.toId,b,a),g.push(E)):E.clusteringEdgeReplacingIds.push(b.id),this.body.edges[b.id].edgeReplacedById=E.id,this._backupEdgeOptions(b),b.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&this.clusteredNodes[s]!==void 0&&o.push(s);for(var l=0;l<o.length;++l)delete e[o[l]];if($e(e).length!=0&&!($e(e).length==1&&i.clusterNodeProperties.allowSingleNodeCluster!=!0)){var u=ce({},i.clusterNodeProperties);if(i.processProperties!==void 0){var d=[];for(var h in e)if(Object.prototype.hasOwnProperty.call(e,h)){var c=ut.cloneOptions(e[h]);d.push(c)}var f=[];for(var v in t)if(Object.prototype.hasOwnProperty.call(t,v)&&v.substr(0,12)!=="clusterEdge:"){var p=ut.cloneOptions(t[v],"edge");f.push(p)}if(u=i.processProperties(u,d,f),!u)throw new Error("The processProperties function does not return properties!")}u.id===void 0&&(u.id="cluster:"+ja());var g=u.id;u.label===void 0&&(u.label="cluster");var y=void 0;u.x===void 0&&(y=this._getClusterPosition(e),u.x=y.x),u.y===void 0&&(y===void 0&&(y=this._getClusterPosition(e)),u.y=y.y),u.id=g;var m=this.body.functions.createNode(u,Jhe);m.containedNodes=e,m.containedEdges=t,m.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[u.id]=m,this._clusterEdges(e,t,u,i.clusterEdgeProperties),u.id=void 0,a===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){this.clusteredEdges[e.id]===void 0&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];t!==void 0&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return this.body.nodes[e]!==void 0?this.body.nodes[e].isCluster===!0:(console.error("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=$e(e),i=e[t[0]].x,a=e[t[0]].x,o=e[t[0]].y,s=e[t[0]].y,l,u=1;u<t.length;u++)l=e[t[u]],i=l.x<i?l.x:i,a=l.x>a?l.x:a,o=l.y<o?l.y:o,s=l.y>s?l.y:s;return{x:.5*(i+a),y:.5*(o+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");var 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.");var o=this.findNode(e),s=te(o).call(o,e)-1;if(s>=0){var l=o[s],u=this.body.nodes[l];u._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}var d=a.containedNodes,h=a.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){var c={},f={x:a.x,y:a.y};for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)){var p=this.body.nodes[v];c[v]={x:p.x,y:p.y}}var g=t.releaseFunction(f,c);for(var y in d)if(Object.prototype.hasOwnProperty.call(d,y)){var m=this.body.nodes[y];g[y]!==void 0&&(m.x=g[y].x===void 0?a.x:g[y].x,m.y=g[y].y===void 0?a.y:g[y].y)}}else J(d,function(at){at.options.fixed.x===!1&&(at.x=a.x),at.options.fixed.y===!1&&(at.y=a.y)});for(var $ in d)if(Object.prototype.hasOwnProperty.call(d,$)){var b=this.body.nodes[$];b.vx=a.vx,b.vy=a.vy,b.setOptions({physics:!0}),delete this.clusteredNodes[$]}for(var E=[],T=0;T<a.edges.length;T++)E.push(a.edges[T]);for(var N=0;N<E.length;N++){for(var M=E[N],R=this._getConnectedId(M,e),D=this.clusteredNodes[R],z=0;z<M.clusteringEdgeReplacingIds.length;z++){var Z=M.clusteringEdgeReplacingIds[z],Y=this.body.edges[Z];if(Y!==void 0)if(D!==void 0){var me=this.body.nodes[D.clusterId];me.containedEdges[Y.id]=Y,delete h[Y.id];var qe=Y.fromId,xe=Y.toId;Y.toId==R?xe=D.clusterId:qe=D.clusterId,this._createClusteredEdge(qe,xe,Y,me.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(Y)}M.remove()}for(var It in h)Object.prototype.hasOwnProperty.call(h,It)&&this._restoreEdge(h[It]);delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(this.isCluster(e)===!0){var i=this.body.nodes[e].containedNodes;for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&t.push(this.body.nodes[a].id)}return t}},{key:"findNode",value:function(e){for(var t=[],i=100,a=0,o;this.clusteredNodes[e]!==void 0&&a<i;){if(o=this.body.nodes[e],o===void 0)return[];t.push(o.id),e=this.clusteredNodes[e].clusterId,a++}return o=this.body.nodes[e],o===void 0?[]:(t.push(o.id),Ti(t).call(t),t)}},{key:"updateClusteredNode",value:function(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")}},{key:"updateEdge",value:function(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.");for(var i=this.getClusteredEdges(e),a=0;a<i.length;a++){var o=this.body.edges[i[a]];o.setOptions(t)}this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var t=[],i=100,a=0;e!==void 0&&this.body.edges[e]!==void 0&&a<i;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,a++;return Ti(t).call(t),t}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var t=[e],i=[],a=[],o=100,s=0;t.length>0&&s<o;){var l=t.pop();if(l!==void 0){var u=this.body.edges[l];if(u!==void 0){s++;var d=u.clusteringEdgeReplacingIds;if(d===void 0)a.push(l);else for(var h=0;h<d.length;++h){var c=d[h];te(t).call(t,d)!==-1||te(i).call(i,d)!==-1||t.push(c)}i.push(l)}}}return a}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:(e.fromId!=t,e.fromId)}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,a=0,o=0;o<this.body.nodeIndices.length;o++){var s=this.body.nodes[this.body.nodeIndices[o]];s.edges.length>a&&(a=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e=e/i,t=t/i;var l=t-Math.pow(e,2),u=Math.sqrt(l),d=Math.floor(e+2*u);return d>a&&(d=a),d}},{key:"_createClusteredEdge",value:function(e,t,i,a,o){var s=ut.cloneOptions(i,"edge");ce(s,a),s.from=e,s.to=t,s.id="clusterEdge:"+ja(),o!==void 0&&ce(s,o);var l=this.body.functions.createEdge(s);return l.clusteringEdgeReplacingIds=[i.id],l.connect(),this.body.edges[l.id]=l,l}},{key:"_clusterEdges",value:function(e,t,i,a){if(t instanceof xn){var o=t,s={};s[o.id]=o,t=s}if(e instanceof xt){var l=e,u={};u[l.id]=l,e=u}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");a===void 0&&(a=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,a);for(var d in t)if(Object.prototype.hasOwnProperty.call(t,d)&&this.body.edges[d]!==void 0){var h=this.body.edges[d];this._backupEdgeOptions(h),h.setOptions({physics:!1})}for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(this.clusteredNodes[c]={clusterId:i.id,node:this.body.nodes[c]},this.body.nodes[c].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(e!==void 0){var t=this.clusteredNodes[e];if(t!==void 0){var i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}}}},{key:"_filter",value:function(e,t){var i=[];return J(e,function(a){t(a)&&i.push(a)}),i}},{key:"_updateState",value:function(){var e=this,t,i=[],a={},o=function(v){J(e.body.nodes,function(p){p.isCluster===!0&&v(p)})};for(t in this.clusteredNodes)if(Object.prototype.hasOwnProperty.call(this.clusteredNodes,t)){var s=this.body.nodes[t];s===void 0&&i.push(t)}o(function(f){for(var v=0;v<i.length;v++)delete f.containedNodes[i[v]]});for(var l=0;l<i.length;l++)delete this.clusteredNodes[i[l]];J(this.clusteredEdges,function(f){var v=e.body.edges[f];(v===void 0||!v.endPointsValid())&&(a[f]=f)}),o(function(f){J(f.containedEdges,function(v,p){!v.endPointsValid()&&!a[p]&&(a[p]=p)})}),J(this.body.edges,function(f,v){var p=!0,g=f.clusteringEdgeReplacingIds;if(g!==void 0){var y=0;J(g,function(m){var $=e.body.edges[m];$!==void 0&&$.endPointsValid()&&(y+=1)}),p=y>0}(!f.endPointsValid()||!p)&&(a[v]=v)}),o(function(f){J(a,function(v){delete f.containedEdges[v],J(f.edges,function(p,g){if(p.id===v){f.edges[g]=null;return}p.clusteringEdgeReplacingIds=e._filter(p.clusteringEdgeReplacingIds,function(y){return!a[y]})}),f.edges=e._filter(f.edges,function(p){return p!==null})})}),J(a,function(f){delete e.clusteredEdges[f]}),J(a,function(f){delete e.body.edges[f]});var u=$e(this.body.edges);J(u,function(f){var v=e.body.edges[f],p=e._isClusteredNode(v.fromId)||e._isClusteredNode(v.toId);if(p!==e._isClusteredEdge(v.id))if(p){var g=e._getClusterNodeForNode(v.fromId);g!==void 0&&e._clusterEdges(e.body.nodes[v.fromId],v,g);var y=e._getClusterNodeForNode(v.toId);y!==void 0&&e._clusterEdges(e.body.nodes[v.toId],v,y)}else delete e._clusterEdges[f],e._restoreEdge(v)});for(var d=!1,h=!0,c=function(){var v=[];o(function(g){var y=$e(g.containedNodes).length,m=g.options.allowSingleNodeCluster===!0;(m&&y<1||!m&&y<2)&&v.push(g.id)});for(var p=0;p<v.length;++p)e.openCluster(v[p],{},!1);h=v.length>0,d=d||h};h;)c();d&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return this.clusteredNodes[e]!==void 0}},{key:"_isClusteredEdge",value:function(e){return this.clusteredEdges[e]!==void 0}}]),r}();function tce(){var r;window!==void 0&&(r=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),r===void 0?window.requestAnimationFrame=function(n){n()}:window.requestAnimationFrame=r}var rce=function(){function r(n,e){C(this,r),tce(),this.body=n,this.canvas=e,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!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},De(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this,t;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=hr(function(){var i;e.zooming=!1,O(i=e._requestRedraw).call(i,e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){e.renderingActive===!1&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",O(t=this._requestRedraw).call(t,this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=e.renderRequests>0,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,e.requiresTimeout===!0?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(e!==void 0){var t=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"];ma(t,this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if(!(typeof window>"u")){var i,a=window;return this.requiresTimeout===!0?i=hr(e,t):a.requestAnimationFrame&&(i=a.requestAnimationFrame(e)),i}}},{key:"_startRendering",value:function(){if(this.renderingActive===!0&&this.renderTimer===void 0){var e;this.renderTimer=this._requestNextFrame(O(e=this._renderStep).call(e,this),this.simulationInterval)}}},{key:"_renderStep",value:function(){this.renderingActive===!0&&(this.renderTimer=void 0,this.requiresTimeout===!0&&this._startRendering(),this._redraw(),this.requiresTimeout===!1&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;var t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();var i=this.canvas.getContext(),a=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,a,o),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.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(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){var s=this._drawNodes(i,e),l=s.drawExternalLabels;t.drawExternalLabels=l}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,a,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var 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);var t=this.body.nodes,i;for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i=t[a],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.body.nodes,a=this.body.nodeIndices,o,s=[],l=[],u=20,d=this.canvas.DOMtoCanvas({x:-u,y:-u}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+u,y:this.canvas.frame.canvas.clientHeight+u}),c={top:d.y,left:d.x,bottom:h.y,right:h.x},f=[],v=0;v<a.length;v++)if(o=i[a[v]],o.hover)l.push(a[v]);else if(o.isSelected())s.push(a[v]);else if(t===!0){var p=o.draw(e);p.drawExternalLabel!=null&&f.push(p.drawExternalLabel)}else if(o.isBoundingBoxOverlappingWith(c)===!0){var g=o.draw(e);g.drawExternalLabel!=null&&f.push(g.drawExternalLabel)}else o.updateBoundingBox(e,o.selected);var y,m=s.length,$=l.length;for(y=0;y<m;y++){o=i[s[y]];var b=o.draw(e);b.drawExternalLabel!=null&&f.push(b.drawExternalLabel)}for(y=0;y<$;y++){o=i[l[y]];var E=o.draw(e);E.drawExternalLabel!=null&&f.push(E.drawExternalLabel)}return{drawExternalLabels:function(){for(var N=0,M=f;N<M.length;N++){var R=M[N];R()}}}}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,i=this.body.edgeIndices,a=0;a<i.length;a++){var o=t[i[a]];o.connected===!0&&o.draw(e)}}},{key:"_drawArrows",value:function(e){for(var t=this.body.edges,i=this.body.edgeIndices,a=0;a<i.length;a++){var o=t[i[a]];o.connected===!0&&o.drawArrows(e)}}},{key:"_determineBrowserMethod",value:function(){if(typeof window<"u"){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,te(e).call(e,"msie 9.0")!=-1?this.requiresTimeout=!0:te(e).call(e,"safari")!=-1&&te(e).call(e,"chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0}},{key:"_drawSelectionBox",value:function(e){if(this.body.selectionBox.show){e.beginPath();var t=this.body.selectionBox.position.end.x-this.body.selectionBox.position.start.x,i=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,i),e.fillStyle="rgba(151, 194, 252, 0.2)",e.fillRect(this.body.selectionBox.position.start.x,this.body.selectionBox.position.start.y,t,i),e.strokeStyle="rgba(151, 194, 252, 1)",e.stroke()}else e.closePath()}}]),r}(),ice=ie,nce=ice.setInterval,ace=nce,oce=j(ace);function Rl(r,n){n.inputHandler=function(e){e.isFirst&&n(e)},r.on("hammer.input",n.inputHandler)}function tT(r,n){return n.inputHandler=function(e){e.isFinal&&n(e)},r.on("hammer.input",n.inputHandler)}var sce=function(){function r(n){C(this,r),this.body=n,this.pixelRatio=1,this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this._cleanupCallbacks=[],this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},De(this.options,this.defaultOptions),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this,t;this.body.emitter.once("resize",function(i){i.width!==0&&(e.body.view.translation.x=i.width*.5),i.height!==0&&(e.body.view.translation.y=i.height*.5)}),this.body.emitter.on("setSize",O(t=this.setSize).call(t,this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(e!==void 0){var i=["width","height","autoResize"];ma(i,this.options,e)}if(this._cleanUp(),this.options.autoResize===!0){var a;if(window.ResizeObserver){var o=new ResizeObserver(function(){var d=t.setSize();d===!0&&t.body.emitter.emit("_requestRedraw")}),s=this.frame;o.observe(s),this._cleanupCallbacks.push(function(){o.unobserve(s)})}else{var l=oce(function(){var d=t.setSize();d===!0&&t.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(function(){clearInterval(l)})}var u=O(a=this._onResize).call(a,this);window.addEventListener("resize",u),this._cleanupCallbacks.push(function(){window.removeEventListener("resize",u)})}}},{key:"_cleanUp",value:function(){var e,t,i;de(e=Ti(t=Or(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,function(a){try{a()}catch(o){console.error(o)}})}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var 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}))}},{key:"_setCameraState",value:function(){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){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;var a=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),o={x:a.x-this.cameraState.position.x,y:a.y-this.cameraState.position.y};this.body.view.translation.x+=o.x*this.body.view.scale,this.body.view.translation.y+=o.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(te(e).call(e,"%")!==-1||te(e).call(e,"px")!==-1)return e;if(te(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){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{var 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()}},{key:"_bindHammer",value:function(){var e=this;this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Cn(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Cn.DIRECTION_ALL}),Rl(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("wheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new Cn(this.frame),tT(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var 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);var i=!1,a=this.frame.canvas.width,o=this.frame.canvas.height,s=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(s),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},i=!0;else{var l=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),u=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==l||this.frame.canvas.height!==u)&&this._getCameraState(s),this.frame.canvas.width!==l&&(this.frame.canvas.width=l,i=!0),this.frame.canvas.height!==u&&(this.frame.canvas.height=u,i=!0)}return i===!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(o/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");var t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);var i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var 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)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),r}();function lce(r,n){var e=De({nodes:n,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},r??{});if(!se(e.nodes))throw new TypeError("Nodes has to be an array of ids.");if(e.nodes.length===0&&(e.nodes=n),!(typeof e.minZoomLevel=="number"&&e.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof e.maxZoomLevel=="number"&&e.minZoomLevel<=e.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return e}var uce=function(){function r(n,e){var t,i=this,a;C(this,r),this.body=n,this.canvas=e,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",O(t=this.fit).call(t,this)),this.body.emitter.on("animationFinished",function(){i.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",O(a=this.releaseNode).call(a,this))}return x(r,[{key:"setOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}},{key:"fit",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=lce(e,this.body.nodeIndices);var i=this.canvas.frame.canvas.clientWidth,a=this.canvas.frame.canvas.clientHeight,o,s;if(i===0||a===0)s=1,o=ut.getRange(this.body.nodes,e.nodes);else if(t===!0){var l=0;for(var u in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,u)){var d=this.body.nodes[u];d.predefinedPosition===!0&&(l+=1)}if(l>.5*this.body.nodeIndices.length){this.fit(e,!1);return}o=ut.getRange(this.body.nodes,e.nodes);var h=this.body.nodeIndices.length;s=12.662/(h+7.4147)+.0964822;var c=Math.min(i/600,a/600);s*=c}else{this.body.emitter.emit("_resizeNodes"),o=ut.getRange(this.body.nodes,e.nodes);var f=Math.abs(o.maxX-o.minX)*1.1,v=Math.abs(o.maxY-o.minY)*1.1,p=i/f,g=a/v;s=p<=g?p:g}s>e.maxZoomLevel?s=e.maxZoomLevel:s<e.minZoomLevel&&(s=e.minZoomLevel);var y=ut.findCenter(o),m={position:y,scale:s,animation:e.animation};this.moveTo(m)}},{key:"focus",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){var i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!bi(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,!bi(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,!bi(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,!bi(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)}},{key:"animateView",value:function(e){if(e!==void 0){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;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var a;this.viewFunction=O(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 o;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=O(o=this._transitionRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}}},{key:"_lockedRedraw",value:function(){var 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}),i={x:t.x-e.x,y:t.y-e.y},a=this.body.view.translation,o={x:a.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:a.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=o}},{key:"releaseNode",value:function(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;var t=Gne[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 i;this.viewFunction=O(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),r}();function H$(r){var n=r&&r.preventDefault||!1,e=r&&r.container||window,t={},i={keydown:{},keyup:{}},a={},o;for(o=97;o<=122;o++)a[String.fromCharCode(o)]={code:65+(o-97),shift:!1};for(o=65;o<=90;o++)a[String.fromCharCode(o)]={code:o,shift:!0};for(o=0;o<=9;o++)a[""+o]={code:48+o,shift:!1};for(o=1;o<=12;o++)a["F"+o]={code:111+o,shift:!1};for(o=0;o<=9;o++)a["num"+o]={code:96+o,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(d){u(d,"keydown")},l=function(d){u(d,"keyup")},u=function(d,h){if(i[h][d.keyCode]!==void 0){for(var c=i[h][d.keyCode],f=0;f<c.length;f++)(c[f].shift===void 0||c[f].shift==!0&&d.shiftKey==!0||c[f].shift==!1&&d.shiftKey==!1)&&c[f].fn(d);n==!0&&d.preventDefault()}};return t.bind=function(d,h,c){if(c===void 0&&(c="keydown"),a[d]===void 0)throw new Error("unsupported key: "+d);i[c][a[d].code]===void 0&&(i[c][a[d].code]=[]),i[c][a[d].code].push({fn:h,shift:a[d].shift})},t.bindAll=function(d,h){h===void 0&&(h="keydown");for(var c in a)a.hasOwnProperty(c)&&t.bind(c,d,h)},t.getKey=function(d){for(var h in a)if(a.hasOwnProperty(h)){if(d.shiftKey==!0&&a[h].shift==!0&&d.keyCode==a[h].code)return h;if(d.shiftKey==!1&&a[h].shift==!1&&d.keyCode==a[h].code)return h;if(d.keyCode==a[h].code&&h=="shift")return h}return"unknown key, currently not supported"},t.unbind=function(d,h,c){if(c===void 0&&(c="keydown"),a[d]===void 0)throw new Error("unsupported key: "+d);if(h!==void 0){var f=[],v=i[c][a[d].code];if(v!==void 0)for(var p=0;p<v.length;p++)v[p].fn==h&&v[p].shift==a[d].shift||f.push(i[c][a[d].code][p]);i[c][a[d].code]=f}else i[c][a[d].code]=[]},t.reset=function(){i={keydown:{},keyup:{}}},t.destroy=function(){i={keydown:{},keyup:{}},e.removeEventListener("keydown",s,!0),e.removeEventListener("keyup",l,!0)},e.addEventListener("keydown",s,!0),e.addEventListener("keyup",l,!0),t}var dce=function(){function r(n,e){var t=this;C(this,r),this.body=n,this.canvas=e,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){t.activated=!0,t.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){t.activated=!1,t.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){t.keycharm!==void 0&&t.keycharm.destroy()}),this.options={}}return x(r,[{key:"setOptions",value:function(e){e!==void 0&&(this.options=e,this.create())}},{key:"create",value:function(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(this.navigationHammers.length!=0){for(var 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}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],i=["_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(var a=0;a<t.length;a++){this.navigationDOM[t[a]]=document.createElement("div"),this.navigationDOM[t[a]].className="vis-button vis-"+t[a],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[a]]);var o=new Cn(this.navigationDOM[t[a]]);if(i[a]==="_fit"){var s;Rl(o,O(s=this._fit).call(s,this))}else{var l;Rl(o,O(l=this.bindToRedraw).call(l,this,i[a]))}this.navigationHammers.push(o)}var u=new Cn(this.canvas.frame);tT(u,function(){e._stopMovement()}),this.navigationHammers.push(u),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=O(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}},{key:"unbindFromRedraw",value:function(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var 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={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+i.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+i.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,a=t/e,o=(1-a)*this.canvas.canvasViewCenter.x+i.x*a,s=(1-a)*this.canvas.canvasViewCenter.y+i.y*a;this.body.view.scale=t,this.body.view.translation={x:o,y:s},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=H$({container:window,preventDefault:!0}):this.keycharm=H$({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var t,i,a,o,s,l,u,d,h,c,f,v,p,g,y,m,$,b,E,T,N,M,R,D;O(t=this.keycharm).call(t,"up",function(){e.bindToRedraw("_moveUp")},"keydown"),O(i=this.keycharm).call(i,"down",function(){e.bindToRedraw("_moveDown")},"keydown"),O(a=this.keycharm).call(a,"left",function(){e.bindToRedraw("_moveLeft")},"keydown"),O(o=this.keycharm).call(o,"right",function(){e.bindToRedraw("_moveRight")},"keydown"),O(s=this.keycharm).call(s,"=",function(){e.bindToRedraw("_zoomIn")},"keydown"),O(l=this.keycharm).call(l,"num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),O(u=this.keycharm).call(u,"num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),O(d=this.keycharm).call(d,"-",function(){e.bindToRedraw("_zoomOut")},"keydown"),O(h=this.keycharm).call(h,"[",function(){e.bindToRedraw("_zoomOut")},"keydown"),O(c=this.keycharm).call(c,"]",function(){e.bindToRedraw("_zoomIn")},"keydown"),O(f=this.keycharm).call(f,"pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),O(v=this.keycharm).call(v,"pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),O(p=this.keycharm).call(p,"up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),O(g=this.keycharm).call(g,"down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),O(y=this.keycharm).call(y,"left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),O(m=this.keycharm).call(m,"right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),O($=this.keycharm).call($,"=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),O(b=this.keycharm).call(b,"num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),O(E=this.keycharm).call(E,"num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),O(T=this.keycharm).call(T,"-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),O(N=this.keycharm).call(N,"[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),O(M=this.keycharm).call(M,"]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),O(R=this.keycharm).call(R,"pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),O(D=this.keycharm).call(D,"pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")}}}]),r}();function hce(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=cce(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function cce(r,n){var e;if(r){if(typeof r=="string")return W$(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return W$(r,n)}}function W$(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var fce=function(){function r(n,e,t){var i,a,o,s,l,u,d,h,c,f,v,p,g;C(this,r),this.body=n,this.canvas=e,this.selectionHandler=t,this.navigationHandler=new dce(n,e),this.body.eventListeners.onTap=O(i=this.onTap).call(i,this),this.body.eventListeners.onTouch=O(a=this.onTouch).call(a,this),this.body.eventListeners.onDoubleTap=O(o=this.onDoubleTap).call(o,this),this.body.eventListeners.onHold=O(s=this.onHold).call(s,this),this.body.eventListeners.onDragStart=O(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=O(u=this.onDrag).call(u,this),this.body.eventListeners.onDragEnd=O(d=this.onDragEnd).call(d,this),this.body.eventListeners.onMouseWheel=O(h=this.onMouseWheel).call(h,this),this.body.eventListeners.onPinch=O(c=this.onPinch).call(c,this),this.body.eventListeners.onMouseMove=O(f=this.onMouseMove).call(f,this),this.body.eventListeners.onRelease=O(v=this.onRelease).call(v,this),this.body.eventListeners.onContext=O(p=this.onContext).call(p,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=O(g=this.getPointer).call(g,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},De(this.options,this.defaultOptions),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(e!==void 0){var t=["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"];kl(t,this.options,e),jt(this.options,e,"keyboard"),e.tooltip&&(De(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=rf(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-Hne(this.canvas.frame.canvas),y:e.y-Wne(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(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())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if(new Date().valueOf()-this.touchTime>10){var t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;t===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}},{key:"_determineDifference",value:function(e,t){var i=function(o,s){for(var l=[],u=0;u<o.length;u++){var d=o[u];te(s).call(s,d)===-1&&l.push(d)}return l};return{nodes:i(e.nodes,t.nodes),edges:i(e.edges,t.edges)}}},{key:"onDragStart",value:function(e){if(!this.drag.dragging){this.drag.pointer===void 0&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=De({},this.body.view.translation),this.drag.nodeId=void 0,e.srcEvent.shiftKey){this.body.selectionBox.show=!0;var i=this.getPointer(e.center);this.body.selectionBox.position.start={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)},this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.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);var a=hce(this.selectionHandler.getSelectedNodes()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,l={id:s.id,node:s,x:s.x,y:s.y,xFixed:s.options.fixed.x,yFixed:s.options.fixed.y};s.options.fixed.x=!0,s.options.fixed.y=!0,this.drag.selection.push(l)}}catch(u){a.e(u)}finally{a.f()}}else this.selectionHandler.generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}}},{key:"onDrag",value:function(e){var t=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var i=this.getPointer(e.center),a=this.drag.selection;if(a&&a.length&&this.options.dragNodes===!0){this.selectionHandler.generateClickEvent("dragging",e,i);var o=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;de(a).call(a,function(d){var h=d.node;d.xFixed===!1&&(h.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(d.x)+o)),d.yFixed===!1&&(h.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(d.y)+s))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,i,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(i.x),y:this.canvas._YconvertDOMtoCanvas(i.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,i,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}var l=i.x-this.drag.pointer.x,u=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+l,y:this.drag.translation.y+u},this.body.emitter.emit("_requestRedraw")}}}}},{key:"onDragEnd",value:function(e){var t=this;if(this.drag.dragging=!1,this.body.selectionBox.show){var i;this.body.selectionBox.show=!1;var a=this.body.selectionBox.position,o={minX:Math.min(a.start.x,a.end.x),minY:Math.min(a.start.y,a.end.y),maxX:Math.max(a.start.x,a.end.x),maxY:Math.max(a.start.y,a.end.y)},s=$t(i=this.body.nodeIndices).call(i,function(d){var h=t.body.nodes[d];return h.x>=o.minX&&h.x<=o.maxX&&h.y>=o.minY&&h.y<=o.maxY});de(s).call(s,function(d){return t.selectionHandler.selectObject(t.body.nodes[d])});var l=this.getPointer(e.center);this.selectionHandler.commitAndEmit(l,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{var u=this.drag.selection;u&&u.length?(de(u).call(u,function(d){d.node.options.fixed.x=d.xFixed,d.node.options.fixed.y=d.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"))}}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);var i=this.pinch.scale*e.scale;this.zoom(i,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);var a=void 0;this.drag!==void 0&&this.drag.dragging===!0&&(a=this.canvas.DOMtoCanvas(this.drag.pointer));var o=this.body.view.translation,s=e/i,l=(1-s)*t.x+o.x*s,u=(1-s)*t.y+o.y*s;if(this.body.view.scale=e,this.body.view.translation={x:l,y:u},a!=null){var d=this.canvas.canvasToDOM(a);this.drag.pointer.x=d.x,this.drag.pointer.y=d.y}this.body.emitter.emit("_requestRedraw"),i<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})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){if(e.deltaY!==0){var t=this.body.view.scale;t*=1+(e.deltaY<0?1:-1)*(this.options.zoomSpeed*.1);var i=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(t,i)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),a=!1;this.popup!==void 0&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(a=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.autoFocus&&this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),a===!1&&(this.popupTimer!==void 0&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=hr(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,i)}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),a={left:t,top:i,right:t,bottom:i},o=this.popupObj===void 0?void 0:this.popupObj.id,s=!1,l="node";if(this.popupObj===void 0){for(var u=this.body.nodeIndices,d=this.body.nodes,h,c=[],f=0;f<u.length;f++)h=d[u[f]],h.isOverlappingWith(a)===!0&&(s=!0,h.getTitle()!==void 0&&c.push(u[f]));c.length>0&&(this.popupObj=d[c[c.length-1]],s=!0)}if(this.popupObj===void 0&&s===!1){for(var v=this.body.edgeIndices,p=this.body.edges,g,y=[],m=0;m<v.length;m++)g=p[v[m]],g.isOverlappingWith(a)===!0&&g.connected===!0&&g.getTitle()!==void 0&&y.push(v[m]);y.length>0&&(this.popupObj=p[y[y.length-1]],l="edge")}this.popupObj!==void 0?this.popupObj.id!==o&&(this.popup===void 0&&(this.popup=new eae(this.canvas.frame)),this.popup.popupTargetType=l,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"))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){var a=this.selectionHandler.getNodeAt(e);i=a===void 0?!1:a.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),r}(),vce=Bv,pce=AO;vce("Set",function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},pce);var gce=ie,yce=gce.Set,mce=yce,bce=mce,$ce=bce,gi=j($ce),wce=ne,U$=Lv,Fs=Ru.getWeakData,_ce=Fv,Ece=Bt,Sce=sa,Gh=Ve,Oce=Nv,rT=si,V$=Ge,iT=qi,Tce=iT.set,Ice=iT.getterFor,kce=rT.find,Pce=rT.findIndex,Cce=wce([].splice),xce=0,Bs=function(r){return r.frozen||(r.frozen=new nT)},nT=function(){this.entries=[]},Kh=function(r,n){return kce(r.entries,function(e){return e[0]===n})};nT.prototype={get:function(r){var n=Kh(this,r);if(n)return n[1]},has:function(r){return!!Kh(this,r)},set:function(r,n){var e=Kh(this,r);e?e[1]=n:this.entries.push([r,n])},delete:function(r){var n=Pce(this.entries,function(e){return e[0]===r});return~n&&Cce(this.entries,n,1),!!~n}};var Rce={getConstructor:function(r,n,e,t){var i=r(function(l,u){_ce(l,a),Tce(l,{type:n,id:xce++,frozen:void 0}),Sce(u)||Oce(u,l[t],{that:l,AS_ENTRIES:e})}),a=i.prototype,o=Ice(n),s=function(l,u,d){var h=o(l),c=Fs(Ece(u),!0);return c===!0?Bs(h).set(u,d):c[h.id]=d,l};return U$(a,{delete:function(l){var u=o(this);if(!Gh(l))return!1;var d=Fs(l);return d===!0?Bs(u).delete(l):d&&V$(d,u.id)&&delete d[u.id]},has:function(u){var d=o(this);if(!Gh(u))return!1;var h=Fs(u);return h===!0?Bs(d).has(u):h&&V$(h,d.id)}}),U$(a,e?{get:function(u){var d=o(this);if(Gh(u)){var h=Fs(u);return h===!0?Bs(d).get(u):h?h[d.id]:void 0}},set:function(u,d){return s(this,u,d)}}:{add:function(u){return s(this,u,!0)}}),i}},Ace=PO,G$=Se,nl=ne,K$=Lv,Dce=Ru,Mce=Bv,aT=Rce,Ls=Ve,js=qi.enforce,Nce=re,Fce=bE,Qo=Object,Bce=Array.isArray,zs=Qo.isExtensible,oT=Qo.isFrozen,Lce=Qo.isSealed,sT=Qo.freeze,jce=Qo.seal,q$={},Y$={},zce=!G$.ActiveXObject&&"ActiveXObject"in G$,Ia,lT=function(r){return function(){return r(this,arguments.length?arguments[0]:void 0)}},uT=Mce("WeakMap",lT,aT),pn=uT.prototype,al=nl(pn.set),Hce=function(){return Ace&&Nce(function(){var r=sT([]);return al(new uT,r,1),!oT(r)})};if(Fce)if(zce){Ia=aT.getConstructor(lT,"WeakMap",!0),Dce.enable();var X$=nl(pn.delete),Hs=nl(pn.has),Z$=nl(pn.get);K$(pn,{delete:function(r){if(Ls(r)&&!zs(r)){var n=js(this);return n.frozen||(n.frozen=new Ia),X$(this,r)||n.frozen.delete(r)}return X$(this,r)},has:function(n){if(Ls(n)&&!zs(n)){var e=js(this);return e.frozen||(e.frozen=new Ia),Hs(this,n)||e.frozen.has(n)}return Hs(this,n)},get:function(n){if(Ls(n)&&!zs(n)){var e=js(this);return e.frozen||(e.frozen=new Ia),Hs(this,n)?Z$(this,n):e.frozen.get(n)}return Z$(this,n)},set:function(n,e){if(Ls(n)&&!zs(n)){var t=js(this);t.frozen||(t.frozen=new Ia),Hs(this,n)?al(this,n,e):t.frozen.set(n,e)}else al(this,n,e);return this}})}else Hce()&&K$(pn,{set:function(n,e){var t;return Bce(n)&&(oT(n)?t=q$:Lce(n)&&(t=Y$)),al(this,n,e),t===q$&&sT(n),t===Y$&&jce(n),this}});var Wce=ie,Uce=Wce.WeakMap,Vce=Uce,Gce=Vce,Kce=Gce,za=j(Kce);function he(r,n,e,t){if(e==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?r!==n||!t:!n.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?t:e==="a"?t.call(r):t?t.value:n.get(r)}function hf(r,n,e,t,i){if(typeof n=="function"?r!==n||!i:!n.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(r,e),e}function cf(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=qce(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function qce(r,n){var e;if(r){if(typeof r=="string")return Q$(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Q$(r,n)}}function Q$(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var pi,Lt,Lr,jr,ol;function J$(r,n){var e=new gi,t=cf(n),i;try{for(t.s();!(i=t.n()).done;){var a=i.value;r.has(a)||e.add(a)}}catch(o){t.e(o)}finally{t.f()}return e}var e1=function(){function r(){C(this,r),pi.set(this,new gi),Lt.set(this,new gi)}return x(r,[{key:"size",get:function(){return he(this,Lt,"f").size}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var a=0,o=t;a<o.length;a++){var s=o[a];he(this,Lt,"f").add(s)}}},{key:"delete",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var a=0,o=t;a<o.length;a++){var s=o[a];he(this,Lt,"f").delete(s)}}},{key:"clear",value:function(){he(this,Lt,"f").clear()}},{key:"getSelection",value:function(){return or(he(this,Lt,"f"))}},{key:"getChanges",value:function(){return{added:or(J$(he(this,pi,"f"),he(this,Lt,"f"))),deleted:or(J$(he(this,Lt,"f"),he(this,pi,"f"))),previous:or(new gi(he(this,pi,"f"))),current:or(new gi(he(this,Lt,"f")))}}},{key:"commit",value:function(){var e=this.getChanges();hf(this,pi,he(this,Lt,"f")),hf(this,Lt,new gi(he(this,pi,"f")));var t=cf(e.added),i;try{for(t.s();!(i=t.n()).done;){var a=i.value;a.select()}}catch(u){t.e(u)}finally{t.f()}var o=cf(e.deleted),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;l.unselect()}}catch(u){o.e(u)}finally{o.f()}return e}}]),r}();pi=new za,Lt=new za;var Yce=function(){function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};C(this,r),Lr.set(this,new e1),jr.set(this,new e1),ol.set(this,void 0),hf(this,ol,n)}return x(r,[{key:"sizeNodes",get:function(){return he(this,Lr,"f").size}},{key:"sizeEdges",get:function(){return he(this,jr,"f").size}},{key:"getNodes",value:function(){return he(this,Lr,"f").getSelection()}},{key:"getEdges",value:function(){return he(this,jr,"f").getSelection()}},{key:"addNodes",value:function(){var e;(e=he(this,Lr,"f")).add.apply(e,arguments)}},{key:"addEdges",value:function(){var e;(e=he(this,jr,"f")).add.apply(e,arguments)}},{key:"deleteNodes",value:function(e){he(this,Lr,"f").delete(e)}},{key:"deleteEdges",value:function(e){he(this,jr,"f").delete(e)}},{key:"clear",value:function(){he(this,Lr,"f").clear(),he(this,jr,"f").clear()}},{key:"commit",value:function(){for(var e,t,i={nodes:he(this,Lr,"f").commit(),edges:he(this,jr,"f").commit()},a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return(e=he(this,ol,"f")).call.apply(e,wv(t=[this,i]).call(t,o)),i}}]),r}();Lr=new za,jr=new za,ol=new za;function t1(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=Xce(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Xce(r,n){var e;if(r){if(typeof r=="string")return r1(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r1(r,n)}}function r1(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var Zce=function(){function r(n,e){var t=this;C(this,r),this.body=n,this.canvas=e,this._selectionAccumulator=new Yce,this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},De(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){t.updateSelection()})}return x(r,[{key:"setOptions",value:function(e){if(e!==void 0){var t=["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"];ma(t,this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(this.options.selectable===!0){var i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_initBaseEvent",value:function(e,t){var i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}},{key:"generateClickEvent",value:function(e,t,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=this._initBaseEvent(t,i);if(o===!0)s.nodes=[],s.edges=[];else{var l=this.getSelection();s.nodes=l.nodes,s.edges=l.edges}a!==void 0&&(s.previousSelection=a),e=="click"&&(s.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(s.controlEdge=t.controlEdge),this.body.emitter.emit(e,s)}},{key:"selectObject",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;if(e!==void 0){if(e instanceof xt){if(t===!0){var i;(i=this._selectionAccumulator).addEdges.apply(i,or(e.edges))}this._selectionAccumulator.addNodes(e)}else this._selectionAccumulator.addEdges(e);return!0}return!1}},{key:"deselectObject",value:function(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],i=this.body.nodes,a=0;a<this.body.nodeIndices.length;a++){var o=this.body.nodeIndices[a];i[o].isOverlappingWith(e)&&t.push(o)}return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._pointerToPositionObject(e),a=this._getAllNodesOverlappingWith(i);if(a.length>0)return t===!0?this.body.nodes[a[a.length-1]]:a[a.length-1]}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var i=this.body.edges,a=0;a<this.body.edgeIndices.length;a++){var o=this.body.edgeIndices[a];i[o].isOverlappingWith(e)&&t.push(o)}}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.canvas.DOMtoCanvas(e),a=10,o=null,s=this.body.edges,l=0;l<this.body.edgeIndices.length;l++){var u=this.body.edgeIndices[l],d=s[u];if(d.connected){var h=d.from.x,c=d.from.y,f=d.to.x,v=d.to.y,p=d.edgeType.getDistanceToEdge(h,c,f,v,i.x,i.y);p<a&&(o=u,a=p)}}if(o!==null)return t===!0?this.body.edges[o]:o}},{key:"_addToHover",value:function(e){e instanceof xt?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){if(e instanceof xt){var t;this._selectionAccumulator.deleteNodes(e),(t=this._selectionAccumulator).deleteEdges.apply(t,or(e.edges))}else this._selectionAccumulator.deleteEdges(e)}},{key:"unselectAll",value:function(){this._selectionAccumulator.clear()}},{key:"getSelectedNodeCount",value:function(){return this._selectionAccumulator.sizeNodes}},{key:"getSelectedEdgeCount",value:function(){return this._selectionAccumulator.sizeEdges}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0;t<e.edges.length;t++){var i=e.edges[t];i.hover=!0,this._addToHover(i)}}},{key:"emitBlurEvent",value:function(e,t,i){var a=this._initBaseEvent(e,t);i.hover===!0&&(i.hover=!1,i instanceof xt?(a.node=i.id,this.body.emitter.emit("blurNode",a)):(a.edge=i.id,this.body.emitter.emit("blurEdge",a)))}},{key:"emitHoverEvent",value:function(e,t,i){var a=this._initBaseEvent(e,t),o=!1;return i.hover===!1&&(i.hover=!0,this._addToHover(i),o=!0,i instanceof xt?(a.node=i.id,this.body.emitter.emit("hoverNode",a)):(a.edge=i.id,this.body.emitter.emit("hoverEdge",a))),o}},{key:"hoverObject",value:function(e,t){var i=this.getNodeAt(t);i===void 0&&(i=this.getEdgeAt(t));var a=!1;for(var o in this.hoverObj.nodes)Object.prototype.hasOwnProperty.call(this.hoverObj.nodes,o)&&(i===void 0||i instanceof xt&&i.id!=o||i instanceof xn)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[o]),delete this.hoverObj.nodes[o],a=!0);for(var s in this.hoverObj.edges)Object.prototype.hasOwnProperty.call(this.hoverObj.edges,s)&&(a===!0?(this.hoverObj.edges[s].hover=!1,delete this.hoverObj.edges[s]):(i===void 0||i instanceof xn&&i.id!=s||i instanceof xt&&!i.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[s]),delete this.hoverObj.edges[s],a=!0));if(i!==void 0){var l=$e(this.hoverObj.edges).length,u=$e(this.hoverObj.nodes).length,d=i instanceof xn&&l===0&&u===0,h=i instanceof xt&&l===0&&u===0;(a||d||h)&&(a=this.emitHoverEvent(e,t,i)),i instanceof xt&&this.options.hoverConnectedEdges===!0&&this._hoverConnectedEdges(i)}a===!0&&this.body.emitter.emit("_requestRedraw")}},{key:"commitWithoutEmitting",value:function(){this._selectionAccumulator.commit()}},{key:"commitAndEmit",value:function(e,t){var i=!1,a=this._selectionAccumulator.commit(),o={nodes:a.nodes.previous,edges:a.edges.previous};a.edges.deleted.length>0&&(this.generateClickEvent("deselectEdge",t,e,o),i=!0),a.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,o),i=!0),a.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),a.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var e;return zn(e=this._selectionAccumulator.getNodes()).call(e,function(t){return t.id})}},{key:"getSelectedEdgeIds",value:function(){var e;return zn(e=this._selectionAccumulator.getEdges()).call(e,function(t){return t.id})}},{key:"setSelection",value:function(e){var 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){var i=t1(e.nodes),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=this.body.nodes[o];if(!s)throw new RangeError('Node with id "'+o+'" not found');this.selectObject(s,t.highlightEdges)}}catch(c){i.e(c)}finally{i.f()}}if(e.edges){var l=t1(e.edges),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,h=this.body.edges[d];if(!h)throw new RangeError('Edge with id "'+d+'" not found');this.selectObject(h)}}catch(c){l.e(c)}finally{l.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(e){var 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})}},{key:"selectEdges",value:function(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),i=[],a=this.body.nodeIndices,o=this.body.nodes,s=a.length-1;s>=0;s--){var l=o[a[s]],u=l.getItemsOnPoint(t);i.push.apply(i,u)}for(var d=this.body.edgeIndices,h=this.body.edges,c=d.length-1;c>=0;c--){var f=h[d[c]],v=f.getItemsOnPoint(t);i.push.apply(i,v)}return i}}]),r}(),i1=KE,Qce=Math.floor,ff=function(r,n){var e=r.length,t=Qce(e/2);return e<8?Jce(r,n):efe(r,ff(i1(r,0,t),n),ff(i1(r,t),n),n)},Jce=function(r,n){for(var e=r.length,t=1,i,a;t<e;){for(a=t,i=r[t];a&&n(r[a-1],i)>0;)r[a]=r[--a];a!==t++&&(r[a]=i)}return r},efe=function(r,n,e,t){for(var i=n.length,a=e.length,o=0,s=0;o<i||s<a;)r[o+s]=o<i&&s<a?t(n[o],e[s])<=0?n[o++]:e[s++]:o<i?n[o++]:e[s++];return r},tfe=ff,rfe=xo,n1=rfe.match(/firefox\/(\d+)/i),ife=!!n1&&+n1[1],nfe=xo,afe=/MSIE|Trident/.test(nfe),ofe=xo,a1=ofe.match(/AppleWebKit\/(\d+)\./),sfe=!!a1&&+a1[1],lfe=V,dT=ne,ufe=Gi,dfe=Tt,o1=Gt,hfe=AS,s1=gr,Vv=re,cfe=tfe,ffe=ga,l1=ife,vfe=afe,u1=Ro,d1=sfe,Vr=[],h1=dT(Vr.sort),pfe=dT(Vr.push),gfe=Vv(function(){Vr.sort(void 0)}),yfe=Vv(function(){Vr.sort(null)}),mfe=ffe("sort"),hT=!Vv(function(){if(u1)return u1<70;if(!(l1&&l1>3)){if(vfe)return!0;if(d1)return d1<603;var r="",n,e,t,i;for(n=65;n<76;n++){switch(e=String.fromCharCode(n),n){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(i=0;i<47;i++)Vr.push({k:e+i,v:t})}for(Vr.sort(function(a,o){return o.v-a.v}),i=0;i<Vr.length;i++)e=Vr[i].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return r!=="DGBEFHACIJK"}}),bfe=gfe||!yfe||!mfe||!hT,$fe=function(r){return function(n,e){return e===void 0?-1:n===void 0?1:r!==void 0?+r(n,e)||0:s1(n)>s1(e)?1:-1}};lfe({target:"Array",proto:!0,forced:bfe},{sort:function(n){n!==void 0&&ufe(n);var e=dfe(this);if(hT)return n===void 0?h1(e):h1(e,n);var t=[],i=o1(e),a,o;for(o=0;o<i;o++)o in e&&pfe(t,e[o]);for(cfe(t,$fe(n)),a=o1(t),o=0;o<a;)e[o]=t[o++];for(;o<i;)hfe(e,o++);return e}});var wfe=Ke,_fe=wfe("Array").sort,Efe=Ce,Sfe=_fe,qh=Array.prototype,Ofe=function(r){var n=r.sort;return r===qh||Efe(qh,r)&&n===qh.sort?Sfe:n},Tfe=Ofe,Ife=Tfe,kfe=Ife,Ha=j(kfe),Pfe=Gi,Cfe=Tt,xfe=du,Rfe=Gt,Afe=TypeError,c1=function(r){return function(n,e,t,i){Pfe(e);var a=Cfe(n),o=xfe(a),s=Rfe(a),l=r?s-1:0,u=r?-1:1;if(t<2)for(;;){if(l in o){i=o[l],l+=u;break}if(l+=u,r?l<0:s<=l)throw new Afe("Reduce of empty array with no initial value")}for(;r?l>=0:s>l;l+=u)l in o&&(i=e(i,o[l],l,a));return i}},Dfe={left:c1(!1),right:c1(!0)},Mfe=Se,Nfe=Mr,Ffe=Nfe(Mfe.process)==="process",Bfe=V,Lfe=Dfe.left,jfe=ga,f1=Ro,zfe=Ffe,Hfe=!zfe&&f1>79&&f1<83,Wfe=Hfe||!jfe("reduce");Bfe({target:"Array",proto:!0,forced:Wfe},{reduce:function(n){var e=arguments.length;return Lfe(this,n,e,e>1?arguments[1]:void 0)}});var Ufe=Ke,Vfe=Ufe("Array").reduce,Gfe=Ce,Kfe=Vfe,Yh=Array.prototype,qfe=function(r){var n=r.reduce;return r===Yh||Gfe(Yh,r)&&n===Yh.reduce?Kfe:n},Yfe=qfe,Xfe=Yfe,Zfe=Xfe,cT=j(Zfe);function fT(r){var n=Qfe();return function(){var t=F(r),i;if(n){var a=F(this).constructor;i=_(t,arguments,a)}else i=t.apply(this,arguments);return le(this,i)}}function Qfe(){if(typeof Reflect>"u"||!_||_.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(_(Boolean,[],function(){})),!0}catch{return!1}}var vT=function(){function r(){C(this,r)}return x(r,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),r}(),Jfe=function(r){ae(e,r);var n=fT(e);function e(t){var i;return C(this,e),i=n.call(this),i.layout=t,i}return x(e,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(i){return i.x}},{key:"setPosition",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(i,o),i.x=a}},{key:"getTreeSize",value:function(i){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,i);return{min:a.min_x,max:a.max_x}}},{key:"sort",value:function(i){Ha(i).call(i,function(a,o){return a.x-o.x})}},{key:"fix",value:function(i,a){i.y=this.layout.options.hierarchical.levelSeparation*a,i.options.fixed.y=!0}},{key:"shift",value:function(i,a){this.layout.body.nodes[i].x+=a}}]),e}(vT),eve=function(r){ae(e,r);var n=fT(e);function e(t){var i;return C(this,e),i=n.call(this),i.layout=t,i}return x(e,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(i){return i.y}},{key:"setPosition",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;o!==void 0&&this.layout.hierarchical.addToOrdering(i,o),i.y=a}},{key:"getTreeSize",value:function(i){var a=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,i);return{min:a.min_y,max:a.max_y}}},{key:"sort",value:function(i){Ha(i).call(i,function(a,o){return a.y-o.y})}},{key:"fix",value:function(i,a){i.x=this.layout.options.hierarchical.levelSeparation*a,i.options.fixed.x=!0}},{key:"shift",value:function(i,a){this.layout.body.nodes[i].y+=a}}]),e}(vT),tve=V,rve=si.every,ive=ga,nve=ive("every");tve({target:"Array",proto:!0,forced:!nve},{every:function(n){return rve(this,n,arguments.length>1?arguments[1]:void 0)}});var ave=Ke,ove=ave("Array").every,sve=Ce,lve=ove,Xh=Array.prototype,uve=function(r){var n=r.every;return r===Xh||sve(Xh,r)&&n===Xh.every?lve:n},dve=uve,hve=dve,cve=hve,pT=j(cve);function fve(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=vve(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function vve(r,n){var e;if(r){if(typeof r=="string")return v1(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v1(r,n)}}function v1(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}function pve(r,n){var e=new gi;return de(r).call(r,function(t){var i;de(i=t.edges).call(i,function(a){a.connected&&e.add(a)})}),de(e).call(e,function(t){var i=t.from.id,a=t.to.id;n[i]==null&&(n[i]=0),(n[a]==null||n[i]>=n[a])&&(n[a]=n[i]+1)}),n}function gve(r){return gT(function(n){var e,t;return pT(e=$t(t=n.edges).call(t,function(i){return r.has(i.toId)})).call(e,function(i){return i.to===n})},function(n,e){return e>n},"from",r)}function yve(r){return gT(function(n){var e,t;return pT(e=$t(t=n.edges).call(t,function(i){return r.has(i.toId)})).call(e,function(i){return i.from===n})},function(n,e){return e<n},"to",r)}function gT(r,n,e,t){var i,a=Ii(null),o=cT(i=or(VO(t).call(t))).call(i,function(f,v){return f+1+v.edges.length},0),s=e+"Id",l=e==="to"?1:-1,u=fve(t),d;try{var h=function(){var v=we(d.value,2),p=v[0],g=v[1];if(!t.has(p)||!r(g))return 0;a[p]=0;for(var y=[g],m=0,$,b=function(){var N,M;if(!t.has(p))return 0;var R=a[$.id]+l;if(de(N=$t(M=$.edges).call(M,function(D){return D.connected&&D.to!==D.from&&D[e]!==$&&t.has(D.toId)&&t.has(D.fromId)})).call(N,function(D){var z=D[s],Z=a[z];(Z==null||n(R,Z))&&(a[z]=R,y.push(D[e]))}),m>o)return{v:{v:pve(t,a)}};++m},E;$=y.pop();)if(E=b(),E!==0&&E)return E.v},c;for(u.s();!(d=u.n()).done;)if(c=h(),c!==0&&c)return c.v}catch(f){u.e(f)}finally{u.f()}return a}var mve=function(){function r(){C(this,r),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return x(r,[{key:"addRelation",value:function(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)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){this.levels[e]===void 0&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,i={},a=function o(s){if(i[s]!==void 0)return i[s];var l=t.levels[s];if(t.childrenReference[s]){var u=t.childrenReference[s];if(u.length>0)for(var d=0;d<u.length;d++)l=Math.max(l,o(u[d]))}return i[s]=l,l};return a(e)}},{key:"levelDownstream",value:function(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)}},{key:"setMinLevelToZero",value:function(e){var t=1e9;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&this.levels[i]!==void 0&&(t=Math.min(this.levels[i],t));for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&this.levels[a]!==void 0&&(this.levels[a]-=t)}},{key:"getTreeSize",value:function(e,t){var i=1e9,a=-1e9,o=1e9,s=-1e9;for(var l in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,l)&&this.trees[l]===t){var u=e[l];i=Math.min(u.x,i),a=Math.max(u.x,a),o=Math.min(u.y,o),s=Math.max(u.y,s)}return{min_x:i,max_x:a,min_y:o,max_y:s}}},{key:"hasSameParent",value:function(e,t){var i=this.parentReference[e.id],a=this.parentReference[t.id];if(i===void 0||a===void 0)return!1;for(var o=0;o<i.length;o++)for(var s=0;s<a.length;s++)if(i[o]==a[s])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,t){return this.trees[e.id]===this.trees[t.id]}},{key:"getLevels",value:function(){return $e(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,t){this.distributionOrdering[t]===void 0&&(this.distributionOrdering[t]=[]);var i=!1,a=this.distributionOrdering[t];for(var o in a)if(a[o]===e){i=!0;break}i||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}]),r}(),bve=function(){function r(n){C(this,r),this.body=n,this._resetRNG(Math.random()+":"+Sl()),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"}},De(this.options,this.defaultOptions),this.bindEventListeners()}return x(r,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(e.options.hierarchical.enabled===!0){var t=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",t,!1)}})}},{key:"setOptions",value:function(e,t){if(e!==void 0){var i=this.options.hierarchical,a=i.enabled;if(ma(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),jt(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return a===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(a===!0)return this.body.emitter.emit("refresh"),ce(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(e){this.initialRandomSeed=e,this._rng=xu(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(this.options.hierarchical.enabled===!0){var 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"):ue(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"});var i=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:i};else{var a=e.edges.smooth;a.type!==void 0&&a.type!=="dynamic"&&(i=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:i,roundness:a.roundness===void 0?.5:a.roundness,forceDirection:a.forceDirection===void 0?!1:a.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}},{key:"positionInitially",value:function(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);for(var t=e.length+50,i=0;i<e.length;i++){var a=e[i],o=2*Math.PI*this._rng();a.x===void 0&&(a.x=t*Math.cos(o)),a.y===void 0&&(a.y=t*Math.sin(o))}}}},{key:"layoutNetwork",value:function(){if(this.options.hierarchical.enabled!==!0&&this.options.improvedLayout===!0){for(var e=this.body.nodeIndices,t=0,i=0;i<e.length;i++){var a=this.body.nodes[e[i]];a.predefinedPosition===!0&&(t+=1)}if(t<.5*e.length){var o=10,s=0,l=this.options.clusterThreshold,u={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>l){for(var d=e.length;e.length>l&&s<=o;){s+=1;var h=e.length;s%3===0?this.body.modules.clustering.clusterBridges(u):this.body.modules.clustering.clusterOutliers(u);var c=e.length;if(h==c&&s%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*d)})}s>o&&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();for(var f=70,v=0;v<e.length;v++){var p=this.body.nodes[e[v]];p.predefinedPosition===!1&&(p.x+=(.5-this._rng())*f,p.y+=(.5-this._rng())*f)}this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=ut.getRangeCore(this.body.nodes,this.body.nodeIndices),t=ut.findCenter(e),i=0;i<this.body.nodeIndices.length;i++){var a=this.body.nodes[this.body.nodeIndices[i]];a.x-=t.x,a.y-=t.y}}},{key:"_declusterAll",value:function(){for(var e=!0;e===!0;){e=!1;for(var 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")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(this.options.hierarchical.enabled===!0&&this.body.nodeIndices.length>0){var e,t,i=!1,a=!1;this.lastNodeOnLevel={},this.hierarchical=new mve;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):a=!0);if(a===!0&&i===!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){var o=this.options.hierarchical.sortMethod;o==="hubsize"?this._determineLevelsByHubsize():o==="directed"?this._determineLevelsDirected():o==="custom"&&this._determineLevelsCustomCallback()}for(var s in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,s)&&this.hierarchical.ensureLevel(s);var l=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(l),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},a=function(){for(var $=s(),b=0,E=0;E<$.length-1;E++){var T=$[E].max-$[E+1].min;b+=T+e.options.hierarchical.treeSpacing,o(E+1,b)}},o=function($,b){var E=e.hierarchical.trees;for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&E[T]===$&&e.direction.shift(T,b)},s=function(){for(var $=[],b=0;b<e.hierarchical.numTrees();b++)$.push(e.direction.getTreeSize(b));return $},l=function m($,b){if(!b[$.id]&&(b[$.id]=!0,e.hierarchical.childrenReference[$.id])){var E=e.hierarchical.childrenReference[$.id];if(E.length>0)for(var T=0;T<E.length;T++)m(e.body.nodes[E[T]],b)}},u=function($){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,E=1e9,T=1e9,N=1e9,M=-1e9;for(var R in $)if(Object.prototype.hasOwnProperty.call($,R)){var D=e.body.nodes[R],z=e.hierarchical.levels[D.id],Z=e.direction.getPosition(D),Y=e._getSpaceAroundNode(D,$),me=we(Y,2),qe=me[0],xe=me[1];E=Math.min(qe,E),T=Math.min(xe,T),z<=b&&(N=Math.min(Z,N),M=Math.max(Z,M))}return[N,M,E,T]},d=function($,b){var E=e.hierarchical.getMaxLevel($.id),T=e.hierarchical.getMaxLevel(b.id);return Math.min(E,T)},h=function($,b,E){for(var T=e.hierarchical,N=0;N<b.length;N++){var M=b[N],R=T.distributionOrdering[M];if(R.length>1)for(var D=0;D<R.length-1;D++){var z=R[D],Z=R[D+1];T.hasSameParent(z,Z)&&T.inSameSubNetwork(z,Z)&&$(z,Z,E)}}},c=function($,b){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,T=e.direction.getPosition($),N=e.direction.getPosition(b),M=Math.abs(N-T),R=e.options.hierarchical.nodeSpacing;if(M>R){var D={},z={};l($,D),l(b,z);var Z=d($,b),Y=u(D,Z),me=u(z,Z),qe=Y[1],xe=me[0],It=me[2],at=Math.abs(qe-xe);if(at>R){var Je=qe-xe+R;Je<-It+R&&(Je=-It+R),Je<0&&(e._shiftBlock(b.id,Je),t=!0,E===!0&&e._centerParent(b))}}},f=function($,b){for(var E=b.id,T=b.edges,N=e.hierarchical.levels[b.id],M=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,R={},D=[],z=0;z<T.length;z++){var Z=T[z];if(Z.toId!=Z.fromId){var Y=Z.toId==E?Z.from:Z.to;R[T[z].id]=Y,e.hierarchical.levels[Y.id]<N&&D.push(Z)}}var me=function(et,ve){for(var Re=0,Ie=0;Ie<ve.length;Ie++)if(R[ve[Ie].id]!==void 0){var tt=e.direction.getPosition(R[ve[Ie].id])-et;Re+=tt/Math.sqrt(tt*tt+M)}return Re},qe=function(et,ve){for(var Re=0,Ie=0;Ie<ve.length;Ie++)if(R[ve[Ie].id]!==void 0){var tt=e.direction.getPosition(R[ve[Ie].id])-et;Re-=M*Math.pow(tt*tt+M,-1.5)}return Re},xe=function(et,ve){for(var Re=e.direction.getPosition(b),Ie={},tt=0;tt<et;tt++){var yr=me(Re,ve),Pt=qe(Re,ve),rt=40,A=Math.max(-rt,Math.min(rt,Math.round(yr/Pt)));if(Re=Re-A,Ie[Re]!==void 0)break;Ie[Re]=tt}return Re},It=function(et){var ve=e.direction.getPosition(b);if(i[b.id]===void 0){var Re={};l(b,Re),i[b.id]=Re}var Ie=u(i[b.id]),tt=Ie[2],yr=Ie[3],Pt=et-ve,rt=0;Pt>0?rt=Math.min(Pt,yr-e.options.hierarchical.nodeSpacing):Pt<0&&(rt=-Math.min(-Pt,tt-e.options.hierarchical.nodeSpacing)),rt!=0&&(e._shiftBlock(b.id,rt),t=!0)},at=function(et){var ve=e.direction.getPosition(b),Re=e._getSpaceAroundNode(b),Ie=we(Re,2),tt=Ie[0],yr=Ie[1],Pt=et-ve,rt=ve;Pt>0?rt=Math.min(ve+(yr-e.options.hierarchical.nodeSpacing),et):Pt<0&&(rt=Math.max(ve-(tt-e.options.hierarchical.nodeSpacing),et)),rt!==ve&&(e.direction.setPosition(b,rt),t=!0)},Je=xe($,D);It(Je),Je=xe($,T),at(Je)},v=function($){var b=e.hierarchical.getLevels();b=Ti(b).call(b);for(var E=0;E<$;E++){t=!1;for(var T=0;T<b.length;T++)for(var N=b[T],M=e.hierarchical.distributionOrdering[N],R=0;R<M.length;R++)f(1e3,M[R]);if(t!==!0)break}},p=function($){var b=e.hierarchical.getLevels();b=Ti(b).call(b);for(var E=0;E<$&&(t=!1,h(c,b,!0),t===!0);E++);},g=function(){for(var $ in e.body.nodes)Object.prototype.hasOwnProperty.call(e.body.nodes,$)&&e._centerParent(e.body.nodes[$])},y=function(){var $=e.hierarchical.getLevels();$=Ti($).call($);for(var b=0;b<$.length;b++)for(var E=$[b],T=e.hierarchical.distributionOrdering[E],N=0;N<T.length;N++)e._centerParent(T[N])};this.options.hierarchical.blockShifting===!0&&(p(5),g()),this.options.hierarchical.edgeMinimization===!0&&v(20),this.options.hierarchical.parentCentralization===!0&&y(),a()}},{key:"_getSpaceAroundNode",value:function(e,t){var i=!0;t===void 0&&(i=!1);var a=this.hierarchical.levels[e.id];if(a!==void 0){var o=this.hierarchical.distributionIndex[e.id],s=this.direction.getPosition(e),l=this.hierarchical.distributionOrdering[a],u=1e9,d=1e9;if(o!==0){var h=l[o-1];if(i===!0&&t[h.id]===void 0||i===!1){var c=this.direction.getPosition(h);u=s-c}}if(o!=l.length-1){var f=l[o+1];if(i===!0&&t[f.id]===void 0||i===!1){var v=this.direction.getPosition(f);d=Math.min(d,v-s)}}return[u,d]}else return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var t=this.hierarchical.parentReference[e.id],i=0;i<t.length;i++){var a=t[i],o=this.body.nodes[a],s=this.hierarchical.childrenReference[a];if(s!==void 0){var l=this._getCenterPosition(s),u=this.direction.getPosition(o),d=this._getSpaceAroundNode(o),h=we(d,2),c=h[0],f=h[1],v=u-l;(v<0&&Math.abs(v)<f-this.options.hierarchical.nodeSpacing||v>0&&Math.abs(v)<c-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(o,l)}}}},{key:"_placeNodesByHierarchy",value:function(e){this.positionedNodes={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i,a=$e(e[t]);a=this._indexArrayToNodes(a),Ha(i=this.direction).call(i,a);for(var o=0,s=0;s<a.length;s++){var l=a[s];if(this.positionedNodes[l.id]===void 0){var u=this.options.hierarchical.nodeSpacing,d=u*o;o>0&&(d=this.direction.getPosition(a[s-1])+u),this.direction.setPosition(l,d,t),this._validatePositionAndContinue(l,t,d),o++}}}}},{key:"_placeBranchNodes",value:function(e,t){var i,a=this.hierarchical.childrenReference[e];if(a!==void 0){for(var o=[],s=0;s<a.length;s++)o.push(this.body.nodes[a[s]]);Ha(i=this.direction).call(i,o);for(var l=0;l<o.length;l++){var u=o[l],d=this.hierarchical.levels[u.id];if(d>t&&this.positionedNodes[u.id]===void 0){var h=this.options.hierarchical.nodeSpacing,c=void 0;l===0?c=this.direction.getPosition(this.body.nodes[e]):c=this.direction.getPosition(o[l-1])+h,this.direction.setPosition(u,c,d),this._validatePositionAndContinue(u,d,c)}else return}var f=this._getCenterPosition(o);this.direction.setPosition(this.body.nodes[e],f,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){var a=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-a<this.options.hierarchical.nodeSpacing){var o=a+this.options.hierarchical.nodeSpacing-i,s=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(s.withChild,o)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.body.nodes[e[i]]);return t}},{key:"_getDistribution",value:function(){var e={},t,i;for(t in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,t)){i=this.body.nodes[t];var a=this.hierarchical.levels[t]===void 0?0:this.hierarchical.levels[t];this.direction.fix(i,a),e[a]===void 0&&(e[a]={}),e[a][t]=i}return e}},{key:"_getActiveEdges",value:function(e){var t=this,i=[];return J(e.edges,function(a){var o;te(o=t.body.edgeIndices).call(o,a.id)!==-1&&i.push(a)}),i}},{key:"_getHubSizes",value:function(){var e=this,t={},i=this.body.nodeIndices;J(i,function(o){var s=e.body.nodes[o],l=e._getActiveEdges(s).length;t[l]=!0});var a=[];return J(t,function(o){a.push(Number(o))}),Ha(a).call(a,function(o,s){return s-o}),a}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=function(l,u){e.hierarchical.levelDownstream(l,u)},i=this._getHubSizes(),a=function(){var l=i[o];if(l===0)return 1;J(e.body.nodeIndices,function(u){var d=e.body.nodes[u];l===e._getActiveEdges(d).length&&e._crawlNetwork(t,u)})},o=0;o<i.length&&!a();++o);}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=1e5,i=function(s,l,u){},a=function(s,l,u){var d=e.hierarchical.levels[s.id];d===void 0&&(d=e.hierarchical.levels[s.id]=t);var h=i(ut.cloneOptions(s,"node"),ut.cloneOptions(l,"node"),ut.cloneOptions(u,"edge"));e.hierarchical.levels[l.id]=d+h};this._crawlNetwork(a),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e,t=this,i=cT(e=this.body.nodeIndices).call(e,function(a,o){return a.set(o,t.body.nodes[o]),a},new DO);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=yve(i):this.hierarchical.levels=gve(i),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this,t=function(a,o){e.hierarchical.levels[o.id]>e.hierarchical.levels[a.id]&&e.hierarchical.addRelation(a.id,o.id)};this._crawlNetwork(t),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},i=arguments.length>1?arguments[1]:void 0,a={},o=function c(f,v){if(a[f.id]===void 0){e.hierarchical.setTreeIndex(f,v),a[f.id]=!0;for(var p,g=e._getActiveEdges(f),y=0;y<g.length;y++){var m=g[y];m.connected===!0&&(m.toId==f.id?p=m.from:p=m.to,f.id!=p.id&&(t(f,p,m),c(p,v)))}}};if(i===void 0)for(var s=0,l=0;l<this.body.nodeIndices.length;l++){var u=this.body.nodeIndices[l];if(a[u]===void 0){var d=this.body.nodes[u];o(d,s),s+=1}}else{var h=this.body.nodes[i];if(h===void 0){console.error("Node not found:",i);return}o(h)}}},{key:"_shiftBlock",value:function(e,t){var i=this,a={},o=function s(l){if(!a[l]){a[l]=!0,i.direction.shift(l,t);var u=i.hierarchical.childrenReference[l];if(u!==void 0)for(var d=0;d<u.length;d++)s(u[d])}};o(e)}},{key:"_findCommonParent",value:function(e,t){var i=this,a={},o=function l(u,d){var h=i.hierarchical.parentReference[d];if(h!==void 0)for(var c=0;c<h.length;c++){var f=h[c];u[f]=!0,l(u,f)}},s=function l(u,d){var h=i.hierarchical.parentReference[d];if(h!==void 0)for(var c=0;c<h.length;c++){var f=h[c];if(u[f]!==void 0)return{foundParent:f,withChild:d};var v=l(u,f);if(v.foundParent!==null)return v}return{foundParent:null,withChild:d}};return o(a,e),s(a,t)}},{key:"setDirectionStrategy",value:function(){var e=this.options.hierarchical.direction==="UD"||this.options.hierarchical.direction==="DU";e?this.direction=new Jfe(this):this.direction=new eve(this)}},{key:"_getCenterPosition",value:function(e){for(var t=1e9,i=-1e9,a=0;a<e.length;a++){var o=void 0;if(e[a].id!==void 0)o=e[a];else{var s=e[a];o=this.body.nodes[s]}var l=this.direction.getPosition(o);t=Math.min(t,l),i=Math.max(i,l)}return .5*(t+i)}}]),r}();function $ve(r,n){var e=typeof li<"u"&&Xi(r)||r["@@iterator"];if(!e){if(se(r)||(e=wve(r))||n){e&&(r=e);var t=0,i=function(){};return{s:i,n:function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(r)},n:function(){var u=e.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function wve(r,n){var e;if(r){if(typeof r=="string")return p1(r,n);var t=Ze(e=Object.prototype.toString.call(r)).call(e,8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Yi(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p1(r,n)}}function p1(r,n){(n==null||n>r.length)&&(n=r.length);for(var e=0,t=new Array(n);e<n;e++)t[e]=r[e];return t}var _ve=function(){function r(n,e,t,i){var a=this,o,s;C(this,r),this.body=n,this.canvas=e,this.selectionHandler=t,this.interactionHandler=i,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}},De(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){a._clean()}),this.body.emitter.on("_dataChanged",O(o=this._restore).call(o,this)),this.body.emitter.on("_resetData",O(s=this._restore).call(s,this))}return x(r,[{key:"_restore",value:function(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,ce(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){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())}},{key:"disableEditMode",value:function(){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())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var i=this.selectionHandler.getSelectedNodeCount(),a=this.selectionHandler.getSelectedEdgeCount(),o=i+a,s=this.options.locales[this.options.locale],l=!1;this.options.addNode!==!1&&(this._createAddNodeButton(s),l=!0),this.options.addEdge!==!1&&(l===!0?this._createSeperator(1):l=!0,this._createAddEdgeButton(s)),i===1&&typeof this.options.editNode=="function"?(l===!0?this._createSeperator(2):l=!0,this._createEditNodeButton(s)):a===1&&i===0&&this.options.editEdge!==!1&&(l===!0?this._createSeperator(3):l=!0,this._createEditEdgeButton(s)),o!==0&&(i>0&&this.options.deleteNode!==!1?(l===!0&&this._createSeperator(4),this._createDeleteButton(s)):i===0&&this.options.deleteEdge!==!1&&(l===!0&&this._createSeperator(4),this._createDeleteButton(s))),this._bindElementEvents(this.closeDiv,O(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",O(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t,i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,O(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",O(e=this._performAddNode).call(e,this))}},{key:"editNode",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(t.isCluster!==!0){var i=ce({},t.options,!1);if(i.x=t.x,i.y=t.y,this.options.editNode.length===2)this.options.editNode(i,function(a){a!=null&&e.inMode==="editNode"&&e.body.data.nodes.getDataSet().update(a),e.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()}},{key:"addEdgeMode",value:function(){var e,t,i,a,o;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var s,l=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(l),this._createSeperator(),this._createDescription(l.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,O(s=this.toggleEditMode).call(s,this))}this._temporaryBindUI("onTouch",O(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",O(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",O(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",O(a=this._finishConnect).call(a,this)),this._temporaryBindUI("onDragStart",O(o=this._dragStartEdge).call(o,this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",ue(this.options.editEdge)==="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){var e=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(e.from.id,e.to.id);return}if(this.guiEnabled===!0){var t,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,O(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var a,o,s,l,u=this.body.edges[this.edgeBeingEditedId],d=this._getNewTargetNode(u.from.x,u.from.y),h=this._getNewTargetNode(u.to.x,u.to.y);this.temporaryIds.nodes.push(d.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[d.id]=d,this.body.nodeIndices.push(d.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",O(a=this._controlNodeTouch).call(a,this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",O(o=this._controlNodeDragStart).call(o,this)),this._temporaryBindUI("onDrag",O(s=this._controlNodeDrag).call(s,this)),this._temporaryBindUI("onDragEnd",O(l=this._controlNodeDragEnd).call(l,this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(c){var f=u.edgeType.findBorderPositions(c);d.selected===!1&&(d.x=f.from.x,d.y=f.from.y),h.selected===!1&&(h.x=f.to.x,h.y=f.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),i=this.selectionHandler.getSelectedEdgeIds(),a=void 0;if(t.length>0){for(var o=0;o<t.length;o++)if(this.body.nodes[t[o]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(a=this.options.deleteNode)}else i.length>0&&typeof this.options.deleteEdge=="function"&&(a=this.options.deleteEdge);if(typeof a=="function"){var s={nodes:t,edges:i};if(a.length===2)a(s,function(l){l!=null&&e.inMode==="delete"?(e.body.data.edges.getDataSet().remove(l.edges),e.body.data.nodes.getDataSet().remove(l.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){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)}}},{key:"_getNewTargetNode",value:function(e,t){var i=ce({},this.options.controlNodeStyle);i.id="targetNode"+ja(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;var a=this.body.functions.createNode(i);return a.shape.boundingBox={left:e,right:e,top:t,bottom:t},a}},{key:"_createEditButton",value:function(){var e;this._clean(),this.manipulationDOM={},zr(this.editModeDiv);var t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,O(e=this.toggleEditMode).call(e,this))}},{key:"_clean",value:function(){this.inMode=!1,this.guiEnabled===!0&&(zr(this.editModeDiv),zr(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var e,t=$ve(Or(e=this._domEventListenerCleanupQueue).call(e,0)),i;try{for(t.s();!(i=t.n()).done;){var a=i.value;a()}}catch(o){t.e(o)}finally{t.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),zr(this.manipulationDiv),zr(this.editModeDiv),zr(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}},{key:"_createSeperator",value:function(){var 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])}},{key:"_createAddNodeButton",value:function(e){var t,i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,O(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(e){var t,i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,O(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(e){var t,i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,O(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(e){var t,i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,O(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(e){var t,i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";var a=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(a),this._bindElementEvents(a,O(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(e){var t,i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,O(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(e,t,i){var 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=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(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: "+Vo($e(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,i=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,i)}this.temporaryEventFunctions=[]}},{key:"_bindElementEvents",value:function(e,t){var i=new Cn(e,{});Rl(i,t),this._domEventListenerCleanupQueue.push(function(){i.destroy()});var a=function(s){var l=s.keyCode,u=s.key;(u==="Enter"||u===" "||l===13||l===32)&&t()};e.addEventListener("keyup",a,!1),this._domEventListenerCleanupQueue.push(function(){e.removeEventListener("keyup",a,!1)})}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){var t;this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var i=te(t=this.body.edgeIndices).call(t,this.temporaryIds.edges[e]);if(i!==-1){var a;Or(a=this.body.edgeIndices).call(a,i,1)}}for(var o=0;o<this.temporaryIds.nodes.length;o++){var s;delete this.body.nodes[this.temporaryIds.nodes[o]];var l=te(s=this.body.nodeIndices).call(s,this.temporaryIds.nodes[o]);if(l!==-1){var u;Or(u=this.body.nodeIndices).call(u,l,1)}}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=De({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(){var e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),i=this.body.nodes[this.temporaryIds.nodes[0]],a=this.body.nodes[this.temporaryIds.nodes[1]],o=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var s=i.isOverlappingWith(t),l=a.isOverlappingWith(t);s===!0?(this.selectedControlNode=i,o.edgeType.from=i):l===!0&&(this.selectedControlNode=a,o.edgeType.to=a),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),i=this.canvas.DOMtoCanvas(t);this.selectedControlNode!==void 0?(this.selectedControlNode.x=i.x,this.selectedControlNode.y=i.y):this.interactionHandler.onDrag(e),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),a=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode!==void 0){this.selectionHandler.unselectAll();for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,l=o.length-1;l>=0;l--)if(o[l]!==this.selectedControlNode.id){s=this.body.nodes[o[l]];break}if(s!==void 0&&this.selectedControlNode!==void 0)if(s.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var u=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===u.id?this._performEditEdge(s.id,a.to.id):this._performEditEdge(a.from.id,s.id)}else a.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=De({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var a=this._getNewTargetNode(i.x,i.y);this.body.nodes[a.id]=a,this.body.nodeIndices.push(a.id);var o=this.body.functions.createEdge({id:"connectionEdge"+ja(),from:i.id,to:a.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[o.id]=o,this.body.edgeIndices.push(o.id),this.temporaryIds.nodes.push(a.id),this.temporaryIds.edges.push(o.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,l=o.length-1;l>=0;l--){var u;if(te(u=this.temporaryIds.nodes).call(u,o[l])===-1){s=this.body.nodes[o[l]];break}}if(e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){var d=this.body.nodes[this.temporaryIds.nodes[0]];d.x=this.canvas._XconvertDOMtoCanvas(t.x),d.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),a=void 0;this.temporaryIds.edges[0]!==void 0&&(a=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var o=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,l=o.length-1;l>=0;l--){var u;if(te(u=this.temporaryIds.nodes).call(u,o[l])===-1){s=this.body.nodes[o[l]];break}}this._cleanupTemporaryNodesAndEdges(),s!==void 0&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[a]!==void 0&&this.body.nodes[s.id]!==void 0&&this._performAddEdge(a,s.id)),e.controlEdge={from:a,to:s?s.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,i={id:ja(),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(i,function(a){a!=null&&t.inMode==="addNode"&&t.body.data.nodes.getDataSet().add(a),t.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(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,a={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(a,function(o){o!=null&&i.inMode==="addEdge"&&(i.body.data.edges.getDataSet().add(o),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,a={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},o=this.options.editEdge;if(ue(o)==="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(a,function(s){s==null||i.inMode!=="editEdge"?(i.body.edges[a.id].updateEdgeType(),i.body.emitter.emit("_redraw"),i.showManipulatorToolbar()):(i.body.data.edges.getDataSet().update(s),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(a),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),r}(),P="string",S="boolean",w="number",xa="array",L="object",yT="dom",Eve="any",Zh=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Qh={borderWidth:{number:w},borderWidthSelected:{number:w,undefined:"undefined"},brokenImage:{string:P,undefined:"undefined"},chosen:{label:{boolean:S,function:"function"},node:{boolean:S,function:"function"},__type__:{object:L,boolean:S}},color:{border:{string:P},background:{string:P},highlight:{border:{string:P},background:{string:P},__type__:{object:L,string:P}},hover:{border:{string:P},background:{string:P},__type__:{object:L,string:P}},__type__:{object:L,string:P}},opacity:{number:w,undefined:"undefined"},fixed:{x:{boolean:S},y:{boolean:S},__type__:{object:L,boolean:S}},font:{align:{string:P},color:{string:P},size:{number:w},face:{string:P},background:{string:P},strokeWidth:{number:w},strokeColor:{string:P},vadjust:{number:w},multi:{boolean:S,string:P},bold:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},boldital:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},ital:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},mono:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},__type__:{object:L,string:P}},group:{string:P,number:w,undefined:"undefined"},heightConstraint:{minimum:{number:w},valign:{string:P},__type__:{object:L,boolean:S,number:w}},hidden:{boolean:S},icon:{face:{string:P},code:{string:P},size:{number:w},color:{string:P},weight:{string:P,number:w},__type__:{object:L}},id:{string:P,number:w},image:{selected:{string:P,undefined:"undefined"},unselected:{string:P,undefined:"undefined"},__type__:{object:L,string:P}},imagePadding:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:L,number:w}},label:{string:P,undefined:"undefined"},labelHighlightBold:{boolean:S},level:{number:w,undefined:"undefined"},margin:{top:{number:w},right:{number:w},bottom:{number:w},left:{number:w},__type__:{object:L,number:w}},mass:{number:w},physics:{boolean:S},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:S},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:L,boolean:S}},customScalingFunction:{function:"function"},__type__:{object:L}},shadow:{enabled:{boolean:S},color:{string:P},size:{number:w},x:{number:w},y:{number:w},__type__:{object:L,boolean:S}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:S,array:xa},borderRadius:{number:w},interpolation:{boolean:S},useImageSize:{boolean:S},useBorderWithImage:{boolean:S},coordinateOrigin:{string:["center","top-left"]},__type__:{object:L}},size:{number:w},title:{string:P,dom:yT,undefined:"undefined"},value:{number:w,undefined:"undefined"},widthConstraint:{minimum:{number:w},maximum:{number:w},__type__:{object:L,boolean:S,number:w}},x:{number:w},y:{number:w},__type__:{object:L}},Sve={configure:{enabled:{boolean:S},filter:{boolean:S,string:P,array:xa,function:"function"},container:{dom:yT},showButton:{boolean:S},__type__:{object:L,boolean:S,string:P,array:xa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:S},scaleFactor:{number:w},type:{string:Zh},imageHeight:{number:w},imageWidth:{number:w},src:{string:P},__type__:{object:L,boolean:S}},middle:{enabled:{boolean:S},scaleFactor:{number:w},type:{string:Zh},imageWidth:{number:w},imageHeight:{number:w},src:{string:P},__type__:{object:L,boolean:S}},from:{enabled:{boolean:S},scaleFactor:{number:w},type:{string:Zh},imageWidth:{number:w},imageHeight:{number:w},src:{string:P},__type__:{object:L,boolean:S}},__type__:{string:["from","to","middle"],object:L}},endPointOffset:{from:{number:w},to:{number:w},__type__:{object:L,number:w}},arrowStrikethrough:{boolean:S},background:{enabled:{boolean:S},color:{string:P},size:{number:w},dashes:{boolean:S,array:xa},__type__:{object:L,boolean:S}},chosen:{label:{boolean:S,function:"function"},edge:{boolean:S,function:"function"},__type__:{object:L,boolean:S}},color:{color:{string:P},highlight:{string:P},hover:{string:P},inherit:{string:["from","to","both"],boolean:S},opacity:{number:w},__type__:{object:L,string:P}},dashes:{boolean:S,array:xa},font:{color:{string:P},size:{number:w},face:{string:P},background:{string:P},strokeWidth:{number:w},strokeColor:{string:P},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:w},multi:{boolean:S,string:P},bold:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},boldital:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},ital:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},mono:{color:{string:P},size:{number:w},face:{string:P},mod:{string:P},vadjust:{number:w},__type__:{object:L,string:P}},__type__:{object:L,string:P}},hidden:{boolean:S},hoverWidth:{function:"function",number:w},label:{string:P,undefined:"undefined"},labelHighlightBold:{boolean:S},length:{number:w,undefined:"undefined"},physics:{boolean:S},scaling:{min:{number:w},max:{number:w},label:{enabled:{boolean:S},min:{number:w},max:{number:w},maxVisible:{number:w},drawThreshold:{number:w},__type__:{object:L,boolean:S}},customScalingFunction:{function:"function"},__type__:{object:L}},selectionWidth:{function:"function",number:w},selfReferenceSize:{number:w},selfReference:{size:{number:w},angle:{number:w},renderBehindTheNode:{boolean:S},__type__:{object:L}},shadow:{enabled:{boolean:S},color:{string:P},size:{number:w},x:{number:w},y:{number:w},__type__:{object:L,boolean:S}},smooth:{enabled:{boolean:S},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:w},forceDirection:{string:["horizontal","vertical","none"],boolean:S},__type__:{object:L,boolean:S}},title:{string:P,undefined:"undefined"},width:{number:w},widthConstraint:{maximum:{number:w},__type__:{object:L,boolean:S,number:w}},value:{number:w,undefined:"undefined"},__type__:{object:L}},groups:{useDefaultGroups:{boolean:S},__any__:Qh,__type__:{object:L}},interaction:{dragNodes:{boolean:S},dragView:{boolean:S},hideEdgesOnDrag:{boolean:S},hideEdgesOnZoom:{boolean:S},hideNodesOnDrag:{boolean:S},hover:{boolean:S},keyboard:{enabled:{boolean:S},speed:{x:{number:w},y:{number:w},zoom:{number:w},__type__:{object:L}},bindToWindow:{boolean:S},autoFocus:{boolean:S},__type__:{object:L,boolean:S}},multiselect:{boolean:S},navigationButtons:{boolean:S},selectable:{boolean:S},selectConnectedEdges:{boolean:S},hoverConnectedEdges:{boolean:S},tooltipDelay:{number:w},zoomView:{boolean:S},zoomSpeed:{number:w},__type__:{object:L}},layout:{randomSeed:{undefined:"undefined",number:w,string:P},improvedLayout:{boolean:S},clusterThreshold:{number:w},hierarchical:{enabled:{boolean:S},levelSeparation:{number:w},nodeSpacing:{number:w},treeSpacing:{number:w},blockShifting:{boolean:S},edgeMinimization:{boolean:S},parentCentralization:{boolean:S},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:L,boolean:S}},__type__:{object:L}},manipulation:{enabled:{boolean:S},initiallyActive:{boolean:S},addNode:{boolean:S,function:"function"},addEdge:{boolean:S,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:L,boolean:S,function:"function"}},deleteNode:{boolean:S,function:"function"},deleteEdge:{boolean:S,function:"function"},controlNodeStyle:Qh,__type__:{object:L,boolean:S}},nodes:Qh,physics:{enabled:{boolean:S},barnesHut:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:L}},forceAtlas2Based:{theta:{number:w},gravitationalConstant:{number:w},centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:L}},repulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},__type__:{object:L}},hierarchicalRepulsion:{centralGravity:{number:w},springLength:{number:w},springConstant:{number:w},nodeDistance:{number:w},damping:{number:w},avoidOverlap:{number:w},__type__:{object:L}},maxVelocity:{number:w},minVelocity:{number:w},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:S},iterations:{number:w},updateInterval:{number:w},onlyDynamicEdges:{boolean:S},fit:{boolean:S},__type__:{object:L,boolean:S}},timestep:{number:w},adaptiveTimestep:{boolean:S},wind:{x:{number:w},y:{number:w},__type__:{object:L}},__type__:{object:L,boolean:S}},autoResize:{boolean:S},clickToUse:{boolean:S},locale:{string:P},locales:{__any__:{any:Eve},__type__:{object:L}},height:{string:P},width:{string:P},__type__:{object:L}},mT={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]}}},Ove=function(n,e,t){var i;return!!(Xr(n).call(n,"physics")&&Xr(i=mT.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")},Tve=function(){function r(){C(this,r)}return x(r,[{key:"getDistances",value:function(e,t,i){for(var a={},o=e.edges,s=0;s<t.length;s++){var l=t[s],u={};a[l]=u;for(var d=0;d<t.length;d++)u[t[d]]=s==d?0:1e9}for(var h=0;h<i.length;h++){var c=o[i[h]];c.connected===!0&&a[c.fromId]!==void 0&&a[c.toId]!==void 0&&(a[c.fromId][c.toId]=1,a[c.toId][c.fromId]=1)}for(var f=t.length,v=0;v<f;v++)for(var p=t[v],g=a[p],y=0;y<f-1;y++)for(var m=t[y],$=a[m],b=y+1;b<f;b++){var E=t[b],T=a[E],N=Math.min($[E],$[p]+g[E]);$[E]=N,T[m]=N}return a}}]),r}(),Ive=function(){function r(n,e,t){C(this,r),this.body=n,this.springLength=e,this.springConstant=t,this.distanceSolver=new Tve}return x(r,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var i=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();for(var o=.01,s=1,l=0,u=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),d=5,h=1e9,c=0,f=0,v=0,p=0,g=0;h>o&&l<u;){l+=1;var y=this._getHighestEnergyNode(i),m=we(y,4);for(c=m[0],h=m[1],f=m[2],v=m[3],p=h,g=0;p>s&&g<d;){g+=1,this._moveNode(c,f,v);var $=this._getEnergy(c),b=we($,3);p=b[0],f=b[1],v=b[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,a=0,o=t[0],s=0,l=0,u=0;u<t.length;u++){var d=t[u];if(i[d].predefinedPosition!==!0||i[d].isCluster===!0&&e===!0||i[d].options.fixed.x!==!0||i[d].options.fixed.y!==!0){var h=this._getEnergy(d),c=we(h,3),f=c[0],v=c[1],p=c[2];a<f&&(a=f,o=d,s=v,l=p)}}return[o,a,s,l]}},{key:"_getEnergy",value:function(e){var t=we(this.E_sums[e],2),i=t[0],a=t[1],o=Math.sqrt(Math.pow(i,2)+Math.pow(a,2));return[o,i,a]}},{key:"_moveNode",value:function(e,t,i){for(var a=this.body.nodeIndices,o=this.body.nodes,s=0,l=0,u=0,d=o[e].x,h=o[e].y,c=this.K_matrix[e],f=this.L_matrix[e],v=0;v<a.length;v++){var p=a[v];if(p!==e){var g=o[p].x,y=o[p].y,m=c[p],$=f[p],b=1/Math.pow(Math.pow(d-g,2)+Math.pow(h-y,2),1.5);s+=m*(1-$*Math.pow(h-y,2)*b),l+=m*($*(d-g)*(h-y)*b),u+=m*(1-$*Math.pow(d-g,2)*b)}}var E=s,T=l,N=t,M=u,R=i,D=(N/E+R/T)/(T/E-M/T),z=-(T*D+N)/E;o[e].x+=z,o[e].y+=D,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springLength;this.L_matrix=[];for(var a=0;a<t.length;a++){this.L_matrix[t[a]]={};for(var o=0;o<t.length;o++)this.L_matrix[t[a]][t[o]]=i*e[t[a]][t[o]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,i=this.springConstant;this.K_matrix=[];for(var a=0;a<t.length;a++){this.K_matrix[t[a]]={};for(var o=0;o<t.length;o++)this.K_matrix[t[a]][t[o]]=i*Math.pow(e[t[a]][t[o]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(var i=0;i<e.length;i++)this.E_matrix[e[i]]=[];for(var a=0;a<e.length;a++){for(var o=e[a],s=t[o].x,l=t[o].y,u=0,d=0,h=a;h<e.length;h++){var c=e[h];if(c!==o){var f=t[c].x,v=t[c].y,p=1/Math.sqrt(Math.pow(s-f,2)+Math.pow(l-v,2));this.E_matrix[o][h]=[this.K_matrix[o][c]*(s-f-this.L_matrix[o][c]*(s-f)*p),this.K_matrix[o][c]*(l-v-this.L_matrix[o][c]*(l-v)*p)],this.E_matrix[c][a]=this.E_matrix[o][h],u+=this.E_matrix[o][h][0],d+=this.E_matrix[o][h][1]}}this.E_sums[o]=[u,d]}}},{key:"_updateE_matrix",value:function(e){for(var t=this.body.nodeIndices,i=this.body.nodes,a=this.E_matrix[e],o=this.K_matrix[e],s=this.L_matrix[e],l=i[e].x,u=i[e].y,d=0,h=0,c=0;c<t.length;c++){var f=t[c];if(f!==e){var v=a[c],p=v[0],g=v[1],y=i[f].x,m=i[f].y,$=1/Math.sqrt(Math.pow(l-y,2)+Math.pow(u-m,2)),b=o[f]*(l-y-s[f]*(l-y)*$),E=o[f]*(u-m-s[f]*(u-m)*$);a[c]=[b,E],d+=b,h+=E;var T=this.E_sums[f];T[0]+=b-p,T[1]+=E-g}}this.E_sums[e]=[d,h]}}]),r}();function B(r,n,e){var t,i,a,o,s=this;if(!(this instanceof B))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:Sae,clickToUse:!1},De(this.options,this.defaultOptions),this.body={container:r,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:O(t=this.on).call(t,this),off:O(i=this.off).call(i,this),emit:O(a=this.emit).call(a,this),once:O(o=this.once).call(o,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 Iae(function(){return s.body.emitter.emit("_requestRedraw")}),this.groups=new Uoe,this.canvas=new sce(this.body),this.selectionHandler=new Zce(this.body,this.canvas),this.interactionHandler=new fce(this.body,this.canvas,this.selectionHandler),this.view=new uce(this.body,this.canvas),this.renderer=new rce(this.body,this.canvas),this.physics=new Ghe(this.body),this.layoutEngine=new bve(this.body),this.clustering=new ece(this.body),this.manipulation=new _ve(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new Pde(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Nhe(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Ive(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(n)}yE(B.prototype);B.prototype.setOptions=function(r){var n=this;if(r===null&&(r=void 0),r!==void 0){var e=tae.validate(r,Sve);e===!0&&console.error("%cErrors have been found in the supplied options object.",$O);var t=["locale","locales","clickToUse"];if(ma(t,this.options,r),r.locale!==void 0&&(r.locale=Oae(r.locales||this.options.locales,r.locale)),r=this.layoutEngine.setOptions(r.layout,r),this.canvas.setOptions(r),this.groups.setOptions(r.groups),this.nodesHandler.setOptions(r.nodes),this.edgesHandler.setOptions(r.edges),this.physics.setOptions(r.physics),this.manipulation.setOptions(r.manipulation,r,this.options),this.interactionHandler.setOptions(r.interaction),this.renderer.setOptions(r.interaction),this.selectionHandler.setOptions(r.interaction),r.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in r&&(this.configurator||(this.configurator=new Jne(this,this.body.container,mT,this.canvas.pixelRatio,Ove)),this.configurator.setOptions(r.configure)),this.configurator&&this.configurator.options.enabled===!0){var i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};ce(i.nodes,this.nodesHandler.options),ce(i.edges,this.edgesHandler.options),ce(i.layout,this.layoutEngine.options),ce(i.interaction,this.selectionHandler.options),ce(i.interaction,this.renderer.options),ce(i.interaction,this.interactionHandler.options),ce(i.manipulation,this.manipulation.options),ce(i.physics,this.physics.options),ce(i.global,this.canvas.options),ce(i.global,this.options),this.configurator.setModuleOptions(i)}r.clickToUse!==void 0?r.clickToUse===!0?this.activator===void 0&&(this.activator=new Qne(this.canvas.frame),this.activator.on("change",function(){n.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")}};B.prototype._updateVisibleIndices=function(){var r=this.body.nodes,n=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&!this.clustering._isClusteredNode(e)&&r[e].options.hidden===!1&&this.body.nodeIndices.push(r[e].id);for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){var i=n[t],a=r[i.fromId],o=r[i.toId],s=a!==void 0&&o!==void 0,l=!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&s&&a.options.hidden===!1&&o.options.hidden===!1;l&&this.body.edgeIndices.push(i.id)}};B.prototype.bindEventListeners=function(){var r=this;this.body.emitter.on("_dataChanged",function(){r.edgesHandler._updateState(),r.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){r.clustering._updateState(),r._updateVisibleIndices(),r._updateValueRange(r.body.nodes),r._updateValueRange(r.body.edges),r.body.emitter.emit("startSimulation"),r.body.emitter.emit("_requestRedraw")})};B.prototype.setData=function(r){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),r&&r.dot&&(r.nodes||r.edges))throw new SyntaxError('Data must contain either parameter "dot" or  parameter pair "nodes" and "edges", but not both.');if(this.setOptions(r&&r.options),r&&r.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);");var n=hae(r.dot);this.setData(n);return}else if(r&&r.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);");var e=cae(r.gephi);this.setData(e);return}else this.nodesHandler.setData(r&&r.nodes,!0),this.edgesHandler.setData(r&&r.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};B.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(var r in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,r)&&delete this.body.nodes[r];for(var n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];zr(this.body.container)};B.prototype._updateValueRange=function(r){var n,e=void 0,t=void 0,i=0;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var a=r[n].getValue();a!==void 0&&(e=e===void 0?a:Math.min(a,e),t=t===void 0?a:Math.max(a,t),i+=a)}if(e!==void 0&&t!==void 0)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&r[n].setValueRange(e,t,i)};B.prototype.isActive=function(){return!this.activator||this.activator.active};B.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};B.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};B.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};B.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};B.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};B.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};B.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};B.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};B.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};B.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};B.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};B.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};B.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};B.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};B.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};B.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};B.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};B.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};B.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};B.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};B.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};B.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};B.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};B.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};B.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};B.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};B.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};B.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};B.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};B.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};B.prototype.getConnectedNodes=function(r){return this.body.nodes[r]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};B.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};B.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};B.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};B.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};B.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};B.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};B.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};B.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};B.prototype.getNodeAt=function(){var r=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return r!==void 0&&r.id!==void 0?r.id:r};B.prototype.getEdgeAt=function(){var r=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return r!==void 0&&r.id!==void 0?r.id:r};B.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};B.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};B.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};B.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};B.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};B.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};B.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};B.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};B.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};B.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};B.prototype.getOptionsFromConfigurator=function(){var r={};return this.configurator&&(r=this.configurator.getOptions.apply(this.configurator)),r};const vn={PRIORITY:20,CUSTOM:21},kve={props:{nodes:{type:[Array]}},computed:{...wT(Gv,["controllerNode"]),content(){return this.$refs.content},fontColor(){return this.isDark?"#ddd":"#333"},isDark(){return this.$vuetify.theme.current.dark},locations(){return this.allNodes.reduce((r,n)=>(n.loc&&r.indexOf(n.loc)===-1&&r.push(n.loc),r),[])},filteredNodes(){return this.allNodes.filter(r=>{if(r.isControllerNode)return!0;let n=!1;return this.locationsFilter.length>0&&(this.invertLocationsFilter?n=!this.locationsFilter.includes(r.loc):n=this.locationsFilter.includes(r.loc)),!n&&this.nodesFilter.length>0&&(this.invertNodesFilter?n=!this.nodesFilter.includes(r.id):n=this.nodesFilter.includes(r.id)),n})},allNodes(){return this.nodes}},network:null,unsubscribeUpdate:null,data(){return{openPanel:-1,hoverNodeTimeout:null,containerHeight:400,selectedNodes:[],showReturnRoutes:!0,showApplicationRoutes:!0,menuX:0,menuY:0,showMenu:!1,hoverNode:null,liveUpdate:!1,shouldReload:!1,locationsFilter:[],invertLocationsFilter:!1,nodesFilter:[],invertNodesFilter:!1,refreshTimeout:null,updateTimeout:null,loading:!1,priorityEdges:{},legends:[{color:"#7e57c2",textColor:"#7e57c2",text:"Controller"},{color:"#00BCD4",textColor:"#00BCD4",text:"1 hop"},{color:"#2DCC70",textColor:"#2DCC70",text:"2 hops"},{color:"#F1C40F",textColor:"#F1C40F",text:"3 hops"},{color:"#E77E23",textColor:"#E77E23",text:"4 hops"},{color:"#8b0000",textColor:"#8b0000",text:"Failed Node"},{color:"#666666",textColor:"#666666",text:"Unknown"}],edgesLegend:[{icon:"star",textColor:"",color:"#F1C40F",text:"Priority route"},{icon:"minimize",textColor:"",text:"Last working route"},{icon:"more_horiz",textColor:"",text:"Next to last working route"},{color:"#8b0000",textColor:"#8b0000",text:Jo(mr.ZWave_9k6)},{color:"#F1C40F",textColor:"#F1C40F",text:Jo(mr.ZWave_40k)},{color:"#2DCC70",textColor:"#2DCC70",text:Jo(mr.ZWave_100k)},{color:"#3F51B5",textColor:"#3F51B5",text:Jo(mr.LongRange_100k)},{color:"#666666",textColor:"#666666",text:"Unknown"}]}},watch:{grouping(){this.debounceRefresh()},filteredNodes(r,n){_T(r,n)||(this.selectedNodes=r.map(e=>e.id),this.setSelection())},showReturnRoutes(r){if(this.network&&!this.loading&&this.selectedNodes.length>0){const{edges:n}=this.network.body.data,e=[];n.forEach(t=>{t.routeKind>=vn.PRIORITY&&e.push({id:t.id,hidden:!r})}),n.update(e)}},showApplicationRoutes(r){if(this.network&&!this.loading&&this.selectedNodes.length>0){const{edges:n}=this.network.body.data,e=[];n.forEach(t=>{t.routeKind===Ct.Application&&e.push({id:t.id,hidden:!r})}),n.update(e)}}},mounted(){this.paintGraph(),this.unsubscribeUpdate=Gv().$onAction(({name:r,args:n})=>{r==="updateMeshGraph"?this.liveUpdate?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(this.onNodeUpdate.bind(this,n[0]),1e3)):this.shouldReload=!0:r==="initNodes"&&this.debounceRefresh()})},beforeUnmount(){this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.updateTimeout&&clearTimeout(this.updateTimeout),this.hoverNodeTimeout&&clearTimeout(this.hoverNodeTimeout),this.destroyNetwork(),this.unsubscribeUpdate()},methods:{onResize(){this.containerHeight=this.$refs.container.$el.offsetHeight;const r=window.innerHeight-180;this.containerHeight>r&&(this.containerHeight=r)},toggleLive(){this.liveUpdate=!this.liveUpdate,this.liveUpdate&&this.shouldReload&&this.paintGraph()},destroyNetwork(){this.network&&(this.network.destroy(),this.network=null,this.content.innerHTML="")},debounceRefresh(){this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.loading=!0,this.refreshTimeout=setTimeout(this.paintGraph.bind(this),1e3)},onNodeUpdate(r){if(this.updateTimeout&&clearTimeout(this.updateTimeout),this.network&&!this.loading){const{nodes:n,edges:e}=this.network.body.data,t=[],i={},a=[];e.forEach(l=>{var d;const u=this.getEdgeId(l);l.routeOf===r.id?(t.push(l.id),((d=this.priorityEdges[u])==null?void 0:d.id)===l.id&&(delete this.priorityEdges[u],a.push(u))):i[u]?i[u].push(l):i[u]=[l]});for(const l of a){const u=i[l];u&&(this.priorityEdges[l]=u.reduce((d,h)=>d.protocolDataRate>h.protocolDataRate?d:h))}n.remove(r.id),e.remove(t);const o=this.parseNode(r);n.add(o.node),e.add(o.edges);const s={nodes:this.selectedNodes};this.network.setSelection(s),this.handleSelectNode(s)}},getEdgeId(r){return`${r.from}-${r.to}`},getDataRateColor(r){switch(r){case mr.ZWave_9k6:return"#8b0000";case mr.ZWave_40k:return"#F1C40F";case mr.ZWave_100k:return"#2DCC70";case mr.LongRange_100k:return"#3F51B5";default:return"#666666"}},setSelection(){if(this.network&&!this.loading){const r=this.nodesFilter.length===0&&this.locationsFilter.length===0&&!this.invertNodesFilter&&!this.invertLocationsFilter,e={nodes:this.filteredNodes.length===this.allNodes.length&&r?[]:this.selectedNodes};this.network.setSelection(e),this.handleSelectNode(e)}},paintGraph(){this.shouldReload=!1,this.destroyNetwork(),this.priorityEdges={},this.loading=!0;const{edges:r,nodes:n}=this.parseNodes(),e=this.content,t={nodes:n,edges:r},i={interaction:{hover:!0,navigationButtons:!0,keyboard:!0,multiselect:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hoverConnectedEdges:!1,selectable:!0,selectConnectedEdges:!1,tooltipDelay:1e3,zoomSpeed:1,zoomView:!0},nodes:{borderWidth:2,widthConstraint:{maximum:180}},edges:{width:2},physics:{enabled:!0,stabilization:{enabled:!0,iterations:50,updateInterval:50,onlyDynamicEdges:!1,fit:!0},barnesHut:{theta:.99,damping:.9,avoidOverlap:.15}}};this.network=new B(e,t,i),this.network.once("stabilizationIterationsDone",()=>{this.loading=!1,this.setSelection()}),this.network.on("click",this.handleClick.bind(this)),this.network.on("hoverNode",this.handleHoverNode.bind(this)),this.network.on("blurNode",this.handleBlurNode.bind(this)),this.network.on("dragStart",this.handleDragStart.bind(this)),this.network.on("dragEnd",this.handleDragEnd.bind(this)),this.network.on("select",this.handleSelectNode.bind(this))},handleSelectNode(r){let{nodes:n}=r;const{edges:e,nodes:t}=this.network.body.data,i=[],a=[],o=[];n.length===1&&t.get(n[0]).isControllerNode&&(n=[]),this.selectedNodes=n;const s=n.length===0;e.forEach(l=>{var f;const u=this.getEdgeId(l),d=s&&((f=this.priorityEdges[u])==null?void 0:f.id)!==l.id||n.length>0&&!n.includes(l.routeOf);let h=!1;s||(l.routeKind===Ct.Application&&!this.showApplicationRoutes||l.routeKind>=vn.PRIORITY&&!this.showReturnRoutes)&&(h=!0);const c=s?0:12;(d!==l.hidden||c!==l.font.size)&&a.push({id:l.id,hidden:d||h,font:{size:c}}),d||(i.push(l.from),i.push(l.to))}),e.update(a),t.forEach(l=>{const u=n.length>0&&!n.includes(l.id)&&!i.includes(l.id);u!==l.hidden&&o.push({id:l.id,hidden:u,color:l.color})}),t.update(o),this.network.fit()},handleDragStart(){this.dragging=!0},handleDragEnd(){this.dragging=!1},handleHoverNode(r){if(this.dragging)return;const{node:n,event:e}=r,t=this.allNodes.find(i=>i.id===n);t&&(this.hoverNodeTimeout=setTimeout(()=>{this.hoverNode=t,this.menuX=e.clientX+5,this.menuY=e.clientY+5,this.showMenu=!0,this.hoverNodeTimeout=null},1e3))},handleBlurNode(){this.hoverNodeTimeout?(clearTimeout(this.hoverNodeTimeout),this.hoverNodeTimeout=null):(this.showMenu=!1,this.hoverNode=null)},handleClick(r){if(r.event){r.event.preventDefault();const n=r.nodes[0];if(n){const e=this.allNodes.find(t=>t.id===n);this.$emit("node-click",e)}else this.$emit("node-click",null)}},parseRouteStats(r,n,e,t,i,a=!1){if(!t){i!==Ct.NLWR&&(e.color=this.legends[6].color);return}const o=i>=20,s=a||i!==Ct.NLWR&&!o,{repeaters:l,repeaterRSSI:u,rssi:d,routeFailedBetween:h}=t;let{protocolDataRate:c}=t;if(t.routeSpeed&&(c=t.routeSpeed),h){const p={id:Kv(),from:h[0],to:h[1],color:this.getDataRateColor(mr.ZWave_9k6),width:1,label:"Failed ❌",font:{align:"top",size:0},dashes:[2,2],hidden:!0,routeOf:e.id,physics:!0};r.push(p)}const f=o?e.id:n,v=o?n:e.id;for(let p=0;p<=l.length;p++){const g=l[p],m=l[p-1]||f,$=g||v,b=p===0?d:u==null?void 0:u[p-1];let E="";b&&!ET(b)&&(E=ST(b));const T=this.getEdgeId({from:m,to:$}),N={enabled:!0,type:"image",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNSIgdmlld0JveD0iLTEgLTEgMTcgMTYiPgogIDxwYXRoIGQ9Im03LjUgMCAyLjI0IDQuNiA1IC43NS0zLjYyIDMuNTkuODYgNS4wNi00LjQ4LTIuNEwzLjAyIDE0bC44Ni01LjA2TC4yNiA1LjM1bDUtLjc0Wm0wIDAiIHN0eWxlPSJzdHJva2U6IzAwMDtmaWxsLXJ1bGU6bm9uemVybztmaWxsOiNmZmM5MDE7ZmlsbC1vcGFjaXR5OjEiLz4KPC9zdmc+",scaleFactor:1};let M,R,D;switch(i){case Ct.NLWR:M=1,R=[5,5];break;case Ct.LWR:M=4,R=!1;break;case Ct.Application:M=4,R=!1,D={middle:N};break;case vn.PRIORITY:M=2,R=[5,10],D={to:{enabled:!0,scaleFactor:1},middle:N};break;case vn.CUSTOM:M=1,R=[5,10],D={to:{enabled:!0,scaleFactor:1}};break;default:M=1,R=[5,5]}const z={id:Kv(),from:m,to:$,color:this.getDataRateColor(c),width:M,layer:p+1,label:E,font:{align:"top",size:0,vadjust:i===Ct.Application?-5:0},dashes:R,arrows:D,hidden:!s,routeOf:e.id,physics:!0,routeKind:i,protocolDataRate:c};r.push(z),s&&(!e.failed&&e.available&&(e.color=this.legends[l.length+1].color),this.priorityEdges[T]?this.priorityEdges[T].protocolDataRate>=c?z.hidden=!0:(this.priorityEdges[T].hidden=!0,this.priorityEdges[T]=z):this.priorityEdges[T]=z)}},parseNodes(){const r={edges:[],nodes:[]};for(const n of this.allNodes){const{node:e}=this.parseNode(n,r.edges);r.nodes.push(e)}return r},parseNode(r,n=[]){var s,l,u,d;const e=((s=this.controllerNode)==null?void 0:s.id)??1,t=r.id;let i=r.minBatteryLevel;const a=r.name||"NodeID "+r.id,o={id:t,hidden:!1,label:a,neighbors:r.neighbors,battery_level:i,group:r.loc,failed:r.failed,available:r.available,font:{color:this.fontColor},forwards:r.isControllerNode||r.ready&&!r.failed&&r.isListening};if(t===e?(o.shape="star",o.isControllerNode=!0,o.color=this.legends[0].color):r.isListening?o.shape="hexagon":o.shape="square",r.failed&&(o.label="FAILED: "+o.label,o.group="Failed",o.color=this.legends[5].color),r.available||(o.label="DEAD: "+o.label,o.group="Dead",o.color=this.legends[5].color),e===t)o.label="Controller";else{if(this.parseRouteStats(n,e,o,r.applicationRoute,Ct.Application),this.parseRouteStats(n,e,o,(l=r.statistics)==null?void 0:l.lwr,Ct.LWR),this.parseRouteStats(n,e,o,(u=r.statistics)==null?void 0:u.nlwr,Ct.NLWR,!((d=r.statistics)!=null&&d.lwr)),r.customSUCReturnRoutes)for(const h of r.customSUCReturnRoutes)this.parseRouteStats(n,e,o,h,vn.CUSTOM);r.prioritySUCReturnRoute&&this.parseRouteStats(n,e,o,r.prioritySUCReturnRoute,vn.PRIORITY)}return{node:o,edges:n}}}},Pve={class:"fill-height"},Cve={class:"mt-5",style:{height:"calc(100% - 95px)"}},xve={class:"align-end font-weight-bold"},Rve={class:"align-end font-weight-bold"},Ave={class:"align-end font-weight-bold"},Dve={class:"align-end font-weight-bold"};function Mve(r,n,e,t,i,a){return fi(),Nu("div",Pve,[ee(NT,{modelValue:i.openPanel,"onUpdate:modelValue":n[8]||(n[8]=o=>i.openPanel=o)},{default:X(()=>[ee(AT,null,{default:X(()=>[ee(DT,null,{default:X(()=>n[10]||(n[10]=[it(" Options ")])),_:1,__:[10]}),ee(MT,null,{default:X(()=>[ee(OT,null,{default:X(()=>[ee(ba,null,{default:X(()=>[ee(es,null,{default:X(()=>n[11]||(n[11]=[it("Legend")])),_:1,__:[11]}),ee(Fu,{density:"compact"},{default:X(()=>[(fi(!0),Nu(qv,null,Yv(i.legends,(o,s)=>(fi(),ts(en,{key:s},{prepend:X(()=>[ee(Bu,{color:o.color},{default:X(()=>[it(rr(o.icon||"turned_in"),1)]),_:2},1032,["color"])]),default:X(()=>[ee(Xv,{style:$a({color:o.textColor})},{default:X(()=>[it(rr(o.text),1)]),_:2},1032,["style"])]),_:2},1024))),128))]),_:1})]),_:1}),ee(ba,null,{default:X(()=>[ee(es,null,{default:X(()=>n[12]||(n[12]=[it("Edges")])),_:1,__:[12]}),ee(Fu,{density:"compact"},{default:X(()=>[(fi(!0),Nu(qv,null,Yv(i.edgesLegend,(o,s)=>(fi(),ts(en,{key:s},{prepend:X(()=>[ee(Bu,{color:o.color},{default:X(()=>[it(rr(o.icon||"turned_in"),1)]),_:2},1032,["color"])]),default:X(()=>[ee(Xv,{style:$a({color:o.textColor})},{default:X(()=>[it(rr(o.text),1)]),_:2},1032,["style"])]),_:2},1024))),128))]),_:1})]),_:1}),ee(ba,null,{default:X(()=>[ee(es,null,{default:X(()=>n[13]||(n[13]=[it("Filters")])),_:1,__:[13]}),ee(Zv,{items:a.locations,modelValue:i.locationsFilter,"onUpdate:modelValue":n[1]||(n[1]=o=>i.locationsFilter=o),multiple:"",label:"Locations filter",clearable:"",chips:"","closable-chips":"",variant:"solo"},{append:X(()=>[rs(ee(is,{onClick:n[0]||(n[0]=o=>i.invertLocationsFilter=!i.invertLocationsFilter),icon:"loop",color:i.invertLocationsFilter?"primary":"",class:Qv(i.invertLocationsFilter?"border-primary":"")},null,8,["color","class"]),[[Jv,"Invert selection","bottom"]])]),_:1},8,["items","modelValue"]),ee(Zv,{items:a.allNodes,modelValue:i.nodesFilter,"onUpdate:modelValue":n[3]||(n[3]=o=>i.nodesFilter=o),multiple:"",label:"Nodes filter",clearable:"","item-title":"_name","item-value":"id",chips:"","closable-chips":"",variant:"solo"},{append:X(()=>[rs(ee(is,{onClick:n[2]||(n[2]=o=>i.invertNodesFilter=!i.invertNodesFilter),icon:"loop",color:i.invertNodesFilter?"primary":"",class:Qv(i.invertNodesFilter?"border-primary":"")},null,8,["color","class"]),[[Jv,"Invert selection","bottom"]])]),_:1},8,["items","modelValue"]),ee(ep,{modelValue:i.showReturnRoutes,"onUpdate:modelValue":n[4]||(n[4]=o=>i.showReturnRoutes=o),label:"Show return routes",disabled:i.selectedNodes.length===0},null,8,["modelValue","disabled"]),ee(ep,{modelValue:i.showApplicationRoutes,"onUpdate:modelValue":n[5]||(n[5]=o=>i.showApplicationRoutes=o),label:"Show priority routes",disabled:i.selectedNodes.length===0},null,8,["modelValue","disabled"]),ee(TT,{color:"error",modelValue:i.shouldReload,"onUpdate:modelValue":n[6]||(n[6]=o=>i.shouldReload=o)},{default:X(()=>[ee(is,{color:"primary",onClick:a.paintGraph},{default:X(()=>n[14]||(n[14]=[it(" Reload graph ")])),_:1,__:[14]},8,["onClick"])]),_:1},8,["modelValue"]),ee(is,{class:"ml-3",color:i.liveUpdate?"error":"success",onClick:n[7]||(n[7]=o=>a.toggleLive())},{default:X(()=>[n[15]||(n[15]=it(" Live ")),ee(Bu,null,{default:X(()=>[it(rr(i.liveUpdate?"pause":"play_arrow"),1)]),_:1})]),_:1,__:[15]},8,["color"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),tn("div",Cve,[rs(ee(ba,{"align-self":"center",class:"text-center",cols:"12"},{default:X(()=>[ee(kT,{size:50,color:"primary",indeterminate:""})]),_:1},512),[[IT,i.loading]]),rs((fi(),ts(ba,{class:"fill-height",style:$a({opacity:i.loading?0:""}),cols:"12",ref:"container"},{default:X(()=>[tn("div",{style:$a({height:i.containerHeight+"px"}),ref:"content"},null,4),ee(PT,{modelValue:i.showMenu,"onUpdate:modelValue":n[9]||(n[9]=o=>i.showMenu=o),"close-on-content-click":!1,location:"bottom left",style:$a({position:"fixed",left:i.menuX+"px",top:i.menuY+"px"})},{default:X(()=>[i.hoverNode?(fi(),ts(CT,{key:0},{default:X(()=>[ee(es,{class:"ml-2 font-weight-bold"},{default:X(()=>[it(rr(i.hoverNode._name),1)]),_:1}),ee(xT),ee(Fu,{style:{"min-width":"300px",background:"transparent"},density:"compact",class:"pa-0 text-caption"},{default:X(()=>[ee(en,{density:"compact"},{append:X(()=>[tn("span",xve,rr(i.hoverNode.id),1)]),default:X(()=>[n[16]||(n[16]=it(" ID "))]),_:1,__:[16]}),ee(en,{density:"compact"},{append:X(()=>[tn("span",Rve,rr(i.hoverNode.productLabel+(i.hoverNode.productDescription?" ("+i.hoverNode.productDescription+")":"")),1)]),default:X(()=>[n[17]||(n[17]=it(" Product "))]),_:1,__:[17]}),ee(en,{density:"compact"},{append:X(()=>[tn("span",Ave,rr(i.hoverNode.minBatteryLevel?i.hoverNode.minBatteryLevel+"%":"MAIN"),1)]),default:X(()=>[n[18]||(n[18]=it(" Power "))]),_:1,__:[18]}),ee(en,{density:"compact"},{append:X(()=>[tn("span",Dve,rr(i.hoverNode.neighbors.join(", ")||"None"),1)]),default:X(()=>[n[19]||(n[19]=it(" Neighbors "))]),_:1,__:[19]})]),_:1})]),_:1})):RT("",!0)]),_:1},8,["modelValue","style"])]),_:1},8,["style"])),[[FT,a.onResize]])])])}const Lve=$T(kve,[["render",Mve]]);export{Lve as default};