@abi-software/map-utilities 1.7.8-beta.2 → 1.7.8-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- (function(Te,Ne){typeof exports=="object"&&typeof module<"u"?Ne(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],Ne):(Te=typeof globalThis<"u"?globalThis:Te||self,Ne(Te.MapUtilities={},Te["@element-plus/icons-vue"],Te.Vue))})(this,function(Te,Ne,s){"use strict";var gG=Object.defineProperty;var mG=(Te,Ne,s)=>Ne in Te?gG(Te,Ne,{enumerable:!0,configurable:!0,writable:!0,value:s}):Te[Ne]=s;var cr=(Te,Ne,s)=>mG(Te,typeof Ne!="symbol"?Ne+"":Ne,s);const Mr=(t,e,{checkForDefaultPrevented:r=!0}={})=>a=>{const i=t==null?void 0:t(a);if(r===!1||!i)return e==null?void 0:e(a)};var Ig;const nt=typeof window<"u",q_=t=>typeof t=="string",Bg=()=>{},_l=nt&&((Ig=window==null?void 0:window.navigator)==null?void 0:Ig.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Dg(t){return typeof t=="function"?t():s.unref(t)}function z_(t){return t}function Do(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function H_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function $r(t){var e;const r=Dg(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Po=nt?window:void 0;function Qt(...t){let e,r,n,a;if(q_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Po):[e,r,n,a]=t,!e)return Bg;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,h,v)=>(d.addEventListener(f,h,v),()=>d.removeEventListener(f,h,v)),c=s.watch(()=>[$r(e),Dg(a)],([d,f])=>{o(),d&&i.push(...r.flatMap(h=>n.map(v=>l(d,h,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Do(u),u}let Pg=!1;function Og(t,e,r={}){const{window:n=Po,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;_l&&!Pg&&(Pg=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",Bg)));let l=!0;const c=h=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(p=>p===h.target||h.composedPath().includes(p));{const p=$r(v);return p&&(h.target===p||h.composedPath().includes(p))}}),d=[Qt(n,"click",h=>{const v=$r(t);if(!(!v||v===h.target||h.composedPath().includes(v))){if(h.detail===0&&(l=!c(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:i}),Qt(n,"pointerdown",h=>{const v=$r(t);v&&(l=!h.composedPath().includes(v)&&!c(h))},{passive:!0}),o&&Qt(n,"blur",h=>{var v;const p=$r(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function Ag(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),H_(n,e),r}const Rg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Lg="__vueuse_ssr_handlers__";Rg[Lg]=Rg[Lg]||{};var Fg=Object.getOwnPropertySymbols,K_=Object.prototype.hasOwnProperty,G_=Object.prototype.propertyIsEnumerable,U_=(t,e)=>{var r={};for(var n in t)K_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Fg)for(var n of Fg(t))e.indexOf(n)<0&&G_.call(t,n)&&(r[n]=t[n]);return r};function Vr(t,e,r={}){const n=r,{window:a=Po}=n,i=U_(n,["window"]);let o;const l=Ag(()=>a&&"ResizeObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Do(d),{isSupported:l,stop:d}}var Mg=Object.getOwnPropertySymbols,j_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,Y_=(t,e)=>{var r={};for(var n in t)j_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Mg)for(var n of Mg(t))e.indexOf(n)<0&&W_.call(t,n)&&(r[n]=t[n]);return r};function Z_(t,e,r={}){const n=r,{window:a=Po}=n,i=Y_(n,["window"]);let o;const l=Ag(()=>a&&"MutationObserver"in a),c=()=>{o&&(o.disconnect(),o=void 0)},u=s.watch(()=>$r(t),f=>{c(),l.value&&a&&f&&(o=new MutationObserver(e),o.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return Do(d),{isSupported:l,stop:d}}var $g;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})($g||($g={}));var X_=Object.defineProperty,Vg=Object.getOwnPropertySymbols,J_=Object.prototype.hasOwnProperty,Q_=Object.prototype.propertyIsEnumerable,qg=(t,e,r)=>e in t?X_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eT=(t,e)=>{for(var r in e||(e={}))J_.call(e,r)&&qg(t,r,e[r]);if(Vg)for(var r of Vg(e))Q_.call(e,r)&&qg(t,r,e[r]);return t};eT({linear:z_},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const tT=()=>nt&&/firefox/i.test(window.navigator.userAgent),Tl=t=>{let e,r;return t.type==="touchend"?(r=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(r=t.touches[0].clientY,e=t.touches[0].clientX):(r=t.clientY,e=t.clientX),{clientX:e,clientY:r}};/**
1
+ (function(_e,xe){typeof exports=="object"&&typeof module<"u"?xe(exports,require("@element-plus/icons-vue"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue"],xe):(_e=typeof globalThis<"u"?globalThis:_e||self,xe(_e.MapUtilities={},_e["@element-plus/icons-vue"],_e.Vue))})(this,function(_e,xe,s){"use strict";var JG=Object.defineProperty;var QG=(_e,xe,s)=>xe in _e?JG(_e,xe,{enumerable:!0,configurable:!0,writable:!0,value:s}):_e[xe]=s;var ur=(_e,xe,s)=>QG(_e,typeof xe!="symbol"?xe+"":xe,s);const $r=(t,e,{checkForDefaultPrevented:r=!0}={})=>a=>{const i=t==null?void 0:t(a);if(r===!1||!i)return e==null?void 0:e(a)};var Dg;const at=typeof window<"u",K_=t=>typeof t=="string",Ag=()=>{},Nl=at&&((Dg=window==null?void 0:window.navigator)==null?void 0:Dg.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Og(t){return typeof t=="function"?t():s.unref(t)}function G_(t){return t}function Ao(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function U_(t,e=!0){s.getCurrentInstance()?s.onMounted(t):e?t():s.nextTick(t)}function Vr(t){var e;const r=Og(t);return(e=r==null?void 0:r.$el)!=null?e:r}const Oo=at?window:void 0;function Qt(...t){let e,r,n,a;if(K_(t[0])||Array.isArray(t[0])?([r,n,a]=t,e=Oo):[e,r,n,a]=t,!e)return Ag;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,h,v)=>(d.addEventListener(f,h,v),()=>d.removeEventListener(f,h,v)),u=s.watch(()=>[Vr(e),Og(a)],([d,f])=>{o(),d&&i.push(...r.flatMap(h=>n.map(v=>l(d,h,v,f))))},{immediate:!0,flush:"post"}),c=()=>{u(),o()};return Ao(c),c}let Pg=!1;function Rg(t,e,r={}){const{window:n=Oo,ignore:a=[],capture:i=!0,detectIframe:o=!1}=r;if(!n)return;Nl&&!Pg&&(Pg=!0,Array.from(n.document.body.children).forEach(h=>h.addEventListener("click",Ag)));let l=!0;const u=h=>a.some(v=>{if(typeof v=="string")return Array.from(n.document.querySelectorAll(v)).some(p=>p===h.target||h.composedPath().includes(p));{const p=Vr(v);return p&&(h.target===p||h.composedPath().includes(p))}}),d=[Qt(n,"click",h=>{const v=Vr(t);if(!(!v||v===h.target||h.composedPath().includes(v))){if(h.detail===0&&(l=!u(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:i}),Qt(n,"pointerdown",h=>{const v=Vr(t);v&&(l=!h.composedPath().includes(v)&&!u(h))},{passive:!0}),o&&Qt(n,"blur",h=>{var v;const p=Vr(t);((v=n.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function Lg(t,e=!1){const r=s.ref(),n=()=>r.value=!!t();return n(),U_(n,e),r}const Mg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fg="__vueuse_ssr_handlers__";Mg[Fg]=Mg[Fg]||{};var $g=Object.getOwnPropertySymbols,W_=Object.prototype.hasOwnProperty,j_=Object.prototype.propertyIsEnumerable,Y_=(t,e)=>{var r={};for(var n in t)W_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&$g)for(var n of $g(t))e.indexOf(n)<0&&j_.call(t,n)&&(r[n]=t[n]);return r};function qr(t,e,r={}){const n=r,{window:a=Oo}=n,i=Y_(n,["window"]);let o;const l=Lg(()=>a&&"ResizeObserver"in a),u=()=>{o&&(o.disconnect(),o=void 0)},c=s.watch(()=>Vr(t),f=>{u(),l.value&&a&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{u(),c()};return Ao(d),{isSupported:l,stop:d}}var Vg=Object.getOwnPropertySymbols,Z_=Object.prototype.hasOwnProperty,X_=Object.prototype.propertyIsEnumerable,J_=(t,e)=>{var r={};for(var n in t)Z_.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Vg)for(var n of Vg(t))e.indexOf(n)<0&&X_.call(t,n)&&(r[n]=t[n]);return r};function Q_(t,e,r={}){const n=r,{window:a=Oo}=n,i=J_(n,["window"]);let o;const l=Lg(()=>a&&"MutationObserver"in a),u=()=>{o&&(o.disconnect(),o=void 0)},c=s.watch(()=>Vr(t),f=>{u(),l.value&&a&&f&&(o=new MutationObserver(e),o.observe(f,i))},{immediate:!0}),d=()=>{u(),c()};return Ao(d),{isSupported:l,stop:d}}var qg;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(qg||(qg={}));var eT=Object.defineProperty,zg=Object.getOwnPropertySymbols,tT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,Hg=(t,e,r)=>e in t?eT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nT=(t,e)=>{for(var r in e||(e={}))tT.call(e,r)&&Hg(t,r,e[r]);if(zg)for(var r of zg(e))rT.call(e,r)&&Hg(t,r,e[r]);return t};nT({linear:G_},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const aT=()=>at&&/firefox/i.test(window.navigator.userAgent),Il=t=>{let e,r;return t.type==="touchend"?(r=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(r=t.touches[0].clientY,e=t.touches[0].clientX):(r=t.clientY,e=t.clientX),{clientX:e,clientY:r}};/**
2
2
  * @vue/shared v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ga=()=>{},rT=Object.prototype.hasOwnProperty,Ln=(t,e)=>rT.call(t,e),Et=Array.isArray,Mt=t=>typeof t=="function",ct=t=>typeof t=="string",yt=t=>t!==null&&typeof t=="object",nT=Object.prototype.toString,aT=t=>nT.call(t),Nl=t=>aT(t).slice(8,-1),zg=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},iT=/-(\w)/g,oT=zg(t=>t.replace(iT,(e,r)=>r?r.toUpperCase():"")),sT=/\B([A-Z])/g,lT=zg(t=>t.replace(sT,"-$1").toLowerCase());var Hg=typeof global=="object"&&global&&global.Object===Object&&global,uT=typeof self=="object"&&self&&self.Object===Object&&self,kr=Hg||uT||Function("return this")(),Sr=kr.Symbol,Kg=Object.prototype,cT=Kg.hasOwnProperty,dT=Kg.toString,gi=Sr?Sr.toStringTag:void 0;function fT(t){var e=cT.call(t,gi),r=t[gi];try{t[gi]=void 0;var n=!0}catch{}var a=dT.call(t);return n&&(e?t[gi]=r:delete t[gi]),a}var hT=Object.prototype,pT=hT.toString;function vT(t){return pT.call(t)}var gT="[object Null]",mT="[object Undefined]",Gg=Sr?Sr.toStringTag:void 0;function ma(t){return t==null?t===void 0?mT:gT:Gg&&Gg in Object(t)?fT(t):vT(t)}function ya(t){return t!=null&&typeof t=="object"}var yT="[object Symbol]";function Oo(t){return typeof t=="symbol"||ya(t)&&ma(t)==yT}function bT(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var dr=Array.isArray,wT=1/0,Ug=Sr?Sr.prototype:void 0,jg=Ug?Ug.toString:void 0;function Wg(t){if(typeof t=="string")return t;if(dr(t))return bT(t,Wg)+"";if(Oo(t))return jg?jg.call(t):"";var e=t+"";return e=="0"&&1/t==-wT?"-0":e}var CT=/\s/;function ET(t){for(var e=t.length;e--&&CT.test(t.charAt(e)););return e}var xT=/^\s+/;function kT(t){return t&&t.slice(0,ET(t)+1).replace(xT,"")}function on(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Yg=NaN,ST=/^[-+]0x[0-9a-f]+$/i,_T=/^0b[01]+$/i,TT=/^0o[0-7]+$/i,NT=parseInt;function Zg(t){if(typeof t=="number")return t;if(Oo(t))return Yg;if(on(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=on(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=kT(t);var r=_T.test(t);return r||TT.test(t)?NT(t.slice(2),r?2:8):ST.test(t)?Yg:+t}function Xg(t){return t}var IT="[object AsyncFunction]",BT="[object Function]",DT="[object GeneratorFunction]",PT="[object Proxy]";function Jg(t){if(!on(t))return!1;var e=ma(t);return e==BT||e==DT||e==IT||e==PT}var Il=kr["__core-js_shared__"],Qg=function(){var t=/[^.]+$/.exec(Il&&Il.keys&&Il.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function OT(t){return!!Qg&&Qg in t}var AT=Function.prototype,RT=AT.toString;function Fn(t){if(t!=null){try{return RT.call(t)}catch{}try{return t+""}catch{}}return""}var LT=/[\\^$.*+?()[\]{}|]/g,FT=/^\[object .+?Constructor\]$/,MT=Function.prototype,$T=Object.prototype,VT=MT.toString,qT=$T.hasOwnProperty,zT=RegExp("^"+VT.call(qT).replace(LT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HT(t){if(!on(t)||OT(t))return!1;var e=Jg(t)?zT:FT;return e.test(Fn(t))}function KT(t,e){return t==null?void 0:t[e]}function Mn(t,e){var r=KT(t,e);return HT(r)?r:void 0}var Bl=Mn(kr,"WeakMap");function GT(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var UT=800,jT=16,WT=Date.now;function YT(t){var e=0,r=0;return function(){var n=WT(),a=jT-(n-r);if(r=n,a>0){if(++e>=UT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ZT(t){return function(){return t}}var Ao=function(){try{var t=Mn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),XT=Ao?function(t,e){return Ao(t,"toString",{configurable:!0,enumerable:!1,value:ZT(e),writable:!0})}:Xg,JT=YT(XT);function QT(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var eN=9007199254740991,tN=/^(?:0|[1-9]\d*)$/;function Dl(t,e){var r=typeof t;return e=e??eN,!!e&&(r=="number"||r!="symbol"&&tN.test(t))&&t>-1&&t%1==0&&t<e}function rN(t,e,r){e=="__proto__"&&Ao?Ao(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Pl(t,e){return t===e||t!==t&&e!==e}var nN=Object.prototype,aN=nN.hasOwnProperty;function iN(t,e,r){var n=t[e];(!(aN.call(t,e)&&Pl(n,r))||r===void 0&&!(e in t))&&rN(t,e,r)}var em=Math.max;function oN(t,e,r){return e=em(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=em(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),GT(t,this,l)}}var sN=9007199254740991;function Ol(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sN}function lN(t){return t!=null&&Ol(t.length)&&!Jg(t)}var uN=Object.prototype;function cN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||uN;return t===r}function dN(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var fN="[object Arguments]";function tm(t){return ya(t)&&ma(t)==fN}var rm=Object.prototype,hN=rm.hasOwnProperty,pN=rm.propertyIsEnumerable,Al=tm(function(){return arguments}())?tm:function(t){return ya(t)&&hN.call(t,"callee")&&!pN.call(t,"callee")};function vN(){return!1}var nm=typeof Te=="object"&&Te&&!Te.nodeType&&Te,am=nm&&typeof module=="object"&&module&&!module.nodeType&&module,gN=am&&am.exports===nm,im=gN?kr.Buffer:void 0,mN=im?im.isBuffer:void 0,Rl=mN||vN,yN="[object Arguments]",bN="[object Array]",wN="[object Boolean]",CN="[object Date]",EN="[object Error]",xN="[object Function]",kN="[object Map]",SN="[object Number]",_N="[object Object]",TN="[object RegExp]",NN="[object Set]",IN="[object String]",BN="[object WeakMap]",DN="[object ArrayBuffer]",PN="[object DataView]",ON="[object Float32Array]",AN="[object Float64Array]",RN="[object Int8Array]",LN="[object Int16Array]",FN="[object Int32Array]",MN="[object Uint8Array]",$N="[object Uint8ClampedArray]",VN="[object Uint16Array]",qN="[object Uint32Array]",We={};We[ON]=We[AN]=We[RN]=We[LN]=We[FN]=We[MN]=We[$N]=We[VN]=We[qN]=!0,We[yN]=We[bN]=We[DN]=We[wN]=We[PN]=We[CN]=We[EN]=We[xN]=We[kN]=We[SN]=We[_N]=We[TN]=We[NN]=We[IN]=We[BN]=!1;function zN(t){return ya(t)&&Ol(t.length)&&!!We[ma(t)]}function HN(t){return function(e){return t(e)}}var om=typeof Te=="object"&&Te&&!Te.nodeType&&Te,mi=om&&typeof module=="object"&&module&&!module.nodeType&&module,KN=mi&&mi.exports===om,Ll=KN&&Hg.process,sm=function(){try{var t=mi&&mi.require&&mi.require("util").types;return t||Ll&&Ll.binding&&Ll.binding("util")}catch{}}(),lm=sm&&sm.isTypedArray,um=lm?HN(lm):zN,GN=Object.prototype,UN=GN.hasOwnProperty;function jN(t,e){var r=dr(t),n=!r&&Al(t),a=!r&&!n&&Rl(t),i=!r&&!n&&!a&&um(t),o=r||n||a||i,l=o?dN(t.length,String):[],c=l.length;for(var u in t)UN.call(t,u)&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Dl(u,c)))&&l.push(u);return l}function WN(t,e){return function(r){return t(e(r))}}var YN=WN(Object.keys,Object),ZN=Object.prototype,XN=ZN.hasOwnProperty;function JN(t){if(!cN(t))return YN(t);var e=[];for(var r in Object(t))XN.call(t,r)&&r!="constructor"&&e.push(r);return e}function cm(t){return lN(t)?jN(t):JN(t)}var QN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eI=/^\w*$/;function Fl(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Oo(t)?!0:eI.test(t)||!QN.test(t)||e!=null&&t in Object(e)}var yi=Mn(Object,"create");function tI(){this.__data__=yi?yi(null):{},this.size=0}function rI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nI="__lodash_hash_undefined__",aI=Object.prototype,iI=aI.hasOwnProperty;function oI(t){var e=this.__data__;if(yi){var r=e[t];return r===nI?void 0:r}return iI.call(e,t)?e[t]:void 0}var sI=Object.prototype,lI=sI.hasOwnProperty;function uI(t){var e=this.__data__;return yi?e[t]!==void 0:lI.call(e,t)}var cI="__lodash_hash_undefined__";function dI(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=yi&&e===void 0?cI:e,this}function $n(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}$n.prototype.clear=tI,$n.prototype.delete=rI,$n.prototype.get=oI,$n.prototype.has=uI,$n.prototype.set=dI;function fI(){this.__data__=[],this.size=0}function Ro(t,e){for(var r=t.length;r--;)if(Pl(t[r][0],e))return r;return-1}var hI=Array.prototype,pI=hI.splice;function vI(t){var e=this.__data__,r=Ro(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():pI.call(e,r,1),--this.size,!0}function gI(t){var e=this.__data__,r=Ro(e,t);return r<0?void 0:e[r][1]}function mI(t){return Ro(this.__data__,t)>-1}function yI(t,e){var r=this.__data__,n=Ro(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function qr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}qr.prototype.clear=fI,qr.prototype.delete=vI,qr.prototype.get=gI,qr.prototype.has=mI,qr.prototype.set=yI;var bi=Mn(kr,"Map");function bI(){this.size=0,this.__data__={hash:new $n,map:new(bi||qr),string:new $n}}function wI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Lo(t,e){var r=t.__data__;return wI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function CI(t){var e=Lo(this,t).delete(t);return this.size-=e?1:0,e}function EI(t){return Lo(this,t).get(t)}function xI(t){return Lo(this,t).has(t)}function kI(t,e){var r=Lo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function zr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}zr.prototype.clear=bI,zr.prototype.delete=CI,zr.prototype.get=EI,zr.prototype.has=xI,zr.prototype.set=kI;var SI="Expected a function";function Ml(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(SI);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Ml.Cache||zr),r}Ml.Cache=zr;var _I=500;function TI(t){var e=Ml(t,function(n){return r.size===_I&&r.clear(),n}),r=e.cache;return e}var NI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,II=/\\(\\)?/g,BI=TI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NI,function(r,n,a,i){e.push(a?i.replace(II,"$1"):n||r)}),e});function DI(t){return t==null?"":Wg(t)}function Fo(t,e){return dr(t)?t:Fl(t,e)?[t]:BI(DI(t))}var PI=1/0;function wi(t){if(typeof t=="string"||Oo(t))return t;var e=t+"";return e=="0"&&1/t==-PI?"-0":e}function $l(t,e){e=Fo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[wi(e[r++])];return r&&r==n?t:void 0}function Hr(t,e,r){var n=t==null?void 0:$l(t,e);return n===void 0?r:n}function dm(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var fm=Sr?Sr.isConcatSpreadable:void 0;function OI(t){return dr(t)||Al(t)||!!(fm&&t&&t[fm])}function AI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=OI),a||(a=[]);++i<o;){var l=t[i];r(l)?dm(a,l):a[a.length]=l}return a}function RI(t){var e=t==null?0:t.length;return e?AI(t):[]}function LI(t){return JT(oN(t,void 0,RI),t+"")}function sn(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function FI(){this.__data__=new qr,this.size=0}function MI(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function $I(t){return this.__data__.get(t)}function VI(t){return this.__data__.has(t)}var qI=200;function zI(t,e){var r=this.__data__;if(r instanceof qr){var n=r.__data__;if(!bi||n.length<qI-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new zr(n)}return r.set(t,e),this.size=r.size,this}function Kr(t){var e=this.__data__=new qr(t);this.size=e.size}Kr.prototype.clear=FI,Kr.prototype.delete=MI,Kr.prototype.get=$I,Kr.prototype.has=VI,Kr.prototype.set=zI;function HI(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i}function KI(){return[]}var GI=Object.prototype,UI=GI.propertyIsEnumerable,hm=Object.getOwnPropertySymbols,jI=hm?function(t){return t==null?[]:(t=Object(t),HI(hm(t),function(e){return UI.call(t,e)}))}:KI;function WI(t,e,r){var n=e(t);return dr(t)?n:dm(n,r(t))}function pm(t){return WI(t,cm,jI)}var Vl=Mn(kr,"DataView"),ql=Mn(kr,"Promise"),zl=Mn(kr,"Set"),vm="[object Map]",YI="[object Object]",gm="[object Promise]",mm="[object Set]",ym="[object WeakMap]",bm="[object DataView]",ZI=Fn(Vl),XI=Fn(bi),JI=Fn(ql),QI=Fn(zl),eB=Fn(Bl),ln=ma;(Vl&&ln(new Vl(new ArrayBuffer(1)))!=bm||bi&&ln(new bi)!=vm||ql&&ln(ql.resolve())!=gm||zl&&ln(new zl)!=mm||Bl&&ln(new Bl)!=ym)&&(ln=function(t){var e=ma(t),r=e==YI?t.constructor:void 0,n=r?Fn(r):"";if(n)switch(n){case ZI:return bm;case XI:return vm;case JI:return gm;case QI:return mm;case eB:return ym}return e});var wm=kr.Uint8Array,tB="__lodash_hash_undefined__";function rB(t){return this.__data__.set(t,tB),this}function nB(t){return this.__data__.has(t)}function Mo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new zr;++e<r;)this.add(t[e])}Mo.prototype.add=Mo.prototype.push=rB,Mo.prototype.has=nB;function aB(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function iB(t,e){return t.has(e)}var oB=1,sB=2;function Cm(t,e,r,n,a,i){var o=r&oB,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,h=!0,v=r&sB?new Mo:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var y=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(v){if(!aB(e,function(m,b){if(!iB(v,b)&&(p===m||a(p,m,r,n,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,r,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function lB(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function uB(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var cB=1,dB=2,fB="[object Boolean]",hB="[object Date]",pB="[object Error]",vB="[object Map]",gB="[object Number]",mB="[object RegExp]",yB="[object Set]",bB="[object String]",wB="[object Symbol]",CB="[object ArrayBuffer]",EB="[object DataView]",Em=Sr?Sr.prototype:void 0,Hl=Em?Em.valueOf:void 0;function xB(t,e,r,n,a,i,o){switch(r){case EB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case CB:return!(t.byteLength!=e.byteLength||!i(new wm(t),new wm(e)));case fB:case hB:case gB:return Pl(+t,+e);case pB:return t.name==e.name&&t.message==e.message;case mB:case bB:return t==e+"";case vB:var l=lB;case yB:var c=n&cB;if(l||(l=uB),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=dB,o.set(t,e);var d=Cm(l(t),l(e),n,a,i,o);return o.delete(t),d;case wB:if(Hl)return Hl.call(t)==Hl.call(e)}return!1}var kB=1,SB=Object.prototype,_B=SB.hasOwnProperty;function TB(t,e,r,n,a,i){var o=r&kB,l=pm(t),c=l.length,u=pm(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in e:_B.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=o;++f<c;){h=l[f];var m=t[h],b=e[h];if(n)var w=o?n(b,m,h,e,t,i):n(m,b,h,t,e,i);if(!(w===void 0?m===b||a(m,b,r,n,i):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var C=t.constructor,x=e.constructor;C!=x&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof x=="function"&&x instanceof x)&&(g=!1)}return i.delete(t),i.delete(e),g}var NB=1,xm="[object Arguments]",km="[object Array]",$o="[object Object]",IB=Object.prototype,Sm=IB.hasOwnProperty;function BB(t,e,r,n,a,i){var o=dr(t),l=dr(e),c=o?km:ln(t),u=l?km:ln(e);c=c==xm?$o:c,u=u==xm?$o:u;var d=c==$o,f=u==$o,h=c==u;if(h&&Rl(t)){if(!Rl(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Kr),o||um(t)?Cm(t,e,r,n,a,i):xB(t,e,c,r,n,a,i);if(!(r&NB)){var v=d&&Sm.call(t,"__wrapped__"),p=f&&Sm.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,y=p?e.value():e;return i||(i=new Kr),a(g,y,r,n,i)}}return h?(i||(i=new Kr),TB(t,e,r,n,a,i)):!1}function Vo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ya(t)&&!ya(e)?t!==t&&e!==e:BB(t,e,r,n,Vo,a)}var DB=1,PB=2;function OB(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var o=r[a];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<i;){o=r[a];var l=o[0],c=t[l],u=o[1];if(o[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Kr,f;if(!(f===void 0?Vo(u,c,DB|PB,n,d):f))return!1}}return!0}function _m(t){return t===t&&!on(t)}function AB(t){for(var e=cm(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,_m(a)]}return e}function Tm(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function RB(t){var e=AB(t);return e.length==1&&e[0][2]?Tm(e[0][0],e[0][1]):function(r){return r===t||OB(r,t,e)}}function LB(t,e){return t!=null&&e in Object(t)}function FB(t,e,r){e=Fo(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=wi(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Ol(a)&&Dl(o,a)&&(dr(t)||Al(t)))}function Nm(t,e){return t!=null&&FB(t,e,LB)}var MB=1,$B=2;function VB(t,e){return Fl(t)&&_m(e)?Tm(wi(t),e):function(r){var n=Hr(r,t);return n===void 0&&n===e?Nm(r,t):Vo(e,n,MB|$B)}}function qB(t){return function(e){return e==null?void 0:e[t]}}function zB(t){return function(e){return $l(e,t)}}function HB(t){return Fl(t)?qB(wi(t)):zB(t)}function KB(t){return typeof t=="function"?t:t==null?Xg:typeof t=="object"?dr(t)?VB(t[0],t[1]):RB(t):HB(t)}var Kl=function(){return kr.Date.now()},GB="Expected a function",UB=Math.max,jB=Math.min;function Gl(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(GB);e=Zg(e)||0,on(r)&&(d=!!r.leading,f="maxWait"in r,i=f?UB(Zg(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?jB(S,i-_):S}function y(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Kl();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Kl())}function x(){var k=Kl(),E=y(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}function WB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return QT(t,KB(e),a)}function qo(t){for(var e=-1,r=t==null?0:t.length,n={};++e<r;){var a=t[e];n[a[0]]=a[1]}return n}function zo(t,e){return Vo(t,e)}function un(t){return t==null}function YB(t){return t===void 0}function ZB(t,e,r,n){if(!on(t))return t;e=Fo(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=wi(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=void 0,u===void 0&&(u=on(d)?d:Dl(e[a+1])?[]:{})}iN(l,c,u),l=l[c]}return t}function XB(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=$l(t,o);r(l,o)&&ZB(i,Fo(o,t),l)}return i}function JB(t,e){return XB(t,e,function(r,n){return Nm(t,n)})}var Im=LI(function(t,e){return t==null?{}:JB(t,e)});const cn=t=>t===void 0,ba=t=>typeof t=="boolean",xt=t=>typeof t=="number",Vn=t=>typeof Element>"u"?!1:t instanceof Element,Ho=t=>un(t),QB=t=>ct(t)?!Number.isNaN(Number(t)):!1,eD=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Bm=t=>Object.keys(t);class Dm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Pm(t,e){throw new Dm(`[${t}] ${e}`)}function at(t,e){if(process.env.NODE_ENV!=="production"){const r=ct(t)?new Dm(`[${t}] ${e}`):t;console.warn(r)}}const tD="utils/dom/style",Om=(t="")=>t.split(" ").filter(e=>!!e.trim()),Ul=(t,e)=>{!t||!e.trim()||t.classList.add(...Om(e))},qn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Om(e))},Ci=(t,e)=>{var r;if(!nt||!t||!e)return"";let n=oT(e);n==="float"&&(n="cssFloat");try{const a=t.style[n];if(a)return a;const i=(r=document.defaultView)==null?void 0:r.getComputedStyle(t,"");return i?i[n]:""}catch{return t.style[n]}};function wa(t,e="px"){if(!t)return"";if(xt(t)||QB(t))return`${t}${e}`;if(ct(t))return t;at(tD,"binding value must be a string or number")}function rD(t,e){if(!nt)return;if(!e){t.scrollTop=0;return}const r=[];let n=e.offsetParent;for(;n!==null&&t!==n&&t.contains(n);)r.push(n),n=n.offsetParent;const a=e.offsetTop+r.reduce((c,u)=>c+u.offsetTop,0),i=a+e.offsetHeight,o=t.scrollTop,l=o+t.clientHeight;a<o?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}const Am="__epPropKey",ke=t=>t,nD=t=>yt(t)&&!!t[Am],Ko=(t,e)=>{if(!yt(t)||nD(t))return t;const{values:r,required:n,default:a,type:i,validator:o}=t,c={type:i,required:!!n,validator:r||o?u=>{let d=!1,f=[];if(r&&(f=Array.from(r),Ln(t,"default")&&f.push(a),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");s.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Am]:!0};return Ln(t,"default")&&(c.default=a),c},Me=t=>qo(Object.entries(t).map(([e,r])=>[e,Ko(r,e)])),dn=ke([String,Object,Function]),Rm={validating:Ne.Loading,success:Ne.CircleCheck,error:Ne.CircleClose},dt=(t,e)=>{if(t.install=r=>{for(const n of[t,...Object.values(e??{})])r.component(n.name,n)},e)for(const[r,n]of Object.entries(e))t[r]=n;return t},aD=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Gr=t=>(t.install=ga,t),ft={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},et="update:modelValue",Ei="change",jl="input",Lm=["","default","small","large"],iD=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),Ca=t=>t,oD=["class","style"],sD=/^on[A-Z]/,Fm=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(oD)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return qo(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&sD.test(o))))}):(at("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Go=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&at(r,`[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ma=()=>{},iT=Object.prototype.hasOwnProperty,Mn=(t,e)=>iT.call(t,e),Et=Array.isArray,$t=t=>typeof t=="function",ut=t=>typeof t=="string",yt=t=>t!==null&&typeof t=="object",oT=Object.prototype.toString,sT=t=>oT.call(t),Bl=t=>sT(t).slice(8,-1),Kg=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},lT=/-(\w)/g,cT=Kg(t=>t.replace(lT,(e,r)=>r?r.toUpperCase():"")),uT=/\B([A-Z])/g,dT=Kg(t=>t.replace(uT,"-$1").toLowerCase());var Gg=typeof global=="object"&&global&&global.Object===Object&&global,fT=typeof self=="object"&&self&&self.Object===Object&&self,kr=Gg||fT||Function("return this")(),Sr=kr.Symbol,Ug=Object.prototype,hT=Ug.hasOwnProperty,pT=Ug.toString,gi=Sr?Sr.toStringTag:void 0;function vT(t){var e=hT.call(t,gi),r=t[gi];try{t[gi]=void 0;var n=!0}catch{}var a=pT.call(t);return n&&(e?t[gi]=r:delete t[gi]),a}var gT=Object.prototype,mT=gT.toString;function yT(t){return mT.call(t)}var bT="[object Null]",wT="[object Undefined]",Wg=Sr?Sr.toStringTag:void 0;function ya(t){return t==null?t===void 0?wT:bT:Wg&&Wg in Object(t)?vT(t):yT(t)}function ba(t){return t!=null&&typeof t=="object"}var CT="[object Symbol]";function Po(t){return typeof t=="symbol"||ba(t)&&ya(t)==CT}function ET(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var dr=Array.isArray,xT=1/0,jg=Sr?Sr.prototype:void 0,Yg=jg?jg.toString:void 0;function Zg(t){if(typeof t=="string")return t;if(dr(t))return ET(t,Zg)+"";if(Po(t))return Yg?Yg.call(t):"";var e=t+"";return e=="0"&&1/t==-xT?"-0":e}var kT=/\s/;function ST(t){for(var e=t.length;e--&&kT.test(t.charAt(e)););return e}var _T=/^\s+/;function TT(t){return t&&t.slice(0,ST(t)+1).replace(_T,"")}function on(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Xg=NaN,NT=/^[-+]0x[0-9a-f]+$/i,IT=/^0b[01]+$/i,BT=/^0o[0-7]+$/i,DT=parseInt;function Jg(t){if(typeof t=="number")return t;if(Po(t))return Xg;if(on(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=on(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=TT(t);var r=IT.test(t);return r||BT.test(t)?DT(t.slice(2),r?2:8):NT.test(t)?Xg:+t}function Qg(t){return t}var AT="[object AsyncFunction]",OT="[object Function]",PT="[object GeneratorFunction]",RT="[object Proxy]";function em(t){if(!on(t))return!1;var e=ya(t);return e==OT||e==PT||e==AT||e==RT}var Dl=kr["__core-js_shared__"],tm=function(){var t=/[^.]+$/.exec(Dl&&Dl.keys&&Dl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function LT(t){return!!tm&&tm in t}var MT=Function.prototype,FT=MT.toString;function Fn(t){if(t!=null){try{return FT.call(t)}catch{}try{return t+""}catch{}}return""}var $T=/[\\^$.*+?()[\]{}|]/g,VT=/^\[object .+?Constructor\]$/,qT=Function.prototype,zT=Object.prototype,HT=qT.toString,KT=zT.hasOwnProperty,GT=RegExp("^"+HT.call(KT).replace($T,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UT(t){if(!on(t)||LT(t))return!1;var e=em(t)?GT:VT;return e.test(Fn(t))}function WT(t,e){return t==null?void 0:t[e]}function $n(t,e){var r=WT(t,e);return UT(r)?r:void 0}var Al=$n(kr,"WeakMap");function jT(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var YT=800,ZT=16,XT=Date.now;function JT(t){var e=0,r=0;return function(){var n=XT(),a=ZT-(n-r);if(r=n,a>0){if(++e>=YT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function QT(t){return function(){return t}}var Ro=function(){try{var t=$n(Object,"defineProperty");return t({},"",{}),t}catch{}}(),eN=Ro?function(t,e){return Ro(t,"toString",{configurable:!0,enumerable:!1,value:QT(e),writable:!0})}:Qg,tN=JT(eN);function rN(t,e,r,n){t.length;for(var a=r+1;a--;)if(e(t[a],a,t))return a;return-1}var nN=9007199254740991,aN=/^(?:0|[1-9]\d*)$/;function Ol(t,e){var r=typeof t;return e=e??nN,!!e&&(r=="number"||r!="symbol"&&aN.test(t))&&t>-1&&t%1==0&&t<e}function iN(t,e,r){e=="__proto__"&&Ro?Ro(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Pl(t,e){return t===e||t!==t&&e!==e}var oN=Object.prototype,sN=oN.hasOwnProperty;function lN(t,e,r){var n=t[e];(!(sN.call(t,e)&&Pl(n,r))||r===void 0&&!(e in t))&&iN(t,e,r)}var rm=Math.max;function cN(t,e,r){return e=rm(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=rm(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),jT(t,this,l)}}var uN=9007199254740991;function Rl(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=uN}function dN(t){return t!=null&&Rl(t.length)&&!em(t)}var fN=Object.prototype;function hN(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||fN;return t===r}function pN(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var vN="[object Arguments]";function nm(t){return ba(t)&&ya(t)==vN}var am=Object.prototype,gN=am.hasOwnProperty,mN=am.propertyIsEnumerable,Ll=nm(function(){return arguments}())?nm:function(t){return ba(t)&&gN.call(t,"callee")&&!mN.call(t,"callee")};function yN(){return!1}var im=typeof _e=="object"&&_e&&!_e.nodeType&&_e,om=im&&typeof module=="object"&&module&&!module.nodeType&&module,bN=om&&om.exports===im,sm=bN?kr.Buffer:void 0,wN=sm?sm.isBuffer:void 0,Ml=wN||yN,CN="[object Arguments]",EN="[object Array]",xN="[object Boolean]",kN="[object Date]",SN="[object Error]",_N="[object Function]",TN="[object Map]",NN="[object Number]",IN="[object Object]",BN="[object RegExp]",DN="[object Set]",AN="[object String]",ON="[object WeakMap]",PN="[object ArrayBuffer]",RN="[object DataView]",LN="[object Float32Array]",MN="[object Float64Array]",FN="[object Int8Array]",$N="[object Int16Array]",VN="[object Int32Array]",qN="[object Uint8Array]",zN="[object Uint8ClampedArray]",HN="[object Uint16Array]",KN="[object Uint32Array]",je={};je[LN]=je[MN]=je[FN]=je[$N]=je[VN]=je[qN]=je[zN]=je[HN]=je[KN]=!0,je[CN]=je[EN]=je[PN]=je[xN]=je[RN]=je[kN]=je[SN]=je[_N]=je[TN]=je[NN]=je[IN]=je[BN]=je[DN]=je[AN]=je[ON]=!1;function GN(t){return ba(t)&&Rl(t.length)&&!!je[ya(t)]}function UN(t){return function(e){return t(e)}}var lm=typeof _e=="object"&&_e&&!_e.nodeType&&_e,mi=lm&&typeof module=="object"&&module&&!module.nodeType&&module,WN=mi&&mi.exports===lm,Fl=WN&&Gg.process,cm=function(){try{var t=mi&&mi.require&&mi.require("util").types;return t||Fl&&Fl.binding&&Fl.binding("util")}catch{}}(),um=cm&&cm.isTypedArray,dm=um?UN(um):GN,jN=Object.prototype,YN=jN.hasOwnProperty;function ZN(t,e){var r=dr(t),n=!r&&Ll(t),a=!r&&!n&&Ml(t),i=!r&&!n&&!a&&dm(t),o=r||n||a||i,l=o?pN(t.length,String):[],u=l.length;for(var c in t)YN.call(t,c)&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ol(c,u)))&&l.push(c);return l}function XN(t,e){return function(r){return t(e(r))}}var JN=XN(Object.keys,Object),QN=Object.prototype,eI=QN.hasOwnProperty;function tI(t){if(!hN(t))return JN(t);var e=[];for(var r in Object(t))eI.call(t,r)&&r!="constructor"&&e.push(r);return e}function fm(t){return dN(t)?ZN(t):tI(t)}var rI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nI=/^\w*$/;function $l(t,e){if(dr(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Po(t)?!0:nI.test(t)||!rI.test(t)||e!=null&&t in Object(e)}var yi=$n(Object,"create");function aI(){this.__data__=yi?yi(null):{},this.size=0}function iI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var oI="__lodash_hash_undefined__",sI=Object.prototype,lI=sI.hasOwnProperty;function cI(t){var e=this.__data__;if(yi){var r=e[t];return r===oI?void 0:r}return lI.call(e,t)?e[t]:void 0}var uI=Object.prototype,dI=uI.hasOwnProperty;function fI(t){var e=this.__data__;return yi?e[t]!==void 0:dI.call(e,t)}var hI="__lodash_hash_undefined__";function pI(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=yi&&e===void 0?hI:e,this}function Vn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Vn.prototype.clear=aI,Vn.prototype.delete=iI,Vn.prototype.get=cI,Vn.prototype.has=fI,Vn.prototype.set=pI;function vI(){this.__data__=[],this.size=0}function Lo(t,e){for(var r=t.length;r--;)if(Pl(t[r][0],e))return r;return-1}var gI=Array.prototype,mI=gI.splice;function yI(t){var e=this.__data__,r=Lo(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():mI.call(e,r,1),--this.size,!0}function bI(t){var e=this.__data__,r=Lo(e,t);return r<0?void 0:e[r][1]}function wI(t){return Lo(this.__data__,t)>-1}function CI(t,e){var r=this.__data__,n=Lo(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function zr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}zr.prototype.clear=vI,zr.prototype.delete=yI,zr.prototype.get=bI,zr.prototype.has=wI,zr.prototype.set=CI;var bi=$n(kr,"Map");function EI(){this.size=0,this.__data__={hash:new Vn,map:new(bi||zr),string:new Vn}}function xI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Mo(t,e){var r=t.__data__;return xI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function kI(t){var e=Mo(this,t).delete(t);return this.size-=e?1:0,e}function SI(t){return Mo(this,t).get(t)}function _I(t){return Mo(this,t).has(t)}function TI(t,e){var r=Mo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Hr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Hr.prototype.clear=EI,Hr.prototype.delete=kI,Hr.prototype.get=SI,Hr.prototype.has=_I,Hr.prototype.set=TI;var NI="Expected a function";function Vl(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(NI);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Vl.Cache||Hr),r}Vl.Cache=Hr;var II=500;function BI(t){var e=Vl(t,function(n){return r.size===II&&r.clear(),n}),r=e.cache;return e}var DI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AI=/\\(\\)?/g,OI=BI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(DI,function(r,n,a,i){e.push(a?i.replace(AI,"$1"):n||r)}),e});function PI(t){return t==null?"":Zg(t)}function Fo(t,e){return dr(t)?t:$l(t,e)?[t]:OI(PI(t))}var RI=1/0;function wi(t){if(typeof t=="string"||Po(t))return t;var e=t+"";return e=="0"&&1/t==-RI?"-0":e}function ql(t,e){e=Fo(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[wi(e[r++])];return r&&r==n?t:void 0}function Kr(t,e,r){var n=t==null?void 0:ql(t,e);return n===void 0?r:n}function hm(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var pm=Sr?Sr.isConcatSpreadable:void 0;function LI(t){return dr(t)||Ll(t)||!!(pm&&t&&t[pm])}function MI(t,e,r,n,a){var i=-1,o=t.length;for(r||(r=LI),a||(a=[]);++i<o;){var l=t[i];r(l)?hm(a,l):a[a.length]=l}return a}function FI(t){var e=t==null?0:t.length;return e?MI(t):[]}function $I(t){return tN(cN(t,void 0,FI),t+"")}function sn(){if(!arguments.length)return[];var t=arguments[0];return dr(t)?t:[t]}function VI(){this.__data__=new zr,this.size=0}function qI(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function zI(t){return this.__data__.get(t)}function HI(t){return this.__data__.has(t)}var KI=200;function GI(t,e){var r=this.__data__;if(r instanceof zr){var n=r.__data__;if(!bi||n.length<KI-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Hr(n)}return r.set(t,e),this.size=r.size,this}function Gr(t){var e=this.__data__=new zr(t);this.size=e.size}Gr.prototype.clear=VI,Gr.prototype.delete=qI,Gr.prototype.get=zI,Gr.prototype.has=HI,Gr.prototype.set=GI;function UI(t,e){for(var r=-1,n=t==null?0:t.length,a=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[a++]=o)}return i}function WI(){return[]}var jI=Object.prototype,YI=jI.propertyIsEnumerable,vm=Object.getOwnPropertySymbols,ZI=vm?function(t){return t==null?[]:(t=Object(t),UI(vm(t),function(e){return YI.call(t,e)}))}:WI;function XI(t,e,r){var n=e(t);return dr(t)?n:hm(n,r(t))}function gm(t){return XI(t,fm,ZI)}var zl=$n(kr,"DataView"),Hl=$n(kr,"Promise"),Kl=$n(kr,"Set"),mm="[object Map]",JI="[object Object]",ym="[object Promise]",bm="[object Set]",wm="[object WeakMap]",Cm="[object DataView]",QI=Fn(zl),eB=Fn(bi),tB=Fn(Hl),rB=Fn(Kl),nB=Fn(Al),ln=ya;(zl&&ln(new zl(new ArrayBuffer(1)))!=Cm||bi&&ln(new bi)!=mm||Hl&&ln(Hl.resolve())!=ym||Kl&&ln(new Kl)!=bm||Al&&ln(new Al)!=wm)&&(ln=function(t){var e=ya(t),r=e==JI?t.constructor:void 0,n=r?Fn(r):"";if(n)switch(n){case QI:return Cm;case eB:return mm;case tB:return ym;case rB:return bm;case nB:return wm}return e});var Em=kr.Uint8Array,aB="__lodash_hash_undefined__";function iB(t){return this.__data__.set(t,aB),this}function oB(t){return this.__data__.has(t)}function $o(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Hr;++e<r;)this.add(t[e])}$o.prototype.add=$o.prototype.push=iB,$o.prototype.has=oB;function sB(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function lB(t,e){return t.has(e)}var cB=1,uB=2;function xm(t,e,r,n,a,i){var o=r&cB,l=t.length,u=e.length;if(l!=u&&!(o&&u>l))return!1;var c=i.get(t),d=i.get(e);if(c&&d)return c==e&&d==t;var f=-1,h=!0,v=r&uB?new $o:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var p=t[f],g=e[f];if(n)var y=o?n(g,p,f,e,t,i):n(p,g,f,t,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(v){if(!sB(e,function(m,b){if(!lB(v,b)&&(p===m||a(p,m,r,n,i)))return v.push(b)})){h=!1;break}}else if(!(p===g||a(p,g,r,n,i))){h=!1;break}}return i.delete(t),i.delete(e),h}function dB(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}function fB(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var hB=1,pB=2,vB="[object Boolean]",gB="[object Date]",mB="[object Error]",yB="[object Map]",bB="[object Number]",wB="[object RegExp]",CB="[object Set]",EB="[object String]",xB="[object Symbol]",kB="[object ArrayBuffer]",SB="[object DataView]",km=Sr?Sr.prototype:void 0,Gl=km?km.valueOf:void 0;function _B(t,e,r,n,a,i,o){switch(r){case SB:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case kB:return!(t.byteLength!=e.byteLength||!i(new Em(t),new Em(e)));case vB:case gB:case bB:return Pl(+t,+e);case mB:return t.name==e.name&&t.message==e.message;case wB:case EB:return t==e+"";case yB:var l=dB;case CB:var u=n&hB;if(l||(l=fB),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;n|=pB,o.set(t,e);var d=xm(l(t),l(e),n,a,i,o);return o.delete(t),d;case xB:if(Gl)return Gl.call(t)==Gl.call(e)}return!1}var TB=1,NB=Object.prototype,IB=NB.hasOwnProperty;function BB(t,e,r,n,a,i){var o=r&TB,l=gm(t),u=l.length,c=gm(e),d=c.length;if(u!=d&&!o)return!1;for(var f=u;f--;){var h=l[f];if(!(o?h in e:IB.call(e,h)))return!1}var v=i.get(t),p=i.get(e);if(v&&p)return v==e&&p==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=o;++f<u;){h=l[f];var m=t[h],b=e[h];if(n)var w=o?n(b,m,h,e,t,i):n(m,b,h,t,e,i);if(!(w===void 0?m===b||a(m,b,r,n,i):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var C=t.constructor,x=e.constructor;C!=x&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof x=="function"&&x instanceof x)&&(g=!1)}return i.delete(t),i.delete(e),g}var DB=1,Sm="[object Arguments]",_m="[object Array]",Vo="[object Object]",AB=Object.prototype,Tm=AB.hasOwnProperty;function OB(t,e,r,n,a,i){var o=dr(t),l=dr(e),u=o?_m:ln(t),c=l?_m:ln(e);u=u==Sm?Vo:u,c=c==Sm?Vo:c;var d=u==Vo,f=c==Vo,h=u==c;if(h&&Ml(t)){if(!Ml(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new Gr),o||dm(t)?xm(t,e,r,n,a,i):_B(t,e,u,r,n,a,i);if(!(r&DB)){var v=d&&Tm.call(t,"__wrapped__"),p=f&&Tm.call(e,"__wrapped__");if(v||p){var g=v?t.value():t,y=p?e.value():e;return i||(i=new Gr),a(g,y,r,n,i)}}return h?(i||(i=new Gr),BB(t,e,r,n,a,i)):!1}function qo(t,e,r,n,a){return t===e?!0:t==null||e==null||!ba(t)&&!ba(e)?t!==t&&e!==e:OB(t,e,r,n,qo,a)}var PB=1,RB=2;function LB(t,e,r,n){var a=r.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var o=r[a];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<i;){o=r[a];var l=o[0],u=t[l],c=o[1];if(o[2]){if(u===void 0&&!(l in t))return!1}else{var d=new Gr,f;if(!(f===void 0?qo(c,u,PB|RB,n,d):f))return!1}}return!0}function Nm(t){return t===t&&!on(t)}function MB(t){for(var e=fm(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Nm(a)]}return e}function Im(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function FB(t){var e=MB(t);return e.length==1&&e[0][2]?Im(e[0][0],e[0][1]):function(r){return r===t||LB(r,t,e)}}function $B(t,e){return t!=null&&e in Object(t)}function VB(t,e,r){e=Fo(e,t);for(var n=-1,a=e.length,i=!1;++n<a;){var o=wi(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=a?i:(a=t==null?0:t.length,!!a&&Rl(a)&&Ol(o,a)&&(dr(t)||Ll(t)))}function Bm(t,e){return t!=null&&VB(t,e,$B)}var qB=1,zB=2;function HB(t,e){return $l(t)&&Nm(e)?Im(wi(t),e):function(r){var n=Kr(r,t);return n===void 0&&n===e?Bm(r,t):qo(e,n,qB|zB)}}function KB(t){return function(e){return e==null?void 0:e[t]}}function GB(t){return function(e){return ql(e,t)}}function UB(t){return $l(t)?KB(wi(t)):GB(t)}function WB(t){return typeof t=="function"?t:t==null?Qg:typeof t=="object"?dr(t)?HB(t[0],t[1]):FB(t):UB(t)}var Ul=function(){return kr.Date.now()},jB="Expected a function",YB=Math.max,ZB=Math.min;function Wl(t,e,r){var n,a,i,o,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(jB);e=Jg(e)||0,on(r)&&(d=!!r.leading,f="maxWait"in r,i=f?YB(Jg(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,c=k,o=t.apply(_,E),o}function p(k){return c=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-u,_=k-c,S=e-E;return f?ZB(S,i-_):S}function y(k){var E=k-u,_=k-c;return u===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Ul();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),c=0,n=u=a=l=void 0}function C(){return l===void 0?o:b(Ul())}function x(){var k=Ul(),E=y(k);if(n=arguments,a=this,u=k,E){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}function XB(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var a=n-1;return rN(t,WB(e),a)}function zo(t){for(var e=-1,r=t==null?0:t.length,n={};++e<r;){var a=t[e];n[a[0]]=a[1]}return n}function Ho(t,e){return qo(t,e)}function cn(t){return t==null}function JB(t){return t===void 0}function QB(t,e,r,n){if(!on(t))return t;e=Fo(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var u=wi(e[a]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=o){var d=l[u];c=void 0,c===void 0&&(c=on(d)?d:Ol(e[a+1])?[]:{})}lN(l,u,c),l=l[u]}return t}function eD(t,e,r){for(var n=-1,a=e.length,i={};++n<a;){var o=e[n],l=ql(t,o);r(l,o)&&QB(i,Fo(o,t),l)}return i}function tD(t,e){return eD(t,e,function(r,n){return Bm(t,n)})}var Dm=$I(function(t,e){return t==null?{}:tD(t,e)});const un=t=>t===void 0,wa=t=>typeof t=="boolean",xt=t=>typeof t=="number",qn=t=>typeof Element>"u"?!1:t instanceof Element,Ko=t=>cn(t),rD=t=>ut(t)?!Number.isNaN(Number(t)):!1,nD=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Am=t=>Object.keys(t);class Om extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Pm(t,e){throw new Om(`[${t}] ${e}`)}function it(t,e){if(process.env.NODE_ENV!=="production"){const r=ut(t)?new Om(`[${t}] ${e}`):t;console.warn(r)}}const aD="utils/dom/style",Rm=(t="")=>t.split(" ").filter(e=>!!e.trim()),jl=(t,e)=>{!t||!e.trim()||t.classList.add(...Rm(e))},zn=(t,e)=>{!t||!e.trim()||t.classList.remove(...Rm(e))},Ci=(t,e)=>{var r;if(!at||!t||!e)return"";let n=cT(e);n==="float"&&(n="cssFloat");try{const a=t.style[n];if(a)return a;const i=(r=document.defaultView)==null?void 0:r.getComputedStyle(t,"");return i?i[n]:""}catch{return t.style[n]}};function Ca(t,e="px"){if(!t)return"";if(xt(t)||rD(t))return`${t}${e}`;if(ut(t))return t;it(aD,"binding value must be a string or number")}function iD(t,e){if(!at)return;if(!e){t.scrollTop=0;return}const r=[];let n=e.offsetParent;for(;n!==null&&t!==n&&t.contains(n);)r.push(n),n=n.offsetParent;const a=e.offsetTop+r.reduce((u,c)=>u+c.offsetTop,0),i=a+e.offsetHeight,o=t.scrollTop,l=o+t.clientHeight;a<o?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}const Lm="__epPropKey",Se=t=>t,oD=t=>yt(t)&&!!t[Lm],Go=(t,e)=>{if(!yt(t)||oD(t))return t;const{values:r,required:n,default:a,type:i,validator:o}=t,u={type:i,required:!!n,validator:r||o?c=>{let d=!1,f=[];if(r&&(f=Array.from(r),Mn(t,"default")&&f.push(a),d||(d=f.includes(c))),o&&(d||(d=o(c))),!d&&f.length>0){const h=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");s.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return d}:void 0,[Lm]:!0};return Mn(t,"default")&&(u.default=a),u},Fe=t=>zo(Object.entries(t).map(([e,r])=>[e,Go(r,e)])),dn=Se([String,Object,Function]),Mm={validating:xe.Loading,success:xe.CircleCheck,error:xe.CircleClose},dt=(t,e)=>{if(t.install=r=>{for(const n of[t,...Object.values(e??{})])r.component(n.name,n)},e)for(const[r,n]of Object.entries(e))t[r]=n;return t},sD=(t,e)=>(t.install=r=>{r.directive(e,t)},t),Ur=t=>(t.install=ma,t),ft={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},tt="update:modelValue",Ei="change",Yl="input",Fm=["","default","small","large"],lD=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),Ea=t=>t,cD=["class","style"],uD=/^on[A-Z]/,$m=(t={})=>{const{excludeListeners:e=!1,excludeKeys:r}=t,n=s.computed(()=>((r==null?void 0:r.value)||[]).concat(cD)),a=s.getCurrentInstance();return a?s.computed(()=>{var i;return zo(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(e&&uD.test(o))))}):(it("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),s.computed(()=>({})))},Uo=({from:t,replacement:e,scope:r,version:n,ref:a,type:i="API"},o)=>{s.watch(()=>s.unref(o),l=>{l&&it(r,`[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
6
6
  For more detail, please visit: ${a}
7
- `)},{immediate:!0})};var lD={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const uD=t=>(e,r)=>cD(e,r,s.unref(t)),cD=(t,e,r)=>Hr(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),dD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:uD(t)}},Mm=Symbol("localeContextKey"),xi=t=>{const e=t||s.inject(Mm,s.ref());return dD(s.computed(()=>e.value||lD))},Uo="el",fD="is-",zn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},$m=Symbol("namespaceContextKey"),Wl=t=>{const e=t||(s.getCurrentInstance()?s.inject($m,s.ref(Uo)):s.ref(Uo));return s.computed(()=>s.unref(e)||Uo)},De=(t,e)=>{const r=Wl(e);return{namespace:r,b:(g="")=>zn(r.value,t,g,"",""),e:g=>g?zn(r.value,t,"",g,""):"",m:g=>g?zn(r.value,t,"","",g):"",be:(g,y)=>g&&y?zn(r.value,t,g,y,""):"",em:(g,y)=>g&&y?zn(r.value,t,"",g,y):"",bm:(g,y)=>g&&y?zn(r.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?zn(r.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${fD}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},hD=Ko({type:ke(Boolean),default:null}),pD=Ko({type:ke(Function)}),vD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:hD,[r]:pD};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=s.getCurrentInstance(),{emit:v}=h,p=h.props,g=s.computed(()=>Mt(p[r])),y=s.computed(()=>p[t]===null),m=E=>{o.value!==!0&&(o.value=!0,l&&(l.value=E),Mt(d)&&d(E))},b=E=>{o.value!==!1&&(o.value=!1,l&&(l.value=E),Mt(f)&&f(E))},w=E=>{if(p.disabled===!0||Mt(u)&&!u())return;const _=g.value&&nt;_&&v(e,!0),(y.value||!_)&&m(E)},C=E=>{if(p.disabled===!0||!nt)return;const _=g.value&&nt;_&&v(e,!1),(y.value||!_)&&b(E)},x=E=>{ba(E)&&(p.disabled&&E?g.value&&v(e,!1):o.value!==E&&(E?m():b()))},k=()=>{o.value?C():w()};return s.watch(()=>p[t],x),c&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&C()}),s.onMounted(()=>{x(p[t])}),{hide:C,show:w,toggle:k,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},Vm=t=>{const e=s.getCurrentInstance();return s.computed(()=>{var r,n;return(n=(r=e==null?void 0:e.proxy)==null?void 0:r.$props)==null?void 0:n[t]})};var qt="top",er="bottom",tr="right",zt="left",Yl="auto",ki=[qt,er,tr,zt],Ea="start",Si="end",gD="clippingParents",qm="viewport",_i="popper",mD="reference",zm=ki.reduce(function(t,e){return t.concat([e+"-"+Ea,e+"-"+Si])},[]),jo=[].concat(ki,[Yl]).reduce(function(t,e){return t.concat([e,e+"-"+Ea,e+"-"+Si])},[]),yD="beforeRead",bD="read",wD="afterRead",CD="beforeMain",ED="main",xD="afterMain",kD="beforeWrite",SD="write",_D="afterWrite",TD=[yD,bD,wD,CD,ED,xD,kD,SD,_D];function _r(t){return t?(t.nodeName||"").toLowerCase():null}function fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function xa(t){var e=fr(t).Element;return t instanceof e||t instanceof Element}function rr(t){var e=fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Zl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ND(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},a=e.attributes[r]||{},i=e.elements[r];!rr(i)||!_r(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var l=a[o];l===!1?i.removeAttribute(o):i.setAttribute(o,l===!0?"":l)}))})}function ID(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var a=e.elements[n],i=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=o.reduce(function(c,u){return c[u]="",c},{});!rr(a)||!_r(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var Hm={name:"applyStyles",enabled:!0,phase:"write",fn:ND,effect:ID,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var Hn=Math.max,Wo=Math.min,ka=Math.round;function Sa(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(rr(t)&&e){var i=t.offsetHeight,o=t.offsetWidth;o>0&&(n=ka(r.width)/o||1),i>0&&(a=ka(r.height)/i||1)}return{width:r.width/n,height:r.height/a,top:r.top/a,right:r.right/n,bottom:r.bottom/a,left:r.left/n,x:r.left/n,y:r.top/a}}function Xl(t){var e=Sa(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Km(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Zl(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ur(t){return fr(t).getComputedStyle(t)}function BD(t){return["table","td","th"].indexOf(_r(t))>=0}function fn(t){return((xa(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Zl(t)?t.host:null)||fn(t)}function Gm(t){return!rr(t)||Ur(t).position==="fixed"?null:t.offsetParent}function DD(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&rr(t)){var n=Ur(t);if(n.position==="fixed")return null}var a=Yo(t);for(Zl(a)&&(a=a.host);rr(a)&&["html","body"].indexOf(_r(a))<0;){var i=Ur(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ti(t){for(var e=fr(t),r=Gm(t);r&&BD(r)&&Ur(r).position==="static";)r=Gm(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Ur(r).position==="static")?e:r||DD(t)||e}function Jl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ni(t,e,r){return Hn(t,Wo(e,r))}function PD(t,e,r){var n=Ni(t,e,r);return n>r?r:n}function Um(){return{top:0,right:0,bottom:0,left:0}}function jm(t){return Object.assign({},Um(),t)}function Wm(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var OD=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,jm(typeof t!="number"?t:Wm(t,ki))};function AD(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,l=Tr(r.placement),c=Jl(l),u=[zt,tr].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!o)){var f=OD(a.padding,r),h=Xl(i),v=c==="y"?qt:zt,p=c==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[c]-o[c]-r.rects.popper[d],y=o[c]-r.rects.reference[c],m=Ti(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],x=b-h[d]-f[p],k=b/2-h[d]/2+w,E=Ni(C,k,x),_=c;r.modifiersData[n]=(e={},e[_]=E,e.centerOffset=E-k,e)}}function RD(t){var e=t.state,r=t.options,n=r.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!Km(e.elements.popper,a)||(e.elements.arrow=a))}var LD={name:"arrow",enabled:!0,phase:"main",fn:AD,effect:RD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _a(t){return t.split("-")[1]}var FD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MD(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:ka(e*a)/a||0,y:ka(r*a)/a||0}}function Ym(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,o=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=o.x,v=h===void 0?0:h,p=o.y,g=p===void 0?0:p,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=zt,C=qt,x=window;if(u){var k=Ti(r),E="clientHeight",_="clientWidth";if(k===fr(r)&&(k=fn(r),Ur(k).position!=="static"&&l==="absolute"&&(E="scrollHeight",_="scrollWidth")),k=k,a===qt||(a===zt||a===tr)&&i===Si){C=er;var S=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];g-=S-n.height,g*=c?1:-1}if(a===zt||(a===qt||a===er)&&i===Si){w=tr;var T=f&&k===x&&x.visualViewport?x.visualViewport.width:k[_];v-=T-n.width,v*=c?1:-1}}var N=Object.assign({position:l},u&&FD),B=d===!0?MD({x:v,y:g}):{x:v,y:g};if(v=B.x,g=B.y,c){var P;return Object.assign({},N,(P={},P[C]=b?"0":"",P[w]=m?"0":"",P.transform=(x.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",P))}return Object.assign({},N,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function $D(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,o=i===void 0?!0:i,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:Tr(e.placement),variation:_a(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ym(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ym(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Zm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$D,data:{}},Zo={passive:!0};function VD(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,l=o===void 0?!0:o,c=fr(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",r.update,Zo)}),l&&c.addEventListener("resize",r.update,Zo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",r.update,Zo)}),l&&c.removeEventListener("resize",r.update,Zo)}}var Xm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VD,data:{}},qD={left:"right",right:"left",bottom:"top",top:"bottom"};function Xo(t){return t.replace(/left|right|bottom|top/g,function(e){return qD[e]})}var zD={start:"end",end:"start"};function Jm(t){return t.replace(/start|end/g,function(e){return zD[e]})}function Ql(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function eu(t){return Sa(fn(t)).left+Ql(t).scrollLeft}function HD(t){var e=fr(t),r=fn(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,o=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:o+eu(t),y:l}}function KD(t){var e,r=fn(t),n=Ql(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Hn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Hn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+eu(t),c=-n.scrollTop;return Ur(a||r).direction==="rtl"&&(l+=Hn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:c}}function tu(t){var e=Ur(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function Qm(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&tu(t)?t:Qm(Yo(t))}function Ii(t,e){var r;e===void 0&&(e=[]);var n=Qm(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],tu(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(Ii(Yo(o)))}function ru(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function GD(t){var e=Sa(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ey(t,e){return e===qm?ru(HD(t)):xa(e)?GD(e):ru(KD(fn(t)))}function UD(t){var e=Ii(Yo(t)),r=["absolute","fixed"].indexOf(Ur(t).position)>=0,n=r&&rr(t)?Ti(t):t;return xa(n)?e.filter(function(a){return xa(a)&&Km(a,n)&&_r(a)!=="body"}):[]}function jD(t,e,r){var n=e==="clippingParents"?UD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,c){var u=ey(t,c);return l.top=Hn(u.top,l.top),l.right=Wo(u.right,l.right),l.bottom=Wo(u.bottom,l.bottom),l.left=Hn(u.left,l.left),l},ey(t,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ty(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?_a(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,c;switch(a){case qt:c={x:o,y:e.y-r.height};break;case er:c={x:o,y:e.y+e.height};break;case tr:c={x:e.x+e.width,y:l};break;case zt:c={x:e.x-r.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?Jl(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ea:c[u]=c[u]-(e[d]/2-r[d]/2);break;case Si:c[u]=c[u]+(e[d]/2-r[d]/2);break}}return c}function Bi(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,o=i===void 0?gD:i,l=r.rootBoundary,c=l===void 0?qm:l,u=r.elementContext,d=u===void 0?_i:u,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=jm(typeof p!="number"?p:Wm(p,ki)),y=d===_i?mD:_i,m=t.rects.popper,b=t.elements[h?y:d],w=jD(xa(b)?b:b.contextElement||fn(t.elements.popper),o,c),C=Sa(t.elements.reference),x=ty({reference:C,element:m,strategy:"absolute",placement:a}),k=ru(Object.assign({},m,x)),E=d===_i?k:C,_={top:w.top-E.top+g.top,bottom:E.bottom-w.bottom+g.bottom,left:w.left-E.left+g.left,right:E.right-w.right+g.right},S=t.modifiersData.offset;if(d===_i&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,P=[qt,er].indexOf(N)>=0?"y":"x";_[N]+=T[P]*B})}return _}function WD(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,o=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?jo:c,d=_a(n),f=d?l?zm:zm.filter(function(p){return _a(p)===d}):ki,h=f.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=Bi(t,{placement:g,boundary:a,rootBoundary:i,padding:o})[Tr(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function YD(t){if(Tr(t)===Yl)return[];var e=Xo(t);return[Jm(t),e,Jm(e)]}function ZD(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,d=r.boundary,f=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,p=v===void 0?!0:v,g=r.allowedAutoPlacements,y=e.options.placement,m=Tr(y),b=m===y,w=c||(b||!p?[Xo(y)]:YD(y)),C=[y].concat(w).reduce(function(M,V){return M.concat(Tr(V)===Yl?WD(e,{placement:V,boundary:d,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):V)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,_=!0,S=C[0],T=0;T<C.length;T++){var N=C[T],B=Tr(N),P=_a(N)===Ea,D=[qt,er].indexOf(B)>=0,R=D?"width":"height",O=Bi(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),F=D?P?tr:zt:P?er:qt;x[R]>k[R]&&(F=Xo(F));var A=Xo(F),z=[];if(i&&z.push(O[B]<=0),l&&z.push(O[F]<=0,O[A]<=0),z.every(function(M){return M})){S=N,_=!1;break}E.set(N,z)}if(_)for(var j=p?3:1,H=function(M){var V=C.find(function(q){var $=E.get(q);if($)return $.slice(0,M).every(function(K){return K})});if(V)return S=V,"break"},G=j;G>0;G--){var X=H(G);if(X==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var XD={name:"flip",enabled:!0,phase:"main",fn:ZD,requiresIfExists:["offset"],data:{_skip:!1}};function ry(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function ny(t){return[qt,tr,er,zt].some(function(e){return t[e]>=0})}function JD(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Bi(e,{elementContext:"reference"}),l=Bi(e,{altBoundary:!0}),c=ry(o,n),u=ry(l,a,i),d=ny(c),f=ny(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var QD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:JD};function eP(t,e,r){var n=Tr(t),a=[zt,qt].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=i[0],l=i[1];return o=o||0,l=(l||0)*a,[zt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function tP(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=jo.reduce(function(d,f){return d[f]=eP(f,e.rects,i),d},{}),l=o[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}var rP={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tP};function nP(t){var e=t.state,r=t.name;e.modifiersData[r]=ty({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ay={name:"popperOffsets",enabled:!0,phase:"read",fn:nP,data:{}};function aP(t){return t==="x"?"y":"x"}function iP(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,f=r.padding,h=r.tether,v=h===void 0?!0:h,p=r.tetherOffset,g=p===void 0?0:p,y=Bi(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=Tr(e.placement),b=_a(e.placement),w=!b,C=Jl(m),x=aP(C),k=e.modifiersData.popperOffsets,E=e.rects.reference,_=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,T=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var P,D=C==="y"?qt:zt,R=C==="y"?er:tr,O=C==="y"?"height":"width",F=k[C],A=F+y[D],z=F-y[R],j=v?-_[O]/2:0,H=b===Ea?E[O]:_[O],G=b===Ea?-_[O]:-E[O],X=e.elements.arrow,M=v&&X?Xl(X):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Um(),q=V[D],$=V[R],K=Ni(0,E[O],M[O]),L=w?E[O]/2-j-K-q-T.mainAxis:H-K-q-T.mainAxis,W=w?-E[O]/2+j+K+$+T.mainAxis:G+K+$+T.mainAxis,Y=e.elements.arrow&&Ti(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ue=(P=N==null?void 0:N[C])!=null?P:0,ae=F+L-ue-se,ne=F+W-ue,ce=Ni(v?Wo(A,ae):A,F,v?Hn(z,ne):z);k[C]=ce,B[C]=ce-F}if(l){var ie,fe=C==="x"?qt:zt,pe=C==="x"?er:tr,Pe=k[x],Ie=x==="y"?"height":"width",we=Pe+y[fe],xe=Pe-y[pe],re=[qt,zt].indexOf(m)!==-1,I=(ie=N==null?void 0:N[x])!=null?ie:0,U=re?we:Pe-E[Ie]-_[Ie]-I+T.altAxis,te=re?Pe+E[Ie]+_[Ie]-I-T.altAxis:xe,Z=v&&re?PD(U,Pe,te):Ni(v?U:we,Pe,v?te:xe);k[x]=Z,B[x]=Z-Pe}e.modifiersData[n]=B}}var oP={name:"preventOverflow",enabled:!0,phase:"main",fn:iP,requiresIfExists:["offset"]};function sP(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lP(t){return t===fr(t)||!rr(t)?Ql(t):sP(t)}function uP(t){var e=t.getBoundingClientRect(),r=ka(e.width)/t.offsetWidth||1,n=ka(e.height)/t.offsetHeight||1;return r!==1||n!==1}function cP(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&uP(e),i=fn(e),o=Sa(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||tu(i))&&(l=lP(e)),rr(e)?(c=Sa(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=eu(i))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function dP(t){var e=new Map,r=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function a(i){r.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(l){if(!r.has(l)){var c=e.get(l);c&&a(c)}}),n.push(i)}return t.forEach(function(i){r.has(i.name)||a(i)}),n}function fP(t){var e=dP(t);return TD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function hP(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function pP(t){var e=t.reduce(function(r,n){var a=r[n.name];return r[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var iy={placement:"bottom",modifiers:[],strategy:"absolute"};function oy(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function nu(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?iy:a;return function(o,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},iy,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;p(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:xa(o)?Ii(o):o.contextElement?Ii(o.contextElement):[],popper:Ii(l)};var m=fP(pP([].concat(n,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(oy(y,m)){u.rects={reference:cP(y,Ti(m),u.options.strategy==="fixed"),popper:Xl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(_){return u.modifiersData[_.name]=Object.assign({},_.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],C=w.fn,x=w.options,k=x===void 0?{}:x,E=w.name;typeof C=="function"&&(u=C({state:u,options:k,name:E,instance:h})||u)}}}},update:hP(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){p(),f=!0}};if(!oy(o,l))return h;h.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:y,instance:h,options:b}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}nu();var vP=[Xm,ay,Zm,Hm];nu({defaultModifiers:vP});var gP=[Xm,ay,Zm,Hm,rP,XD,oP,LD,QD],mP=nu({defaultModifiers:gP});const yP=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=bP(c);Object.assign(o.value,u)},requires:["computeStyles"]},a=s.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=s.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{name:"applyStyles",enabled:!1}]}}),i=s.shallowRef(),o=s.ref({styles:{popper:{position:s.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return s.watch(a,c=>{const u=s.unref(i);u&&u.setOptions(c)},{deep:!0}),s.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=mP(c,u,s.unref(a)))}),s.onBeforeUnmount(()=>{l()}),{state:s.computed(()=>{var c;return{...((c=s.unref(i))==null?void 0:c.state)||{}}}),styles:s.computed(()=>s.unref(o).styles),attributes:s.computed(()=>s.unref(o).attributes),update:()=>{var c;return(c=s.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=s.unref(i))==null?void 0:c.forceUpdate()},instanceRef:s.computed(()=>s.unref(i))}};function bP(t){const e=Object.keys(t.elements),r=qo(e.map(a=>[a,t.styles[a]||{}])),n=qo(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function sy(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Do(()=>r()),{registerTimeout:e,cancelTimeout:r}}const au={prefix:Math.floor(Math.random()*1e4),current:0},wP=Symbol("elIdInjection"),ly=()=>s.getCurrentInstance()?s.inject(wP,au):au,Di=t=>{const e=ly();!nt&&e===au&&at("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
7
+ `)},{immediate:!0})};var dD={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const fD=t=>(e,r)=>hD(e,r,s.unref(t)),hD=(t,e,r)=>Kr(r,t,t).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),pD=t=>{const e=s.computed(()=>s.unref(t).name),r=s.isRef(t)?t:s.ref(t);return{lang:e,locale:r,t:fD(t)}},Vm=Symbol("localeContextKey"),xi=t=>{const e=t||s.inject(Vm,s.ref());return pD(s.computed(()=>e.value||dD))},Wo="el",vD="is-",Hn=(t,e,r,n,a)=>{let i=`${t}-${e}`;return r&&(i+=`-${r}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},qm=Symbol("namespaceContextKey"),Zl=t=>{const e=t||(s.getCurrentInstance()?s.inject(qm,s.ref(Wo)):s.ref(Wo));return s.computed(()=>s.unref(e)||Wo)},De=(t,e)=>{const r=Zl(e);return{namespace:r,b:(g="")=>Hn(r.value,t,g,"",""),e:g=>g?Hn(r.value,t,"",g,""):"",m:g=>g?Hn(r.value,t,"","",g):"",be:(g,y)=>g&&y?Hn(r.value,t,g,y,""):"",em:(g,y)=>g&&y?Hn(r.value,t,"",g,y):"",bm:(g,y)=>g&&y?Hn(r.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Hn(r.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${vD}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${r.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${r.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${r.value}-${t}-${g}`}},gD=Go({type:Se(Boolean),default:null}),mD=Go({type:Se(Function)}),yD=t=>{const e=`update:${t}`,r=`onUpdate:${t}`,n=[e],a={[t]:gD,[r]:mD};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:d,onHide:f})=>{const h=s.getCurrentInstance(),{emit:v}=h,p=h.props,g=s.computed(()=>$t(p[r])),y=s.computed(()=>p[t]===null),m=E=>{o.value!==!0&&(o.value=!0,l&&(l.value=E),$t(d)&&d(E))},b=E=>{o.value!==!1&&(o.value=!1,l&&(l.value=E),$t(f)&&f(E))},w=E=>{if(p.disabled===!0||$t(c)&&!c())return;const _=g.value&&at;_&&v(e,!0),(y.value||!_)&&m(E)},C=E=>{if(p.disabled===!0||!at)return;const _=g.value&&at;_&&v(e,!1),(y.value||!_)&&b(E)},x=E=>{wa(E)&&(p.disabled&&E?g.value&&v(e,!1):o.value!==E&&(E?m():b()))},k=()=>{o.value?C():w()};return s.watch(()=>p[t],x),u&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{u.value&&o.value&&C()}),s.onMounted(()=>{x(p[t])}),{hide:C,show:w,toggle:k,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:n}},zm=t=>{const e=s.getCurrentInstance();return s.computed(()=>{var r,n;return(n=(r=e==null?void 0:e.proxy)==null?void 0:r.$props)==null?void 0:n[t]})};var Ht="top",er="bottom",tr="right",Kt="left",Xl="auto",ki=[Ht,er,tr,Kt],xa="start",Si="end",bD="clippingParents",Hm="viewport",_i="popper",wD="reference",Km=ki.reduce(function(t,e){return t.concat([e+"-"+xa,e+"-"+Si])},[]),jo=[].concat(ki,[Xl]).reduce(function(t,e){return t.concat([e,e+"-"+xa,e+"-"+Si])},[]),CD="beforeRead",ED="read",xD="afterRead",kD="beforeMain",SD="main",_D="afterMain",TD="beforeWrite",ND="write",ID="afterWrite",BD=[CD,ED,xD,kD,SD,_D,TD,ND,ID];function _r(t){return t?(t.nodeName||"").toLowerCase():null}function fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ka(t){var e=fr(t).Element;return t instanceof e||t instanceof Element}function rr(t){var e=fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Jl(t){if(typeof ShadowRoot>"u")return!1;var e=fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function DD(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},a=e.attributes[r]||{},i=e.elements[r];!rr(i)||!_r(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var l=a[o];l===!1?i.removeAttribute(o):i.setAttribute(o,l===!0?"":l)}))})}function AD(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var a=e.elements[n],i=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),l=o.reduce(function(u,c){return u[c]="",u},{});!rr(a)||!_r(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(u){a.removeAttribute(u)}))})}}var Gm={name:"applyStyles",enabled:!0,phase:"write",fn:DD,effect:AD,requires:["computeStyles"]};function Tr(t){return t.split("-")[0]}var Kn=Math.max,Yo=Math.min,Sa=Math.round;function _a(t,e){e===void 0&&(e=!1);var r=t.getBoundingClientRect(),n=1,a=1;if(rr(t)&&e){var i=t.offsetHeight,o=t.offsetWidth;o>0&&(n=Sa(r.width)/o||1),i>0&&(a=Sa(r.height)/i||1)}return{width:r.width/n,height:r.height/a,top:r.top/a,right:r.right/n,bottom:r.bottom/a,left:r.left/n,x:r.left/n,y:r.top/a}}function Ql(t){var e=_a(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Um(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Jl(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Wr(t){return fr(t).getComputedStyle(t)}function OD(t){return["table","td","th"].indexOf(_r(t))>=0}function fn(t){return((ka(t)?t.ownerDocument:t.document)||window.document).documentElement}function Zo(t){return _r(t)==="html"?t:t.assignedSlot||t.parentNode||(Jl(t)?t.host:null)||fn(t)}function Wm(t){return!rr(t)||Wr(t).position==="fixed"?null:t.offsetParent}function PD(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&rr(t)){var n=Wr(t);if(n.position==="fixed")return null}var a=Zo(t);for(Jl(a)&&(a=a.host);rr(a)&&["html","body"].indexOf(_r(a))<0;){var i=Wr(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ti(t){for(var e=fr(t),r=Wm(t);r&&OD(r)&&Wr(r).position==="static";)r=Wm(r);return r&&(_r(r)==="html"||_r(r)==="body"&&Wr(r).position==="static")?e:r||PD(t)||e}function ec(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ni(t,e,r){return Kn(t,Yo(e,r))}function RD(t,e,r){var n=Ni(t,e,r);return n>r?r:n}function jm(){return{top:0,right:0,bottom:0,left:0}}function Ym(t){return Object.assign({},jm(),t)}function Zm(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var LD=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Ym(typeof t!="number"?t:Zm(t,ki))};function MD(t){var e,r=t.state,n=t.name,a=t.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,l=Tr(r.placement),u=ec(l),c=[Kt,tr].indexOf(l)>=0,d=c?"height":"width";if(!(!i||!o)){var f=LD(a.padding,r),h=Ql(i),v=u==="y"?Ht:Kt,p=u==="y"?er:tr,g=r.rects.reference[d]+r.rects.reference[u]-o[u]-r.rects.popper[d],y=o[u]-r.rects.reference[u],m=Ti(i),b=m?u==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],x=b-h[d]-f[p],k=b/2-h[d]/2+w,E=Ni(C,k,x),_=u;r.modifiersData[n]=(e={},e[_]=E,e.centerOffset=E-k,e)}}function FD(t){var e=t.state,r=t.options,n=r.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!Um(e.elements.popper,a)||(e.elements.arrow=a))}var $D={name:"arrow",enabled:!0,phase:"main",fn:MD,effect:FD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ta(t){return t.split("-")[1]}var VD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qD(t){var e=t.x,r=t.y,n=window,a=n.devicePixelRatio||1;return{x:Sa(e*a)/a||0,y:Sa(r*a)/a||0}}function Xm(t){var e,r=t.popper,n=t.popperRect,a=t.placement,i=t.variation,o=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=o.x,v=h===void 0?0:h,p=o.y,g=p===void 0?0:p,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),w=Kt,C=Ht,x=window;if(c){var k=Ti(r),E="clientHeight",_="clientWidth";if(k===fr(r)&&(k=fn(r),Wr(k).position!=="static"&&l==="absolute"&&(E="scrollHeight",_="scrollWidth")),k=k,a===Ht||(a===Kt||a===tr)&&i===Si){C=er;var S=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];g-=S-n.height,g*=u?1:-1}if(a===Kt||(a===Ht||a===er)&&i===Si){w=tr;var T=f&&k===x&&x.visualViewport?x.visualViewport.width:k[_];v-=T-n.width,v*=u?1:-1}}var N=Object.assign({position:l},c&&VD),B=d===!0?qD({x:v,y:g}):{x:v,y:g};if(v=B.x,g=B.y,u){var A;return Object.assign({},N,(A={},A[C]=b?"0":"",A[w]=m?"0":"",A.transform=(x.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",A))}return Object.assign({},N,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function zD(t){var e=t.state,r=t.options,n=r.gpuAcceleration,a=n===void 0?!0:n,i=r.adaptive,o=i===void 0?!0:i,l=r.roundOffsets,u=l===void 0?!0:l,c={placement:Tr(e.placement),variation:Ta(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Xm(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xm(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Jm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:zD,data:{}},Xo={passive:!0};function HD(t){var e=t.state,r=t.instance,n=t.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,l=o===void 0?!0:o,u=fr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",r.update,Xo)}),l&&u.addEventListener("resize",r.update,Xo),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",r.update,Xo)}),l&&u.removeEventListener("resize",r.update,Xo)}}var Qm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HD,data:{}},KD={left:"right",right:"left",bottom:"top",top:"bottom"};function Jo(t){return t.replace(/left|right|bottom|top/g,function(e){return KD[e]})}var GD={start:"end",end:"start"};function ey(t){return t.replace(/start|end/g,function(e){return GD[e]})}function tc(t){var e=fr(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function rc(t){return _a(fn(t)).left+tc(t).scrollLeft}function UD(t){var e=fr(t),r=fn(t),n=e.visualViewport,a=r.clientWidth,i=r.clientHeight,o=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:o+rc(t),y:l}}function WD(t){var e,r=fn(t),n=tc(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Kn(r.scrollWidth,r.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Kn(r.scrollHeight,r.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+rc(t),u=-n.scrollTop;return Wr(a||r).direction==="rtl"&&(l+=Kn(r.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:u}}function nc(t){var e=Wr(t),r=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+a+n)}function ty(t){return["html","body","#document"].indexOf(_r(t))>=0?t.ownerDocument.body:rr(t)&&nc(t)?t:ty(Zo(t))}function Ii(t,e){var r;e===void 0&&(e=[]);var n=ty(t),a=n===((r=t.ownerDocument)==null?void 0:r.body),i=fr(n),o=a?[i].concat(i.visualViewport||[],nc(n)?n:[]):n,l=e.concat(o);return a?l:l.concat(Ii(Zo(o)))}function ac(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function jD(t){var e=_a(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ry(t,e){return e===Hm?ac(UD(t)):ka(e)?jD(e):ac(WD(fn(t)))}function YD(t){var e=Ii(Zo(t)),r=["absolute","fixed"].indexOf(Wr(t).position)>=0,n=r&&rr(t)?Ti(t):t;return ka(n)?e.filter(function(a){return ka(a)&&Um(a,n)&&_r(a)!=="body"}):[]}function ZD(t,e,r){var n=e==="clippingParents"?YD(t):[].concat(e),a=[].concat(n,[r]),i=a[0],o=a.reduce(function(l,u){var c=ry(t,u);return l.top=Kn(c.top,l.top),l.right=Yo(c.right,l.right),l.bottom=Yo(c.bottom,l.bottom),l.left=Kn(c.left,l.left),l},ry(t,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ny(t){var e=t.reference,r=t.element,n=t.placement,a=n?Tr(n):null,i=n?Ta(n):null,o=e.x+e.width/2-r.width/2,l=e.y+e.height/2-r.height/2,u;switch(a){case Ht:u={x:o,y:e.y-r.height};break;case er:u={x:o,y:e.y+e.height};break;case tr:u={x:e.x+e.width,y:l};break;case Kt:u={x:e.x-r.width,y:l};break;default:u={x:e.x,y:e.y}}var c=a?ec(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case xa:u[c]=u[c]-(e[d]/2-r[d]/2);break;case Si:u[c]=u[c]+(e[d]/2-r[d]/2);break}}return u}function Bi(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=n===void 0?t.placement:n,i=r.boundary,o=i===void 0?bD:i,l=r.rootBoundary,u=l===void 0?Hm:l,c=r.elementContext,d=c===void 0?_i:c,f=r.altBoundary,h=f===void 0?!1:f,v=r.padding,p=v===void 0?0:v,g=Ym(typeof p!="number"?p:Zm(p,ki)),y=d===_i?wD:_i,m=t.rects.popper,b=t.elements[h?y:d],w=ZD(ka(b)?b:b.contextElement||fn(t.elements.popper),o,u),C=_a(t.elements.reference),x=ny({reference:C,element:m,strategy:"absolute",placement:a}),k=ac(Object.assign({},m,x)),E=d===_i?k:C,_={top:w.top-E.top+g.top,bottom:E.bottom-w.bottom+g.bottom,left:w.left-E.left+g.left,right:E.right-w.right+g.right},S=t.modifiersData.offset;if(d===_i&&S){var T=S[a];Object.keys(_).forEach(function(N){var B=[tr,er].indexOf(N)>=0?1:-1,A=[Ht,er].indexOf(N)>=0?"y":"x";_[N]+=T[A]*B})}return _}function XD(t,e){e===void 0&&(e={});var r=e,n=r.placement,a=r.boundary,i=r.rootBoundary,o=r.padding,l=r.flipVariations,u=r.allowedAutoPlacements,c=u===void 0?jo:u,d=Ta(n),f=d?l?Km:Km.filter(function(p){return Ta(p)===d}):ki,h=f.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=f);var v=h.reduce(function(p,g){return p[g]=Bi(t,{placement:g,boundary:a,rootBoundary:i,padding:o})[Tr(g)],p},{});return Object.keys(v).sort(function(p,g){return v[p]-v[g]})}function JD(t){if(Tr(t)===Xl)return[];var e=Jo(t);return[ey(t),e,ey(e)]}function QD(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!0:o,u=r.fallbackPlacements,c=r.padding,d=r.boundary,f=r.rootBoundary,h=r.altBoundary,v=r.flipVariations,p=v===void 0?!0:v,g=r.allowedAutoPlacements,y=e.options.placement,m=Tr(y),b=m===y,w=u||(b||!p?[Jo(y)]:JD(y)),C=[y].concat(w).reduce(function(F,V){return F.concat(Tr(V)===Xl?XD(e,{placement:V,boundary:d,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):V)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,_=!0,S=C[0],T=0;T<C.length;T++){var N=C[T],B=Tr(N),A=Ta(N)===xa,D=[Ht,er].indexOf(B)>=0,R=D?"width":"height",O=Bi(e,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:c}),M=D?A?tr:Kt:A?er:Ht;x[R]>k[R]&&(M=Jo(M));var P=Jo(M),z=[];if(i&&z.push(O[B]<=0),l&&z.push(O[M]<=0,O[P]<=0),z.every(function(F){return F})){S=N,_=!1;break}E.set(N,z)}if(_)for(var W=p?3:1,H=function(F){var V=C.find(function(q){var $=E.get(q);if($)return $.slice(0,F).every(function(K){return K})});if(V)return S=V,"break"},G=W;G>0;G--){var X=H(G);if(X==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}var eA={name:"flip",enabled:!0,phase:"main",fn:QD,requiresIfExists:["offset"],data:{_skip:!1}};function ay(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function iy(t){return[Ht,tr,er,Kt].some(function(e){return t[e]>=0})}function tA(t){var e=t.state,r=t.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=Bi(e,{elementContext:"reference"}),l=Bi(e,{altBoundary:!0}),u=ay(o,n),c=ay(l,a,i),d=iy(u),f=iy(c);e.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var rA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:tA};function nA(t,e,r){var n=Tr(t),a=[Kt,Ht].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=i[0],l=i[1];return o=o||0,l=(l||0)*a,[Kt,tr].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function aA(t){var e=t.state,r=t.options,n=t.name,a=r.offset,i=a===void 0?[0,0]:a,o=jo.reduce(function(d,f){return d[f]=nA(f,e.rects,i),d},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}var iA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aA};function oA(t){var e=t.state,r=t.name;e.modifiersData[r]=ny({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var oy={name:"popperOffsets",enabled:!0,phase:"read",fn:oA,data:{}};function sA(t){return t==="x"?"y":"x"}function lA(t){var e=t.state,r=t.options,n=t.name,a=r.mainAxis,i=a===void 0?!0:a,o=r.altAxis,l=o===void 0?!1:o,u=r.boundary,c=r.rootBoundary,d=r.altBoundary,f=r.padding,h=r.tether,v=h===void 0?!0:h,p=r.tetherOffset,g=p===void 0?0:p,y=Bi(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),m=Tr(e.placement),b=Ta(e.placement),w=!b,C=ec(m),x=sA(C),k=e.modifiersData.popperOffsets,E=e.rects.reference,_=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,T=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(k){if(i){var A,D=C==="y"?Ht:Kt,R=C==="y"?er:tr,O=C==="y"?"height":"width",M=k[C],P=M+y[D],z=M-y[R],W=v?-_[O]/2:0,H=b===xa?E[O]:_[O],G=b===xa?-_[O]:-E[O],X=e.elements.arrow,F=v&&X?Ql(X):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:jm(),q=V[D],$=V[R],K=Ni(0,E[O],F[O]),L=w?E[O]/2-W-K-q-T.mainAxis:H-K-q-T.mainAxis,j=w?-E[O]/2+W+K+$+T.mainAxis:G+K+$+T.mainAxis,Y=e.elements.arrow&&Ti(e.elements.arrow),se=Y?C==="y"?Y.clientTop||0:Y.clientLeft||0:0,ce=(A=N==null?void 0:N[C])!=null?A:0,ae=M+L-ce-se,ne=M+j-ce,ue=Ni(v?Yo(P,ae):P,M,v?Kn(z,ne):z);k[C]=ue,B[C]=ue-M}if(l){var ie,fe=C==="x"?Ht:Kt,pe=C==="x"?er:tr,Ae=k[x],Ie=x==="y"?"height":"width",we=Ae+y[fe],ke=Ae-y[pe],re=[Ht,Kt].indexOf(m)!==-1,I=(ie=N==null?void 0:N[x])!=null?ie:0,U=re?we:Ae-E[Ie]-_[Ie]-I+T.altAxis,te=re?Ae+E[Ie]+_[Ie]-I-T.altAxis:ke,Z=v&&re?RD(U,Ae,te):Ni(v?U:we,Ae,v?te:ke);k[x]=Z,B[x]=Z-Ae}e.modifiersData[n]=B}}var cA={name:"preventOverflow",enabled:!0,phase:"main",fn:lA,requiresIfExists:["offset"]};function uA(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function dA(t){return t===fr(t)||!rr(t)?tc(t):uA(t)}function fA(t){var e=t.getBoundingClientRect(),r=Sa(e.width)/t.offsetWidth||1,n=Sa(e.height)/t.offsetHeight||1;return r!==1||n!==1}function hA(t,e,r){r===void 0&&(r=!1);var n=rr(e),a=rr(e)&&fA(e),i=fn(e),o=_a(t,a),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(n||!n&&!r)&&((_r(e)!=="body"||nc(i))&&(l=dA(e)),rr(e)?(u=_a(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=rc(i))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function pA(t){var e=new Map,r=new Set,n=[];t.forEach(function(i){e.set(i.name,i)});function a(i){r.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(l){if(!r.has(l)){var u=e.get(l);u&&a(u)}}),n.push(i)}return t.forEach(function(i){r.has(i.name)||a(i)}),n}function vA(t){var e=pA(t);return BD.reduce(function(r,n){return r.concat(e.filter(function(a){return a.phase===n}))},[])}function gA(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function mA(t){var e=t.reduce(function(r,n){var a=r[n.name];return r[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var sy={placement:"bottom",modifiers:[],strategy:"absolute"};function ly(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function ic(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,a=e.defaultOptions,i=a===void 0?sy:a;return function(o,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},sy,i),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(g){var y=typeof g=="function"?g(c.options):g;p(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:ka(o)?Ii(o):o.contextElement?Ii(o.contextElement):[],popper:Ii(l)};var m=vA(mA([].concat(n,c.options.modifiers)));return c.orderedModifiers=m.filter(function(b){return b.enabled}),v(),h.update()},forceUpdate:function(){if(!f){var g=c.elements,y=g.reference,m=g.popper;if(ly(y,m)){c.rects={reference:hA(y,Ti(m),c.options.strategy==="fixed"),popper:Ql(m)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(_){return c.modifiersData[_.name]=Object.assign({},_.data)});for(var b=0;b<c.orderedModifiers.length;b++){if(c.reset===!0){c.reset=!1,b=-1;continue}var w=c.orderedModifiers[b],C=w.fn,x=w.options,k=x===void 0?{}:x,E=w.name;typeof C=="function"&&(c=C({state:c,options:k,name:E,instance:h})||c)}}}},update:gA(function(){return new Promise(function(g){h.forceUpdate(),g(c)})}),destroy:function(){p(),f=!0}};if(!ly(o,l))return h;h.setOptions(u).then(function(g){!f&&u.onFirstUpdate&&u.onFirstUpdate(g)});function v(){c.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:c,name:y,instance:h,options:b}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(g){return g()}),d=[]}return h}}ic();var yA=[Qm,oy,Jm,Gm];ic({defaultModifiers:yA});var bA=[Qm,oy,Jm,Gm,iA,eA,cA,$D,rA],wA=ic({defaultModifiers:bA});const CA=(t,e,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const c=EA(u);Object.assign(o.value,c)},requires:["computeStyles"]},a=s.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:d,modifiers:f}=s.unref(r);return{onFirstUpdate:u,placement:c||"bottom",strategy:d||"absolute",modifiers:[...f||[],n,{name:"applyStyles",enabled:!1}]}}),i=s.shallowRef(),o=s.ref({styles:{popper:{position:s.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return s.watch(a,u=>{const c=s.unref(i);c&&c.setOptions(u)},{deep:!0}),s.watch([t,e],([u,c])=>{l(),!(!u||!c)&&(i.value=wA(u,c,s.unref(a)))}),s.onBeforeUnmount(()=>{l()}),{state:s.computed(()=>{var u;return{...((u=s.unref(i))==null?void 0:u.state)||{}}}),styles:s.computed(()=>s.unref(o).styles),attributes:s.computed(()=>s.unref(o).attributes),update:()=>{var u;return(u=s.unref(i))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=s.unref(i))==null?void 0:u.forceUpdate()},instanceRef:s.computed(()=>s.unref(i))}};function EA(t){const e=Object.keys(t.elements),r=zo(e.map(a=>[a,t.styles[a]||{}])),n=zo(e.map(a=>[a,t.attributes[a]]));return{styles:r,attributes:n}}function cy(){let t;const e=(n,a)=>{r(),t=window.setTimeout(n,a)},r=()=>window.clearTimeout(t);return Ao(()=>r()),{registerTimeout:e,cancelTimeout:r}}const oc={prefix:Math.floor(Math.random()*1e4),current:0},xA=Symbol("elIdInjection"),uy=()=>s.getCurrentInstance()?s.inject(xA,oc):oc,Di=t=>{const e=uy();!at&&e===oc&&it("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
8
  usage: app.provide(ID_INJECTION_KEY, {
9
9
  prefix: number,
10
10
  current: number,
11
- })`);const r=Wl();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let Ta=[];const uy=t=>{const e=t;e.key===ft.esc&&Ta.forEach(r=>r(e))},CP=t=>{s.onMounted(()=>{Ta.length===0&&document.addEventListener("keydown",uy),nt&&Ta.push(t)}),s.onBeforeUnmount(()=>{Ta=Ta.filter(e=>e!==t),Ta.length===0&&nt&&document.removeEventListener("keydown",uy)})};let cy;const dy=()=>{const t=Wl(),e=ly(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},EP=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},xP=()=>{const{id:t,selector:e}=dy();return s.onBeforeMount(()=>{nt&&(process.env.NODE_ENV==="test"||!cy||!document.body.querySelector(e.value))&&(cy=EP(t.value))}),{id:t,selector:e}},kP=Me({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),SP=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=sy(),{registerTimeout:o,cancelTimeout:l}=sy();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);xt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},fy=Symbol("elForwardRef"),_P=t=>{const e=r=>{t.value=r};s.provide(fy,{setForwardRef:e})},TP=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),hy={current:0},py=s.ref(0),vy=2e3,gy=Symbol("elZIndexContextKey"),my=Symbol("zIndexContextKey"),yy=t=>{const e=s.getCurrentInstance()?s.inject(gy,hy):hy,r=t||(s.getCurrentInstance()?s.inject(my,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return xt(o)?o:vy}),a=s.computed(()=>n.value+py.value),i=()=>(e.current++,py.value=e.current,a.value);return!nt&&!s.inject(gy)&&at("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
12
- usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:a,nextZIndex:i}};function NP(t){let e;function r(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:o}=t.value;if(a==null||i==null)return;const l=o.slice(0,Math.max(0,a)),c=o.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:o,beforeTxt:l,afterTxt:c}}function n(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:o,selectionStart:l}=e;if(i==null||o==null||l==null)return;let c=a.length;if(a.endsWith(o))c=a.length-o.length;else if(a.startsWith(i))c=i.length;else{const u=i[l-1],d=a.indexOf(u,l-1);d!==-1&&(c=d+1)}t.value.setSelectionRange(c,c)}return[r,n]}const Na=Ko({type:String,values:Lm,required:!1}),by=Symbol("size"),IP=()=>{const t=s.inject(by,{});return s.computed(()=>s.unref(t.size)||"")};function iu(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=s.getCurrentInstance(),{emit:o}=i,l=s.shallowRef(),c=s.ref(!1),u=h=>{Mt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),r==null||r())},d=h=>{var v;Mt(n)&&n(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(c.value=!1,o("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return s.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),Qt(l,"focus",u,!0),Qt(l,"blur",d,!0),Qt(l,"click",f,!0),process.env.NODE_ENV==="test"&&s.onMounted(()=>{const h=Vn(t.value)?t.value:document.querySelector("input,textarea");h&&(Qt(h,"focus",u,!0),Qt(h,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function wy({afterComposition:t,emit:e}){const r=s.ref(!1),n=l=>{e==null||e("compositionstart",l),r.value=!0},a=l=>{var c;e==null||e("compositionupdate",l);const u=(c=l.target)==null?void 0:c.value,d=u[u.length-1]||"";r.value=!iD(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,s.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const Cy=Symbol("emptyValuesContextKey"),BP="use-empty-values",DP=["",void 0,null],PP=void 0,OP=Me({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Mt(t)?!t():!t}}),AP=(t,e)=>{const r=s.getCurrentInstance()?s.inject(Cy,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||DP),a=s.computed(()=>Mt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Mt(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:PP),i=o=>n.value.includes(o);return n.value.includes(a.value)||at(BP,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},RP=Me({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),jr=t=>Im(RP,t),Ey=Symbol(),Jo=s.ref();function ou(t,e=void 0){const r=s.getCurrentInstance()?s.inject(Ey,Jo):Jo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function LP(t,e){const r=ou(),n=De(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Uo})),a=xi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=yy(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||vy})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return FP(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const FP=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?ou():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){at("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const c=s.unref(t);return i!=null&&i.value?MP(i.value,c):c});return o(Ey,l),o(Mm,s.computed(()=>l.value.locale)),o($m,s.computed(()=>l.value.namespace)),o(my,s.computed(()=>l.value.zIndex)),o(by,{size:s.computed(()=>l.value.size||"")}),o(Cy,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Jo.value)&&(Jo.value=l.value),l},MP=(t,e)=>{const r=[...new Set([...Bm(t),...Bm(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Be=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const $P=Me({size:{type:ke([Number,String])},color:{type:String}}),VP=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),qP=s.defineComponent({...VP,props:$P,setup(t){const e=t,r=De("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:cn(a)?void 0:wa(a),"--color":i}});return(a,i)=>(s.openBlock(),s.createElementBlock("i",s.mergeProps({class:s.unref(r).b(),style:s.unref(n)},a.$attrs),[s.renderSlot(a.$slots,"default")],16))}});var zP=Be(qP,[["__file","icon.vue"]]);const it=dt(zP),su=Symbol("formContextKey"),Pi=Symbol("formItemContextKey"),Kn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:Vm("size"),a=e.global?r:IP(),i=e.form?{size:void 0}:s.inject(su,void 0),o=e.formItem?{size:void 0}:s.inject(Pi,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ia=t=>{const e=Vm("disabled"),r=s.inject(su,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Gn=()=>{const t=s.inject(su,void 0),e=s.inject(Pi,void 0);return{form:t,formItem:e}},Oi=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=s.ref(!1)),n||(n=s.ref(!1));const a=s.ref();let i;const o=s.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return s.onMounted(()=>{i=s.watch([s.toRef(t,"id"),r],([l,c])=>{const u=l??(c?void 0:Di().value);u!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(n!=null&&n.value)&&!c&&u&&e.addInputId(u)),a.value=u)},{immediate:!0})}),s.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:o,inputId:a}};let hr;const HP=`
11
+ })`);const r=Zl();return s.computed(()=>s.unref(t)||`${r.value}-id-${e.prefix}-${e.current++}`)};let Na=[];const dy=t=>{const e=t;e.key===ft.esc&&Na.forEach(r=>r(e))},kA=t=>{s.onMounted(()=>{Na.length===0&&document.addEventListener("keydown",dy),at&&Na.push(t)}),s.onBeforeUnmount(()=>{Na=Na.filter(e=>e!==t),Na.length===0&&at&&document.removeEventListener("keydown",dy)})};let fy;const hy=()=>{const t=Zl(),e=uy(),r=s.computed(()=>`${t.value}-popper-container-${e.prefix}`),n=s.computed(()=>`#${r.value}`);return{id:r,selector:n}},SA=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},_A=()=>{const{id:t,selector:e}=hy();return s.onBeforeMount(()=>{at&&(process.env.NODE_ENV==="test"||!fy||!document.body.querySelector(e.value))&&(fy=SA(t.value))}),{id:t,selector:e}},TA=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),NA=({showAfter:t,hideAfter:e,autoClose:r,open:n,close:a})=>{const{registerTimeout:i}=cy(),{registerTimeout:o,cancelTimeout:l}=cy();return{onOpen:d=>{i(()=>{n(d);const f=s.unref(r);xt(f)&&f>0&&o(()=>{a(d)},f)},s.unref(t))},onClose:d=>{l(),i(()=>{a(d)},s.unref(e))}}},py=Symbol("elForwardRef"),IA=t=>{const e=r=>{t.value=r};s.provide(py,{setForwardRef:e})},BA=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),vy={current:0},gy=s.ref(0),my=2e3,yy=Symbol("elZIndexContextKey"),by=Symbol("zIndexContextKey"),wy=t=>{const e=s.getCurrentInstance()?s.inject(yy,vy):vy,r=t||(s.getCurrentInstance()?s.inject(by,void 0):void 0),n=s.computed(()=>{const o=s.unref(r);return xt(o)?o:my}),a=s.computed(()=>n.value+gy.value),i=()=>(e.current++,gy.value=e.current,a.value);return!at&&!s.inject(yy)&&it("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
12
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:a,nextZIndex:i}};function DA(t){let e;function r(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:o}=t.value;if(a==null||i==null)return;const l=o.slice(0,Math.max(0,a)),u=o.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:o,beforeTxt:l,afterTxt:u}}function n(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:o,selectionStart:l}=e;if(i==null||o==null||l==null)return;let u=a.length;if(a.endsWith(o))u=a.length-o.length;else if(a.startsWith(i))u=i.length;else{const c=i[l-1],d=a.indexOf(c,l-1);d!==-1&&(u=d+1)}t.value.setSelectionRange(u,u)}return[r,n]}const Ia=Go({type:String,values:Fm,required:!1}),Cy=Symbol("size"),AA=()=>{const t=s.inject(Cy,{});return s.computed(()=>s.unref(t.size)||"")};function sc(t,{beforeFocus:e,afterFocus:r,beforeBlur:n,afterBlur:a}={}){const i=s.getCurrentInstance(),{emit:o}=i,l=s.shallowRef(),u=s.ref(!1),c=h=>{$t(e)&&e(h)||u.value||(u.value=!0,o("focus",h),r==null||r())},d=h=>{var v;$t(n)&&n(h)||h.relatedTarget&&((v=l.value)!=null&&v.contains(h.relatedTarget))||(u.value=!1,o("blur",h),a==null||a())},f=()=>{var h,v;(h=l.value)!=null&&h.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return s.watch(l,h=>{h&&h.setAttribute("tabindex","-1")}),Qt(l,"focus",c,!0),Qt(l,"blur",d,!0),Qt(l,"click",f,!0),process.env.NODE_ENV==="test"&&s.onMounted(()=>{const h=qn(t.value)?t.value:document.querySelector("input,textarea");h&&(Qt(h,"focus",c,!0),Qt(h,"blur",d,!0))}),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}function Ey({afterComposition:t,emit:e}){const r=s.ref(!1),n=l=>{e==null||e("compositionstart",l),r.value=!0},a=l=>{var u;e==null||e("compositionupdate",l);const c=(u=l.target)==null?void 0:u.value,d=c[c.length-1]||"";r.value=!lD(d)},i=l=>{e==null||e("compositionend",l),r.value&&(r.value=!1,s.nextTick(()=>t(l)))};return{isComposing:r,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const xy=Symbol("emptyValuesContextKey"),OA="use-empty-values",PA=["",void 0,null],RA=void 0,LA=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>$t(t)?!t():!t}}),MA=(t,e)=>{const r=s.getCurrentInstance()?s.inject(xy,s.ref({})):s.ref({}),n=s.computed(()=>t.emptyValues||r.value.emptyValues||PA),a=s.computed(()=>$t(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:$t(r.value.valueOnClear)?r.value.valueOnClear():r.value.valueOnClear!==void 0?r.value.valueOnClear:RA),i=o=>n.value.includes(o);return n.value.includes(a.value)||it(OA,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},FA=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),jr=t=>Dm(FA,t),ky=Symbol(),Qo=s.ref();function lc(t,e=void 0){const r=s.getCurrentInstance()?s.inject(ky,Qo):Qo;return t?s.computed(()=>{var n,a;return(a=(n=r.value)==null?void 0:n[t])!=null?a:e}):r}function $A(t,e){const r=lc(),n=De(t,s.computed(()=>{var l;return((l=r.value)==null?void 0:l.namespace)||Wo})),a=xi(s.computed(()=>{var l;return(l=r.value)==null?void 0:l.locale})),i=wy(s.computed(()=>{var l;return((l=r.value)==null?void 0:l.zIndex)||my})),o=s.computed(()=>{var l;return s.unref(e)||((l=r.value)==null?void 0:l.size)||""});return VA(s.computed(()=>s.unref(r)||{})),{ns:n,locale:a,zIndex:i,size:o}}const VA=(t,e,r=!1)=>{var n;const a=!!s.getCurrentInstance(),i=a?lc():void 0,o=(n=void 0)!=null?n:a?s.provide:void 0;if(!o){it("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=s.computed(()=>{const u=s.unref(t);return i!=null&&i.value?qA(i.value,u):u});return o(ky,l),o(Vm,s.computed(()=>l.value.locale)),o(qm,s.computed(()=>l.value.namespace)),o(by,s.computed(()=>l.value.zIndex)),o(Cy,{size:s.computed(()=>l.value.size||"")}),o(xy,s.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(r||!Qo.value)&&(Qo.value=l.value),l},qA=(t,e)=>{const r=[...new Set([...Am(t),...Am(e)])],n={};for(const a of r)n[a]=e[a]!==void 0?e[a]:t[a];return n};var Be=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r};const zA=Fe({size:{type:Se([Number,String])},color:{type:String}}),HA=s.defineComponent({name:"ElIcon",inheritAttrs:!1}),KA=s.defineComponent({...HA,props:zA,setup(t){const e=t,r=De("icon"),n=s.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:un(a)?void 0:Ca(a),"--color":i}});return(a,i)=>(s.openBlock(),s.createElementBlock("i",s.mergeProps({class:s.unref(r).b(),style:s.unref(n)},a.$attrs),[s.renderSlot(a.$slots,"default")],16))}});var GA=Be(KA,[["__file","icon.vue"]]);const Xe=dt(GA),cc=Symbol("formContextKey"),Ai=Symbol("formItemContextKey"),Gn=(t,e={})=>{const r=s.ref(void 0),n=e.prop?r:zm("size"),a=e.global?r:AA(),i=e.form?{size:void 0}:s.inject(cc,void 0),o=e.formItem?{size:void 0}:s.inject(Ai,void 0);return s.computed(()=>n.value||s.unref(t)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Ba=t=>{const e=zm("disabled"),r=s.inject(cc,void 0);return s.computed(()=>e.value||s.unref(t)||(r==null?void 0:r.disabled)||!1)},Un=()=>{const t=s.inject(cc,void 0),e=s.inject(Ai,void 0);return{form:t,formItem:e}},Oi=(t,{formItemContext:e,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=s.ref(!1)),n||(n=s.ref(!1));const a=s.ref();let i;const o=s.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return s.onMounted(()=>{i=s.watch([s.toRef(t,"id"),r],([l,u])=>{const c=l??(u?void 0:Di().value);c!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(n!=null&&n.value)&&!u&&c&&e.addInputId(c)),a.value=c)},{immediate:!0})}),s.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:o,inputId:a}};let hr;const UA=`
13
13
  height:0 !important;
14
14
  visibility:hidden !important;
15
- ${tT()?"":"overflow:hidden !important;"}
15
+ ${aT()?"":"overflow:hidden !important;"}
16
16
  position:absolute !important;
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,KP=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function GP(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:KP.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function xy(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=GP(t);hr.setAttribute("style",`${l};${HP}`),hr.value=t.value||t.placeholder||"";let c=hr.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-a),hr.value="";const d=hr.scrollHeight-a;if(xt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(xt(r)){let f=d*r;o==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(n=hr.parentNode)==null||n.removeChild(hr),hr=void 0,u}const UP=Me({id:{type:String,default:void 0},size:Na,disabled:Boolean,modelValue:{type:ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:dn},prefixIcon:{type:dn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>Ca({})},autofocus:Boolean,rows:{type:Number,default:2},...jr(["ariaLabel"])}),jP={[et]:t=>ct(t),input:t=>ct(t),change:t=>ct(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},WP=s.defineComponent({name:"ElInput",inheritAttrs:!1}),YP=s.defineComponent({...WP,props:UP,emits:jP,setup(t,{expose:e,emit:r}){const n=t,a=s.useAttrs(),i=s.useSlots(),o=s.computed(()=>{const I={};return n.containerRole==="combobox"&&(I["aria-haspopup"]=a["aria-haspopup"],I["aria-owns"]=a["aria-owns"],I["aria-expanded"]=a["aria-expanded"]),I}),l=s.computed(()=>[n.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",X.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||n.prefixIcon,[g.m("suffix")]:i.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:z.value&&j.value,[g.b("hidden")]:n.type==="hidden"},a.class]),c=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Fm({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Gn(),{inputId:h}=Oi(n,{formItemContext:f}),v=Kn(),p=Ia(),g=De("input"),y=De("textarea"),m=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),x=s.ref(),k=s.shallowRef(n.inputStyle),E=s.computed(()=>m.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=iu(E,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(U=>at(U)))}}),B=s.computed(()=>{var I;return(I=d==null?void 0:d.statusIcon)!=null?I:!1}),P=s.computed(()=>(f==null?void 0:f.validateState)||""),D=s.computed(()=>P.value&&Rm[P.value]),R=s.computed(()=>C.value?Ne.View:Ne.Hide),O=s.computed(()=>[a.style]),F=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),A=s.computed(()=>un(n.modelValue)?"":String(n.modelValue)),z=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!A.value&&(S.value||w.value)),j=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!A.value&&(!!A.value||S.value)),H=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),G=s.computed(()=>A.value.length),X=s.computed(()=>!!H.value&&G.value>Number(n.maxlength)),M=s.computed(()=>!!i.suffix||!!n.suffixIcon||z.value||n.showPassword||H.value||!!P.value&&B.value),[V,q]=NP(m);Vr(b,I=>{if(L(),!H.value||n.resize!=="both")return;const U=I[0],{width:te}=U.contentRect;x.value={right:`calc(100% - ${te+15+6}px)`}});const $=()=>{const{type:I,autosize:U}=n;if(!(!nt||I!=="textarea"||!b.value))if(U){const te=yt(U)?U.minRows:void 0,Z=yt(U)?U.maxRows:void 0,J=xy(b.value,te,Z);k.value={overflowY:"hidden",...J},s.nextTick(()=>{b.value.offsetHeight,k.value=J})}else k.value={minHeight:xy(b.value).minHeight}},L=(I=>{let U=!1;return()=>{var te;if(U||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),U=!0)}})($),W=()=>{const I=E.value,U=n.formatter?n.formatter(A.value):A.value;!I||I.value===U||(I.value=U)},Y=async I=>{V();let{value:U}=I.target;if(n.formatter&&(U=n.parser?n.parser(U):U),!ue.value){if(U===A.value){W();return}r(et,U),r("input",U),await s.nextTick(),W(),q()}},se=I=>{r("change",I.target.value)},{isComposing:ue,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ce}=wy({emit:r,afterComposition:Y}),ie=()=>{C.value=!C.value,fe()},fe=async()=>{var I;await s.nextTick(),(I=E.value)==null||I.focus()},pe=()=>{var I;return(I=E.value)==null?void 0:I.blur()},Pe=I=>{w.value=!1,r("mouseleave",I)},Ie=I=>{w.value=!0,r("mouseenter",I)},we=I=>{r("keydown",I)},xe=()=>{var I;(I=E.value)==null||I.select()},re=()=>{r(et,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>$()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(U=>at(U)))}),s.watch(A,()=>W()),s.watch(()=>n.type,async()=>{await s.nextTick(),W(),$()}),s.onMounted(()=>{!n.formatter&&n.parser&&at("ElInput","If you set the parser, you also need to set the formatter."),W(),s.nextTick($)}),e({input:m,textarea:b,ref:E,textareaStyle:F,autosize:s.toRef(n,"autosize"),isComposing:ue,focus:fe,blur:pe,select:xe,clear:re,resizeTextarea:$}),(I,U)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(o),{class:[s.unref(l),{[s.unref(g).bm("group","append")]:I.$slots.append,[s.unref(g).bm("group","prepend")]:I.$slots.prepend}],style:s.unref(O),role:I.containerRole,onMouseenter:Ie,onMouseleave:Pe}),[s.createCommentVNode(" input "),I.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),I.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(g).be("group","prepend"))},[s.renderSlot(I.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:s.normalizeClass(s.unref(c))},[s.createCommentVNode(" prefix slot "),I.$slots.prefix||I.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(g).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("prefix-inner"))},[s.renderSlot(I.$slots,"prefix"),I.prefixIcon?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(h),ref_key:"input",ref:m,class:s.unref(g).e("inner")},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,type:I.showPassword?C.value?"text":"password":I.type,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,tabindex:I.tabindex,"aria-label":I.ariaLabel,placeholder:I.placeholder,style:I.inputStyle,form:I.form,autofocus:I.autofocus,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ce),onInput:Y,onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(M)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(g).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("suffix-inner"))},[!s.unref(z)||!s.unref(j)||!s.unref(H)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(z)?(s.openBlock(),s.createBlock(s.unref(it),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(ga),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(j)?(s.openBlock(),s.createBlock(s.unref(it),{key:2,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("password")]),onClick:ie},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(R))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(g).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("count-inner"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(P)&&s.unref(D)&&s.unref(B)?(s.openBlock(),s.createBlock(s.unref(it),{key:4,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("validateIcon"),s.unref(g).is("loading",s.unref(P)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(D))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),I.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(g).be("group","append"))},[s.renderSlot(I.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(h),ref_key:"textarea",ref:b,class:[s.unref(y).e("inner"),s.unref(g).is("focus",s.unref(S))]},s.unref(u),{minlength:I.minlength,maxlength:I.maxlength,tabindex:I.tabindex,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,style:s.unref(F),"aria-label":I.ariaLabel,placeholder:I.placeholder,form:I.form,autofocus:I.autofocus,rows:I.rows,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ce),onInput:Y,onFocus:s.unref(T),onBlur:s.unref(N),onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(x.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var ZP=Be(YP,[["__file","input.vue"]]);const Ai=dt(ZP),Ba=4,XP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},JP=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),lu=Symbol("scrollbarContextKey"),QP=Me({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),eO="Thumb";var ky=Be(s.defineComponent({__name:"thumb",props:QP,setup(t){const e=t,r=s.inject(lu),n=De("scrollbar");r||Pm(eO,"can not inject scrollbar context");const a=s.ref(),i=s.ref(),o=s.ref({}),l=s.ref(!1);let c=!1,u=!1,d=nt?document.onselectstart:null;const f=s.computed(()=>XP[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>JP({size:e.size,move:e.move,bar:f.value})),v=s.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=k=>{var E;if(k.stopPropagation(),k.ctrlKey||[1,2].includes(k.button))return;(E=window.getSelection())==null||E.removeAllRanges(),y(k);const _=k.currentTarget;_&&(o.value[f.value.axis]=_[f.value.offset]-(k[f.value.client]-_.getBoundingClientRect()[f.value.direction]))},g=k=>{if(!i.value||!a.value||!r.wrapElement)return;const E=Math.abs(k.target.getBoundingClientRect()[f.value.direction]-k[f.value.client]),_=i.value[f.value.offset]/2,S=(E-_)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},y=k=>{k.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=k=>{if(!a.value||!i.value||c===!1)return;const E=o.value[f.value.axis];if(!E)return;const _=(a.value.getBoundingClientRect()[f.value.direction]-k[f.value.client])*-1,S=i.value[f.value.offset]-E,T=(_-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=T*r.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,o.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),x(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};s.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Qt(s.toRef(r,"scrollbarElement"),"mousemove",w),Qt(s.toRef(r,"scrollbarElement"),"mouseleave",C),(k,E)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(n).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:a,class:s.normalizeClass([s.unref(n).e("bar"),s.unref(n).is(s.unref(f).key)]),onMousedown:g},[s.createElementVNode("div",{ref_key:"thumb",ref:i,class:s.normalizeClass(s.unref(n).e("thumb")),style:s.normalizeStyle(s.unref(h)),onMousedown:p},null,38)],34),[[s.vShow,k.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const tO=Me({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var rO=Be(s.defineComponent({__name:"bar",props:tO,setup(t,{expose:e}){const r=t,n=s.inject(lu),a=s.ref(0),i=s.ref(0),o=s.ref(""),l=s.ref(""),c=s.ref(1),u=s.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-Ba,p=h.offsetWidth-Ba;i.value=h.scrollTop*100/v*c.value,a.value=h.scrollLeft*100/p*u.value}},update:()=>{const h=n==null?void 0:n.wrapElement;if(!h)return;const v=h.offsetHeight-Ba,p=h.offsetWidth-Ba,g=v**2/h.scrollHeight,y=p**2/h.scrollWidth,m=Math.max(g,r.minSize),b=Math.max(y,r.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(p-y)/(b/(p-b)),l.value=m+Ba<v?`${m}px`:"",o.value=b+Ba<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(ky,{move:a.value,ratio:u.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(ky,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const nO=Me({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...jr(["ariaLabel","ariaOrientation"])}),aO={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xt)},uu="ElScrollbar",iO=s.defineComponent({name:uu}),oO=s.defineComponent({...iO,props:nO,emits:aO,setup(t,{expose:e,emit:r}){const n=t,a=De("scrollbar");let i,o,l=0,c=0;const u=s.ref(),d=s.ref(),f=s.ref(),h=s.ref(),v=s.computed(()=>{const x={};return n.height&&(x.height=wa(n.height)),n.maxHeight&&(x.maxHeight=wa(n.maxHeight)),[n.wrapStyle,x]}),p=s.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=s.computed(()=>[a.e("view"),n.viewClass]),y=()=>{var x;d.value&&((x=h.value)==null||x.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,r("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(x,k){yt(x)?d.value.scrollTo(x):xt(x)&&xt(k)&&d.value.scrollTo(x,k)}const b=x=>{if(!xt(x)){at(uu,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!xt(x)){at(uu,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=h.value)==null||x.update()};return s.watch(()=>n.noresize,x=>{x?(i==null||i(),o==null||o()):({stop:i}=Vr(f,C),o=Qt("resize",C))},{immediate:!0}),s.watch(()=>[n.maxHeight,n.height],()=>{n.native||s.nextTick(()=>{var x;C(),d.value&&((x=h.value)==null||x.handleScroll(d.value))})}),s.provide(lu,s.reactive({scrollbarElement:u,wrapElement:d})),s.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),s.onMounted(()=>{n.native||s.nextTick(()=>{C()})}),s.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(x,k)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:s.normalizeClass(s.unref(a).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:s.normalizeClass(s.unref(p)),style:s.normalizeStyle(s.unref(v)),tabindex:x.tabindex,onScroll:y},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(g)),style:s.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(rO,{key:0,ref_key:"barRef",ref:h,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var sO=Be(oO,[["__file","scrollbar.vue"]]);const Sy=dt(sO),cu=Symbol("popper"),_y=Symbol("popperContent"),Ty=Me({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),lO=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),uO=s.defineComponent({...lO,props:Ty,setup(t,{expose:e}){const r=t,n=s.ref(),a=s.ref(),i=s.ref(),o=s.ref(),l=s.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:o,role:l};return e(c),s.provide(cu,c),(u,d)=>s.renderSlot(u.$slots,"default")}});var cO=Be(uO,[["__file","popper.vue"]]);const Ny=Me({arrowOffset:{type:Number,default:5}}),dO=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),fO=s.defineComponent({...dO,props:Ny,setup(t,{expose:e}){const r=t,n=De("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(_y,void 0);return s.watch(()=>r.arrowOffset,l=>{a.value=l}),s.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:s.normalizeClass(s.unref(n).e("arrow")),style:s.normalizeStyle(s.unref(o)),"data-popper-arrow":""},null,6))}});var hO=Be(fO,[["__file","arrow.vue"]]);const du="ElOnlyChild",pO=s.defineComponent({name:du,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(fy),i=TP((n=a==null?void 0:a.setForwardRef)!=null?n:ga);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return at(du,"requires exact only one valid child."),null;const c=Iy(l);return c?s.withDirectives(s.cloneVNode(c,r),[[i]]):(at(du,"no valid child node found"),null)}}});function Iy(t){if(!t)return null;const e=t;for(const r of e){if(yt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return By(r);case s.Fragment:return Iy(r.children);default:return r}return By(r)}return null}function By(t){const e=De("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const Dy=Me({virtualRef:{type:ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:ke(Function)},onMouseleave:{type:ke(Function)},onClick:{type:ke(Function)},onKeydown:{type:ke(Function)},onFocus:{type:ke(Function)},onBlur:{type:ke(Function)},onContextmenu:{type:ke(Function)},id:String,open:Boolean}),vO=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),gO=s.defineComponent({...vO,props:Dy,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(cu,void 0);_P(a);const i=s.computed(()=>l.value?r.id:void 0),o=s.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=s.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=s.computed(()=>l.value?`${r.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>r.virtualRef,f=>{f&&(a.value=$r(f))},{immediate:!0}),s.watch(a,(f,h)=>{u==null||u(),u=void 0,Vn(f)&&(d.forEach(v=>{var p;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),u=s.watch([i,o,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{un(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),Vn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&Vn(a.value)){const f=a.value;d.forEach(h=>{const v=r[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(pO),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(i),"aria-describedby":s.unref(o),"aria-expanded":s.unref(c),"aria-haspopup":s.unref(l)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var mO=Be(gO,[["__file","trigger.vue"]]);const fu="focus-trap.focus-after-trapped",hu="focus-trap.focus-after-released",yO="focus-trap.focusout-prevented",Py={cancelable:!0,bubbles:!1},bO={cancelable:!0,bubbles:!1},Oy="focusAfterTrapped",Ay="focusAfterReleased",wO=Symbol("elFocusTrap"),pu=s.ref(),Qo=s.ref(0),vu=s.ref(0);let es=0;const Ry=t=>{const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e},Ly=(t,e)=>{for(const r of t)if(!CO(r,e))return r},CO=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},EO=t=>{const e=Ry(t),r=Ly(e,t),n=Ly(e.reverse(),t);return[r,n]},xO=t=>t instanceof HTMLInputElement&&"select"in t,hn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),vu.value=window.performance.now(),t!==r&&xO(t)&&e&&t.select()}};function Fy(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const kO=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=Fy(t,n),t.unshift(n)},remove:n=>{var a,i;t=Fy(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},SO=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(hn(n,e),document.activeElement!==r)return},My=kO(),_O=()=>Qo.value>vu.value,ts=()=>{pu.value="pointer",Qo.value=window.performance.now()},$y=()=>{pu.value="keyboard",Qo.value=window.performance.now()},TO=()=>(s.onMounted(()=>{es===0&&(document.addEventListener("mousedown",ts),document.addEventListener("touchstart",ts),document.addEventListener("keydown",$y)),es++}),s.onBeforeUnmount(()=>{es--,es<=0&&(document.removeEventListener("mousedown",ts),document.removeEventListener("touchstart",ts),document.removeEventListener("keydown",$y))}),{focusReason:pu,lastUserFocusTimestamp:Qo,lastAutomatedFocusTimestamp:vu}),rs=t=>new CustomEvent(yO,{...bO,detail:t}),NO=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Oy,Ay,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=TO();CP(p=>{t.trapped&&!o.paused&&e("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||o.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:x}=t,k=g===ft.tab&&!y&&!m&&!b,E=document.activeElement;if(k&&E){const _=w,[S,T]=EO(_);if(S&&T){if(!C&&E===T){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(S,!0))}else if(C&&[S,_].includes(E)){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(T,!0))}}else if(E===_){const B=rs({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(wO,{focusTrapRef:r,onKeydown:l}),s.watch(()=>t.focusTrapEl,p=>{p&&(r.value=p)},{immediate:!0}),s.watch([r],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=p=>{e(Oy,p)},u=p=>e(Ay,p),d=p=>{const g=s.unref(r);if(!g)return;const y=p.target,m=p.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(n=m),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=y:hn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const y=p.relatedTarget;!un(y)&&!g.contains(y)&&setTimeout(()=>{if(!o.paused&&t.trapped){const m=rs({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||hn(a,!0)}},0)}else{const y=p.target;y&&g.contains(y)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){My.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const m=new Event(fu,Py);p.addEventListener(fu,c),p.dispatchEvent(m),m.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;ct(b)||(hn(b),document.activeElement!==b&&(b="first")),b==="first"&&SO(Ry(p),!0),(document.activeElement===g||b==="container")&&hn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(fu,c);const g=new CustomEvent(hu,{...Py,detail:{focusReason:i.value}});p.addEventListener(hu,u),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!_O()||p.contains(document.activeElement))&&hn(n??document.body),p.removeEventListener(hu,u),My.remove(o)}}return s.onMounted(()=>{t.trapped&&h(),s.watch(()=>t.trapped,p=>{p?h():v()})}),s.onBeforeUnmount(()=>{t.trapped&&v(),r.value&&(r.value.removeEventListener("keydown",l),r.value.removeEventListener("focusin",d),r.value.removeEventListener("focusout",f),r.value=void 0)}),{onKeydown:l}}});function IO(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var BO=Be(NO,[["render",IO],["__file","focus-trap.vue"]]);const DO=["fixed","absolute"],PO=Me({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:jo,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:DO,default:"absolute"}}),Vy=Me({...PO,id:String,style:{type:ke([String,Array,Object])},className:{type:ke([String,Array,Object])},effect:{type:ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ke([String,Array,Object])},popperStyle:{type:ke([String,Array,Object])},referenceEl:{type:ke(Object)},triggerTargetEl:{type:ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...jr(["ariaLabel"])}),OO={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},AO=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...LO(t),...e]};return FO(i,a==null?void 0:a.modifiers),i},RO=t=>{if(nt)return $r(t)};function LO(t){const{offset:e,gpuAcceleration:r,fallbackPlacements:n}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function FO(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const MO=0,$O=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(cu,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=s.computed(()=>{var m;const b=s.unref(i),w=(m=s.unref(o))!=null?m:MO;return{name:"arrow",enabled:!YB(b),options:{element:b,padding:w}}}),u=s.computed(()=>({onFirstUpdate:()=>{p()},...AO(t,[s.unref(c),s.unref(l)])})),d=s.computed(()=>RO(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:y}=yP(d,r,u);return s.watch(y,m=>e.value=m),s.onMounted(()=>{s.watch(()=>{var m;return(m=s.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:y,state:h,styles:v,role:a,forceUpdate:g,update:p}},VO=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=yy(),i=De("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(xt(t.zIndex)?t.zIndex:a()),c=s.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=s.computed(()=>[{zIndex:s.unref(l)},s.unref(r).popper,t.popperStyle||{}]),d=s.computed(()=>n.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=xt(t.zIndex)?t.zIndex:a()}}},qO=(t,e)=>{const r=s.ref(!1),n=s.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(n.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{t.visible&&!r.value&&(u.target&&(n.value=u.target),r.value=!0)},onFocusoutPrevented:u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,e("close")}}},zO=s.defineComponent({name:"ElPopperContent"}),HO=s.defineComponent({...zO,props:Vy,emits:OO,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=qO(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:y,update:m}=$O(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:k,updateZIndex:E}=VO(n,{styles:p,attributes:f,role:y}),_=s.inject(Pi,void 0),S=s.ref();s.provide(_y,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Pi,{..._,addInputId:ga,removeInputId:ga});let T;const N=(P=!0)=>{m(),P&&E()},B=()=>{N(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return s.onMounted(()=>{s.watch(()=>n.triggerTargetEl,(P,D)=>{T==null||T(),T=void 0;const R=s.unref(P||v.value),O=s.unref(D||v.value);Vn(R)&&(T=s.watch([y,()=>n.ariaLabel,b,()=>n.id],F=>{["role","aria-label","aria-modal","id"].forEach((A,z)=>{un(F[z])?R.removeAttribute(A):R.setAttribute(A,F[z])})},{immediate:!0})),O!==R&&Vn(O)&&["role","aria-label","aria-modal","id"].forEach(F=>{O.removeAttribute(F)})},{immediate:!0}),s.watch(()=>n.visible,B,{immediate:!0})}),s.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:N,contentStyle:k}),(P,D)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:v},s.unref(C),{style:s.unref(k),class:s.unref(x),tabindex:"-1",onMouseenter:R=>P.$emit("mouseenter",R),onMouseleave:R=>P.$emit("mouseleave",R)}),[s.createVNode(s.unref(BO),{trapped:s.unref(i),"trap-on-focus-in":!0,"focus-trap-el":s.unref(v),"focus-start-el":s.unref(a),onFocusAfterTrapped:s.unref(l),onFocusAfterReleased:s.unref(o),onFocusin:s.unref(c),onFocusoutPrevented:s.unref(u),onReleaseRequested:s.unref(d)},{default:s.withCtx(()=>[s.renderSlot(P.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var KO=Be(HO,[["__file","content.vue"]]);const GO=dt(cO),gu=Symbol("elTooltip"),$t=Me({...kP,...Vy,appendTo:{type:ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...jr(["ariaLabel"])}),Ri=Me({...Dy,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[ft.enter,ft.space]}}),{useModelToggleProps:UO,useModelToggleEmits:jO,useModelToggle:WO}=vD("visible"),YO=Me({...Ty,...UO,...$t,...Ri,...Ny,showArrow:{type:Boolean,default:!0}}),ZO=[...jO,"before-show","before-hide","show","hide","open","close"],XO=(t,e)=>Et(t)?t.includes(e):t===e,Da=(t,e,r)=>n=>{XO(s.unref(t),e)&&r(n)},JO=s.defineComponent({name:"ElTooltipTrigger"}),QO=s.defineComponent({...JO,props:Ri,setup(t,{expose:e}){const r=t,n=De("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:c,onToggle:u}=s.inject(gu,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=Mr(f,Da(h,"hover",l)),p=Mr(f,Da(h,"hover",c)),g=Mr(f,Da(h,"click",C=>{C.button===0&&u(C)})),y=Mr(f,Da(h,"focus",l)),m=Mr(f,Da(h,"focus",c)),b=Mr(f,Da(h,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Mr(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,x)=>(s.openBlock(),s.createBlock(s.unref(mO),{id:s.unref(i),"virtual-ref":C.virtualRef,open:s.unref(o),"virtual-triggering":C.virtualTriggering,class:s.normalizeClass(s.unref(n).e("trigger")),onBlur:s.unref(m),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(y),onMouseenter:s.unref(v),onMouseleave:s.unref(p),onKeydown:s.unref(w)},{default:s.withCtx(()=>[s.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var eA=Be(QO,[["__file","trigger.vue"]]);const tA=Me({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var rA=Be(s.defineComponent({__name:"teleport",props:tA,setup(t){return(e,r)=>e.disabled?s.renderSlot(e.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:e.to},[s.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const nA=dt(rA),aA=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),iA=s.defineComponent({...aA,props:$t,setup(t,{expose:e}){const r=t,{selector:n}=dy(),a=De("tooltip"),i=s.ref(null);let o;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:y}=s.inject(gu,void 0),m=s.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=s.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);s.onBeforeUnmount(()=>{o==null||o()});const w=s.computed(()=>s.unref(b)?!0:s.unref(u)),C=s.computed(()=>r.disabled?!1:s.unref(u)),x=s.computed(()=>r.appendTo||n.value),k=s.computed(()=>{var O;return(O=r.style)!=null?O:{}}),E=s.ref(!0),_=()=>{p(),E.value=!0},S=()=>{if(s.unref(l))return!0},T=Mr(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=Mr(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var O,F;(F=(O=i.value)==null?void 0:O.updatePopper)==null||F.call(O),g==null||g()},P=()=>{y==null||y()},D=()=>{v(),o=Og(s.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(s.unref(l))return;s.unref(d)!=="hover"&&f()})},R=()=>{r.virtualTriggering||f()};return s.watch(()=>s.unref(u),O=>{O?E.value=!1:o==null||o()},{flush:"post"}),s.watch(()=>r.content,()=>{var O,F;(F=(O=i.value)==null?void 0:O.updatePopper)==null||F.call(O)}),e({contentRef:i}),(O,F)=>(s.openBlock(),s.createBlock(s.unref(nA),{disabled:!O.teleported,to:s.unref(x)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(m),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:P},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(KO),s.mergeProps({key:0,id:s.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":E.value,"boundaries-padding":O.boundariesPadding,"fallback-placements":O.fallbackPlacements,"gpu-acceleration":O.gpuAcceleration,offset:O.offset,placement:O.placement,"popper-options":O.popperOptions,strategy:O.strategy,effect:O.effect,enterable:O.enterable,pure:O.pure,"popper-class":O.popperClass,"popper-style":[O.popperStyle,s.unref(k)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:s.unref(C),"z-index":O.zIndex,onMouseenter:s.unref(T),onMouseleave:s.unref(N),onBlur:R,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.renderSlot(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[s.vShow,s.unref(C)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var oA=Be(iA,[["__file","content.vue"]]);const sA=s.defineComponent({name:"ElTooltip"}),lA=s.defineComponent({...sA,props:YO,emits:ZO,setup(t,{expose:e,emit:r}){const n=t;xP();const a=Di(),i=s.ref(),o=s.ref(),l=()=>{var m;const b=s.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=s.ref(!1),u=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=WO({indicator:c,toggleReason:u}),{onOpen:v,onClose:p}=SP({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>ba(n.visible)&&!h.value);s.provide(gu,{controlled:g,id:a,open:s.readonly(c),trigger:s.toRef(n,"trigger"),onOpen:m=>{v(m)},onClose:m=>{p(m)},onToggle:m=>{s.unref(c)?p(m):v(m)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),s.watch(()=>n.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=o.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(x)};return s.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:p,hide:f}),(m,b)=>(s.openBlock(),s.createBlock(s.unref(GO),{ref_key:"popperRef",ref:i,role:m.role},{default:s.withCtx(()=>[s.createVNode(eA,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:s.withCtx(()=>[m.$slots.default?s.renderSlot(m.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(oA,{ref_key:"contentRef",ref:o,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:s.withCtx(()=>[s.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(m.content),1))]),m.showArrow?(s.openBlock(),s.createBlock(s.unref(hO),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):s.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var uA=Be(lA,[["__file","tooltip.vue"]]);const Pa=dt(uA),cA=Me({valueKey:{type:String,default:"value"},modelValue:{type:[String,Number],default:""},debounce:{type:Number,default:300},placement:{type:ke(String),values:["top","top-start","top-end","bottom","bottom-start","bottom-end"],default:"bottom-start"},fetchSuggestions:{type:ke([Function,Array]),default:ga},popperClass:{type:String,default:""},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},hideLoading:{type:Boolean,default:!1},teleported:$t.teleported,highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:String,...jr(["ariaLabel"])}),dA={[et]:t=>ct(t),[jl]:t=>ct(t),[Ei]:t=>ct(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,select:t=>yt(t)},qy="ElAutocomplete",fA=s.defineComponent({name:qy,inheritAttrs:!1}),hA=s.defineComponent({...fA,props:cA,emits:dA,setup(t,{expose:e,emit:r}){const n=t,a=Fm(),i=s.useAttrs(),o=Ia(),l=De("autocomplete"),c=s.ref(),u=s.ref(),d=s.ref(),f=s.ref();let h=!1,v=!1;const p=s.ref([]),g=s.ref(-1),y=s.ref(""),m=s.ref(!1),b=s.ref(!1),w=s.ref(!1),C=Di(),x=s.computed(()=>i.style),k=s.computed(()=>(p.value.length>0||w.value)&&m.value),E=s.computed(()=>!n.hideLoading&&w.value),_=s.computed(()=>c.value?Array.from(c.value.$el.querySelectorAll("input")):[]),S=()=>{k.value&&(y.value=`${c.value.$el.offsetWidth}px`)},T=()=>{g.value=-1},N=async $=>{if(b.value)return;const K=L=>{w.value=!1,!b.value&&(Et(L)?(p.value=L,g.value=n.highlightFirstItem?0:-1):Pm(qy,"autocomplete suggestions must be an array"))};if(w.value=!0,Et(n.fetchSuggestions))K(n.fetchSuggestions);else{const L=await n.fetchSuggestions($,K);Et(L)&&K(L)}},B=Gl(N,n.debounce),P=$=>{const K=!!$;if(r(jl,$),r(et,$),b.value=!1,m.value||(m.value=K),!n.triggerOnFocus&&!$){b.value=!0,p.value=[];return}B($)},D=$=>{var K;o.value||(((K=$.target)==null?void 0:K.tagName)!=="INPUT"||_.value.includes(document.activeElement))&&(m.value=!0)},R=$=>{r(Ei,$)},O=$=>{v?v=!1:(m.value=!0,r("focus",$),n.triggerOnFocus&&!h&&B(String(n.modelValue)))},F=$=>{setTimeout(()=>{var K;if((K=d.value)!=null&&K.isFocusInsideContent()){v=!0;return}m.value&&H(),r("blur",$)})},A=()=>{m.value=!1,r(et,""),r("clear")},z=async()=>{k.value&&g.value>=0&&g.value<p.value.length?M(p.value[g.value]):n.selectWhenUnmatched&&(r("select",{value:n.modelValue}),p.value=[],g.value=-1)},j=$=>{k.value&&($.preventDefault(),$.stopPropagation(),H())},H=()=>{m.value=!1},G=()=>{var $;($=c.value)==null||$.focus()},X=()=>{var $;($=c.value)==null||$.blur()},M=async $=>{r(jl,$[n.valueKey]),r(et,$[n.valueKey]),r("select",$),p.value=[],g.value=-1},V=$=>{if(!k.value||w.value)return;if($<0){g.value=-1;return}$>=p.value.length&&($=p.value.length-1);const K=u.value.querySelector(`.${l.be("suggestion","wrap")}`),W=K.querySelectorAll(`.${l.be("suggestion","list")} li`)[$],Y=K.scrollTop,{offsetTop:se,scrollHeight:ue}=W;se+ue>Y+K.clientHeight&&(K.scrollTop+=ue),se<Y&&(K.scrollTop-=ue),g.value=$,c.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`)},q=Og(f,()=>{k.value&&H()});return s.onBeforeUnmount(()=>{q==null||q()}),s.onMounted(()=>{c.value.ref.setAttribute("role","textbox"),c.value.ref.setAttribute("aria-autocomplete","list"),c.value.ref.setAttribute("aria-controls","id"),c.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`),h=c.value.ref.hasAttribute("readonly")}),e({highlightedIndex:g,activated:m,loading:w,inputRef:c,popperRef:d,suggestions:p,handleSelect:M,handleKeyEnter:z,focus:G,blur:X,close:H,highlight:V,getData:N}),($,K)=>(s.openBlock(),s.createBlock(s.unref(Pa),{ref_key:"popperRef",ref:d,visible:s.unref(k),placement:$.placement,"fallback-placements":["bottom-start","top-start"],"popper-class":[s.unref(l).e("popper"),$.popperClass],teleported:$.teleported,"gpu-acceleration":!1,pure:"","manual-mode":"",effect:"light",trigger:"click",transition:`${s.unref(l).namespace.value}-zoom-in-top`,persistent:"",role:"listbox",onBeforeShow:S,onHide:T},{content:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"regionRef",ref:u,class:s.normalizeClass([s.unref(l).b("suggestion"),s.unref(l).is("loading",s.unref(E))]),style:s.normalizeStyle({[$.fitInputWidth?"width":"minWidth"]:y.value,outline:"none"}),role:"region"},[s.createVNode(s.unref(Sy),{id:s.unref(C),tag:"ul","wrap-class":s.unref(l).be("suggestion","wrap"),"view-class":s.unref(l).be("suggestion","list"),role:"listbox"},{default:s.withCtx(()=>[s.unref(E)?(s.openBlock(),s.createElementBlock("li",{key:0},[s.renderSlot($.$slots,"loading",{},()=>[s.createVNode(s.unref(it),{class:s.normalizeClass(s.unref(l).is("loading"))},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Loading))]),_:1},8,["class"])])])):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(p.value,(L,W)=>(s.openBlock(),s.createElementBlock("li",{id:`${s.unref(C)}-item-${W}`,key:W,class:s.normalizeClass({highlighted:g.value===W}),role:"option","aria-selected":g.value===W,onClick:Y=>M(L)},[s.renderSlot($.$slots,"default",{item:L},()=>[s.createTextVNode(s.toDisplayString(L[$.valueKey]),1)])],10,["id","aria-selected","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class"])],6)]),default:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"listboxRef",ref:f,class:s.normalizeClass([s.unref(l).b(),$.$attrs.class]),style:s.normalizeStyle(s.unref(x)),role:"combobox","aria-haspopup":"listbox","aria-expanded":s.unref(k),"aria-owns":s.unref(C)},[s.createVNode(s.unref(Ai),s.mergeProps({ref_key:"inputRef",ref:c},s.unref(a),{clearable:$.clearable,disabled:s.unref(o),name:$.name,"model-value":$.modelValue,"aria-label":$.ariaLabel,onInput:P,onChange:R,onFocus:O,onBlur:F,onClear:A,onKeydown:[s.withKeys(s.withModifiers(L=>V(g.value-1),["prevent"]),["up"]),s.withKeys(s.withModifiers(L=>V(g.value+1),["prevent"]),["down"]),s.withKeys(z,["enter"]),s.withKeys(H,["tab"]),s.withKeys(j,["esc"])],onMousedown:D}),s.createSlots({_:2},[$.$slots.prepend?{name:"prepend",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prepend")])}:void 0,$.$slots.append?{name:"append",fn:s.withCtx(()=>[s.renderSlot($.$slots,"append")])}:void 0,$.$slots.prefix?{name:"prefix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prefix")])}:void 0,$.$slots.suffix?{name:"suffix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"suffix")])}:void 0]),1040,["clearable","disabled","name","model-value","aria-label","onKeydown"])],14,["aria-expanded","aria-owns"])]),_:3},8,["visible","placement","popper-class","teleported","transition"]))}});var pA=Be(hA,[["__file","autocomplete.vue"]]);const zy=dt(pA),Hy=Symbol("buttonGroupContextKey"),vA=(t,e)=>{Go({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>t.type==="text"));const r=s.inject(Hy,void 0),n=ou("button"),{form:a}=Gn(),i=Kn(s.computed(()=>r==null?void 0:r.size)),o=Ia(),l=s.ref(),c=s.useSlots(),u=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=s.computed(()=>t.tag==="button"?{ariaDisabled:o.value||t.loading,disabled:o.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=s.computed(()=>{var p;const g=(p=c.default)==null?void 0:p.call(c);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===s.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(o.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},mu=Me({size:Na,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:dn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:dn,default:()=>Ne.Loading},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ke([String,Object]),default:"button"}}),gA={click:t=>t instanceof MouseEvent};function kt(t,e){mA(t)&&(t="100%");var r=yA(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function ns(t){return Math.min(1,Math.max(0,t))}function mA(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function yA(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Ky(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function as(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Un(t){return t.length===1?"0"+t:String(t)}function bA(t,e,r){return{r:kt(t,255)*255,g:kt(e,255)*255,b:kt(r,255)*255}}function Gy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=0,l=(n+a)/2;if(n===a)o=0,i=0;else{var c=n-a;switch(o=l>.5?c/(2-n-a):c/(n+a),n){case t:i=(e-r)/c+(e<r?6:0);break;case e:i=(r-t)/c+2;break;case r:i=(t-e)/c+4;break}i/=6}return{h:i,s:o,l}}function yu(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*(6*r):r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function wA(t,e,r){var n,a,i;if(t=kt(t,360),e=kt(e,100),r=kt(r,100),e===0)a=r,i=r,n=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=yu(l,o,t+1/3),a=yu(l,o,t),i=yu(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function Uy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:i=(e-r)/l+(e<r?6:0);break;case e:i=(r-t)/l+2;break;case r:i=(t-e)/l+4;break}i/=6}return{h:i,s:c,v:o}}function CA(t,e,r){t=kt(t,360)*6,e=kt(e,100),r=kt(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][c];return{r:u*255,g:d*255,b:f*255}}function jy(t,e,r,n){var a=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(Math.round(r).toString(16))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function EA(t,e,r,n,a){var i=[Un(Math.round(t).toString(16)),Un(Math.round(e).toString(16)),Un(Math.round(r).toString(16)),Un(xA(n))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function xA(t){return Math.round(parseFloat(t)*255).toString(16)}function Wy(t){return Wt(t)/255}function Wt(t){return parseInt(t,16)}function kA(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var bu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function SA(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,l=!1;return typeof t=="string"&&(t=NA(t)),typeof t=="object"&&(Wr(t.r)&&Wr(t.g)&&Wr(t.b)?(e=bA(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Wr(t.h)&&Wr(t.s)&&Wr(t.v)?(n=as(t.s),a=as(t.v),e=CA(t.h,n,a),o=!0,l="hsv"):Wr(t.h)&&Wr(t.s)&&Wr(t.l)&&(n=as(t.s),i=as(t.l),e=wA(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=Ky(r),{ok:o,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}var _A="[-\\+]?\\d+%?",TA="[-\\+]?\\d*\\.\\d+%?",pn="(?:".concat(TA,")|(?:").concat(_A,")"),wu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),Cu="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(pn),rgb:new RegExp("rgb"+wu),rgba:new RegExp("rgba"+Cu),hsl:new RegExp("hsl"+wu),hsla:new RegExp("hsla"+Cu),hsv:new RegExp("hsv"+wu),hsva:new RegExp("hsva"+Cu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function NA(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(bu[t])t=bu[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=pr.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=pr.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=pr.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=pr.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=pr.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=pr.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=pr.hex8.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),a:Wy(r[4]),format:e?"name":"hex8"}:(r=pr.hex6.exec(t),r?{r:Wt(r[1]),g:Wt(r[2]),b:Wt(r[3]),format:e?"name":"hex"}:(r=pr.hex4.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),a:Wy(r[4]+r[4]),format:e?"name":"hex8"}:(r=pr.hex3.exec(t),r?{r:Wt(r[1]+r[1]),g:Wt(r[2]+r[2]),b:Wt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function Wr(t){return!!pr.CSS_UNIT.exec(String(t))}var IA=function(){function t(e,r){e===void 0&&(e=""),r===void 0&&(r={});var n;if(e instanceof t)return e;typeof e=="number"&&(e=kA(e)),this.originalInput=e;var a=SA(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:a.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),r,n,a,i=e.r/255,o=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=Ky(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=Uy(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=Uy(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=Gy(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=Gy(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),jy(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),EA(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(r,", ").concat(n,")"):"rgba(".concat(e,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(r){return"".concat(Math.round(kt(r,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(r){return Math.round(kt(r,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+jy(this.r,this.g,this.b,!1),r=0,n=Object.entries(bu);r<n.length;r++){var a=n[r],i=a[0],o=a[1];if(e===o)return i}return!1},t.prototype.toString=function(e){var r=!!e;e=e??this.format;var n=!1,a=this.a<1&&this.a>=0,i=!r&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l+=e/100,r.l=ns(r.l),new t(r)},t.prototype.brighten=function(e){e===void 0&&(e=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),new t(r)},t.prototype.darken=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l-=e/100,r.l=ns(r.l),new t(r)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s-=e/100,r.s=ns(r.s),new t(r)},t.prototype.saturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s+=e/100,r.s=ns(r.s),new t(r)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var r=this.toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,new t(r)},t.prototype.mix=function(e,r){r===void 0&&(r=50);var n=this.toRgb(),a=new t(e).toRgb(),i=r/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new t(o)},t.prototype.analogous=function(e,r){e===void 0&&(e=6),r===void 0&&(r=30);var n=this.toHsl(),a=360/r,i=[this];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(new t(n));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var r=this.toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return o},t.prototype.splitcomplement=function(){var e=this.toHsl(),r=e.h;return[this,new t({h:(r+72)%360,s:e.s,l:e.l}),new t({h:(r+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var r=this.toRgb(),n=new t(e).toRgb(),a=r.a+n.a*(1-r.a);return new t({r:(r.r*r.a+n.r*n.a*(1-r.a))/a,g:(r.g*r.a+n.g*n.a*(1-r.a))/a,b:(r.b*r.a+n.b*n.a*(1-r.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var r=this.toHsl(),n=r.h,a=[this],i=360/e,o=1;o<e;o++)a.push(new t({h:(n+o*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function vn(t,e=20){return t.mix("#141414",e).toString()}function BA(t){const e=Ia(),r=De("button");return s.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new IA(a),l=t.dark?o.tint(20).toString():vn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?vn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?vn(o,50):o.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(n[r.cssVarBlockName("disabled-bg-color")]=t.dark?vn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?vn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?vn(o,80):o.tint(80).toString());else{const c=t.dark?vn(o,30):o.tint(30).toString(),u=o.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":a,"text-color":u,"border-color":a,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?vn(o,50):o.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=d,n[r.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=d}}}return n})}const DA=s.defineComponent({name:"ElButton"}),PA=s.defineComponent({...DA,props:mu,emits:gA,setup(t,{expose:e,emit:r}){const n=t,a=BA(n),i=De("button"),{_ref:o,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=vA(n,r),v=s.computed(()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",u.value),i.is("loading",n.loading),i.is("plain",n.plain),i.is("round",n.round),i.is("circle",n.circle),i.is("text",n.text),i.is("link",n.link),i.is("has-bg",n.bg)]);return e({ref:o,size:l,type:c,disabled:u,shouldAddSpace:f}),(p,g)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.tag),s.mergeProps({ref_key:"_ref",ref:o},s.unref(d),{class:s.unref(v),style:s.unref(a),onClick:s.unref(h)}),{default:s.withCtx(()=>[p.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[p.$slots.loading?s.renderSlot(p.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(it),{key:1,class:s.normalizeClass(s.unref(i).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(s.openBlock(),s.createBlock(s.unref(it),{key:1},{default:s.withCtx(()=>[p.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.icon),{key:0})):s.renderSlot(p.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),p.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(i).em("text","expand")]:s.unref(f)})},[s.renderSlot(p.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var OA=Be(PA,[["__file","button.vue"]]);const AA={size:mu.size,type:mu.type},RA=s.defineComponent({name:"ElButtonGroup"}),LA=s.defineComponent({...RA,props:AA,setup(t){const e=t;s.provide(Hy,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=De("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var Yy=Be(LA,[["__file","button-group.vue"]]);const Ht=dt(OA,{ButtonGroup:Yy});Gr(Yy);var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function FA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const gn=new Map;if(nt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of gn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function Zy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:Vn(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,o=n.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!o||!l,d=t.contains(o)||t.contains(l),f=t===o,h=r.length&&r.some(p=>p==null?void 0:p.contains(o))||r.length&&r.includes(l),v=i&&(i.contains(o)||i.contains(l));c||u||d||f||h||v||e.value(n,a)}}const Xy={beforeMount(t,e){gn.has(t)||gn.set(t,[]),gn.get(t).push({documentHandler:Zy(t,e),bindingFn:e.value})},updated(t,e){gn.has(t)||gn.set(t,[]);const r=gn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:Zy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){gn.delete(t)}},MA=Me({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),$A=s.defineComponent({name:"ElCard"}),VA=s.defineComponent({...$A,props:MA,setup(t){const e=De("card");return(r,n)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(e).b(),s.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(e).e("header"))},[s.renderSlot(r.$slots,"header",{},()=>[s.createTextVNode(s.toDisplayString(r.header),1)])],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([s.unref(e).e("body"),r.bodyClass]),style:s.normalizeStyle(r.bodyStyle)},[s.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(e).e("footer"))},[s.renderSlot(r.$slots,"footer",{},()=>[s.createTextVNode(s.toDisplayString(r.footer),1)])],2)):s.createCommentVNode("v-if",!0)],2))}});var qA=Be(VA,[["__file","card.vue"]]);const zA=dt(qA),Jy={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:Na,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...jr(["ariaControls"])},Qy={[et]:t=>ct(t)||xt(t)||ba(t),change:t=>ct(t)||xt(t)||ba(t)},Oa=Symbol("checkboxGroupContextKey"),HA=({model:t,isChecked:e})=>{const r=s.inject(Oa,void 0),n=s.computed(()=>{var i,o;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,c=(o=r==null?void 0:r.min)==null?void 0:o.value;return!cn(l)&&t.value.length>=l&&!e.value||!cn(c)&&t.value.length<=c&&e.value});return{isDisabled:Ia(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},KA=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Oa,void 0),{formItem:l}=Gn(),{emit:c}=s.getCurrentInstance();function u(p){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(p,g){c("change",u(p),g)}function f(p){if(r.value)return;const g=p.target;c("change",u(g.checked),p)}async function h(p){r.value||!n.value&&!a.value&&i.value&&(p.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await s.nextTick(),d(e.value,p)))}const v=s.computed(()=>(o==null?void 0:o.validateEvent)||t.validateEvent);return s.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>at(p)))}),{handleChange:f,onClickRoot:h}},GA=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Oa,void 0),a=s.computed(()=>cn(n)===!1),i=s.ref(!1),o=s.computed({get(){var l,c;return a.value?(l=n==null?void 0:n.modelValue)==null?void 0:l.value:(c=t.modelValue)!=null?c:e.value},set(l){var c,u;a.value&&Et(l)?(i.value=((c=n==null?void 0:n.max)==null?void 0:c.value)!==void 0&&l.length>(n==null?void 0:n.max.value)&&l.length>o.value.length,i.value===!1&&((u=n==null?void 0:n.changeEvent)==null||u.call(n,l))):(r(et,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},UA=(t,e,{model:r})=>{const n=s.inject(Oa,void 0),a=s.ref(!1),i=s.computed(()=>Ho(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return ba(d)?d:Et(d)?yt(i.value)?d.map(s.toRaw).some(f=>zo(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),c=Kn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),u=s.computed(()=>!!e.default||!Ho(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},e0=(t,e)=>{const{formItem:r}=Gn(),{model:n,isGroup:a,isLimitExceeded:i}=GA(t),{isFocused:o,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=UA(t,e,{model:n}),{isDisabled:h}=HA({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Oi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=KA(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;Et(n.value)&&!n.value.includes(f.value)?n.value.push(f.value):n.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),Go({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>a.value&&Ho(t.value))),Go({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.trueLabel)),Go({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:o,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:y}},jA=s.defineComponent({name:"ElCheckbox"}),WA=s.defineComponent({...jA,props:Jy,emits:Qy,setup(t){const e=t,r=s.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:o,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:h,onClickRoot:v}=e0(e,r),p=De("checkbox"),g=s.computed(()=>[p.b(),p.m(c.value),p.is("disabled",o.value),p.is("bordered",e.border),p.is("checked",i.value)]),y=s.computed(()=>[p.e("input"),p.is("disabled",o.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(m,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(u)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,x,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:s.unref(o),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(k=(x=m.falseValue)!=null?x:m.falseLabel)!=null?k:!1,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:s.unref(o),value:s.unref(f),name:m.name,tabindex:m.tabindex,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(p).e("inner"))},null,2)],2),s.unref(u)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(p).e("label"))},[s.renderSlot(m.$slots,"default"),m.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(m.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var YA=Be(WA,[["__file","checkbox.vue"]]);const ZA=s.defineComponent({name:"ElCheckboxButton"}),XA=s.defineComponent({...ZA,props:Jy,emits:Qy,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:c,handleChange:u}=e0(e,r),d=s.inject(Oa,void 0),f=De("checkbox"),h=s.computed(()=>{var p,g,y,m;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=s.computed(()=>[f.b("button"),f.bm("button",o.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",n.value)]);return(p,g)=>{var y,m,b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),"true-value":(m=(y=p.trueValue)!=null?y:p.trueLabel)!=null?m:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),value:s.unref(c),onChange:s.unref(u),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]),p.$slots.default||p.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(a)?s.unref(h):void 0)},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var t0=Be(XA,[["__file","checkbox-button.vue"]]);const JA=Me({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Na,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),QA={[et]:t=>Et(t),change:t=>Et(t)},eR=s.defineComponent({name:"ElCheckboxGroup"}),tR=s.defineComponent({...eR,props:JA,emits:QA,setup(t,{emit:e}){const r=t,n=De("checkbox"),{formItem:a}=Gn(),{inputId:i,isLabeledByFormItem:o}=Oi(r,{formItemContext:a}),l=async u=>{e(et,u),await s.nextTick(),e("change",u)},c=s.computed({get(){return r.modelValue},set(u){l(u)}});return s.provide(Oa,{...Im(s.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),s.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(u=>at(u)))}),(u,d)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.tag),{id:s.unref(i),class:s.normalizeClass(s.unref(n).b("group")),role:"group","aria-label":s.unref(o)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":s.unref(o)?(f=s.unref(a))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var r0=Be(tR,[["__file","checkbox-group.vue"]]);const rR=dt(YA,{CheckboxButton:t0,CheckboxGroup:r0});Gr(t0),Gr(r0);const Eu=Me({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Lm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),nR={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},aR=s.defineComponent({name:"ElTag"}),iR=s.defineComponent({...aR,props:Eu,emits:nR,setup(t,{emit:e}){const r=t,n=Kn(),a=De("tag"),i=s.computed(()=>{const{type:u,hit:d,effect:f,closable:h,round:v}=r;return[a.b(),a.is("closable",h),a.m(u||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),o=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(it),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var oR=Be(iR,[["__file","tag.vue"]]);const sR=dt(oR),n0=Symbol("rowContextKey"),lR=Me({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),uR=s.defineComponent({name:"ElRow"}),cR=s.defineComponent({...uR,props:lR,setup(t){const e=t,r=De("row"),n=s.computed(()=>e.gutter);s.provide(n0,{gutter:n});const a=s.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),i=s.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var dR=Be(cR,[["__file","row.vue"]]);const is=dt(dR),fR=Me({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:ke([Number,Object]),default:()=>Ca({})},sm:{type:ke([Number,Object]),default:()=>Ca({})},md:{type:ke([Number,Object]),default:()=>Ca({})},lg:{type:ke([Number,Object]),default:()=>Ca({})},xl:{type:ke([Number,Object]),default:()=>Ca({})}}),hR=s.defineComponent({name:"ElCol"}),pR=s.defineComponent({...hR,props:fR,setup(t){const e=t,{gutter:r}=s.inject(n0,{gutter:s.computed(()=>0)}),n=De("col"),a=s.computed(()=>{const o={};return r.value&&(o.paddingLeft=o.paddingRight=`${r.value/2}px`),o}),i=s.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];xt(d)&&(u==="span"?o.push(n.b(`${e[u]}`)):d>0&&o.push(n.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{xt(e[u])?o.push(n.b(`${u}-${e[u]}`)):yt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{o.push(d!=="span"?n.b(`${u}-${d}-${f}`):n.b(`${u}-${f}`))})}),r.value&&o.push(n.is("guttered")),[n.b(),o]});return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var vR=Be(pR,[["__file","col.vue"]]);const Fi=dt(vR),gR=s.defineComponent({name:"ElCollapseTransition"}),mR=s.defineComponent({...gR,setup(t){const e=De("collapse-transition"),r=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},n={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){r(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){r(a)},leaveCancelled(a){r(a)}};return(a,i)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(e).b()},s.toHandlers(n)),{default:s.withCtx(()=>[s.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var yR=Be(mR,[["__file","collapse-transition.vue"]]);const bR=dt(yR),wR=Me({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let xu=!1;function Mi(t,e){if(!nt)return;const r=function(i){var o;(o=e.drag)==null||o.call(e,i)},n=function(i){var o;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,xu=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;xu||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),xu=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const CR=t=>{const e=s.getCurrentInstance(),{t:r}=xi(),n=s.shallowRef(),a=s.shallowRef(),i=s.computed(()=>t.color.get("alpha")),o=s.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==n.value&&c(f),(h=n.value)==null||h.focus()}function c(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=Tl(f);if(t.vertical){let y=g-v.top;y=Math.max(n.value.offsetHeight/2,y),y=Math.min(y,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((y-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let y=p-v.left;y=Math.max(n.value.offsetWidth/2,y),y=Math.min(y,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((y-n.value.offsetWidth/2)/(v.width-n.value.offsetWidth)*100))}}function u(f){const{code:h,shiftKey:v}=f,p=v?10:1;switch(h){case ft.left:case ft.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case ft.right:case ft.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:n,bar:a,alpha:i,alphaLabel:o,handleDrag:c,handleClick:l,handleKeydown:u}},ER=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=De("color-alpha-slider"),o=s.ref(0),l=s.ref(0),c=s.ref();function u(){if(!r.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-r.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function h(){o.value=u(),l.value=d(),c.value=f()}s.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};Mi(e.value,b),Mi(r.value,b),h()}),s.watch(()=>t.color.get("alpha"),()=>h()),s.watch(()=>t.color.value,()=>h());const v=s.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=s.computed(()=>i.e("bar")),g=s.computed(()=>i.e("thumb")),y=s.computed(()=>({background:c.value})),m=s.computed(()=>({left:wa(o.value),top:wa(l.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:g,thumbStyle:m,update:h}},xR=s.defineComponent({name:"ElColorAlphaSlider"}),kR=s.defineComponent({...xR,props:wR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:c,handleKeydown:u}=CR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=ER(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(y,m)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(d))},[s.createElementVNode("div",{ref_key:"bar",ref:i,class:s.normalizeClass(s.unref(f)),style:s.normalizeStyle(s.unref(h)),onClick:s.unref(c)},null,14,["onClick"]),s.createElementVNode("div",{ref_key:"thumb",ref:o,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(p)),"aria-label":s.unref(a),"aria-valuenow":s.unref(n),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:s.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var SR=Be(kR,[["__file","alpha-slider.vue"]]);const _R=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=De("color-hue-slider"),r=s.getCurrentInstance(),n=s.ref(),a=s.ref(),i=s.ref(0),o=s.ref(0),l=s.computed(()=>t.color.get("hue"));s.watch(()=>l.value,()=>{h()});function c(v){v.target!==n.value&&u(v)}function u(v){if(!a.value||!n.value)return;const g=r.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Tl(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-n.value.offsetHeight/2),w=Math.max(n.value.offsetHeight/2,w),b=Math.round((w-n.value.offsetHeight/2)/(g.height-n.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-n.value.offsetWidth/2),w=Math.max(n.value.offsetWidth/2,w),b=Math.round((w-n.value.offsetWidth/2)/(g.width-n.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!n.value)return 0;const v=r.vnode.el;if(t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function f(){if(!n.value)return 0;const v=r.vnode.el;if(!t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){i.value=d(),o.value=f()}return s.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:p=>{u(p)},end:p=>{u(p)}};Mi(a.value,v),Mi(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:c,update:h,ns:e}}});function TR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[s.createElementVNode("div",{ref:"bar",class:s.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),s.createElementVNode("div",{ref:"thumb",class:s.normalizeClass(t.ns.e("thumb")),style:s.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var NR=Be(_R,[["render",TR],["__file","hue-slider.vue"]]);const IR=Me({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:Na,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),BR={[et]:t=>ct(t)||un(t),[Ei]:t=>ct(t)||un(t),activeChange:t=>ct(t)||un(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},a0=Symbol("colorPickerContextKey"),i0=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},DR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},PR=function(t){return typeof t=="string"&&t.includes("%")},Aa=function(t,e){DR(t)&&(t="100%");const r=PR(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),r&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},o0={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},os=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${o0[e]||e}${o0[r]||r}`},s0=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${os(t)}${os(e)}${os(r)}`},ku={A:10,B:11,C:12,D:13,E:14,F:15},jn=function(t){return t.length===2?(ku[t[0].toUpperCase()]||+t[0])*16+(ku[t[1].toUpperCase()]||+t[1]):ku[t[1].toUpperCase()]||+t[1]},OR=function(t,e,r){e=e/100,r=r/100;let n=e;const a=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=a<=1?a:2-a;const i=(r+e)/2,o=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:o*100,v:i*100}},l0=(t,e,r)=>{t=Aa(t,255),e=Aa(e,255),r=Aa(r,255);const n=Math.max(t,e,r),a=Math.min(t,e,r);let i;const o=n,l=n-a,c=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:{i=(e-r)/l+(e<r?6:0);break}case e:{i=(r-t)/l+2;break}case r:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:c*100,v:o*100}},$i=function(t,e,r){t=Aa(t,360)*6,e=Aa(e,100),r=Aa(r,100);const n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),c=n%6,u=[r,o,i,i,l,r][c],d=[l,r,r,o,i,i][c],f=[i,i,l,r,r,o][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class Vi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in e)Ln(e,r)&&(this[r]=e[r]);e.value?this.fromString(e.value):this.doOnChange()}set(e,r){if(arguments.length===1&&typeof e=="object"){for(const n in e)Ln(e,n)&&this.set(n,e[n]);return}this[`_${e}`]=r,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return $i(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,a,i)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const n=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:o}=OR(n[0],n[1],n[2]);r(a,i,o)}}else if(e.includes("hsv")){const n=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(e.includes("rgb")){const n=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:o}=l0(n[0],n[1],n[2]);r(a,i,o)}}else if(e.includes("#")){const n=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let a,i,o;n.length===3?(a=jn(n[0]+n[0]),i=jn(n[1]+n[1]),o=jn(n[2]+n[2])):(n.length===6||n.length===8)&&(a=jn(n.slice(0,2)),i=jn(n.slice(2,4)),o=jn(n.slice(4,6))),n.length===8?this._alpha=jn(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=l0(a,i,o);r(l,c,u)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:r,_value:n,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const o=i0(e,r/100,n/100);this.value=`hsla(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${s0($i(e,r,n))}${os(a*255/100)}`;break}default:{const{r:o,g:l,b:c}=$i(e,r,n);this.value=`rgba(${o}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=i0(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:o,g:l,b:c}=$i(e,r,n);this.value=`rgb(${o}, ${l}, ${c})`;break}default:this.value=s0($i(e,r,n))}}}const AR=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=De("color-predefine"),{currentColor:r}=s.inject(a0),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Vi;l.fromString(o),n.value.forEach(c=>{c.selected=l.compare(c)})}),s.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(o){t.color.fromString(t.colors[o])}function i(o,l){return o.map(c=>{const u=new Vi;return u.enableAlpha=t.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:n,handleSelect:a,ns:e}}});function RR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b())},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("colors"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.rgbaColors,(o,l)=>(s.openBlock(),s.createElementBlock("div",{key:t.colors[l],class:s.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",o._alpha<100),{selected:o.selected}]),onClick:c=>t.handleSelect(l)},[s.createElementVNode("div",{style:s.normalizeStyle({backgroundColor:o.value})},null,4)],10,["onClick"]))),128))],2)],2)}var LR=Be(AR,[["render",RR],["__file","predefine.vue"]]);const FR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=De("color-svpanel"),r=s.getCurrentInstance(),n=s.ref(0),a=s.ref(0),i=s.ref("hsl(0, 100%, 50%)"),o=s.computed(()=>{const u=t.color.get("hue"),d=t.color.get("value");return{hue:u,value:d}});function l(){const u=t.color.get("saturation"),d=t.color.get("value"),f=r.vnode.el,{clientWidth:h,clientHeight:v}=f;a.value=u*h/100,n.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function c(u){const f=r.vnode.el.getBoundingClientRect(),{clientX:h,clientY:v}=Tl(u);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,n.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return s.watch(()=>o.value,()=>{l()}),s.onMounted(()=>{Mi(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:o,handleDrag:c,update:l,ns:e}}});function MR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b()),style:s.normalizeStyle({backgroundColor:t.background})},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("white"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("black"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("cursor")),style:s.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[s.createElementVNode("div")],6)],6)}var $R=Be(FR,[["render",MR],["__file","sv-panel.vue"]]);const VR=s.defineComponent({name:"ElColorPicker"}),qR=s.defineComponent({...VR,props:IR,emits:BR,setup(t,{expose:e,emit:r}){const n=t,{t:a}=xi(),i=De("color"),{formItem:o}=Gn(),l=Kn(),c=Ia(),{inputId:u,isLabeledByFormItem:d}=Oi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),y=s.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=iu(g,{beforeFocus(){return c.value},beforeBlur(L){var W;return(W=p.value)==null?void 0:W.isFocusInsideContent(L)},afterBlur(){R(!1),z()}});let C=!0;const x=s.reactive(new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=s.ref(!1),E=s.ref(!1),_=s.ref(""),S=s.computed(()=>!n.modelValue&&!E.value?"transparent":D(x,n.showAlpha)),T=s.computed(()=>!n.modelValue&&!E.value?"":x.value),N=s.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),B=s.computed(()=>d.value?o==null?void 0:o.labelId:void 0),P=s.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function D(L,W){if(!(L instanceof Vi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ue}=L.toRgb();return W?`rgba(${Y}, ${se}, ${ue}, ${L.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ue})`}function R(L){k.value=L}const O=Gl(R,100,{leading:!0});function F(){c.value||R(!0)}function A(){O(!1),z()}function z(){s.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",s.nextTick(()=>{E.value=!1}))})}function j(){c.value||O(!k.value)}function H(){x.fromString(_.value)}function G(){const L=x.value;r(et,L),r("change",L),n.validateEvent&&(o==null||o.validate("change").catch(W=>at(W))),O(!1),s.nextTick(()=>{const W=new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(W)||z()})}function X(){O(!1),r(et,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(L=>at(L))),z()}function M(){k.value&&(A(),m.value&&$())}function V(L){L.preventDefault(),L.stopPropagation(),R(!1),z()}function q(L){switch(L.code){case ft.enter:case ft.space:L.preventDefault(),L.stopPropagation(),F(),y.value.focus();break;case ft.esc:V(L);break}}function $(){g.value.focus()}function K(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,L=>{L?L&&L!==x.value&&(C=!1,x.fromString(L)):E.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(et,x.value)}),s.watch(()=>T.value,L=>{_.value=L,C&&r("activeChange",L),C=!0}),s.watch(()=>x.value,()=>{!n.modelValue&&!E.value&&(E.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var L,W,Y;(L=f.value)==null||L.update(),(W=h.value)==null||W.update(),(Y=v.value)==null||Y.update()})}),s.provide(a0,{currentColor:T}),e({color:x,show:F,hide:A,focus:$,blur:K}),(L,W)=>(s.openBlock(),s.createBlock(s.unref(Pa),{ref_key:"popper",ref:p,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[s.unref(i).be("picker","panel"),s.unref(i).b("dropdown"),L.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:L.teleported,transition:`${s.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:Y=>R(!1)},{content:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("div",{onKeydown:s.withKeys(V,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(NR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(x),vertical:""},null,8,["color"]),s.createVNode($R,{ref_key:"sv",ref:h,color:s.unref(x)},null,8,["color"])],2),L.showAlpha?(s.openBlock(),s.createBlock(SR,{key:0,ref_key:"alpha",ref:v,color:s.unref(x)},null,8,["color"])):s.createCommentVNode("v-if",!0),L.predefine?(s.openBlock(),s.createBlock(LR,{key:1,ref:"predefine","enable-alpha":L.showAlpha,color:s.unref(x),colors:L.predefine},null,8,["enable-alpha","color","colors"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","btns"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("dropdown","value"))},[s.createVNode(s.unref(Ai),{ref_key:"inputRef",ref:y,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(H,["enter"]),onBlur:H},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),s.createVNode(s.unref(Ht),{class:s.normalizeClass(s.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:X},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),s.createVNode(s.unref(Ht),{plain:"",size:"small",class:s.normalizeClass(s.unref(i).be("dropdown","btn")),onClick:G},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[s.unref(Xy),M]])]),default:s.withCtx(()=>[s.createElementVNode("div",s.mergeProps({id:s.unref(u),ref_key:"triggerRef",ref:g},L.$attrs,{class:s.unref(P),role:"button","aria-label":s.unref(N),"aria-labelledby":s.unref(B),"aria-description":s.unref(a)("el.colorpicker.description",{color:L.modelValue||""}),"aria-disabled":s.unref(c),tabindex:s.unref(c)?-1:L.tabindex,onKeydown:q,onFocus:s.unref(b),onBlur:s.unref(w)}),[s.unref(c)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).be("picker","mask"))},null,2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("picker","trigger")),onClick:j},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",L.showAlpha)])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("picker","color-inner")),style:s.normalizeStyle({backgroundColor:s.unref(S)})},[s.withDirectives(s.createVNode(s.unref(it),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.ArrowDown))]),_:1},8,["class"]),[[s.vShow,L.modelValue||E.value]]),s.withDirectives(s.createVNode(s.unref(it),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(Ne.Close))]),_:1},8,["class"]),[[s.vShow,!L.modelValue&&!E.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var zR=Be(qR,[["__file","color-picker.vue"]]);const HR=dt(zR),KR=s.defineComponent({name:"ElContainer"}),GR=s.defineComponent({...KR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=De("container"),a=s.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,o)=>(s.openBlock(),s.createElementBlock("section",{class:s.normalizeClass([s.unref(n).b(),s.unref(n).is("vertical",s.unref(a))])},[s.renderSlot(i.$slots,"default")],2))}});var UR=Be(GR,[["__file","container.vue"]]);const jR=s.defineComponent({name:"ElAside"}),WR=s.defineComponent({...jR,props:{width:{type:String,default:null}},setup(t){const e=t,r=De("aside"),n=s.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("aside",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var u0=Be(WR,[["__file","aside.vue"]]);const YR=s.defineComponent({name:"ElFooter"}),ZR=s.defineComponent({...YR,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("footer"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("footer",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var c0=Be(ZR,[["__file","footer.vue"]]);const XR=s.defineComponent({name:"ElHeader"}),JR=s.defineComponent({...XR,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("header"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("header",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var d0=Be(JR,[["__file","header.vue"]]);const QR=s.defineComponent({name:"ElMain"}),eL=s.defineComponent({...QR,setup(t){const e=De("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var f0=Be(eL,[["__file","main.vue"]]);const Su=dt(UR,{Aside:u0,Footer:c0,Header:d0,Main:f0});Gr(u0),Gr(c0);const h0=Gr(d0),_u=Gr(f0),tL=s.defineComponent({inheritAttrs:!1});function rL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var nL=Be(tL,[["render",rL],["__file","collection.vue"]]);const aL=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function iL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var oL=Be(aL,[["render",iL],["__file","collection-item.vue"]]);const sL="data-el-collection-item",lL=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...nL,name:e,setup(){const l=s.ref(null),c=new Map,u=()=>{const d=s.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${sL}]`));return[...c.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:c,getItems:u,collectionRef:l})}},o={...oL,name:r,setup(l,{attrs:c}){const u=s.ref(null),d=s.inject(n,void 0);s.provide(a,{collectionItemRef:u}),s.onMounted(()=>{const f=s.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),s.onBeforeUnmount(()=>{const f=s.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:o}},Tu=Me({trigger:Ri.trigger,effect:{...$t.effect,default:"light"},type:{type:ke(String)},placement:{type:ke(String),default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ke([Number,String]),default:0},maxHeight:{type:ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ke(Object)},teleported:$t.teleported});Me({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:dn}}),Me({onKeydown:{type:ke(Function)}}),lL("Dropdown");const p0=Symbol("ElSelectGroup"),qi=Symbol("ElSelect");function uL(t,e){const r=s.inject(qi),n=s.inject(p0,{disabled:!1}),a=s.computed(()=>d(sn(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=sn((v=r.props.modelValue)!=null?v:[]);return!a.value&&p.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=s.computed(()=>t.label||(yt(t.value)?"":t.value)),l=s.computed(()=>t.value||t.label||""),c=s.computed(()=>t.disabled||e.groupDisabled||i.value),u=s.getCurrentInstance(),d=(v=[],p)=>{if(yt(t.value)){const g=r.props.valueKey;return v&&v.some(y=>s.toRaw(Hr(y,g))===Hr(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},h=v=>{const p=new RegExp(eD(v),"i");e.visible=p.test(o.value)||t.created};return s.watch(()=>o.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),s.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:y}=r.props;if(v!==p&&(r.onOptionDestroy(p,u.proxy),r.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&yt(v)&&yt(p)&&v[y]===p[y])return;r.setSelected()}}),s.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:o,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:h}}const cL=s.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=De("select"),r=Di(),n=s.computed(()=>[e.be("dropdown","item"),e.is("disabled",s.unref(l)),e.is("selected",s.unref(o)),e.is("hovering",s.unref(h))]),a=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d}=uL(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;c.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);s.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function p(){l.value||c.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:o,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function dL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:t.id,class:s.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:s.withModifiers(t.selectOptionClick,["stop"])},[s.renderSlot(t.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,t.visible]])}var Nu=Be(cL,[["render",dL],["__file","option.vue"]]);const fL=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject(qi),e=De("select"),r=s.computed(()=>t.props.popperClass),n=s.computed(()=>t.props.multiple),a=s.computed(()=>t.props.fitInputWidth),i=s.ref("");function o(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return s.onMounted(()=>{o(),Vr(t.selectRef,o)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function hL(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:s.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("dropdown","header"))},[s.renderSlot(t.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"default"),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.ns.be("dropdown","footer"))},[s.renderSlot(t.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var pL=Be(fL,[["render",hL],["__file","select-dropdown.vue"]]);const vL=11,gL=(t,e)=>{const{t:r}=xi(),n=Di(),a=De("select"),i=De("input"),o=s.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.ref(null),f=s.ref(null),h=s.ref(null),v=s.ref(null),p=s.ref(null),g=s.ref(null),y=s.ref(null),m=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k}=wy({afterComposition:Q=>te(Q)}),{wrapperRef:E,isFocused:_}=iu(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(Q){var he,Oe;return((he=u.value)==null?void 0:he.isFocusInsideContent(Q))||((Oe=d.value)==null?void 0:Oe.isFocusInsideContent(Q))},afterBlur(){S.value=!1,o.menuVisibleOnFocus=!1}}),S=s.ref(!1),T=s.ref(),{form:N,formItem:B}=Gn(),{inputId:P}=Oi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=AP(t),O=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),F=s.computed(()=>Et(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),A=s.computed(()=>t.clearable&&!O.value&&o.inputHovering&&F.value),z=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),j=s.computed(()=>a.is("reverse",z.value&&S.value)),H=s.computed(()=>(B==null?void 0:B.validateState)||""),G=s.computed(()=>Rm[H.value]),X=s.computed(()=>t.remote?300:0),M=s.computed(()=>t.loading?t.loadingText||r("el.select.loading"):t.remote&&!o.inputValue&&o.options.size===0?!1:t.filterable&&o.inputValue&&o.options.size>0&&V.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),V=s.computed(()=>q.value.filter(Q=>Q.visible).length),q=s.computed(()=>{const Q=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Oe=>{const He=Q.findIndex(Fr=>Fr.value===Oe);He>-1&&he.push(Q[He])}),he.length>=Q.length?he:Q}),$=s.computed(()=>Array.from(o.cachedOptions.values())),K=s.computed(()=>{const Q=q.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!Q}),L=()=>{t.filterable&&Mt(t.filterMethod)||t.filterable&&t.remote&&Mt(t.remoteMethod)||q.value.forEach(Q=>{var he;(he=Q.updateOption)==null||he.call(Q,o.inputValue)})},W=Kn(),Y=s.computed(()=>["small"].includes(W.value)?"small":"default"),se=s.computed({get(){return S.value&&M.value!==!1},set(Q){S.value=Q}}),ue=s.computed(()=>{if(t.multiple&&!cn(t.modelValue))return sn(t.modelValue).length===0&&!o.inputValue;const Q=Et(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||cn(Q)?!o.inputValue:!0}),ae=s.computed(()=>{var Q;const he=(Q=t.placeholder)!=null?Q:r("el.select.placeholder");return t.multiple||!F.value?he:o.selectedLabel}),ne=s.computed(()=>_l?null:"mouseenter");s.watch(()=>t.modelValue,(Q,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ce("")),fe(),!zo(Q,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Oe=>at(Oe)))},{flush:"post",deep:!0}),s.watch(()=>S.value,Q=>{Q?ce(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",Q)}),s.watch(()=>o.options.entries(),()=>{var Q;if(!nt)return;const he=((Q=l.value)==null?void 0:Q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!cn(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,Q=>{xt(Q)&&Q>-1?T.value=q.value[Q]||{}:T.value={},q.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||L()});const ce=Q=>{o.previousQuery===Q||w.value||(o.previousQuery=Q,t.filterable&&Mt(t.filterMethod)?t.filterMethod(Q):t.filterable&&t.remote&&Mt(t.remoteMethod)&&t.remoteMethod(Q),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value?s.nextTick(ie):s.nextTick(Pe))},ie=()=>{const Q=q.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=Q.find(He=>He.created),Oe=Q[0];o.hoveringIndex=ye(q.value,he||Oe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=Et(t.modelValue)?t.modelValue[0]:t.modelValue,Oe=pe(he);o.selectedLabel=Oe.currentLabel,o.selected=[Oe];return}const Q=[];cn(t.modelValue)||sn(t.modelValue).forEach(he=>{Q.push(pe(he))}),o.selected=Q},pe=Q=>{let he;const Oe=Nl(Q).toLowerCase()==="object",He=Nl(Q).toLowerCase()==="null",Fr=Nl(Q).toLowerCase()==="undefined";for(let an=o.cachedOptions.size-1;an>=0;an--){const ur=$.value[an];if(Oe?Hr(ur.value,t.valueKey)===Hr(Q,t.valueKey):ur.value===Q){he={value:Q,currentLabel:ur.currentLabel,get isDisabled(){return ur.isDisabled}};break}}if(he)return he;const An=Oe?Q.label:!He&&!Fr?Q:"";return{value:Q,currentLabel:An}},Pe=()=>{o.hoveringIndex=q.value.findIndex(Q=>o.selected.some(he=>Lt(he)===Lt(Q)))},Ie=()=>{o.selectionWidth=c.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},xe=()=>{o.collapseItemWidth=m.value.getBoundingClientRect().width},re=()=>{var Q,he;(he=(Q=u.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},I=()=>{var Q,he;(he=(Q=d.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},U=()=>{o.inputValue.length>0&&!S.value&&(S.value=!0),ce(o.inputValue)},te=Q=>{if(o.inputValue=Q.target.value,t.remote)Z();else return U()},Z=Gl(()=>{U()},X.value),J=Q=>{zo(t.modelValue,Q)||e(Ei,Q)},le=Q=>WB(Q,he=>!o.disabledOptions.has(he)),ee=Q=>{if(t.multiple&&Q.code!==ft.delete&&Q.target.value.length<=0){const he=sn(t.modelValue).slice(),Oe=le(he);if(Oe<0)return;const He=he[Oe];he.splice(Oe,1),e(et,he),J(he),e("remove-tag",He)}},oe=(Q,he)=>{const Oe=o.selected.indexOf(he);if(Oe>-1&&!O.value){const He=sn(t.modelValue).slice();He.splice(Oe,1),e(et,He),J(He),e("remove-tag",he.value)}Q.stopPropagation(),st()},me=Q=>{Q.stopPropagation();const he=t.multiple?[]:D.value;if(t.multiple)for(const Oe of o.selected)Oe.isDisabled&&he.push(Oe.value);e(et,he),J(he),o.hoveringIndex=-1,S.value=!1,e("clear"),st()},be=Q=>{var he;if(t.multiple){const Oe=sn((he=t.modelValue)!=null?he:[]).slice(),He=ye(Oe,Q.value);He>-1?Oe.splice(He,1):(t.multipleLimit<=0||Oe.length<t.multipleLimit)&&Oe.push(Q.value),e(et,Oe),J(Oe),Q.created&&ce(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(et,Q.value),J(Q.value),S.value=!1;st(),!S.value&&s.nextTick(()=>{_e(Q)})},ye=(Q=[],he)=>{if(!yt(he))return Q.indexOf(he);const Oe=t.valueKey;let He=-1;return Q.some((Fr,An)=>s.toRaw(Hr(Fr,Oe))===Hr(he,Oe)?(He=An,!0):!1),He},_e=Q=>{var he,Oe,He,Fr,An;const vi=Et(Q)?Q[0]:Q;let an=null;if(vi!=null&&vi.value){const ur=q.value.filter(Rn=>Rn.value===vi.value);ur.length>0&&(an=ur[0].$el)}if(u.value&&an){const ur=(Fr=(He=(Oe=(he=u.value)==null?void 0:he.popperRef)==null?void 0:Oe.contentRef)==null?void 0:He.querySelector)==null?void 0:Fr.call(He,`.${a.be("dropdown","wrap")}`);ur&&rD(ur,an)}(An=b.value)==null||An.handleScroll()},ge=Q=>{o.options.set(Q.value,Q),o.cachedOptions.set(Q.value,Q),Q.disabled&&o.disabledOptions.set(Q.value,Q)},Ce=(Q,he)=>{o.options.get(Q)===he&&o.options.delete(Q)},je=s.computed(()=>{var Q,he;return(he=(Q=u.value)==null?void 0:Q.popperRef)==null?void 0:he.contentRef}),qe=()=>{o.isBeforeHide=!1,s.nextTick(()=>_e(o.selected))},st=()=>{var Q;(Q=f.value)==null||Q.focus()},lt=()=>{var Q;(Q=f.value)==null||Q.blur()},tt=Q=>{me(Q)},Rt=()=>{S.value=!1,_.value&&lt()},mt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},wt=()=>{O.value||(_l&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Jt=()=>{S.value?q.value[o.hoveringIndex]&&be(q.value[o.hoveringIndex]):wt()},Lt=Q=>yt(Q.value)?Hr(Q.value,t.valueKey):Q.value,Ft=s.computed(()=>q.value.filter(Q=>Q.visible).every(Q=>Q.disabled)),lr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(0,t.maxCollapseTags):o.selected:[]),Cr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(t.maxCollapseTags):[]:[]),jt=Q=>{if(!S.value){S.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Ft.value){Q==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):Q==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const he=q.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(Q),s.nextTick(()=>_e(T.value))}},rt=()=>{if(!c.value)return 0;const Q=window.getComputedStyle(c.value);return Number.parseFloat(Q.gap||"6px")},ut=s.computed(()=>{const Q=rt();return{maxWidth:`${m.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-Q:o.selectionWidth}px`}}),Ct=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),On=s.computed(()=>({width:`${Math.max(o.calculatorWidth,vL)}px`}));return Vr(c,Ie),Vr(h,we),Vr(g,re),Vr(E,re),Vr(y,I),Vr(m,xe),s.onMounted(()=>{fe()}),{inputId:P,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:q,hoverOption:T,selectSize:W,filteredOptionsCount:V,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:_e,hasModelValue:F,shouldShowPlaceholder:ue,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:A,iconComponent:z,iconReverse:j,validateState:H,validateIcon:G,showNewOption:K,updateOptions:L,collapseTagSize:Y,setSelected:fe,selectDisabled:O,emptyText:M,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:st,blur:lt,handleClearClick:tt,handleClickOutside:Rt,handleEsc:mt,toggleMenu:wt,selectOption:Jt,getValueKey:Lt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:ut,collapseTagStyle:Ct,inputStyle:On,popperRef:je,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:E,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var mL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject(qi);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){Et(u)&&u.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!ct(d.children)&&!Et(d.children)&&Mt((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):Et(d.children)&&c(d.children)})}return o.length&&c((i=o[0])==null?void 0:i.children),zo(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const yL=Me({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Na,effect:{type:ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:$t.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:dn,default:Ne.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:dn,default:Ne.ArrowDown},tagType:{...Eu.type,default:"info"},tagEffect:{...Eu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:jo,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...OP,...jr(["ariaLabel"])}),v0="ElSelect",bL=s.defineComponent({name:v0,componentName:v0,components:{ElSelectMenu:pL,ElOption:Nu,ElOptions:mL,ElTag:sR,ElScrollbar:Sy,ElTooltip:Pa,ElIcon:it},directives:{ClickOutside:Xy},props:yL,emits:[et,Ei,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=s.computed(()=>{const{modelValue:i,multiple:o}=t,l=o?[]:void 0;return Et(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=gL(n,e);return s.provide(qi,s.reactive({props:n,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:r}}});function wL(t,e,r,n,a,i){const o=s.resolveComponent("el-tag"),l=s.resolveComponent("el-tooltip"),c=s.resolveComponent("el-icon"),u=s.resolveComponent("el-option"),d=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),h=s.resolveComponent("el-select-menu"),v=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[s.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[s.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:s.withCtx(()=>{var p;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:s.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(t.nsSelect.e("prefix"))},[s.renderSlot(t.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?s.renderSlot(t.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.showTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(s.openBlock(),s.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))}," + "+s.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(t.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.collapseTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),t.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:s.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:s.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:s.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[s.vModelText,t.states.inputValue]]),t.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(t.nsSelect.e("input-calculator")),textContent:s.toDisplayString(t.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?s.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(t.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(s.openBlock(),s.createBlock(c,{key:0,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(s.openBlock(),s.createBlock(c,{key:1,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(s.openBlock(),s.createBlock(c,{key:2,class:s.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(h,{ref:"menuRef"},{default:s.withCtx(()=>[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:s.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[t.showNewOption?(s.openBlock(),s.createBlock(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(d,null,{default:s.withCtx(()=>[s.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.nsSelect.be("dropdown","loading"))},[s.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.nsSelect.be("dropdown","empty"))},[s.renderSlot(t.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"footer")],10,["onClick"])):s.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var CL=Be(bL,[["render",wL],["__file","select.vue"]]);const EL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=De("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(p0,s.reactive({...s.toRefs(t)}));const i=s.computed(()=>a.value.some(u=>u.visible===!0)),o=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=sn(u),f=[];return d.forEach(h=>{var v,p;o(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},c=()=>{a.value=l(n.subTree)};return s.onMounted(()=>{c()}),Z_(r,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function xL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(t.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(t.ns.be("group","title"))},s.toDisplayString(t.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(t.ns.b("group"))},[s.renderSlot(t.$slots,"default")],2)])],2)),[[s.vShow,t.visible]])}var g0=Be(EL,[["render",xL],["__file","option-group.vue"]]);const kL=dt(CL,{Option:Nu,OptionGroup:g0}),SL=Gr(Nu);Gr(g0);const _L=Me({trigger:Ri.trigger,placement:Tu.placement,disabled:Ri.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Tu.popperOptions,tabindex:Tu.tabindex,content:$t.content,popperStyle:$t.popperStyle,popperClass:$t.popperClass,enterable:{...$t.enterable,default:!0},effect:{...$t.effect,default:"light"},teleported:$t.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),TL={"update:visible":t=>ba(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},NL="onUpdate:visible",IL=s.defineComponent({name:"ElPopover"}),BL=s.defineComponent({...IL,props:_L,emits:TL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[NL]),i=De("popover"),o=s.ref(),l=s.computed(()=>{var y;return(y=s.unref(o))==null?void 0:y.popperRef}),c=s.computed(()=>[{width:wa(n.width)},n.popperStyle]),u=s.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=s.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=o.value)==null||y.hide()},h=()=>{r("before-enter")},v=()=>{r("before-leave")},p=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(s.openBlock(),s.createBlock(s.unref(Pa),s.mergeProps({ref_key:"tooltipRef",ref:o},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":s.unref(u),"popper-style":s.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[y.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(y.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(y.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(y.content),1)])]),default:s.withCtx(()=>[y.$slots.reference?s.renderSlot(y.$slots,"reference",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var DL=Be(BL,[["__file","popover.vue"]]);const m0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var PL={mounted(t,e){m0(t,e)},updated(t,e){m0(t,e)}};const OL=aD(PL,"popover"),Ra=dt(DL,{directive:OL}),La="$treeNodeId",y0=function(t,e){!e||e[La]||Object.defineProperty(e,La,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Iu=function(t,e){return t?e[t]:e[La]},Bu=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Du=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const o=t[a];(o.checked!==!0||o.indeterminate)&&(e=!1,o.disabled||(n=!1)),(o.checked!==!1||o.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},zi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Du(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):n?(t.checked=!1,t.indeterminate=!0):r&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||zi(a)},ss=function(t,e){const r=t.store.props,n=t.data||{},a=r[e];if(typeof a=="function")return a(n,t);if(typeof a=="string")return n[a];if(typeof a>"u"){const i=n[e];return i===void 0?"":i}};let AL=0;class Wn{constructor(e){this.id=AL++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in e)Ln(e,r)&&(this[r]=e[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const r=e.props;if(r&&typeof r.isLeaf<"u"){const i=ss(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||y0(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,a=e.key;a&&n&&n.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||y0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=ss(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return ss(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return ss(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return e.childNodes[r+1]}return null}get previousSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return r>0?e.childNodes[r-1]:null}return null}contains(e,r=!0){return(this.childNodes||[]).some(n=>n===e||r&&n.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,r,n){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Wn)){if(!n){const a=this.getChildren(!0);a.includes(e.data)||(typeof r>"u"||r<0?a.push(e.data):a.splice(r,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=s.reactive(new Wn(e)),e instanceof Wn&&e.initialize()}e.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),this.updateLeafState()}insertBefore(e,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(e,n)}insertAfter(e,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(e,n)}removeChild(e){const r=this.getChildren()||[],n=r.indexOf(e.data);n>-1&&r.splice(n,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(e,r){const n=()=>{if(r){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||zi(this),n())}):n()}doCreateChildren(e,r={}){e.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,r,n,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:o,allWithoutDisable:l}=Du(this.childNodes);!this.isLeaf&&!o&&l&&(this.checked=!1,e=!1);const c=()=>{if(r){const u=this.childNodes;for(let h=0,v=u.length;h<v;h++){const p=u[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,r,!0,a)}const{half:d,all:f}=Du(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),zi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||n||zi(i)}getChildren(e=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let a="children";return n&&(a=n.children||"children"),r[a]===void 0&&(r[a]=null),e&&!r[a]&&(r[a]=[]),r[a]}updateChildren(){const e=this.getChildren()||[],r=this.childNodes.map(i=>i.data),n={},a=[];e.forEach((i,o)=>{const l=i[La];!!l&&r.findIndex(u=>u[La]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[La]]||this.removeChildByData(i)}),a.forEach(({index:i,data:o})=>{this.insertChild({data:o},i)}),this.updateLeafState()}loadData(e,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,n,a)}else e&&e.call(this)}eachNode(e){const r=[this];for(;r.length;){const n=r.shift();r.unshift(...n.childNodes),e(n)}}reInitChecked(){this.store.checkStrictly||zi(this)}}class RL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Ln(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new Wn({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const r=this.filterNodeMethod,n=this.lazy,a=function(i){const o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&o.length){let l=!0;l=!o.some(c=>c.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!n||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Wn)return e;const r=yt(e)?Iu(this.key,e):e;return this.nodesMap[r]||null}insertBefore(e,r){const n=this.getNode(r);n.parent.insertBefore({data:e},n)}insertAfter(e,r){const n=this.getNode(r);n.parent.insertAfter({data:e},n)}remove(e){const r=this.getNode(e);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(e,r){const n=Ho(r)?this.root:this.getNode(r);n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],r=this.nodesMap;e.forEach(n=>{const a=r[n];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const r=this.key;!e||!e.data||(r?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,r=!1){const n=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||r&&l.indeterminate)&&(!e||e&&l.isLeaf)&&n.push(l.data),a(l)})};return a(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const e=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),r(i)})};return r(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],r=this.nodesMap;for(const n in r)Ln(r,n)&&e.push(r[n]);return e}updateChildren(e,r){const n=this.nodesMap[e];if(!n)return;const a=n.childNodes;for(let i=a.length-1;i>=0;i--){const o=a[i];this.remove(o.data)}for(let i=0,o=r.length;i<o;i++){const l=r[i];this.append(l,n.data)}}_setCheckedKeys(e,r=!1,n){const a=this._getAllNodes().sort((c,u)=>c.level-u.level),i=Object.create(null),o=Object.keys(n);a.forEach(c=>c.setChecked(!1,!1));const l=c=>{c.childNodes.forEach(u=>{var d;i[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&l(u)})};for(let c=0,u=a.length;c<u;c++){const d=a[c],f=d.data[e].toString();if(!o.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),r){d.setChecked(!1,!1);const v=function(p){p.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,r=!1){const n=this.key,a={};e.forEach(i=>{a[(i||{})[n]]=!0}),this._setCheckedKeys(n,r,a)}setCheckedKeys(e,r=!1){this.defaultCheckedKeys=e;const n=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(n,r,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(e,r,n){const a=this.getNode(e);a&&a.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,r=!0){const n=e[this.key],a=this.nodesMap[n];this.setCurrentNode(a),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,r=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(e);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const LL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=De("tree"),r=s.inject("NodeInstance"),n=s.inject("RootTree");return()=>{const a=t.node,{data:i,store:o}=a;return t.renderContent?t.renderContent(s.h,{_self:r,node:a,data:i,store:o}):s.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[s.h("span",{class:e.be("node","label")},[a.label])])}}});var FL=Be(LL,[["__file","tree-node-content.vue"]]);function b0(t){const e=s.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),s.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const w0=Symbol("dragEvents");function ML({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=De("tree"),o=s.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}o.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},c=({event:d,treeNode:f})=>{const h=f,v=o.value.dropNode;v&&v.node.id!==h.node.id&&qn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=y=t.allowDrop(p.node,h.node,"inner"),m=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||y||m?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(m=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(y=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,y=!1,m=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const k=g?y?.25:m?.45:1:-1,E=m?y?.75:g?.55:0:1;let _=-9999;const S=d.clientY-w.top;S<w.height*k?x="before":S>w.height*E?x="after":y?x="inner":x="none";const T=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),N=n.value;x==="before"?_=T.top-C.top:x==="after"&&(_=T.bottom-C.top),N.style.top=`${_}px`,N.style.left=`${T.right-C.left}px`,x==="inner"?Ul(h.$el,i.is("drop-inner")):qn(h.$el,i.is("drop-inner")),o.value.showDropIndicator=x==="before"||x==="after",o.value.allowDrop=o.value.showDropIndicator||b,o.value.dropType=x,e.emit("node-drag-over",p.node,h.node,d)},u=d=>{const{draggingNode:f,dropType:h,dropNode:v}=o.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),qn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),o.value.showDropIndicator=!1,o.value.draggingNode=null,o.value.dropNode=null,o.value.allowDrop=!0};return s.provide(w0,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:o}}const $L=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:bR,ElCheckbox:rR,NodeContent:FL,ElIcon:it,Loading:Ne.Loading},props:{node:{type:Wn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=De("tree"),{broadcastExpanded:n}=b0(t),a=s.inject("RootTree"),i=s.ref(!1),o=s.ref(!1),l=s.ref(null),c=s.ref(null),u=s.ref(null),d=s.inject(w0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||at("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,o.value=!0);const h=a.props.props.children||"children";s.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),s.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),s.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),s.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),s.watch(()=>t.node.expanded,S=>{s.nextTick(()=>i.value=S),S&&(o.value=!0)});const v=S=>Iu(a.props.nodeKey,S.data),p=S=>{const T=t.props.class;if(!T)return{};let N;if(Mt(T)){const{data:B}=S;N=T(B,S)}else N=T;return ct(N)?{[N]:!0}:N},g=(S,T)=>{(l.value!==S||c.value!==T)&&a.ctx.emit("check-change",t.node.data,S,T),l.value=S,c.value=T},y=S=>{Bu(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,T)=>{t.node.setChecked(T.target.checked,!a.props.checkStrictly),s.nextTick(()=>{const N=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:N.getCheckedNodes(),checkedKeys:N.getCheckedKeys(),halfCheckedNodes:N.getHalfCheckedNodes(),halfCheckedKeys:N.getHalfCheckedKeys()})})};return{ns:r,node$:u,tree:a,expanded:i,childNodeRendered:o,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,T,N)=>{n(T),a.ctx.emit("node-expand",S,T,N)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:u.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:Ne.CaretRight}}});function VL(t,e,r,n,a,i){const o=s.resolveComponent("el-icon"),l=s.resolveComponent("el-checkbox"),c=s.resolveComponent("loading"),u=s.resolveComponent("node-content"),d=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:s.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:s.withModifiers(t.handleDragStart,["stop"]),onDragover:s.withModifiers(t.handleDragOver,["stop"]),onDragend:s.withModifiers(t.handleDragEnd,["stop"]),onDrop:s.withModifiers(t.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(s.openBlock(),s.createBlock(o,{key:0,class:s.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:s.withModifiers(t.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.showCheckbox?(s.openBlock(),s.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),t.node.loading?(s.openBlock(),s.createBlock(o,{key:2,class:s.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(c)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(u,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.node.childNodes,h=>(s.openBlock(),s.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,t.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,t.node.visible]])}var qL=Be($L,[["render",VL],["__file","tree-node.vue"]]);function zL({el$:t},e){const r=De("tree"),n=s.shallowRef([]),a=s.shallowRef([]);s.onMounted(()=>{o()}),s.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),s.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),Qt(t,"keydown",l=>{const c=l.target;if(!c.className.includes(r.b("node")))return;const u=l.code;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const d=n.value.indexOf(c);let f;if([ft.up,ft.down].includes(u)){if(l.preventDefault(),u===ft.up){f=d===-1?0:d!==0?d-1:n.value.length-1;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=n.value.length-1)}}else{f=d===-1?0:d<n.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=n.value.length&&(f=0)}}f!==-1&&n.value[f].focus()}[ft.left,ft.right].includes(u)&&(l.preventDefault(),c.click());const h=c.querySelector('[type="checkbox"]');[ft.enter,ft.space].includes(u)&&h&&(l.preventDefault(),h.click())});const o=()=>{var l;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const c=t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(l=n.value[0])==null||l.setAttribute("tabindex","0")}}const HL=s.defineComponent({name:"ElTree",components:{ElTreeNode:qL},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:dn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:r}=xi(),n=De("tree"),a=s.inject(qi,null),i=s.ref(new RL({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const o=s.ref(i.value.root),l=s.ref(null),c=s.ref(null),u=s.ref(null),{broadcastExpanded:d}=b0(t),{dragState:f}=ML({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});zL({el$:c},i);const h=s.computed(()=>{const{childNodes:A}=o.value,z=a?a.hasFilteredOptions!==0:!1;return(!A||A.length===0||A.every(({visible:j})=>!j))&&!z});s.watch(()=>t.currentNodeKey,A=>{i.value.setCurrentNodeKey(A)}),s.watch(()=>t.defaultCheckedKeys,A=>{i.value.setDefaultCheckedKey(A)}),s.watch(()=>t.defaultExpandedKeys,A=>{i.value.setDefaultExpandedKeys(A)}),s.watch(()=>t.data,A=>{i.value.setData(A)},{deep:!0}),s.watch(()=>t.checkStrictly,A=>{i.value.checkStrictly=A});const v=A=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(A)},p=A=>Iu(t.nodeKey,A.data),g=A=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const z=i.value.getNode(A);if(!z)return[];const j=[z.data];let H=z.parent;for(;H&&H!==o.value;)j.push(H.data),H=H.parent;return j.reverse()},y=(A,z)=>i.value.getCheckedNodes(A,z),m=A=>i.value.getCheckedKeys(A),b=()=>{const A=i.value.getCurrentNode();return A?A.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const A=b();return A?A[t.nodeKey]:null},C=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(A,z)},x=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(A,z)},k=(A,z,j)=>{i.value.setChecked(A,z,j)},E=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(A,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Bu(i,e.emit,()=>{d(A),i.value.setUserCurrentNode(A,z)})},T=(A,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Bu(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(A,z)})},N=A=>i.value.getNode(A),B=A=>{i.value.remove(A)},P=(A,z)=>{i.value.append(A,z)},D=(A,z)=>{i.value.insertBefore(A,z)},R=(A,z)=>{i.value.insertAfter(A,z)},O=(A,z,j)=>{d(z),e.emit("node-expand",A,z,j)},F=(A,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(A,z)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Pi,void 0),{ns:n,store:i,root:o,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:k,getHalfCheckedNodes:E,getHalfCheckedKeys:_,setCurrentNode:S,setCurrentKey:T,t:r,getNode:N,remove:B,append:P,insertBefore:D,insertAfter:R,handleNodeExpand:O,updateKeyChildren:F}}});function KL(t,e,r,n,a,i){const o=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.root.childNodes,l=>(s.openBlock(),s.createBlock(o,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.e("empty-block"))},[s.renderSlot(t.$slots,"empty",{},()=>{var l;return[s.createElementVNode("span",{class:s.normalizeClass(t.ns.e("empty-text"))},s.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[s.vShow,t.dragState.showDropIndicator]])],2)}var GL=Be(HL,[["render",KL],["__file","tree.vue"]]);const UL=dt(GL);function jL(t){let e;const r=s.ref(!1),n=s.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){n.text=h}function i(){const h=n.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(qn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),qn(h,v.bm("parent","hidden"))}o(),d.unmount()}function o(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(c,400),n.visible=!1,(h=t.closed)==null||h.call(t))}function c(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,i()}const u=s.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=LP("loading");return v({ns:p,zIndex:g}),()=>{const y=n.spinner||n.svg,m=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[s.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?s.h("p",{class:p.b("text")},[n.text]):void 0;return s.h(s.Transition,{name:p.b("fade"),onAfterLeave:c},{default:s.withCtx(()=>[s.withDirectives(s.createVNode("div",{style:{backgroundColor:n.background||""},class:[p.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[s.h("div",{class:p.b("spinner")},[m,b])]),[[s.vShow,n.visible]])])})}}}),d=s.createApp(u),f=d.mount(document.createElement("div"));return{...s.toRefs(n),setText:a,removeElLoadingChild:o,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let ls;const WL=function(t={}){if(!nt)return;const e=YL(t);if(e.fullscreen&&ls)return ls;const r=jL({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(ls=void 0)}});ZL(e,e.parent,r),C0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>C0(e,e.parent,r);let n=e.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",e.parent.setAttribute("loading-number",n),e.parent.appendChild(r.$el),s.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(ls=r),r},YL=t=>{var e,r,n,a;let i;return ct(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((r=t.fullscreen)!=null?r:!0),lock:(n=t.lock)!=null?n:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},ZL=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=Ci(document.body,"position"),r.originalOverflow.value=Ci(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=Ci(document.body,"position"),await s.nextTick();for(const i of["top","left"]){const o=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[o]+document.documentElement[o]-Number.parseInt(Ci(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=Ci(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},C0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?qn(e,n.bm("parent","relative")):Ul(e,n.bm("parent","relative")),t.fullscreen&&t.lock?Ul(e,n.bm("parent","hidden")):qn(e,n.bm("parent","hidden"))},us=Symbol("ElLoading"),E0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>yt(e.value)?e.value[h]:void 0,c=h=>{const v=ct(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},u=h=>c(l(h)||t.getAttribute(`element-loading-${lT(h)}`)),d=(r=l("fullscreen"))!=null?r:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[us]={options:f,instance:WL(f)}},XL=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Pu={mounted(t,e){e.value&&E0(t,e)},updated(t,e){const r=t[us];e.oldValue!==e.value&&(e.value&&!e.oldValue?E0(t,e):e.value&&e.oldValue?yt(e.value)&&XL(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[us])==null||e.instance.close(),t[us]=null}},Yt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},JL="Copy to clipboard",QL="Copied!",eF={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:JL},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
- `,""),r=document.createElement("div");r.innerHTML=this.content;const n=r.textContent||r.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([n],{type:"text/plain"}),o=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([o])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?(this.textLabel=QL,this.$emit("copied",{status:"success"})):(this.textLabel="Error trying to copy to clipboard!",this.$emit("copied",{status:"error"}))},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},tF={class:"visually-hidden"};function rF(t,e,r,n,a,i){const o=Ne.CopyDocument,l=it,c=Ht,u=Pa;return s.openBlock(),s.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:s.normalizeClass(["copy-clipboard-button",r.theme]),size:"small",onClick:i.copyToClipboard,disabled:!r.content},{default:s.withCtx(()=>[s.createVNode(l,{color:r.content?"#8300bf":"#dab3ec"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1},8,["color"]),s.createElementVNode("span",tF,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const cs=Yt(eF,[["render",rF],["__scopeId","data-v-c791b9aa"]]),nF={name:"AnnotationPopup",props:{annotationEntry:{type:Array}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:"",entryIndex:0}},computed:{entry:function(){return this.annotationEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.annotationEntry[this.entryIndex-1])==null?void 0:t.label},nextLabel:function(){var t;return this.entryIndex===this.annotationEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.annotationEntry[this.entryIndex+1])==null?void 0:t.label},isEditable:function(){return this.entry.resourceId&&this.entry.featureId},isPositionUpdated:function(){return this.entry.resourceId&&this.entry.type==="updated"&&this.entry.positionUpdated},isDeleted:function(){return this.entry.resourceId&&this.entry.type==="deleted"},ontologyLink:function(){const t=this.entry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.entry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()},offlineAnnotationEnabled:function(){return this.entry?this.entry.offline:!1}},methods:{previous:function(){if(this.entryIndex!==0){this.entryIndex=this.entryIndex-1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_previous",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},next:function(){if(this.entryIndex!==this.annotationEntry.length-1){this.entryIndex=this.entryIndex+1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_next",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},emitActiveItemChange:function(){const t={tabType:"annotation"},e=this.annotationEntry[this.entryIndex],r={...t,...e};this.$emit("hover-changed",r)},processEvidences:function(t){var r;const e=[];return(r=t==null?void 0:t.body)!=null&&r.evidence&&t.body.evidence.forEach(n=>{if(typeof n=="object")e.push(n);else{const a={};if(n.includes("https://doi.org/")){const i=n.replace("https://doi.org/","DOI:");a[i]=n}else if(n.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=n.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=n}Object.keys(a).length>0?e.push(a):e.push(n)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;if(this.offlineAnnotationEnabled){const e=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[];this.prevSubs=e.filter(r=>r.resource===this.entry.resourceId&&r.item.id===this.entry.featureId)}else this.$annotator&&this.authenticated&&this.entry.resourceId&&this.entry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.entry.resourceId,this.entry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.entry.type==="updated"&&this.entry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.entry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.entry.resourceId&&this.entry.featureId){const e=[];this.evidence.forEach(n=>{if(n.includes("DOI:")){const a=n.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(n.includes("PMID:")){const a=n.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(n)});const r={resource:this.entry.resourceId,item:Object.assign({id:this.entry.featureId},Object.fromEntries(Object.entries(this.entry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.entry.feature};Object.assign(r.body,this.entry.body),this.entry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"}),this.$emit("annotation",r)}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.entry)return"";const t=[];if(this.entry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`),this.entry.label&&t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`),this.entry.models&&(t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.entry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
20
+ `,WA=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function jA(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:WA.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function Sy(t,e=1,r){var n;hr||(hr=document.createElement("textarea"),document.body.appendChild(hr));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=jA(t);hr.setAttribute("style",`${l};${UA}`),hr.value=t.value||t.placeholder||"";let u=hr.scrollHeight;const c={};o==="border-box"?u=u+i:o==="content-box"&&(u=u-a),hr.value="";const d=hr.scrollHeight-a;if(xt(e)){let f=d*e;o==="border-box"&&(f=f+a+i),u=Math.max(f,u),c.minHeight=`${f}px`}if(xt(r)){let f=d*r;o==="border-box"&&(f=f+a+i),u=Math.min(f,u)}return c.height=`${u}px`,(n=hr.parentNode)==null||n.removeChild(hr),hr=void 0,c}const YA=Fe({id:{type:String,default:void 0},size:Ia,disabled:Boolean,modelValue:{type:Se([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Se([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:dn},prefixIcon:{type:dn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Se([Object,Array,String]),default:()=>Ea({})},autofocus:Boolean,rows:{type:Number,default:2},...jr(["ariaLabel"])}),ZA={[tt]:t=>ut(t),input:t=>ut(t),change:t=>ut(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},XA=s.defineComponent({name:"ElInput",inheritAttrs:!1}),JA=s.defineComponent({...XA,props:YA,emits:ZA,setup(t,{expose:e,emit:r}){const n=t,a=s.useAttrs(),i=s.useSlots(),o=s.computed(()=>{const I={};return n.containerRole==="combobox"&&(I["aria-haspopup"]=a["aria-haspopup"],I["aria-owns"]=a["aria-owns"],I["aria-expanded"]=a["aria-expanded"]),I}),l=s.computed(()=>[n.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",p.value),g.is("exceed",X.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||n.prefixIcon,[g.m("suffix")]:i.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:z.value&&W.value,[g.b("hidden")]:n.type==="hidden"},a.class]),u=s.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),c=$m({excludeKeys:s.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Un(),{inputId:h}=Oi(n,{formItemContext:f}),v=Gn(),p=Ba(),g=De("input"),y=De("textarea"),m=s.shallowRef(),b=s.shallowRef(),w=s.ref(!1),C=s.ref(!1),x=s.ref(),k=s.shallowRef(n.inputStyle),E=s.computed(()=>m.value||b.value),{wrapperRef:_,isFocused:S,handleFocus:T,handleBlur:N}=sc(E,{beforeFocus(){return p.value},afterBlur(){var I;n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"blur").catch(U=>it(U)))}}),B=s.computed(()=>{var I;return(I=d==null?void 0:d.statusIcon)!=null?I:!1}),A=s.computed(()=>(f==null?void 0:f.validateState)||""),D=s.computed(()=>A.value&&Mm[A.value]),R=s.computed(()=>C.value?xe.View:xe.Hide),O=s.computed(()=>[a.style]),M=s.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),P=s.computed(()=>cn(n.modelValue)?"":String(n.modelValue)),z=s.computed(()=>n.clearable&&!p.value&&!n.readonly&&!!P.value&&(S.value||w.value)),W=s.computed(()=>n.showPassword&&!p.value&&!n.readonly&&!!P.value&&(!!P.value||S.value)),H=s.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!p.value&&!n.readonly&&!n.showPassword),G=s.computed(()=>P.value.length),X=s.computed(()=>!!H.value&&G.value>Number(n.maxlength)),F=s.computed(()=>!!i.suffix||!!n.suffixIcon||z.value||n.showPassword||H.value||!!A.value&&B.value),[V,q]=DA(m);qr(b,I=>{if(L(),!H.value||n.resize!=="both")return;const U=I[0],{width:te}=U.contentRect;x.value={right:`calc(100% - ${te+15+6}px)`}});const $=()=>{const{type:I,autosize:U}=n;if(!(!at||I!=="textarea"||!b.value))if(U){const te=yt(U)?U.minRows:void 0,Z=yt(U)?U.maxRows:void 0,J=Sy(b.value,te,Z);k.value={overflowY:"hidden",...J},s.nextTick(()=>{b.value.offsetHeight,k.value=J})}else k.value={minHeight:Sy(b.value).minHeight}},L=(I=>{let U=!1;return()=>{var te;if(U||!n.autosize)return;((te=b.value)==null?void 0:te.offsetParent)===null||(I(),U=!0)}})($),j=()=>{const I=E.value,U=n.formatter?n.formatter(P.value):P.value;!I||I.value===U||(I.value=U)},Y=async I=>{V();let{value:U}=I.target;if(n.formatter&&(U=n.parser?n.parser(U):U),!ce.value){if(U===P.value){j();return}r(tt,U),r("input",U),await s.nextTick(),j(),q()}},se=I=>{r("change",I.target.value)},{isComposing:ce,handleCompositionStart:ae,handleCompositionUpdate:ne,handleCompositionEnd:ue}=Ey({emit:r,afterComposition:Y}),ie=()=>{C.value=!C.value,fe()},fe=async()=>{var I;await s.nextTick(),(I=E.value)==null||I.focus()},pe=()=>{var I;return(I=E.value)==null?void 0:I.blur()},Ae=I=>{w.value=!1,r("mouseleave",I)},Ie=I=>{w.value=!0,r("mouseenter",I)},we=I=>{r("keydown",I)},ke=()=>{var I;(I=E.value)==null||I.select()},re=()=>{r(tt,""),r("change",""),r("clear"),r("input","")};return s.watch(()=>n.modelValue,()=>{var I;s.nextTick(()=>$()),n.validateEvent&&((I=f==null?void 0:f.validate)==null||I.call(f,"change").catch(U=>it(U)))}),s.watch(P,()=>j()),s.watch(()=>n.type,async()=>{await s.nextTick(),j(),$()}),s.onMounted(()=>{!n.formatter&&n.parser&&it("ElInput","If you set the parser, you also need to set the formatter."),j(),s.nextTick($)}),e({input:m,textarea:b,ref:E,textareaStyle:M,autosize:s.toRef(n,"autosize"),isComposing:ce,focus:fe,blur:pe,select:ke,clear:re,resizeTextarea:$}),(I,U)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(o),{class:[s.unref(l),{[s.unref(g).bm("group","append")]:I.$slots.append,[s.unref(g).bm("group","prepend")]:I.$slots.prepend}],style:s.unref(O),role:I.containerRole,onMouseenter:Ie,onMouseleave:Ae}),[s.createCommentVNode(" input "),I.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),I.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(g).be("group","prepend"))},[s.renderSlot(I.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:s.normalizeClass(s.unref(u))},[s.createCommentVNode(" prefix slot "),I.$slots.prefix||I.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(g).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("prefix-inner"))},[s.renderSlot(I.$slots,"prefix"),I.prefixIcon?(s.openBlock(),s.createBlock(s.unref(Xe),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(h),ref_key:"input",ref:m,class:s.unref(g).e("inner")},s.unref(c),{minlength:I.minlength,maxlength:I.maxlength,type:I.showPassword?C.value?"text":"password":I.type,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,tabindex:I.tabindex,"aria-label":I.ariaLabel,placeholder:I.placeholder,style:I.inputStyle,form:I.form,autofocus:I.autofocus,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ue),onInput:Y,onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(F)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(g).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("suffix-inner"))},[!s.unref(z)||!s.unref(W)||!s.unref(H)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(I.$slots,"suffix"),I.suffixIcon?(s.openBlock(),s.createBlock(s.unref(Xe),{key:0,class:s.normalizeClass(s.unref(g).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(I.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(z)?(s.openBlock(),s.createBlock(s.unref(Xe),{key:1,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("clear")]),onMousedown:s.withModifiers(s.unref(ma),["prevent"]),onClick:re},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(W)?(s.openBlock(),s.createBlock(s.unref(Xe),{key:2,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("password")]),onClick:ie},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(R))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(g).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(g).e("count-inner"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(A)&&s.unref(D)&&s.unref(B)?(s.openBlock(),s.createBlock(s.unref(Xe),{key:4,class:s.normalizeClass([s.unref(g).e("icon"),s.unref(g).e("validateIcon"),s.unref(g).is("loading",s.unref(A)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(D))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),I.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(g).be("group","append"))},[s.renderSlot(I.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(h),ref_key:"textarea",ref:b,class:[s.unref(y).e("inner"),s.unref(g).is("focus",s.unref(S))]},s.unref(c),{minlength:I.minlength,maxlength:I.maxlength,tabindex:I.tabindex,disabled:s.unref(p),readonly:I.readonly,autocomplete:I.autocomplete,style:s.unref(M),"aria-label":I.ariaLabel,placeholder:I.placeholder,form:I.form,autofocus:I.autofocus,rows:I.rows,onCompositionstart:s.unref(ae),onCompositionupdate:s.unref(ne),onCompositionend:s.unref(ue),onInput:Y,onFocus:s.unref(T),onBlur:s.unref(N),onChange:se,onKeydown:we}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),s.unref(H)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(x.value),class:s.normalizeClass(s.unref(g).e("count"))},s.toDisplayString(s.unref(G))+" / "+s.toDisplayString(I.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var QA=Be(JA,[["__file","input.vue"]]);const Pi=dt(QA),Da=4,eO={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},tO=({move:t,size:e,bar:r})=>({[r.size]:e,transform:`translate${r.axis}(${t}%)`}),uc=Symbol("scrollbarContextKey"),rO=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),nO="Thumb";var _y=Be(s.defineComponent({__name:"thumb",props:rO,setup(t){const e=t,r=s.inject(uc),n=De("scrollbar");r||Pm(nO,"can not inject scrollbar context");const a=s.ref(),i=s.ref(),o=s.ref({}),l=s.ref(!1);let u=!1,c=!1,d=at?document.onselectstart:null;const f=s.computed(()=>eO[e.vertical?"vertical":"horizontal"]),h=s.computed(()=>tO({size:e.size,move:e.move,bar:f.value})),v=s.computed(()=>a.value[f.value.offset]**2/r.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),p=k=>{var E;if(k.stopPropagation(),k.ctrlKey||[1,2].includes(k.button))return;(E=window.getSelection())==null||E.removeAllRanges(),y(k);const _=k.currentTarget;_&&(o.value[f.value.axis]=_[f.value.offset]-(k[f.value.client]-_.getBoundingClientRect()[f.value.direction]))},g=k=>{if(!i.value||!a.value||!r.wrapElement)return;const E=Math.abs(k.target.getBoundingClientRect()[f.value.direction]-k[f.value.client]),_=i.value[f.value.offset]/2,S=(E-_)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=S*r.wrapElement[f.value.scrollSize]/100},y=k=>{k.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=k=>{if(!a.value||!i.value||u===!1)return;const E=o.value[f.value.axis];if(!E)return;const _=(a.value.getBoundingClientRect()[f.value.direction]-k[f.value.client])*-1,S=i.value[f.value.offset]-E,T=(_-S)*100*v.value/a.value[f.value.offset];r.wrapElement[f.value.scroll]=T*r.wrapElement[f.value.scrollSize]/100},b=()=>{u=!1,o.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),x(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},C=()=>{c=!0,l.value=u};s.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",b)});const x=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return Qt(s.toRef(r,"scrollbarElement"),"mousemove",w),Qt(s.toRef(r,"scrollbarElement"),"mouseleave",C),(k,E)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(n).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:a,class:s.normalizeClass([s.unref(n).e("bar"),s.unref(n).is(s.unref(f).key)]),onMousedown:g},[s.createElementVNode("div",{ref_key:"thumb",ref:i,class:s.normalizeClass(s.unref(n).e("thumb")),style:s.normalizeStyle(s.unref(h)),onMousedown:p},null,38)],34),[[s.vShow,k.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const aO=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var iO=Be(s.defineComponent({__name:"bar",props:aO,setup(t,{expose:e}){const r=t,n=s.inject(uc),a=s.ref(0),i=s.ref(0),o=s.ref(""),l=s.ref(""),u=s.ref(1),c=s.ref(1);return e({handleScroll:h=>{if(h){const v=h.offsetHeight-Da,p=h.offsetWidth-Da;i.value=h.scrollTop*100/v*u.value,a.value=h.scrollLeft*100/p*c.value}},update:()=>{const h=n==null?void 0:n.wrapElement;if(!h)return;const v=h.offsetHeight-Da,p=h.offsetWidth-Da,g=v**2/h.scrollHeight,y=p**2/h.scrollWidth,m=Math.max(g,r.minSize),b=Math.max(y,r.minSize);u.value=g/(v-g)/(m/(v-m)),c.value=y/(p-y)/(b/(p-b)),l.value=m+Da<v?`${m}px`:"",o.value=b+Da<p?`${b}px`:""}}),(h,v)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(_y,{move:a.value,ratio:c.value,size:o.value,always:h.always},null,8,["move","ratio","size","always"]),s.createVNode(_y,{move:i.value,ratio:u.value,size:l.value,vertical:"",always:h.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const oO=Fe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Se([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...jr(["ariaLabel","ariaOrientation"])}),sO={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xt)},dc="ElScrollbar",lO=s.defineComponent({name:dc}),cO=s.defineComponent({...lO,props:oO,emits:sO,setup(t,{expose:e,emit:r}){const n=t,a=De("scrollbar");let i,o,l=0,u=0;const c=s.ref(),d=s.ref(),f=s.ref(),h=s.ref(),v=s.computed(()=>{const x={};return n.height&&(x.height=Ca(n.height)),n.maxHeight&&(x.maxHeight=Ca(n.maxHeight)),[n.wrapStyle,x]}),p=s.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),g=s.computed(()=>[a.e("view"),n.viewClass]),y=()=>{var x;d.value&&((x=h.value)==null||x.handleScroll(d.value),l=d.value.scrollTop,u=d.value.scrollLeft,r("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(x,k){yt(x)?d.value.scrollTo(x):xt(x)&&xt(k)&&d.value.scrollTo(x,k)}const b=x=>{if(!xt(x)){it(dc,"value must be a number");return}d.value.scrollTop=x},w=x=>{if(!xt(x)){it(dc,"value must be a number");return}d.value.scrollLeft=x},C=()=>{var x;(x=h.value)==null||x.update()};return s.watch(()=>n.noresize,x=>{x?(i==null||i(),o==null||o()):({stop:i}=qr(f,C),o=Qt("resize",C))},{immediate:!0}),s.watch(()=>[n.maxHeight,n.height],()=>{n.native||s.nextTick(()=>{var x;C(),d.value&&((x=h.value)==null||x.handleScroll(d.value))})}),s.provide(uc,s.reactive({scrollbarElement:c,wrapElement:d})),s.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=u)}),s.onMounted(()=>{n.native||s.nextTick(()=>{C()})}),s.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(x,k)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:s.normalizeClass(s.unref(a).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:s.normalizeClass(s.unref(p)),style:s.normalizeStyle(s.unref(v)),tabindex:x.tabindex,onScroll:y},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(g)),style:s.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(iO,{key:0,ref_key:"barRef",ref:h,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var uO=Be(cO,[["__file","scrollbar.vue"]]);const Ty=dt(uO),fc=Symbol("popper"),Ny=Symbol("popperContent"),Iy=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),dO=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),fO=s.defineComponent({...dO,props:Iy,setup(t,{expose:e}){const r=t,n=s.ref(),a=s.ref(),i=s.ref(),o=s.ref(),l=s.computed(()=>r.role),u={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:o,role:l};return e(u),s.provide(fc,u),(c,d)=>s.renderSlot(c.$slots,"default")}});var hO=Be(fO,[["__file","popper.vue"]]);const By=Fe({arrowOffset:{type:Number,default:5}}),pO=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),vO=s.defineComponent({...pO,props:By,setup(t,{expose:e}){const r=t,n=De("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=s.inject(Ny,void 0);return s.watch(()=>r.arrowOffset,l=>{a.value=l}),s.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,u)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:s.normalizeClass(s.unref(n).e("arrow")),style:s.normalizeStyle(s.unref(o)),"data-popper-arrow":""},null,6))}});var gO=Be(vO,[["__file","arrow.vue"]]);const hc="ElOnlyChild",mO=s.defineComponent({name:hc,setup(t,{slots:e,attrs:r}){var n;const a=s.inject(py),i=BA((n=a==null?void 0:a.setForwardRef)!=null?n:ma);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,r);if(!l)return null;if(l.length>1)return it(hc,"requires exact only one valid child."),null;const u=Dy(l);return u?s.withDirectives(s.cloneVNode(u,r),[[i]]):(it(hc,"no valid child node found"),null)}}});function Dy(t){if(!t)return null;const e=t;for(const r of e){if(yt(r))switch(r.type){case s.Comment:continue;case s.Text:case"svg":return Ay(r);case s.Fragment:return Dy(r.children);default:return r}return Ay(r)}return null}function Ay(t){const e=De("only-child");return s.createVNode("span",{class:e.e("content")},[t])}const Oy=Fe({virtualRef:{type:Se(Object)},virtualTriggering:Boolean,onMouseenter:{type:Se(Function)},onMouseleave:{type:Se(Function)},onClick:{type:Se(Function)},onKeydown:{type:Se(Function)},onFocus:{type:Se(Function)},onBlur:{type:Se(Function)},onContextmenu:{type:Se(Function)},id:String,open:Boolean}),yO=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),bO=s.defineComponent({...yO,props:Oy,setup(t,{expose:e}){const r=t,{role:n,triggerRef:a}=s.inject(fc,void 0);IA(a);const i=s.computed(()=>l.value?r.id:void 0),o=s.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=s.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),u=s.computed(()=>l.value?`${r.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>r.virtualRef,f=>{f&&(a.value=Vr(f))},{immediate:!0}),s.watch(a,(f,h)=>{c==null||c(),c=void 0,qn(f)&&(d.forEach(v=>{var p;const g=r[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(p=h==null?void 0:h.removeEventListener)==null||p.call(h,v.slice(2).toLowerCase(),g))}),c=s.watch([i,o,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,g)=>{cn(v[g])?f.removeAttribute(p):f.setAttribute(p,v[g])})},{immediate:!0})),qn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>h.removeAttribute(v))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,a.value&&qn(a.value)){const f=a.value;d.forEach(h=>{const v=r[h];v&&f.removeEventListener(h.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,h)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(mO),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(i),"aria-describedby":s.unref(o),"aria-expanded":s.unref(u),"aria-haspopup":s.unref(l)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var wO=Be(bO,[["__file","trigger.vue"]]);const pc="focus-trap.focus-after-trapped",vc="focus-trap.focus-after-released",CO="focus-trap.focusout-prevented",Py={cancelable:!0,bubbles:!1},EO={cancelable:!0,bubbles:!1},Ry="focusAfterTrapped",Ly="focusAfterReleased",xO=Symbol("elFocusTrap"),gc=s.ref(),es=s.ref(0),mc=s.ref(0);let ts=0;const My=t=>{const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e},Fy=(t,e)=>{for(const r of t)if(!kO(r,e))return r},kO=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},SO=t=>{const e=My(t),r=Fy(e,t),n=Fy(e.reverse(),t);return[r,n]},_O=t=>t instanceof HTMLInputElement&&"select"in t,hn=(t,e)=>{if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),mc.value=window.performance.now(),t!==r&&_O(t)&&e&&t.select()}};function $y(t,e){const r=[...t],n=t.indexOf(e);return n!==-1&&r.splice(n,1),r}const TO=()=>{let t=[];return{push:n=>{const a=t[0];a&&n!==a&&a.pause(),t=$y(t,n),t.unshift(n)},remove:n=>{var a,i;t=$y(t,n),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},NO=(t,e=!1)=>{const r=document.activeElement;for(const n of t)if(hn(n,e),document.activeElement!==r)return},Vy=TO(),IO=()=>es.value>mc.value,rs=()=>{gc.value="pointer",es.value=window.performance.now()},qy=()=>{gc.value="keyboard",es.value=window.performance.now()},BO=()=>(s.onMounted(()=>{ts===0&&(document.addEventListener("mousedown",rs),document.addEventListener("touchstart",rs),document.addEventListener("keydown",qy)),ts++}),s.onBeforeUnmount(()=>{ts--,ts<=0&&(document.removeEventListener("mousedown",rs),document.removeEventListener("touchstart",rs),document.removeEventListener("keydown",qy))}),{focusReason:gc,lastUserFocusTimestamp:es,lastAutomatedFocusTimestamp:mc}),ns=t=>new CustomEvent(CO,{...EO,detail:t}),DO=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Ry,Ly,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const r=s.ref();let n,a;const{focusReason:i}=BO();kA(p=>{t.trapped&&!o.paused&&e("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=p=>{if(!t.loop&&!t.trapped||o.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=p,{loop:x}=t,k=g===ft.tab&&!y&&!m&&!b,E=document.activeElement;if(k&&E){const _=w,[S,T]=SO(_);if(S&&T){if(!C&&E===T){const B=ns({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(S,!0))}else if(C&&[S,_].includes(E)){const B=ns({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||(p.preventDefault(),x&&hn(T,!0))}}else if(E===_){const B=ns({focusReason:i.value});e("focusout-prevented",B),B.defaultPrevented||p.preventDefault()}}};s.provide(xO,{focusTrapRef:r,onKeydown:l}),s.watch(()=>t.focusTrapEl,p=>{p&&(r.value=p)},{immediate:!0}),s.watch([r],([p],[g])=>{p&&(p.addEventListener("keydown",l),p.addEventListener("focusin",d),p.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const u=p=>{e(Ry,p)},c=p=>e(Ly,p),d=p=>{const g=s.unref(r);if(!g)return;const y=p.target,m=p.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(n=m),b&&e("focusin",p),!o.paused&&t.trapped&&(b?a=y:hn(a,!0))},f=p=>{const g=s.unref(r);if(!(o.paused||!g))if(t.trapped){const y=p.relatedTarget;!cn(y)&&!g.contains(y)&&setTimeout(()=>{if(!o.paused&&t.trapped){const m=ns({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||hn(a,!0)}},0)}else{const y=p.target;y&&g.contains(y)||e("focusout",p)}};async function h(){await s.nextTick();const p=s.unref(r);if(p){Vy.push(o);const g=p.contains(document.activeElement)?n:document.activeElement;if(n=g,!p.contains(g)){const m=new Event(pc,Py);p.addEventListener(pc,u),p.dispatchEvent(m),m.defaultPrevented||s.nextTick(()=>{let b=t.focusStartEl;ut(b)||(hn(b),document.activeElement!==b&&(b="first")),b==="first"&&NO(My(p),!0),(document.activeElement===g||b==="container")&&hn(p)})}}}function v(){const p=s.unref(r);if(p){p.removeEventListener(pc,u);const g=new CustomEvent(vc,{...Py,detail:{focusReason:i.value}});p.addEventListener(vc,c),p.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!IO()||p.contains(document.activeElement))&&hn(n??document.body),p.removeEventListener(vc,c),Vy.remove(o)}}return s.onMounted(()=>{t.trapped&&h(),s.watch(()=>t.trapped,p=>{p?h():v()})}),s.onBeforeUnmount(()=>{t.trapped&&v(),r.value&&(r.value.removeEventListener("keydown",l),r.value.removeEventListener("focusin",d),r.value.removeEventListener("focusout",f),r.value=void 0)}),{onKeydown:l}}});function AO(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var OO=Be(DO,[["render",AO],["__file","focus-trap.vue"]]);const PO=["fixed","absolute"],RO=Fe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Se(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:jo,default:"bottom"},popperOptions:{type:Se(Object),default:()=>({})},strategy:{type:String,values:PO,default:"absolute"}}),zy=Fe({...RO,id:String,style:{type:Se([String,Array,Object])},className:{type:Se([String,Array,Object])},effect:{type:Se(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Se([String,Array,Object])},popperStyle:{type:Se([String,Array,Object])},referenceEl:{type:Se(Object)},triggerTargetEl:{type:Se(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...jr(["ariaLabel"])}),LO={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},MO=(t,e=[])=>{const{placement:r,strategy:n,popperOptions:a}=t,i={placement:r,strategy:n,...a,modifiers:[...$O(t),...e]};return VO(i,a==null?void 0:a.modifiers),i},FO=t=>{if(at)return Vr(t)};function $O(t){const{offset:e,gpuAcceleration:r,fallbackPlacements:n}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function VO(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const qO=0,zO=t=>{const{popperInstanceRef:e,contentRef:r,triggerRef:n,role:a}=s.inject(fc,void 0),i=s.ref(),o=s.ref(),l=s.computed(()=>({name:"eventListeners",enabled:!!t.visible})),u=s.computed(()=>{var m;const b=s.unref(i),w=(m=s.unref(o))!=null?m:qO;return{name:"arrow",enabled:!JB(b),options:{element:b,padding:w}}}),c=s.computed(()=>({onFirstUpdate:()=>{p()},...MO(t,[s.unref(u),s.unref(l)])})),d=s.computed(()=>FO(t.referenceEl)||s.unref(n)),{attributes:f,state:h,styles:v,update:p,forceUpdate:g,instanceRef:y}=CA(d,r,c);return s.watch(y,m=>e.value=m),s.onMounted(()=>{s.watch(()=>{var m;return(m=s.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:r,instanceRef:y,state:h,styles:v,role:a,forceUpdate:g,update:p}},HO=(t,{attributes:e,styles:r,role:n})=>{const{nextZIndex:a}=wy(),i=De("popper"),o=s.computed(()=>s.unref(e).popper),l=s.ref(xt(t.zIndex)?t.zIndex:a()),u=s.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),c=s.computed(()=>[{zIndex:s.unref(l)},s.unref(r).popper,t.popperStyle||{}]),d=s.computed(()=>n.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(r).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=xt(t.zIndex)?t.zIndex:a()}}},KO=(t,e)=>{const r=s.ref(!1),n=s.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:c=>{var d;((d=c.detail)==null?void 0:d.focusReason)!=="pointer"&&(n.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{t.visible&&!r.value&&(c.target&&(n.value=c.target),r.value=!0)},onFocusoutPrevented:c=>{t.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,e("close")}}},GO=s.defineComponent({name:"ElPopperContent"}),UO=s.defineComponent({...GO,props:zy,emits:LO,setup(t,{expose:e,emit:r}){const n=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:d}=KO(n,r),{attributes:f,arrowRef:h,contentRef:v,styles:p,instanceRef:g,role:y,update:m}=zO(n),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:x,contentStyle:k,updateZIndex:E}=HO(n,{styles:p,attributes:f,role:y}),_=s.inject(Ai,void 0),S=s.ref();s.provide(Ny,{arrowStyle:w,arrowRef:h,arrowOffset:S}),_&&s.provide(Ai,{..._,addInputId:ma,removeInputId:ma});let T;const N=(A=!0)=>{m(),A&&E()},B=()=>{N(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return s.onMounted(()=>{s.watch(()=>n.triggerTargetEl,(A,D)=>{T==null||T(),T=void 0;const R=s.unref(A||v.value),O=s.unref(D||v.value);qn(R)&&(T=s.watch([y,()=>n.ariaLabel,b,()=>n.id],M=>{["role","aria-label","aria-modal","id"].forEach((P,z)=>{cn(M[z])?R.removeAttribute(P):R.setAttribute(P,M[z])})},{immediate:!0})),O!==R&&qn(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),s.watch(()=>n.visible,B,{immediate:!0})}),s.onBeforeUnmount(()=>{T==null||T(),T=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:N,contentStyle:k}),(A,D)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:v},s.unref(C),{style:s.unref(k),class:s.unref(x),tabindex:"-1",onMouseenter:R=>A.$emit("mouseenter",R),onMouseleave:R=>A.$emit("mouseleave",R)}),[s.createVNode(s.unref(OO),{trapped:s.unref(i),"trap-on-focus-in":!0,"focus-trap-el":s.unref(v),"focus-start-el":s.unref(a),onFocusAfterTrapped:s.unref(l),onFocusAfterReleased:s.unref(o),onFocusin:s.unref(u),onFocusoutPrevented:s.unref(c),onReleaseRequested:s.unref(d)},{default:s.withCtx(()=>[s.renderSlot(A.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var WO=Be(UO,[["__file","content.vue"]]);const jO=dt(hO),yc=Symbol("elTooltip"),Vt=Fe({...TA,...zy,appendTo:{type:Se([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Se(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...jr(["ariaLabel"])}),Ri=Fe({...Oy,disabled:Boolean,trigger:{type:Se([String,Array]),default:"hover"},triggerKeys:{type:Se(Array),default:()=>[ft.enter,ft.space]}}),{useModelToggleProps:YO,useModelToggleEmits:ZO,useModelToggle:XO}=yD("visible"),JO=Fe({...Iy,...YO,...Vt,...Ri,...By,showArrow:{type:Boolean,default:!0}}),QO=[...ZO,"before-show","before-hide","show","hide","open","close"],eP=(t,e)=>Et(t)?t.includes(e):t===e,Aa=(t,e,r)=>n=>{eP(s.unref(t),e)&&r(n)},tP=s.defineComponent({name:"ElTooltipTrigger"}),rP=s.defineComponent({...tP,props:Ri,setup(t,{expose:e}){const r=t,n=De("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:u,onToggle:c}=s.inject(yc,void 0),d=s.ref(null),f=()=>{if(s.unref(a)||r.disabled)return!0},h=s.toRef(r,"trigger"),v=$r(f,Aa(h,"hover",l)),p=$r(f,Aa(h,"hover",u)),g=$r(f,Aa(h,"click",C=>{C.button===0&&c(C)})),y=$r(f,Aa(h,"focus",l)),m=$r(f,Aa(h,"focus",u)),b=$r(f,Aa(h,"contextmenu",C=>{C.preventDefault(),c(C)})),w=$r(f,C=>{const{code:x}=C;r.triggerKeys.includes(x)&&(C.preventDefault(),c(C))});return e({triggerRef:d}),(C,x)=>(s.openBlock(),s.createBlock(s.unref(wO),{id:s.unref(i),"virtual-ref":C.virtualRef,open:s.unref(o),"virtual-triggering":C.virtualTriggering,class:s.normalizeClass(s.unref(n).e("trigger")),onBlur:s.unref(m),onClick:s.unref(g),onContextmenu:s.unref(b),onFocus:s.unref(y),onMouseenter:s.unref(v),onMouseleave:s.unref(p),onKeydown:s.unref(w)},{default:s.withCtx(()=>[s.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var nP=Be(rP,[["__file","trigger.vue"]]);const aP=Fe({to:{type:Se([String,Object]),required:!0},disabled:Boolean});var iP=Be(s.defineComponent({__name:"teleport",props:aP,setup(t){return(e,r)=>e.disabled?s.renderSlot(e.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:e.to},[s.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const oP=dt(iP),sP=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),lP=s.defineComponent({...sP,props:Vt,setup(t,{expose:e}){const r=t,{selector:n}=hy(),a=De("tooltip"),i=s.ref(null);let o;const{controlled:l,id:u,open:c,trigger:d,onClose:f,onOpen:h,onShow:v,onHide:p,onBeforeShow:g,onBeforeHide:y}=s.inject(yc,void 0),m=s.computed(()=>r.transition||`${a.namespace.value}-fade-in-linear`),b=s.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);s.onBeforeUnmount(()=>{o==null||o()});const w=s.computed(()=>s.unref(b)?!0:s.unref(c)),C=s.computed(()=>r.disabled?!1:s.unref(c)),x=s.computed(()=>r.appendTo||n.value),k=s.computed(()=>{var O;return(O=r.style)!=null?O:{}}),E=s.ref(!0),_=()=>{p(),E.value=!0},S=()=>{if(s.unref(l))return!0},T=$r(S,()=>{r.enterable&&s.unref(d)==="hover"&&h()}),N=$r(S,()=>{s.unref(d)==="hover"&&f()}),B=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},A=()=>{y==null||y()},D=()=>{v(),o=Rg(s.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(s.unref(l))return;s.unref(d)!=="hover"&&f()})},R=()=>{r.virtualTriggering||f()};return s.watch(()=>s.unref(c),O=>{O?E.value=!1:o==null||o()},{flush:"post"}),s.watch(()=>r.content,()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O)}),e({contentRef:i}),(O,M)=>(s.openBlock(),s.createBlock(s.unref(oP),{disabled:!O.teleported,to:s.unref(x)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(m),onAfterLeave:_,onBeforeEnter:B,onAfterEnter:D,onBeforeLeave:A},{default:s.withCtx(()=>[s.unref(w)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(WO),s.mergeProps({key:0,id:s.unref(u),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":E.value,"boundaries-padding":O.boundariesPadding,"fallback-placements":O.fallbackPlacements,"gpu-acceleration":O.gpuAcceleration,offset:O.offset,placement:O.placement,"popper-options":O.popperOptions,strategy:O.strategy,effect:O.effect,enterable:O.enterable,pure:O.pure,"popper-class":O.popperClass,"popper-style":[O.popperStyle,s.unref(k)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:s.unref(C),"z-index":O.zIndex,onMouseenter:s.unref(T),onMouseleave:s.unref(N),onBlur:R,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.renderSlot(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[s.vShow,s.unref(C)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var cP=Be(lP,[["__file","content.vue"]]);const uP=s.defineComponent({name:"ElTooltip"}),dP=s.defineComponent({...uP,props:JO,emits:QO,setup(t,{expose:e,emit:r}){const n=t;_A();const a=Di(),i=s.ref(),o=s.ref(),l=()=>{var m;const b=s.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},u=s.ref(!1),c=s.ref(),{show:d,hide:f,hasUpdateHandler:h}=XO({indicator:u,toggleReason:c}),{onOpen:v,onClose:p}=NA({showAfter:s.toRef(n,"showAfter"),hideAfter:s.toRef(n,"hideAfter"),autoClose:s.toRef(n,"autoClose"),open:d,close:f}),g=s.computed(()=>wa(n.visible)&&!h.value);s.provide(yc,{controlled:g,id:a,open:s.readonly(u),trigger:s.toRef(n,"trigger"),onOpen:m=>{v(m)},onClose:m=>{p(m)},onToggle:m=>{s.unref(u)?p(m):v(m)},onShow:()=>{r("show",c.value)},onHide:()=>{r("hide",c.value)},onBeforeShow:()=>{r("before-show",c.value)},onBeforeHide:()=>{r("before-hide",c.value)},updatePopper:l}),s.watch(()=>n.disabled,m=>{m&&u.value&&(u.value=!1)});const y=m=>{var b,w;const C=(w=(b=o.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,x=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(x)};return s.onDeactivated(()=>u.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:p,hide:f}),(m,b)=>(s.openBlock(),s.createBlock(s.unref(jO),{ref_key:"popperRef",ref:i,role:m.role},{default:s.withCtx(()=>[s.createVNode(nP,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:s.withCtx(()=>[m.$slots.default?s.renderSlot(m.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(cP,{ref_key:"contentRef",ref:o,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:s.withCtx(()=>[s.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(m.content),1))]),m.showArrow?(s.openBlock(),s.createBlock(s.unref(gO),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):s.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var fP=Be(dP,[["__file","tooltip.vue"]]);const Oa=dt(fP),hP=Fe({valueKey:{type:String,default:"value"},modelValue:{type:[String,Number],default:""},debounce:{type:Number,default:300},placement:{type:Se(String),values:["top","top-start","top-end","bottom","bottom-start","bottom-end"],default:"bottom-start"},fetchSuggestions:{type:Se([Function,Array]),default:ma},popperClass:{type:String,default:""},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},hideLoading:{type:Boolean,default:!1},teleported:Vt.teleported,highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:String,...jr(["ariaLabel"])}),pP={[tt]:t=>ut(t),[Yl]:t=>ut(t),[Ei]:t=>ut(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,select:t=>yt(t)},Hy="ElAutocomplete",vP=s.defineComponent({name:Hy,inheritAttrs:!1}),gP=s.defineComponent({...vP,props:hP,emits:pP,setup(t,{expose:e,emit:r}){const n=t,a=$m(),i=s.useAttrs(),o=Ba(),l=De("autocomplete"),u=s.ref(),c=s.ref(),d=s.ref(),f=s.ref();let h=!1,v=!1;const p=s.ref([]),g=s.ref(-1),y=s.ref(""),m=s.ref(!1),b=s.ref(!1),w=s.ref(!1),C=Di(),x=s.computed(()=>i.style),k=s.computed(()=>(p.value.length>0||w.value)&&m.value),E=s.computed(()=>!n.hideLoading&&w.value),_=s.computed(()=>u.value?Array.from(u.value.$el.querySelectorAll("input")):[]),S=()=>{k.value&&(y.value=`${u.value.$el.offsetWidth}px`)},T=()=>{g.value=-1},N=async $=>{if(b.value)return;const K=L=>{w.value=!1,!b.value&&(Et(L)?(p.value=L,g.value=n.highlightFirstItem?0:-1):Pm(Hy,"autocomplete suggestions must be an array"))};if(w.value=!0,Et(n.fetchSuggestions))K(n.fetchSuggestions);else{const L=await n.fetchSuggestions($,K);Et(L)&&K(L)}},B=Wl(N,n.debounce),A=$=>{const K=!!$;if(r(Yl,$),r(tt,$),b.value=!1,m.value||(m.value=K),!n.triggerOnFocus&&!$){b.value=!0,p.value=[];return}B($)},D=$=>{var K;o.value||(((K=$.target)==null?void 0:K.tagName)!=="INPUT"||_.value.includes(document.activeElement))&&(m.value=!0)},R=$=>{r(Ei,$)},O=$=>{v?v=!1:(m.value=!0,r("focus",$),n.triggerOnFocus&&!h&&B(String(n.modelValue)))},M=$=>{setTimeout(()=>{var K;if((K=d.value)!=null&&K.isFocusInsideContent()){v=!0;return}m.value&&H(),r("blur",$)})},P=()=>{m.value=!1,r(tt,""),r("clear")},z=async()=>{k.value&&g.value>=0&&g.value<p.value.length?F(p.value[g.value]):n.selectWhenUnmatched&&(r("select",{value:n.modelValue}),p.value=[],g.value=-1)},W=$=>{k.value&&($.preventDefault(),$.stopPropagation(),H())},H=()=>{m.value=!1},G=()=>{var $;($=u.value)==null||$.focus()},X=()=>{var $;($=u.value)==null||$.blur()},F=async $=>{r(Yl,$[n.valueKey]),r(tt,$[n.valueKey]),r("select",$),p.value=[],g.value=-1},V=$=>{if(!k.value||w.value)return;if($<0){g.value=-1;return}$>=p.value.length&&($=p.value.length-1);const K=c.value.querySelector(`.${l.be("suggestion","wrap")}`),j=K.querySelectorAll(`.${l.be("suggestion","list")} li`)[$],Y=K.scrollTop,{offsetTop:se,scrollHeight:ce}=j;se+ce>Y+K.clientHeight&&(K.scrollTop+=ce),se<Y&&(K.scrollTop-=ce),g.value=$,u.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`)},q=Rg(f,()=>{k.value&&H()});return s.onBeforeUnmount(()=>{q==null||q()}),s.onMounted(()=>{u.value.ref.setAttribute("role","textbox"),u.value.ref.setAttribute("aria-autocomplete","list"),u.value.ref.setAttribute("aria-controls","id"),u.value.ref.setAttribute("aria-activedescendant",`${C.value}-item-${g.value}`),h=u.value.ref.hasAttribute("readonly")}),e({highlightedIndex:g,activated:m,loading:w,inputRef:u,popperRef:d,suggestions:p,handleSelect:F,handleKeyEnter:z,focus:G,blur:X,close:H,highlight:V,getData:N}),($,K)=>(s.openBlock(),s.createBlock(s.unref(Oa),{ref_key:"popperRef",ref:d,visible:s.unref(k),placement:$.placement,"fallback-placements":["bottom-start","top-start"],"popper-class":[s.unref(l).e("popper"),$.popperClass],teleported:$.teleported,"gpu-acceleration":!1,pure:"","manual-mode":"",effect:"light",trigger:"click",transition:`${s.unref(l).namespace.value}-zoom-in-top`,persistent:"",role:"listbox",onBeforeShow:S,onHide:T},{content:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"regionRef",ref:c,class:s.normalizeClass([s.unref(l).b("suggestion"),s.unref(l).is("loading",s.unref(E))]),style:s.normalizeStyle({[$.fitInputWidth?"width":"minWidth"]:y.value,outline:"none"}),role:"region"},[s.createVNode(s.unref(Ty),{id:s.unref(C),tag:"ul","wrap-class":s.unref(l).be("suggestion","wrap"),"view-class":s.unref(l).be("suggestion","list"),role:"listbox"},{default:s.withCtx(()=>[s.unref(E)?(s.openBlock(),s.createElementBlock("li",{key:0},[s.renderSlot($.$slots,"loading",{},()=>[s.createVNode(s.unref(Xe),{class:s.normalizeClass(s.unref(l).is("loading"))},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.Loading))]),_:1},8,["class"])])])):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(p.value,(L,j)=>(s.openBlock(),s.createElementBlock("li",{id:`${s.unref(C)}-item-${j}`,key:j,class:s.normalizeClass({highlighted:g.value===j}),role:"option","aria-selected":g.value===j,onClick:Y=>F(L)},[s.renderSlot($.$slots,"default",{item:L},()=>[s.createTextVNode(s.toDisplayString(L[$.valueKey]),1)])],10,["id","aria-selected","onClick"]))),128))]),_:3},8,["id","wrap-class","view-class"])],6)]),default:s.withCtx(()=>[s.createElementVNode("div",{ref_key:"listboxRef",ref:f,class:s.normalizeClass([s.unref(l).b(),$.$attrs.class]),style:s.normalizeStyle(s.unref(x)),role:"combobox","aria-haspopup":"listbox","aria-expanded":s.unref(k),"aria-owns":s.unref(C)},[s.createVNode(s.unref(Pi),s.mergeProps({ref_key:"inputRef",ref:u},s.unref(a),{clearable:$.clearable,disabled:s.unref(o),name:$.name,"model-value":$.modelValue,"aria-label":$.ariaLabel,onInput:A,onChange:R,onFocus:O,onBlur:M,onClear:P,onKeydown:[s.withKeys(s.withModifiers(L=>V(g.value-1),["prevent"]),["up"]),s.withKeys(s.withModifiers(L=>V(g.value+1),["prevent"]),["down"]),s.withKeys(z,["enter"]),s.withKeys(H,["tab"]),s.withKeys(W,["esc"])],onMousedown:D}),s.createSlots({_:2},[$.$slots.prepend?{name:"prepend",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prepend")])}:void 0,$.$slots.append?{name:"append",fn:s.withCtx(()=>[s.renderSlot($.$slots,"append")])}:void 0,$.$slots.prefix?{name:"prefix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"prefix")])}:void 0,$.$slots.suffix?{name:"suffix",fn:s.withCtx(()=>[s.renderSlot($.$slots,"suffix")])}:void 0]),1040,["clearable","disabled","name","model-value","aria-label","onKeydown"])],14,["aria-expanded","aria-owns"])]),_:3},8,["visible","placement","popper-class","teleported","transition"]))}});var mP=Be(gP,[["__file","autocomplete.vue"]]);const Ky=dt(mP),Gy=Symbol("buttonGroupContextKey"),yP=(t,e)=>{Uo({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>t.type==="text"));const r=s.inject(Gy,void 0),n=lc("button"),{form:a}=Un(),i=Gn(s.computed(()=>r==null?void 0:r.size)),o=Ba(),l=s.ref(),u=s.useSlots(),c=s.computed(()=>t.type||(r==null?void 0:r.type)||""),d=s.computed(()=>{var p,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(p=n.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=s.computed(()=>t.tag==="button"?{ariaDisabled:o.value||t.loading,disabled:o.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),h=s.computed(()=>{var p;const g=(p=u.default)==null?void 0:p.call(u);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===s.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:o,_size:i,_type:c,_ref:l,_props:f,shouldAddSpace:h,handleClick:p=>{if(o.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",p)}}},bc=Fe({size:Ia,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:dn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:dn,default:()=>xe.Loading},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Se([String,Object]),default:"button"}}),bP={click:t=>t instanceof MouseEvent};function kt(t,e){wP(t)&&(t="100%");var r=CP(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function as(t){return Math.min(1,Math.max(0,t))}function wP(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function CP(t){return typeof t=="string"&&t.indexOf("%")!==-1}function Uy(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function is(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Wn(t){return t.length===1?"0"+t:String(t)}function EP(t,e,r){return{r:kt(t,255)*255,g:kt(e,255)*255,b:kt(r,255)*255}}function Wy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=0,l=(n+a)/2;if(n===a)o=0,i=0;else{var u=n-a;switch(o=l>.5?u/(2-n-a):u/(n+a),n){case t:i=(e-r)/u+(e<r?6:0);break;case e:i=(r-t)/u+2;break;case r:i=(t-e)/u+4;break}i/=6}return{h:i,s:o,l}}function wc(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*(6*r):r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function xP(t,e,r){var n,a,i;if(t=kt(t,360),e=kt(e,100),r=kt(r,100),e===0)a=r,i=r,n=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=wc(l,o,t+1/3),a=wc(l,o,t),i=wc(l,o,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function jy(t,e,r){t=kt(t,255),e=kt(e,255),r=kt(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i=0,o=n,l=n-a,u=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:i=(e-r)/l+(e<r?6:0);break;case e:i=(r-t)/l+2;break;case r:i=(t-e)/l+4;break}i/=6}return{h:i,s:u,v:o}}function kP(t,e,r){t=kt(t,360)*6,e=kt(e,100),r=kt(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),u=n%6,c=[r,o,i,i,l,r][u],d=[l,r,r,o,i,i][u],f=[i,i,l,r,r,o][u];return{r:c*255,g:d*255,b:f*255}}function Yy(t,e,r,n){var a=[Wn(Math.round(t).toString(16)),Wn(Math.round(e).toString(16)),Wn(Math.round(r).toString(16))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function SP(t,e,r,n,a){var i=[Wn(Math.round(t).toString(16)),Wn(Math.round(e).toString(16)),Wn(Math.round(r).toString(16)),Wn(_P(n))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function _P(t){return Math.round(parseFloat(t)*255).toString(16)}function Zy(t){return Yt(t)/255}function Yt(t){return parseInt(t,16)}function TP(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var Cc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function NP(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,l=!1;return typeof t=="string"&&(t=DP(t)),typeof t=="object"&&(Yr(t.r)&&Yr(t.g)&&Yr(t.b)?(e=EP(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Yr(t.h)&&Yr(t.s)&&Yr(t.v)?(n=is(t.s),a=is(t.v),e=kP(t.h,n,a),o=!0,l="hsv"):Yr(t.h)&&Yr(t.s)&&Yr(t.l)&&(n=is(t.s),i=is(t.l),e=xP(t.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(r=t.a)),r=Uy(r),{ok:o,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}var IP="[-\\+]?\\d+%?",BP="[-\\+]?\\d*\\.\\d+%?",pn="(?:".concat(BP,")|(?:").concat(IP,")"),Ec="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),xc="[\\s|\\(]+(".concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")[,|\\s]+(").concat(pn,")\\s*\\)?"),pr={CSS_UNIT:new RegExp(pn),rgb:new RegExp("rgb"+Ec),rgba:new RegExp("rgba"+xc),hsl:new RegExp("hsl"+Ec),hsla:new RegExp("hsla"+xc),hsv:new RegExp("hsv"+Ec),hsva:new RegExp("hsva"+xc),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function DP(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Cc[t])t=Cc[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=pr.rgb.exec(t);return r?{r:r[1],g:r[2],b:r[3]}:(r=pr.rgba.exec(t),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=pr.hsl.exec(t),r?{h:r[1],s:r[2],l:r[3]}:(r=pr.hsla.exec(t),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=pr.hsv.exec(t),r?{h:r[1],s:r[2],v:r[3]}:(r=pr.hsva.exec(t),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=pr.hex8.exec(t),r?{r:Yt(r[1]),g:Yt(r[2]),b:Yt(r[3]),a:Zy(r[4]),format:e?"name":"hex8"}:(r=pr.hex6.exec(t),r?{r:Yt(r[1]),g:Yt(r[2]),b:Yt(r[3]),format:e?"name":"hex"}:(r=pr.hex4.exec(t),r?{r:Yt(r[1]+r[1]),g:Yt(r[2]+r[2]),b:Yt(r[3]+r[3]),a:Zy(r[4]+r[4]),format:e?"name":"hex8"}:(r=pr.hex3.exec(t),r?{r:Yt(r[1]+r[1]),g:Yt(r[2]+r[2]),b:Yt(r[3]+r[3]),format:e?"name":"hex"}:!1)))))))))}function Yr(t){return!!pr.CSS_UNIT.exec(String(t))}var AP=function(){function t(e,r){e===void 0&&(e=""),r===void 0&&(r={});var n;if(e instanceof t)return e;typeof e=="number"&&(e=TP(e)),this.originalInput=e;var a=NP(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:a.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),r,n,a,i=e.r/255,o=e.g/255,l=e.b/255;return i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=Uy(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=jy(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=jy(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=Wy(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=Wy(this.r,this.g,this.b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),Yy(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),SP(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(r,", ").concat(n,")"):"rgba(".concat(e,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(r){return"".concat(Math.round(kt(r,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(r){return Math.round(kt(r,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+Yy(this.r,this.g,this.b,!1),r=0,n=Object.entries(Cc);r<n.length;r++){var a=n[r],i=a[0],o=a[1];if(e===o)return i}return!1},t.prototype.toString=function(e){var r=!!e;e=e??this.format;var n=!1,a=this.a<1&&this.a>=0,i=!r&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l+=e/100,r.l=as(r.l),new t(r)},t.prototype.brighten=function(e){e===void 0&&(e=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),new t(r)},t.prototype.darken=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.l-=e/100,r.l=as(r.l),new t(r)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s-=e/100,r.s=as(r.s),new t(r)},t.prototype.saturate=function(e){e===void 0&&(e=10);var r=this.toHsl();return r.s+=e/100,r.s=as(r.s),new t(r)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var r=this.toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,new t(r)},t.prototype.mix=function(e,r){r===void 0&&(r=50);var n=this.toRgb(),a=new t(e).toRgb(),i=r/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new t(o)},t.prototype.analogous=function(e,r){e===void 0&&(e=6),r===void 0&&(r=30);var n=this.toHsl(),a=360/r,i=[this];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(new t(n));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var r=this.toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(new t({h:n,s:a,v:i})),i=(i+l)%1;return o},t.prototype.splitcomplement=function(){var e=this.toHsl(),r=e.h;return[this,new t({h:(r+72)%360,s:e.s,l:e.l}),new t({h:(r+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var r=this.toRgb(),n=new t(e).toRgb(),a=r.a+n.a*(1-r.a);return new t({r:(r.r*r.a+n.r*n.a*(1-r.a))/a,g:(r.g*r.a+n.g*n.a*(1-r.a))/a,b:(r.b*r.a+n.b*n.a*(1-r.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var r=this.toHsl(),n=r.h,a=[this],i=360/e,o=1;o<e;o++)a.push(new t({h:(n+o*i)%360,s:r.s,l:r.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function vn(t,e=20){return t.mix("#141414",e).toString()}function OP(t){const e=Ba(),r=De("button");return s.computed(()=>{let n={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new AP(a),l=t.dark?o.tint(20).toString():vn(o,20);if(t.plain)n=r.cssVarBlock({"bg-color":t.dark?vn(o,90):o.tint(90).toString(),"text-color":a,"border-color":t.dark?vn(o,50):o.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(n[r.cssVarBlockName("disabled-bg-color")]=t.dark?vn(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=t.dark?vn(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=t.dark?vn(o,80):o.tint(80).toString());else{const u=t.dark?vn(o,30):o.tint(30).toString(),c=o.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":a,"text-color":c,"border-color":a,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?vn(o,50):o.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=d,n[r.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=d}}}return n})}const PP=s.defineComponent({name:"ElButton"}),RP=s.defineComponent({...PP,props:bc,emits:bP,setup(t,{expose:e,emit:r}){const n=t,a=OP(n),i=De("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:d,shouldAddSpace:f,handleClick:h}=yP(n,r),v=s.computed(()=>[i.b(),i.m(u.value),i.m(l.value),i.is("disabled",c.value),i.is("loading",n.loading),i.is("plain",n.plain),i.is("round",n.round),i.is("circle",n.circle),i.is("text",n.text),i.is("link",n.link),i.is("has-bg",n.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:f}),(p,g)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.tag),s.mergeProps({ref_key:"_ref",ref:o},s.unref(d),{class:s.unref(v),style:s.unref(a),onClick:s.unref(h)}),{default:s.withCtx(()=>[p.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[p.$slots.loading?s.renderSlot(p.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(Xe),{key:1,class:s.normalizeClass(s.unref(i).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(s.openBlock(),s.createBlock(s.unref(Xe),{key:1},{default:s.withCtx(()=>[p.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.icon),{key:0})):s.renderSlot(p.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),p.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(i).em("text","expand")]:s.unref(f)})},[s.renderSlot(p.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var LP=Be(RP,[["__file","button.vue"]]);const MP={size:bc.size,type:bc.type},FP=s.defineComponent({name:"ElButtonGroup"}),$P=s.defineComponent({...FP,props:MP,setup(t){const e=t;s.provide(Gy,s.reactive({size:s.toRef(e,"size"),type:s.toRef(e,"type")}));const r=De("button");return(n,a)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(r).b("group"))},[s.renderSlot(n.$slots,"default")],2))}});var Xy=Be($P,[["__file","button-group.vue"]]);const Bt=dt(LP,{ButtonGroup:Xy});Ur(Xy);var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const gn=new Map;if(at){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const r of gn.values())for(const{documentHandler:n}of r)n(e,t);t=void 0}})}function Jy(t,e){let r=[];return Array.isArray(e.arg)?r=e.arg:qn(e.arg)&&r.push(e.arg),function(n,a){const i=e.instance.popperRef,o=n.target,l=a==null?void 0:a.target,u=!e||!e.instance,c=!o||!l,d=t.contains(o)||t.contains(l),f=t===o,h=r.length&&r.some(p=>p==null?void 0:p.contains(o))||r.length&&r.includes(l),v=i&&(i.contains(o)||i.contains(l));u||c||d||f||h||v||e.value(n,a)}}const Qy={beforeMount(t,e){gn.has(t)||gn.set(t,[]),gn.get(t).push({documentHandler:Jy(t,e),bindingFn:e.value})},updated(t,e){gn.has(t)||gn.set(t,[]);const r=gn.get(t),n=r.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:Jy(t,e),bindingFn:e.value};n>=0?r.splice(n,1,a):r.push(a)},unmounted(t){gn.delete(t)}},qP=Fe({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:Se([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),zP=s.defineComponent({name:"ElCard"}),HP=s.defineComponent({...zP,props:qP,setup(t){const e=De("card");return(r,n)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(e).b(),s.unref(e).is(`${r.shadow}-shadow`)])},[r.$slots.header||r.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(e).e("header"))},[s.renderSlot(r.$slots,"header",{},()=>[s.createTextVNode(s.toDisplayString(r.header),1)])],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([s.unref(e).e("body"),r.bodyClass]),style:s.normalizeStyle(r.bodyStyle)},[s.renderSlot(r.$slots,"default")],6),r.$slots.footer||r.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(e).e("footer"))},[s.renderSlot(r.$slots,"footer",{},()=>[s.createTextVNode(s.toDisplayString(r.footer),1)])],2)):s.createCommentVNode("v-if",!0)],2))}});var KP=Be(HP,[["__file","card.vue"]]);const GP=dt(KP),e0={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:Ia,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...jr(["ariaControls"])},t0={[tt]:t=>ut(t)||xt(t)||wa(t),change:t=>ut(t)||xt(t)||wa(t)},Pa=Symbol("checkboxGroupContextKey"),UP=({model:t,isChecked:e})=>{const r=s.inject(Pa,void 0),n=s.computed(()=>{var i,o;const l=(i=r==null?void 0:r.max)==null?void 0:i.value,u=(o=r==null?void 0:r.min)==null?void 0:o.value;return!un(l)&&t.value.length>=l&&!e.value||!un(u)&&t.value.length<=u&&e.value});return{isDisabled:Ba(s.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},WP=(t,{model:e,isLimitExceeded:r,hasOwnLabel:n,isDisabled:a,isLabeledByFormItem:i})=>{const o=s.inject(Pa,void 0),{formItem:l}=Un(),{emit:u}=s.getCurrentInstance();function c(p){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(p)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(p,g){u("change",c(p),g)}function f(p){if(r.value)return;const g=p.target;u("change",c(g.checked),p)}async function h(p){r.value||!n.value&&!a.value&&i.value&&(p.composedPath().some(m=>m.tagName==="LABEL")||(e.value=c([!1,t.falseValue,t.falseLabel].includes(e.value)),await s.nextTick(),d(e.value,p)))}const v=s.computed(()=>(o==null?void 0:o.validateEvent)||t.validateEvent);return s.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(p=>it(p)))}),{handleChange:f,onClickRoot:h}},jP=t=>{const e=s.ref(!1),{emit:r}=s.getCurrentInstance(),n=s.inject(Pa,void 0),a=s.computed(()=>un(n)===!1),i=s.ref(!1),o=s.computed({get(){var l,u;return a.value?(l=n==null?void 0:n.modelValue)==null?void 0:l.value:(u=t.modelValue)!=null?u:e.value},set(l){var u,c;a.value&&Et(l)?(i.value=((u=n==null?void 0:n.max)==null?void 0:u.value)!==void 0&&l.length>(n==null?void 0:n.max.value)&&l.length>o.value.length,i.value===!1&&((c=n==null?void 0:n.changeEvent)==null||c.call(n,l))):(r(tt,l),e.value=l)}});return{model:o,isGroup:a,isLimitExceeded:i}},YP=(t,e,{model:r})=>{const n=s.inject(Pa,void 0),a=s.ref(!1),i=s.computed(()=>Ko(t.value)?t.label:t.value),o=s.computed(()=>{const d=r.value;return wa(d)?d:Et(d)?yt(i.value)?d.map(s.toRaw).some(f=>Ho(f,i.value)):d.map(s.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Gn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value}),{prop:!0}),u=Gn(s.computed(()=>{var d;return(d=n==null?void 0:n.size)==null?void 0:d.value})),c=s.computed(()=>!!e.default||!Ko(i.value));return{checkboxButtonSize:l,isChecked:o,isFocused:a,checkboxSize:u,hasOwnLabel:c,actualValue:i}},r0=(t,e)=>{const{formItem:r}=Un(),{model:n,isGroup:a,isLimitExceeded:i}=jP(t),{isFocused:o,isChecked:l,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,actualValue:f}=YP(t,e,{model:n}),{isDisabled:h}=UP({model:n,isChecked:l}),{inputId:v,isLabeledByFormItem:p}=Oi(t,{formItemContext:r,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=WP(t,{model:n,isLimitExceeded:i,hasOwnLabel:d,isDisabled:h,isLabeledByFormItem:p});return(()=>{function b(){var w,C;Et(n.value)&&!n.value.includes(f.value)?n.value.push(f.value):n.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),Uo({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>a.value&&Ko(t.value))),Uo({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.trueLabel)),Uo({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:p,isChecked:l,isDisabled:h,isFocused:o,checkboxButtonSize:u,checkboxSize:c,hasOwnLabel:d,model:n,actualValue:f,handleChange:g,onClickRoot:y}},ZP=s.defineComponent({name:"ElCheckbox"}),XP=s.defineComponent({...ZP,props:e0,emits:t0,setup(t){const e=t,r=s.useSlots(),{inputId:n,isLabeledByFormItem:a,isChecked:i,isDisabled:o,isFocused:l,checkboxSize:u,hasOwnLabel:c,model:d,actualValue:f,handleChange:h,onClickRoot:v}=r0(e,r),p=De("checkbox"),g=s.computed(()=>[p.b(),p.m(u.value),p.is("disabled",o.value),p.is("bordered",e.border),p.is("checked",i.value)]),y=s.computed(()=>[p.e("input"),p.is("disabled",o.value),p.is("checked",i.value),p.is("indeterminate",e.indeterminate),p.is("focus",l.value)]);return(m,b)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(c)&&s.unref(a)?"span":"label"),{class:s.normalizeClass(s.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:s.unref(v)},{default:s.withCtx(()=>{var w,C,x,k;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:s.unref(o),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(k=(x=m.falseValue)!=null?x:m.falseLabel)!=null?k:!1,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(n),"onUpdate:modelValue":E=>s.isRef(d)?d.value=E:null,class:s.normalizeClass(s.unref(p).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:s.unref(o),value:s.unref(f),name:m.name,tabindex:m.tabindex,onChange:s.unref(h),onFocus:E=>l.value=!0,onBlur:E=>l.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(p).e("inner"))},null,2)],2),s.unref(c)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(p).e("label"))},[s.renderSlot(m.$slots,"default"),m.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(m.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var JP=Be(XP,[["__file","checkbox.vue"]]);const QP=s.defineComponent({name:"ElCheckboxButton"}),eR=s.defineComponent({...QP,props:e0,emits:t0,setup(t){const e=t,r=s.useSlots(),{isFocused:n,isChecked:a,isDisabled:i,checkboxButtonSize:o,model:l,actualValue:u,handleChange:c}=r0(e,r),d=s.inject(Pa,void 0),f=De("checkbox"),h=s.computed(()=>{var p,g,y,m;const b=(g=(p=d==null?void 0:d.fill)==null?void 0:p.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=s.computed(()=>[f.b("button"),f.bm("button",o.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",n.value)]);return(p,g)=>{var y,m,b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(v))},[p.trueValue||p.falseValue||p.trueLabel||p.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),"true-value":(m=(y=p.trueValue)!=null?y:p.trueLabel)!=null?m:!0,"false-value":(w=(b=p.falseValue)!=null?b:p.falseLabel)!=null?w:!1,onChange:s.unref(c),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(l)?l.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:p.name,tabindex:p.tabindex,disabled:s.unref(i),value:s.unref(u),onChange:s.unref(c),onFocus:C=>n.value=!0,onBlur:C=>n.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(l)]]),p.$slots.default||p.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(a)?s.unref(h):void 0)},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var n0=Be(eR,[["__file","checkbox-button.vue"]]);const tR=Fe({modelValue:{type:Se(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Ia,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),rR={[tt]:t=>Et(t),change:t=>Et(t)},nR=s.defineComponent({name:"ElCheckboxGroup"}),aR=s.defineComponent({...nR,props:tR,emits:rR,setup(t,{emit:e}){const r=t,n=De("checkbox"),{formItem:a}=Un(),{inputId:i,isLabeledByFormItem:o}=Oi(r,{formItemContext:a}),l=async c=>{e(tt,c),await s.nextTick(),e("change",c)},u=s.computed({get(){return r.modelValue},set(c){l(c)}});return s.provide(Pa,{...Dm(s.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),s.watch(()=>r.modelValue,()=>{r.validateEvent&&(a==null||a.validate("change").catch(c=>it(c)))}),(c,d)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(c.tag),{id:s.unref(i),class:s.normalizeClass(s.unref(n).b("group")),role:"group","aria-label":s.unref(o)?void 0:c.ariaLabel||"checkbox-group","aria-labelledby":s.unref(o)?(f=s.unref(a))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(c.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var a0=Be(aR,[["__file","checkbox-group.vue"]]);const iR=dt(JP,{CheckboxButton:n0,CheckboxGroup:a0});Ur(n0),Ur(a0);const kc=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Fm},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),oR={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},sR=s.defineComponent({name:"ElTag"}),lR=s.defineComponent({...sR,props:kc,emits:oR,setup(t,{emit:e}){const r=t,n=Gn(),a=De("tag"),i=s.computed(()=>{const{type:c,hit:d,effect:f,closable:h,round:v}=r;return[a.b(),a.is("closable",h),a.m(c||"primary"),a.m(n.value),a.m(f),a.is("hit",d),a.is("round",v)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,d)=>c.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:c.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(c.$slots,"default")],2),c.closable?(s.openBlock(),s.createBlock(s.unref(Xe),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle({backgroundColor:c.color}),onClick:l},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).e("content"))},[s.renderSlot(c.$slots,"default")],2),c.closable?(s.openBlock(),s.createBlock(s.unref(Xe),{key:0,class:s.normalizeClass(s.unref(a).e("close")),onClick:s.withModifiers(o,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var cR=Be(lR,[["__file","tag.vue"]]);const uR=dt(cR),i0=Symbol("rowContextKey"),dR=Fe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),fR=s.defineComponent({name:"ElRow"}),hR=s.defineComponent({...fR,props:dR,setup(t){const e=t,r=De("row"),n=s.computed(()=>e.gutter);s.provide(i0,{gutter:n});const a=s.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),i=s.computed(()=>[r.b(),r.is(`justify-${e.justify}`,e.justify!=="start"),r.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var pR=Be(hR,[["__file","row.vue"]]);const os=dt(pR),vR=Fe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Se([Number,Object]),default:()=>Ea({})},sm:{type:Se([Number,Object]),default:()=>Ea({})},md:{type:Se([Number,Object]),default:()=>Ea({})},lg:{type:Se([Number,Object]),default:()=>Ea({})},xl:{type:Se([Number,Object]),default:()=>Ea({})}}),gR=s.defineComponent({name:"ElCol"}),mR=s.defineComponent({...gR,props:vR,setup(t){const e=t,{gutter:r}=s.inject(i0,{gutter:s.computed(()=>0)}),n=De("col"),a=s.computed(()=>{const o={};return r.value&&(o.paddingLeft=o.paddingRight=`${r.value/2}px`),o}),i=s.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const d=e[c];xt(d)&&(c==="span"?o.push(n.b(`${e[c]}`)):d>0&&o.push(n.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{xt(e[c])?o.push(n.b(`${c}-${e[c]}`)):yt(e[c])&&Object.entries(e[c]).forEach(([d,f])=>{o.push(d!=="span"?n.b(`${c}-${d}-${f}`):n.b(`${c}-${f}`))})}),r.value&&o.push(n.is("guttered")),[n.b(),o]});return(o,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.tag),{class:s.normalizeClass(s.unref(i)),style:s.normalizeStyle(s.unref(a))},{default:s.withCtx(()=>[s.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var yR=Be(mR,[["__file","col.vue"]]);const Mi=dt(yR),bR=s.defineComponent({name:"ElCollapseTransition"}),wR=s.defineComponent({...bR,setup(t){const e=De("collapse-transition"),r=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},n={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){r(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){r(a)},leaveCancelled(a){r(a)}};return(a,i)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(e).b()},s.toHandlers(n)),{default:s.withCtx(()=>[s.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var CR=Be(wR,[["__file","collapse-transition.vue"]]);const ER=dt(CR),xR=Fe({color:{type:Se(Object),required:!0},vertical:{type:Boolean,default:!1}});let Sc=!1;function Fi(t,e){if(!at)return;const r=function(i){var o;(o=e.drag)==null||o.call(e,i)},n=function(i){var o;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,Sc=!1,(o=e.end)==null||o.call(e,i)},a=function(i){var o;Sc||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),Sc=!0,(o=e.start)==null||o.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const kR=t=>{const e=s.getCurrentInstance(),{t:r}=xi(),n=s.shallowRef(),a=s.shallowRef(),i=s.computed(()=>t.color.get("alpha")),o=s.computed(()=>r("el.colorpicker.alphaLabel"));function l(f){var h;f.target!==n.value&&u(f),(h=n.value)==null||h.focus()}function u(f){if(!a.value||!n.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:g}=Il(f);if(t.vertical){let y=g-v.top;y=Math.max(n.value.offsetHeight/2,y),y=Math.min(y,v.height-n.value.offsetHeight/2),t.color.set("alpha",Math.round((y-n.value.offsetHeight/2)/(v.height-n.value.offsetHeight)*100))}else{let y=p-v.left;y=Math.max(n.value.offsetWidth/2,y),y=Math.min(y,v.width-n.value.offsetWidth/2),t.color.set("alpha",Math.round((y-n.value.offsetWidth/2)/(v.width-n.value.offsetWidth)*100))}}function c(f){const{code:h,shiftKey:v}=f,p=v?10:1;switch(h){case ft.left:case ft.down:f.preventDefault(),f.stopPropagation(),d(-p);break;case ft.right:case ft.up:f.preventDefault(),f.stopPropagation(),d(p);break}}function d(f){let h=i.value+f;h=h<0?0:h>100?100:h,t.color.set("alpha",h)}return{thumb:n,bar:a,alpha:i,alphaLabel:o,handleDrag:u,handleClick:l,handleKeydown:c}},SR=(t,{bar:e,thumb:r,handleDrag:n})=>{const a=s.getCurrentInstance(),i=De("color-alpha-slider"),o=s.ref(0),l=s.ref(0),u=s.ref();function c(){if(!r.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-r.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function h(){o.value=c(),l.value=d(),u.value=f()}s.onMounted(()=>{if(!e.value||!r.value)return;const b={drag:w=>{n(w)},end:w=>{n(w)}};Fi(e.value,b),Fi(r.value,b),h()}),s.watch(()=>t.color.get("alpha"),()=>h()),s.watch(()=>t.color.value,()=>h());const v=s.computed(()=>[i.b(),i.is("vertical",t.vertical)]),p=s.computed(()=>i.e("bar")),g=s.computed(()=>i.e("thumb")),y=s.computed(()=>({background:u.value})),m=s.computed(()=>({left:Ca(o.value),top:Ca(l.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:g,thumbStyle:m,update:h}},_R=s.defineComponent({name:"ElColorAlphaSlider"}),TR=s.defineComponent({..._R,props:xR,setup(t,{expose:e}){const r=t,{alpha:n,alphaLabel:a,bar:i,thumb:o,handleDrag:l,handleClick:u,handleKeydown:c}=kR(r),{rootKls:d,barKls:f,barStyle:h,thumbKls:v,thumbStyle:p,update:g}=SR(r,{bar:i,thumb:o,handleDrag:l});return e({update:g,bar:i,thumb:o}),(y,m)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(d))},[s.createElementVNode("div",{ref_key:"bar",ref:i,class:s.normalizeClass(s.unref(f)),style:s.normalizeStyle(s.unref(h)),onClick:s.unref(u)},null,14,["onClick"]),s.createElementVNode("div",{ref_key:"thumb",ref:o,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(p)),"aria-label":s.unref(a),"aria-valuenow":s.unref(n),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:s.unref(c)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var NR=Be(TR,[["__file","alpha-slider.vue"]]);const IR=s.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=De("color-hue-slider"),r=s.getCurrentInstance(),n=s.ref(),a=s.ref(),i=s.ref(0),o=s.ref(0),l=s.computed(()=>t.color.get("hue"));s.watch(()=>l.value,()=>{h()});function u(v){v.target!==n.value&&c(v)}function c(v){if(!a.value||!n.value)return;const g=r.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Il(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-n.value.offsetHeight/2),w=Math.max(n.value.offsetHeight/2,w),b=Math.round((w-n.value.offsetHeight/2)/(g.height-n.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-n.value.offsetWidth/2),w=Math.max(n.value.offsetWidth/2,w),b=Math.round((w-n.value.offsetWidth/2)/(g.width-n.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!n.value)return 0;const v=r.vnode.el;if(t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetWidth-n.value.offsetWidth/2)/360):0}function f(){if(!n.value)return 0;const v=r.vnode.el;if(!t.vertical)return 0;const p=t.color.get("hue");return v?Math.round(p*(v.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){i.value=d(),o.value=f()}return s.onMounted(()=>{if(!a.value||!n.value)return;const v={drag:p=>{c(p)},end:p=>{c(p)}};Fi(a.value,v),Fi(n.value,v),h()}),{bar:a,thumb:n,thumbLeft:i,thumbTop:o,hueValue:l,handleClick:u,update:h,ns:e}}});function BR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[s.createElementVNode("div",{ref:"bar",class:s.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),s.createElementVNode("div",{ref:"thumb",class:s.normalizeClass(t.ns.e("thumb")),style:s.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var DR=Be(IR,[["render",BR],["__file","hue-slider.vue"]]);const AR=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:Ia,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:Vt.teleported,predefine:{type:Se(Array)},validateEvent:{type:Boolean,default:!0},...jr(["ariaLabel"])}),OR={[tt]:t=>ut(t)||cn(t),[Ei]:t=>ut(t)||cn(t),activeChange:t=>ut(t)||cn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},o0=Symbol("colorPickerContextKey"),s0=function(t,e,r){return[t,e*r/((t=(2-e)*r)<1?t:2-t)||0,t/2]},PR=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},RR=function(t){return typeof t=="string"&&t.includes("%")},Ra=function(t,e){PR(t)&&(t="100%");const r=RR(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),r&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},l0={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},ss=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),r=t%16;return`${l0[e]||e}${l0[r]||r}`},c0=function({r:t,g:e,b:r}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+r)?"":`#${ss(t)}${ss(e)}${ss(r)}`},_c={A:10,B:11,C:12,D:13,E:14,F:15},jn=function(t){return t.length===2?(_c[t[0].toUpperCase()]||+t[0])*16+(_c[t[1].toUpperCase()]||+t[1]):_c[t[1].toUpperCase()]||+t[1]},LR=function(t,e,r){e=e/100,r=r/100;let n=e;const a=Math.max(r,.01);r*=2,e*=r<=1?r:2-r,n*=a<=1?a:2-a;const i=(r+e)/2,o=r===0?2*n/(a+n):2*e/(r+e);return{h:t,s:o*100,v:i*100}},u0=(t,e,r)=>{t=Ra(t,255),e=Ra(e,255),r=Ra(r,255);const n=Math.max(t,e,r),a=Math.min(t,e,r);let i;const o=n,l=n-a,u=n===0?0:l/n;if(n===a)i=0;else{switch(n){case t:{i=(e-r)/l+(e<r?6:0);break}case e:{i=(r-t)/l+2;break}case r:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:u*100,v:o*100}},$i=function(t,e,r){t=Ra(t,360)*6,e=Ra(e,100),r=Ra(r,100);const n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),u=n%6,c=[r,o,i,i,l,r][u],d=[l,r,r,o,i,i][u],f=[i,i,l,r,r,o][u];return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(f*255)}};class Vi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in e)Mn(e,r)&&(this[r]=e[r]);e.value?this.fromString(e.value):this.doOnChange()}set(e,r){if(arguments.length===1&&typeof e=="object"){for(const n in e)Mn(e,n)&&this.set(n,e[n]);return}this[`_${e}`]=r,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return $i(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,a,i)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const n=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:o}=LR(n[0],n[1],n[2]);r(a,i,o)}}else if(e.includes("hsv")){const n=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(e.includes("rgb")){const n=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:a,s:i,v:o}=u0(n[0],n[1],n[2]);r(a,i,o)}}else if(e.includes("#")){const n=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let a,i,o;n.length===3?(a=jn(n[0]+n[0]),i=jn(n[1]+n[1]),o=jn(n[2]+n[2])):(n.length===6||n.length===8)&&(a=jn(n.slice(0,2)),i=jn(n.slice(2,4)),o=jn(n.slice(4,6))),n.length===8?this._alpha=jn(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:u,v:c}=u0(a,i,o);r(l,u,c)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:r,_value:n,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const o=s0(e,r/100,n/100);this.value=`hsla(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${c0($i(e,r,n))}${ss(a*255/100)}`;break}default:{const{r:o,g:l,b:u}=$i(e,r,n);this.value=`rgba(${o}, ${l}, ${u}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const o=s0(e,r/100,n/100);this.value=`hsl(${e}, ${Math.round(o[1]*100)}%, ${Math.round(o[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:o,g:l,b:u}=$i(e,r,n);this.value=`rgb(${o}, ${l}, ${u})`;break}default:this.value=c0($i(e,r,n))}}}const MR=s.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=De("color-predefine"),{currentColor:r}=s.inject(o0),n=s.ref(i(t.colors,t.color));s.watch(()=>r.value,o=>{const l=new Vi;l.fromString(o),n.value.forEach(u=>{u.selected=l.compare(u)})}),s.watchEffect(()=>{n.value=i(t.colors,t.color)});function a(o){t.color.fromString(t.colors[o])}function i(o,l){return o.map(u=>{const c=new Vi;return c.enableAlpha=t.enableAlpha,c.format="rgba",c.fromString(u),c.selected=c.value===l.value,c})}return{rgbaColors:n,handleSelect:a,ns:e}}});function FR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b())},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("colors"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.rgbaColors,(o,l)=>(s.openBlock(),s.createElementBlock("div",{key:t.colors[l],class:s.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",o._alpha<100),{selected:o.selected}]),onClick:u=>t.handleSelect(l)},[s.createElementVNode("div",{style:s.normalizeStyle({backgroundColor:o.value})},null,4)],10,["onClick"]))),128))],2)],2)}var $R=Be(MR,[["render",FR],["__file","predefine.vue"]]);const VR=s.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=De("color-svpanel"),r=s.getCurrentInstance(),n=s.ref(0),a=s.ref(0),i=s.ref("hsl(0, 100%, 50%)"),o=s.computed(()=>{const c=t.color.get("hue"),d=t.color.get("value");return{hue:c,value:d}});function l(){const c=t.color.get("saturation"),d=t.color.get("value"),f=r.vnode.el,{clientWidth:h,clientHeight:v}=f;a.value=c*h/100,n.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function u(c){const f=r.vnode.el.getBoundingClientRect(),{clientX:h,clientY:v}=Il(c);let p=h-f.left,g=v-f.top;p=Math.max(0,p),p=Math.min(p,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=p,n.value=g,t.color.set({saturation:p/f.width*100,value:100-g/f.height*100})}return s.watch(()=>o.value,()=>{l()}),s.onMounted(()=>{Fi(r.vnode.el,{drag:c=>{u(c)},end:c=>{u(c)}}),l()}),{cursorTop:n,cursorLeft:a,background:i,colorValue:o,handleDrag:u,update:l,ns:e}}});function qR(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(t.ns.b()),style:s.normalizeStyle({backgroundColor:t.background})},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("white"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("black"))},null,2),s.createElementVNode("div",{class:s.normalizeClass(t.ns.e("cursor")),style:s.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[s.createElementVNode("div")],6)],6)}var zR=Be(VR,[["render",qR],["__file","sv-panel.vue"]]);const HR=s.defineComponent({name:"ElColorPicker"}),KR=s.defineComponent({...HR,props:AR,emits:OR,setup(t,{expose:e,emit:r}){const n=t,{t:a}=xi(),i=De("color"),{formItem:o}=Un(),l=Gn(),u=Ba(),{inputId:c,isLabeledByFormItem:d}=Oi(n,{formItemContext:o}),f=s.ref(),h=s.ref(),v=s.ref(),p=s.ref(),g=s.ref(),y=s.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=sc(g,{beforeFocus(){return u.value},beforeBlur(L){var j;return(j=p.value)==null?void 0:j.isFocusInsideContent(L)},afterBlur(){R(!1),z()}});let C=!0;const x=s.reactive(new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=s.ref(!1),E=s.ref(!1),_=s.ref(""),S=s.computed(()=>!n.modelValue&&!E.value?"transparent":D(x,n.showAlpha)),T=s.computed(()=>!n.modelValue&&!E.value?"":x.value),N=s.computed(()=>d.value?void 0:n.ariaLabel||a("el.colorpicker.defaultLabel")),B=s.computed(()=>d.value?o==null?void 0:o.labelId:void 0),A=s.computed(()=>[i.b("picker"),i.is("disabled",u.value),i.bm("picker",l.value),i.is("focused",m.value)]);function D(L,j){if(!(L instanceof Vi))throw new TypeError("color should be instance of _color Class");const{r:Y,g:se,b:ce}=L.toRgb();return j?`rgba(${Y}, ${se}, ${ce}, ${L.get("alpha")/100})`:`rgb(${Y}, ${se}, ${ce})`}function R(L){k.value=L}const O=Wl(R,100,{leading:!0});function M(){u.value||R(!0)}function P(){O(!1),z()}function z(){s.nextTick(()=>{n.modelValue?x.fromString(n.modelValue):(x.value="",s.nextTick(()=>{E.value=!1}))})}function W(){u.value||O(!k.value)}function H(){x.fromString(_.value)}function G(){const L=x.value;r(tt,L),r("change",L),n.validateEvent&&(o==null||o.validate("change").catch(j=>it(j))),O(!1),s.nextTick(()=>{const j=new Vi({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});x.compare(j)||z()})}function X(){O(!1),r(tt,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(o==null||o.validate("change").catch(L=>it(L))),z()}function F(){k.value&&(P(),m.value&&$())}function V(L){L.preventDefault(),L.stopPropagation(),R(!1),z()}function q(L){switch(L.code){case ft.enter:case ft.space:L.preventDefault(),L.stopPropagation(),M(),y.value.focus();break;case ft.esc:V(L);break}}function $(){g.value.focus()}function K(){g.value.blur()}return s.onMounted(()=>{n.modelValue&&(_.value=T.value)}),s.watch(()=>n.modelValue,L=>{L?L&&L!==x.value&&(C=!1,x.fromString(L)):E.value=!1}),s.watch(()=>[n.colorFormat,n.showAlpha],()=>{x.enableAlpha=n.showAlpha,x.format=n.colorFormat||x.format,x.doOnChange(),r(tt,x.value)}),s.watch(()=>T.value,L=>{_.value=L,C&&r("activeChange",L),C=!0}),s.watch(()=>x.value,()=>{!n.modelValue&&!E.value&&(E.value=!0)}),s.watch(()=>k.value,()=>{s.nextTick(()=>{var L,j,Y;(L=f.value)==null||L.update(),(j=h.value)==null||j.update(),(Y=v.value)==null||Y.update()})}),s.provide(o0,{currentColor:T}),e({color:x,show:M,hide:P,focus:$,blur:K}),(L,j)=>(s.openBlock(),s.createBlock(s.unref(Oa),{ref_key:"popper",ref:p,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[s.unref(i).be("picker","panel"),s.unref(i).b("dropdown"),L.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:L.teleported,transition:`${s.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:Y=>R(!1)},{content:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("div",{onKeydown:s.withKeys(V,["esc"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","main-wrapper"))},[s.createVNode(DR,{ref_key:"hue",ref:f,class:"hue-slider",color:s.unref(x),vertical:""},null,8,["color"]),s.createVNode(zR,{ref_key:"sv",ref:h,color:s.unref(x)},null,8,["color"])],2),L.showAlpha?(s.openBlock(),s.createBlock(NR,{key:0,ref_key:"alpha",ref:v,color:s.unref(x)},null,8,["color"])):s.createCommentVNode("v-if",!0),L.predefine?(s.openBlock(),s.createBlock($R,{key:1,ref:"predefine","enable-alpha":L.showAlpha,color:s.unref(x),colors:L.predefine},null,8,["enable-alpha","color","colors"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("dropdown","btns"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("dropdown","value"))},[s.createVNode(s.unref(Pi),{ref_key:"inputRef",ref:y,modelValue:_.value,"onUpdate:modelValue":Y=>_.value=Y,"validate-event":!1,size:"small",onKeyup:s.withKeys(H,["enter"]),onBlur:H},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),s.createVNode(s.unref(Bt),{class:s.normalizeClass(s.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:X},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),s.createVNode(s.unref(Bt),{plain:"",size:"small",class:s.normalizeClass(s.unref(i).be("dropdown","btn")),onClick:G},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[s.unref(Qy),F]])]),default:s.withCtx(()=>[s.createElementVNode("div",s.mergeProps({id:s.unref(c),ref_key:"triggerRef",ref:g},L.$attrs,{class:s.unref(A),role:"button","aria-label":s.unref(N),"aria-labelledby":s.unref(B),"aria-description":s.unref(a)("el.colorpicker.description",{color:L.modelValue||""}),"aria-disabled":s.unref(u),tabindex:s.unref(u)?-1:L.tabindex,onKeydown:q,onFocus:s.unref(b),onBlur:s.unref(w)}),[s.unref(u)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).be("picker","mask"))},null,2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(i).be("picker","trigger")),onClick:W},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(i).be("picker","color"),s.unref(i).is("alpha",L.showAlpha)])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(i).be("picker","color-inner")),style:s.normalizeStyle({backgroundColor:s.unref(S)})},[s.withDirectives(s.createVNode(s.unref(Xe),{class:s.normalizeClass([s.unref(i).be("picker","icon"),s.unref(i).is("icon-arrow-down")])},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.ArrowDown))]),_:1},8,["class"]),[[s.vShow,L.modelValue||E.value]]),s.withDirectives(s.createVNode(s.unref(Xe),{class:s.normalizeClass([s.unref(i).be("picker","empty"),s.unref(i).is("icon-close")])},{default:s.withCtx(()=>[s.createVNode(s.unref(xe.Close))]),_:1},8,["class"]),[[s.vShow,!L.modelValue&&!E.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var GR=Be(KR,[["__file","color-picker.vue"]]);const UR=dt(GR),WR=s.defineComponent({name:"ElContainer"}),jR=s.defineComponent({...WR,props:{direction:{type:String}},setup(t){const e=t,r=s.useSlots(),n=De("container"),a=s.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,o)=>(s.openBlock(),s.createElementBlock("section",{class:s.normalizeClass([s.unref(n).b(),s.unref(n).is("vertical",s.unref(a))])},[s.renderSlot(i.$slots,"default")],2))}});var YR=Be(jR,[["__file","container.vue"]]);const ZR=s.defineComponent({name:"ElAside"}),XR=s.defineComponent({...ZR,props:{width:{type:String,default:null}},setup(t){const e=t,r=De("aside"),n=s.computed(()=>e.width?r.cssVarBlock({width:e.width}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("aside",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var d0=Be(XR,[["__file","aside.vue"]]);const JR=s.defineComponent({name:"ElFooter"}),QR=s.defineComponent({...JR,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("footer"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("footer",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var f0=Be(QR,[["__file","footer.vue"]]);const eL=s.defineComponent({name:"ElHeader"}),tL=s.defineComponent({...eL,props:{height:{type:String,default:null}},setup(t){const e=t,r=De("header"),n=s.computed(()=>e.height?r.cssVarBlock({height:e.height}):{});return(a,i)=>(s.openBlock(),s.createElementBlock("header",{class:s.normalizeClass(s.unref(r).b()),style:s.normalizeStyle(s.unref(n))},[s.renderSlot(a.$slots,"default")],6))}});var h0=Be(tL,[["__file","header.vue"]]);const rL=s.defineComponent({name:"ElMain"}),nL=s.defineComponent({...rL,setup(t){const e=De("main");return(r,n)=>(s.openBlock(),s.createElementBlock("main",{class:s.normalizeClass(s.unref(e).b())},[s.renderSlot(r.$slots,"default")],2))}});var p0=Be(nL,[["__file","main.vue"]]);const ls=dt(YR,{Aside:d0,Footer:f0,Header:h0,Main:p0});Ur(d0),Ur(f0);const v0=Ur(h0),Tc=Ur(p0),aL=s.defineComponent({inheritAttrs:!1});function iL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var oL=Be(aL,[["render",iL],["__file","collection.vue"]]);const sL=s.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function lL(t,e,r,n,a,i){return s.renderSlot(t.$slots,"default")}var cL=Be(sL,[["render",lL],["__file","collection-item.vue"]]);const uL="data-el-collection-item",dL=t=>{const e=`El${t}Collection`,r=`${e}Item`,n=Symbol(e),a=Symbol(r),i={...oL,name:e,setup(){const l=s.ref(null),u=new Map,c=()=>{const d=s.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${uL}]`));return[...u.values()].sort((v,p)=>f.indexOf(v.ref)-f.indexOf(p.ref))};s.provide(n,{itemMap:u,getItems:c,collectionRef:l})}},o={...cL,name:r,setup(l,{attrs:u}){const c=s.ref(null),d=s.inject(n,void 0);s.provide(a,{collectionItemRef:c}),s.onMounted(()=>{const f=s.unref(c);f&&d.itemMap.set(f,{ref:f,...u})}),s.onBeforeUnmount(()=>{const f=s.unref(c);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:o}},Nc=Fe({trigger:Ri.trigger,effect:{...Vt.effect,default:"light"},type:{type:Se(String)},placement:{type:Se(String),default:"bottom"},popperOptions:{type:Se(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Se([Number,String]),default:0},maxHeight:{type:Se([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Se(Object)},teleported:Vt.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:dn}}),Fe({onKeydown:{type:Se(Function)}}),dL("Dropdown");const g0=Symbol("ElSelectGroup"),qi=Symbol("ElSelect");function fL(t,e){const r=s.inject(qi),n=s.inject(g0,{disabled:!1}),a=s.computed(()=>d(sn(r.props.modelValue),t.value)),i=s.computed(()=>{var v;if(r.props.multiple){const p=sn((v=r.props.modelValue)!=null?v:[]);return!a.value&&p.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),o=s.computed(()=>t.label||(yt(t.value)?"":t.value)),l=s.computed(()=>t.value||t.label||""),u=s.computed(()=>t.disabled||e.groupDisabled||i.value),c=s.getCurrentInstance(),d=(v=[],p)=>{if(yt(t.value)){const g=r.props.valueKey;return v&&v.some(y=>s.toRaw(Kr(y,g))===Kr(p,g))}else return v&&v.includes(p)},f=()=>{!t.disabled&&!n.disabled&&(r.states.hoveringIndex=r.optionsArray.indexOf(c.proxy))},h=v=>{const p=new RegExp(nD(v),"i");e.visible=p.test(o.value)||t.created};return s.watch(()=>o.value,()=>{!t.created&&!r.props.remote&&r.setSelected()}),s.watch(()=>t.value,(v,p)=>{const{remote:g,valueKey:y}=r.props;if(v!==p&&(r.onOptionDestroy(p,c.proxy),r.onOptionCreate(c.proxy)),!t.created&&!g){if(y&&yt(v)&&yt(p)&&v[y]===p[y])return;r.setSelected()}}),s.watch(()=>n.disabled,()=>{e.groupDisabled=n.disabled},{immediate:!0}),{select:r,currentLabel:o,currentValue:l,itemSelected:a,isDisabled:u,hoverItem:f,updateOption:h}}const hL=s.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=De("select"),r=Di(),n=s.computed(()=>[e.be("dropdown","item"),e.is("disabled",s.unref(l)),e.is("selected",s.unref(o)),e.is("hovering",s.unref(h))]),a=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:d}=fL(t,a),{visible:f,hover:h}=s.toRefs(a),v=s.getCurrentInstance().proxy;u.onOptionCreate(v),s.onBeforeUnmount(()=>{const g=v.value,{selected:y}=u.states,b=(u.props.multiple?y:[y]).some(w=>w.value===v.value);s.nextTick(()=>{u.states.cachedOptions.get(g)===v&&!b&&u.states.cachedOptions.delete(g)}),u.onOptionDestroy(g,v)});function p(){l.value||u.handleOptionSelect(v)}return{ns:e,id:r,containerKls:n,currentLabel:i,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:d,visible:f,hover:h,selectOptionClick:p,states:a}}});function pL(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:t.id,class:s.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:s.withModifiers(t.selectOptionClick,["stop"])},[s.renderSlot(t.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,t.visible]])}var Ic=Be(hL,[["render",pL],["__file","option.vue"]]);const vL=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=s.inject(qi),e=De("select"),r=s.computed(()=>t.props.popperClass),n=s.computed(()=>t.props.multiple),a=s.computed(()=>t.props.fitInputWidth),i=s.ref("");function o(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return s.onMounted(()=>{o(),qr(t.selectRef,o)}),{ns:e,minWidth:i,popperClass:r,isMultiple:n,isFitInputWidth:a}}});function gL(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:s.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("dropdown","header"))},[s.renderSlot(t.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(t.$slots,"default"),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.ns.be("dropdown","footer"))},[s.renderSlot(t.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var mL=Be(vL,[["render",gL],["__file","select-dropdown.vue"]]);const yL=11,bL=(t,e)=>{const{t:r}=xi(),n=Di(),a=De("select"),i=De("input"),o=s.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=s.ref(null),u=s.ref(null),c=s.ref(null),d=s.ref(null),f=s.ref(null),h=s.ref(null),v=s.ref(null),p=s.ref(null),g=s.ref(null),y=s.ref(null),m=s.ref(null),b=s.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k}=Ey({afterComposition:Q=>te(Q)}),{wrapperRef:E,isFocused:_}=sc(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(Q){var he,Oe;return((he=c.value)==null?void 0:he.isFocusInsideContent(Q))||((Oe=d.value)==null?void 0:Oe.isFocusInsideContent(Q))},afterBlur(){S.value=!1,o.menuVisibleOnFocus=!1}}),S=s.ref(!1),T=s.ref(),{form:N,formItem:B}=Un(),{inputId:A}=Oi(t,{formItemContext:B}),{valueOnClear:D,isEmptyValue:R}=MA(t),O=s.computed(()=>t.disabled||(N==null?void 0:N.disabled)),M=s.computed(()=>Et(t.modelValue)?t.modelValue.length>0:!R(t.modelValue)),P=s.computed(()=>t.clearable&&!O.value&&o.inputHovering&&M.value),z=s.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),W=s.computed(()=>a.is("reverse",z.value&&S.value)),H=s.computed(()=>(B==null?void 0:B.validateState)||""),G=s.computed(()=>Mm[H.value]),X=s.computed(()=>t.remote?300:0),F=s.computed(()=>t.loading?t.loadingText||r("el.select.loading"):t.remote&&!o.inputValue&&o.options.size===0?!1:t.filterable&&o.inputValue&&o.options.size>0&&V.value===0?t.noMatchText||r("el.select.noMatch"):o.options.size===0?t.noDataText||r("el.select.noData"):null),V=s.computed(()=>q.value.filter(Q=>Q.visible).length),q=s.computed(()=>{const Q=Array.from(o.options.values()),he=[];return o.optionValues.forEach(Oe=>{const He=Q.findIndex(Fr=>Fr.value===Oe);He>-1&&he.push(Q[He])}),he.length>=Q.length?he:Q}),$=s.computed(()=>Array.from(o.cachedOptions.values())),K=s.computed(()=>{const Q=q.value.filter(he=>!he.created).some(he=>he.currentLabel===o.inputValue);return t.filterable&&t.allowCreate&&o.inputValue!==""&&!Q}),L=()=>{t.filterable&&$t(t.filterMethod)||t.filterable&&t.remote&&$t(t.remoteMethod)||q.value.forEach(Q=>{var he;(he=Q.updateOption)==null||he.call(Q,o.inputValue)})},j=Gn(),Y=s.computed(()=>["small"].includes(j.value)?"small":"default"),se=s.computed({get(){return S.value&&F.value!==!1},set(Q){S.value=Q}}),ce=s.computed(()=>{if(t.multiple&&!un(t.modelValue))return sn(t.modelValue).length===0&&!o.inputValue;const Q=Et(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||un(Q)?!o.inputValue:!0}),ae=s.computed(()=>{var Q;const he=(Q=t.placeholder)!=null?Q:r("el.select.placeholder");return t.multiple||!M.value?he:o.selectedLabel}),ne=s.computed(()=>Nl?null:"mouseenter");s.watch(()=>t.modelValue,(Q,he)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(o.inputValue="",ue("")),fe(),!Ho(Q,he)&&t.validateEvent&&(B==null||B.validate("change").catch(Oe=>it(Oe)))},{flush:"post",deep:!0}),s.watch(()=>S.value,Q=>{Q?ue(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",Q)}),s.watch(()=>o.options.entries(),()=>{var Q;if(!at)return;const he=((Q=l.value)==null?void 0:Q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!un(t.modelValue)||!Array.from(he).includes(document.activeElement))&&fe(),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value&&ie()},{flush:"post"}),s.watch(()=>o.hoveringIndex,Q=>{xt(Q)&&Q>-1?T.value=q.value[Q]||{}:T.value={},q.value.forEach(he=>{he.hover=T.value===he})}),s.watchEffect(()=>{o.isBeforeHide||L()});const ue=Q=>{o.previousQuery===Q||w.value||(o.previousQuery=Q,t.filterable&&$t(t.filterMethod)?t.filterMethod(Q):t.filterable&&t.remote&&$t(t.remoteMethod)&&t.remoteMethod(Q),t.defaultFirstOption&&(t.filterable||t.remote)&&V.value?s.nextTick(ie):s.nextTick(Ae))},ie=()=>{const Q=q.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),he=Q.find(He=>He.created),Oe=Q[0];o.hoveringIndex=ye(q.value,he||Oe)},fe=()=>{if(t.multiple)o.selectedLabel="";else{const he=Et(t.modelValue)?t.modelValue[0]:t.modelValue,Oe=pe(he);o.selectedLabel=Oe.currentLabel,o.selected=[Oe];return}const Q=[];un(t.modelValue)||sn(t.modelValue).forEach(he=>{Q.push(pe(he))}),o.selected=Q},pe=Q=>{let he;const Oe=Bl(Q).toLowerCase()==="object",He=Bl(Q).toLowerCase()==="null",Fr=Bl(Q).toLowerCase()==="undefined";for(let an=o.cachedOptions.size-1;an>=0;an--){const cr=$.value[an];if(Oe?Kr(cr.value,t.valueKey)===Kr(Q,t.valueKey):cr.value===Q){he={value:Q,currentLabel:cr.currentLabel,get isDisabled(){return cr.isDisabled}};break}}if(he)return he;const Rn=Oe?Q.label:!He&&!Fr?Q:"";return{value:Q,currentLabel:Rn}},Ae=()=>{o.hoveringIndex=q.value.findIndex(Q=>o.selected.some(he=>Mt(he)===Mt(Q)))},Ie=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},we=()=>{o.calculatorWidth=h.value.getBoundingClientRect().width},ke=()=>{o.collapseItemWidth=m.value.getBoundingClientRect().width},re=()=>{var Q,he;(he=(Q=c.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},I=()=>{var Q,he;(he=(Q=d.value)==null?void 0:Q.updatePopper)==null||he.call(Q)},U=()=>{o.inputValue.length>0&&!S.value&&(S.value=!0),ue(o.inputValue)},te=Q=>{if(o.inputValue=Q.target.value,t.remote)Z();else return U()},Z=Wl(()=>{U()},X.value),J=Q=>{Ho(t.modelValue,Q)||e(Ei,Q)},le=Q=>XB(Q,he=>!o.disabledOptions.has(he)),ee=Q=>{if(t.multiple&&Q.code!==ft.delete&&Q.target.value.length<=0){const he=sn(t.modelValue).slice(),Oe=le(he);if(Oe<0)return;const He=he[Oe];he.splice(Oe,1),e(tt,he),J(he),e("remove-tag",He)}},oe=(Q,he)=>{const Oe=o.selected.indexOf(he);if(Oe>-1&&!O.value){const He=sn(t.modelValue).slice();He.splice(Oe,1),e(tt,He),J(He),e("remove-tag",he.value)}Q.stopPropagation(),st()},me=Q=>{Q.stopPropagation();const he=t.multiple?[]:D.value;if(t.multiple)for(const Oe of o.selected)Oe.isDisabled&&he.push(Oe.value);e(tt,he),J(he),o.hoveringIndex=-1,S.value=!1,e("clear"),st()},be=Q=>{var he;if(t.multiple){const Oe=sn((he=t.modelValue)!=null?he:[]).slice(),He=ye(Oe,Q.value);He>-1?Oe.splice(He,1):(t.multipleLimit<=0||Oe.length<t.multipleLimit)&&Oe.push(Q.value),e(tt,Oe),J(Oe),Q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(o.inputValue="")}else e(tt,Q.value),J(Q.value),S.value=!1;st(),!S.value&&s.nextTick(()=>{Ne(Q)})},ye=(Q=[],he)=>{if(!yt(he))return Q.indexOf(he);const Oe=t.valueKey;let He=-1;return Q.some((Fr,Rn)=>s.toRaw(Kr(Fr,Oe))===Kr(he,Oe)?(He=Rn,!0):!1),He},Ne=Q=>{var he,Oe,He,Fr,Rn;const vi=Et(Q)?Q[0]:Q;let an=null;if(vi!=null&&vi.value){const cr=q.value.filter(Ln=>Ln.value===vi.value);cr.length>0&&(an=cr[0].$el)}if(c.value&&an){const cr=(Fr=(He=(Oe=(he=c.value)==null?void 0:he.popperRef)==null?void 0:Oe.contentRef)==null?void 0:He.querySelector)==null?void 0:Fr.call(He,`.${a.be("dropdown","wrap")}`);cr&&iD(cr,an)}(Rn=b.value)==null||Rn.handleScroll()},ge=Q=>{o.options.set(Q.value,Q),o.cachedOptions.set(Q.value,Q),Q.disabled&&o.disabledOptions.set(Q.value,Q)},Ce=(Q,he)=>{o.options.get(Q)===he&&o.options.delete(Q)},We=s.computed(()=>{var Q,he;return(he=(Q=c.value)==null?void 0:Q.popperRef)==null?void 0:he.contentRef}),qe=()=>{o.isBeforeHide=!1,s.nextTick(()=>Ne(o.selected))},st=()=>{var Q;(Q=f.value)==null||Q.focus()},lt=()=>{var Q;(Q=f.value)==null||Q.blur()},rt=Q=>{me(Q)},Lt=()=>{S.value=!1,_.value&&lt()},mt=()=>{o.inputValue.length>0?o.inputValue="":S.value=!1},wt=()=>{O.value||(Nl&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:S.value=!S.value)},Jt=()=>{S.value?q.value[o.hoveringIndex]&&be(q.value[o.hoveringIndex]):wt()},Mt=Q=>yt(Q.value)?Kr(Q.value,t.valueKey):Q.value,Ft=s.computed(()=>q.value.filter(Q=>Q.visible).every(Q=>Q.disabled)),lr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(0,t.maxCollapseTags):o.selected:[]),Cr=s.computed(()=>t.multiple?t.collapseTags?o.selected.slice(t.maxCollapseTags):[]:[]),jt=Q=>{if(!S.value){S.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Ft.value){Q==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):Q==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const he=q.value[o.hoveringIndex];(he.disabled===!0||he.states.groupDisabled===!0||!he.visible)&&jt(Q),s.nextTick(()=>Ne(T.value))}},nt=()=>{if(!u.value)return 0;const Q=window.getComputedStyle(u.value);return Number.parseFloat(Q.gap||"6px")},ct=s.computed(()=>{const Q=nt();return{maxWidth:`${m.value&&t.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-Q:o.selectionWidth}px`}}),Ct=s.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Pn=s.computed(()=>({width:`${Math.max(o.calculatorWidth,yL)}px`}));return qr(u,Ie),qr(h,we),qr(g,re),qr(E,re),qr(y,I),qr(m,ke),s.onMounted(()=>{fe()}),{inputId:A,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:_,expanded:S,optionsArray:q,hoverOption:T,selectSize:j,filteredOptionsCount:V,resetCalculatorWidth:we,updateTooltip:re,updateTagTooltip:I,debouncedOnInputChange:Z,onInput:te,deletePrevTag:ee,deleteTag:oe,deleteSelected:me,handleOptionSelect:be,scrollToOption:Ne,hasModelValue:M,shouldShowPlaceholder:ce,currentPlaceholder:ae,mouseEnterEventName:ne,showClose:P,iconComponent:z,iconReverse:W,validateState:H,validateIcon:G,showNewOption:K,updateOptions:L,collapseTagSize:Y,setSelected:fe,selectDisabled:O,emptyText:F,handleCompositionStart:C,handleCompositionUpdate:x,handleCompositionEnd:k,onOptionCreate:ge,onOptionDestroy:Ce,handleMenuEnter:qe,focus:st,blur:lt,handleClearClick:rt,handleClickOutside:Lt,handleEsc:mt,toggleMenu:wt,selectOption:Jt,getValueKey:Mt,navigateOptions:jt,dropdownMenuVisible:se,showTagList:lr,collapseTagList:Cr,tagStyle:ct,collapseTagStyle:Ct,inputStyle:Pn,popperRef:We,inputRef:f,tooltipRef:c,tagTooltipRef:d,calculatorRef:h,prefixRef:v,suffixRef:p,selectRef:l,wrapperRef:E,selectionRef:u,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var wL=s.defineComponent({name:"ElOptions",setup(t,{slots:e}){const r=s.inject(qi);let n=[];return()=>{var a,i;const o=(a=e.default)==null?void 0:a.call(e),l=[];function u(c){Et(c)&&c.forEach(d=>{var f,h,v,p;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?u(!ut(d.children)&&!Et(d.children)&&$t((h=d.children)==null?void 0:h.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((p=d.props)==null?void 0:p.value):Et(d.children)&&u(d.children)})}return o.length&&u((i=o[0])==null?void 0:i.children),Ho(l,n)||(n=l,r&&(r.states.optionValues=l)),o}}});const CL=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Ia,effect:{type:Se(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Se(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Vt.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:dn,default:xe.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:dn,default:xe.ArrowDown},tagType:{...kc.type,default:"info"},tagEffect:{...kc.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Se(String),values:jo,default:"bottom-start"},fallbackPlacements:{type:Se(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...LA,...jr(["ariaLabel"])}),m0="ElSelect",EL=s.defineComponent({name:m0,componentName:m0,components:{ElSelectMenu:mL,ElOption:Ic,ElOptions:wL,ElTag:uR,ElScrollbar:Ty,ElTooltip:Oa,ElIcon:Xe},directives:{ClickOutside:Qy},props:CL,emits:[tt,Ei,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const r=s.computed(()=>{const{modelValue:i,multiple:o}=t,l=o?[]:void 0;return Et(i)?o?i:l:o?l:i}),n=s.reactive({...s.toRefs(t),modelValue:r}),a=bL(n,e);return s.provide(qi,s.reactive({props:n,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:r}}});function xL(t,e,r,n,a,i){const o=s.resolveComponent("el-tag"),l=s.resolveComponent("el-tooltip"),u=s.resolveComponent("el-icon"),c=s.resolveComponent("el-option"),d=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),h=s.resolveComponent("el-select-menu"),v=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[s.toHandlerKey(t.mouseEnterEventName)]:p=>t.states.inputHovering=!0,onMouseleave:p=>t.states.inputHovering=!1},[s.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:p=>t.states.isBeforeHide=!1},{default:s.withCtx(()=>{var p;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:s.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(t.nsSelect.e("prefix"))},[s.renderSlot(t.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?s.renderSlot(t.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.showTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(s.openBlock(),s.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:s.normalizeStyle(t.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))}," + "+s.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(t.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.collapseTagList,g=>(s.openBlock(),s.createElementBlock("div",{key:t.getValueKey(g),class:s.normalizeClass(t.nsSelect.e("selected-item"))},[s.createVNode(o,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(t.nsSelect.e("tags-text"))},[s.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[s.createTextVNode(s.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),t.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:s.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:s.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((p=t.hoverOption)==null?void 0:p.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:s.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[s.vModelText,t.states.inputValue]]),t.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(t.nsSelect.e("input-calculator")),textContent:s.toDisplayString(t.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?s.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(t.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(t.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(s.openBlock(),s.createBlock(u,{key:0,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(s.openBlock(),s.createBlock(u,{key:1,class:s.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(s.openBlock(),s.createBlock(u,{key:2,class:s.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(h,{ref:"menuRef"},{default:s.withCtx(()=>[t.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:s.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[t.showNewOption?(s.openBlock(),s.createBlock(c,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(d,null,{default:s.withCtx(()=>[s.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(t.nsSelect.be("dropdown","loading"))},[s.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(t.nsSelect.be("dropdown","empty"))},[s.renderSlot(t.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(t.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(t.$slots,"footer")],10,["onClick"])):s.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var kL=Be(EL,[["render",xL],["__file","select.vue"]]);const SL=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=De("select"),r=s.ref(null),n=s.getCurrentInstance(),a=s.ref([]);s.provide(g0,s.reactive({...s.toRefs(t)}));const i=s.computed(()=>a.value.some(c=>c.visible===!0)),o=c=>{var d,f;return((d=c.type)==null?void 0:d.name)==="ElOption"&&!!((f=c.component)!=null&&f.proxy)},l=c=>{const d=sn(c),f=[];return d.forEach(h=>{var v,p;o(h)?f.push(h.component.proxy):(v=h.children)!=null&&v.length?f.push(...l(h.children)):(p=h.component)!=null&&p.subTree&&f.push(...l(h.component.subTree))}),f},u=()=>{a.value=l(n.subTree)};return s.onMounted(()=>{u()}),Q_(r,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:i,ns:e}}});function _L(t,e,r,n,a,i){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(t.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(t.ns.be("group","title"))},s.toDisplayString(t.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(t.ns.b("group"))},[s.renderSlot(t.$slots,"default")],2)])],2)),[[s.vShow,t.visible]])}var y0=Be(SL,[["render",_L],["__file","option-group.vue"]]);const TL=dt(kL,{Option:Ic,OptionGroup:y0}),NL=Ur(Ic);Ur(y0);const IL=Fe({trigger:Ri.trigger,placement:Nc.placement,disabled:Ri.disabled,visible:Vt.visible,transition:Vt.transition,popperOptions:Nc.popperOptions,tabindex:Nc.tabindex,content:Vt.content,popperStyle:Vt.popperStyle,popperClass:Vt.popperClass,enterable:{...Vt.enterable,default:!0},effect:{...Vt.effect,default:"light"},teleported:Vt.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),BL={"update:visible":t=>wa(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},DL="onUpdate:visible",AL=s.defineComponent({name:"ElPopover"}),OL=s.defineComponent({...AL,props:IL,emits:BL,setup(t,{expose:e,emit:r}){const n=t,a=s.computed(()=>n[DL]),i=De("popover"),o=s.ref(),l=s.computed(()=>{var y;return(y=s.unref(o))==null?void 0:y.popperRef}),u=s.computed(()=>[{width:Ca(n.width)},n.popperStyle]),c=s.computed(()=>[i.b(),n.popperClass,{[i.m("plain")]:!!n.content}]),d=s.computed(()=>n.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=o.value)==null||y.hide()},h=()=>{r("before-enter")},v=()=>{r("before-leave")},p=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(s.openBlock(),s.createBlock(s.unref(Oa),s.mergeProps({ref_key:"tooltipRef",ref:o},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":s.unref(c),"popper-style":s.unref(u),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":s.unref(d),"onUpdate:visible":s.unref(a),onBeforeShow:h,onBeforeHide:v,onShow:p,onHide:g}),{content:s.withCtx(()=>[y.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(i).e("title")),role:"title"},s.toDisplayString(y.title),3)):s.createCommentVNode("v-if",!0),s.renderSlot(y.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(y.content),1)])]),default:s.withCtx(()=>[y.$slots.reference?s.renderSlot(y.$slots,"reference",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var PL=Be(OL,[["__file","popover.vue"]]);const b0=(t,e)=>{const r=e.arg||e.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=t)};var RL={mounted(t,e){b0(t,e)},updated(t,e){b0(t,e)}};const LL=sD(RL,"popover"),mn=dt(PL,{directive:LL}),La="$treeNodeId",w0=function(t,e){!e||e[La]||Object.defineProperty(e,La,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Bc=function(t,e){return t?e[t]:e[La]},Dc=(t,e,r)=>{const n=t.value.currentNode;r();const a=t.value.currentNode;n!==a&&e("current-change",a?a.data:null,a)},Ac=t=>{let e=!0,r=!0,n=!0;for(let a=0,i=t.length;a<i;a++){const o=t[a];(o.checked!==!0||o.indeterminate)&&(e=!1,o.disabled||(n=!1)),(o.checked!==!1||o.indeterminate)&&(r=!1)}return{all:e,none:r,allWithoutDisable:n,half:!e&&!r}},zi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:r,half:n}=Ac(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):n?(t.checked=!1,t.indeterminate=!0):r&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||zi(a)},cs=function(t,e){const r=t.store.props,n=t.data||{},a=r[e];if(typeof a=="function")return a(n,t);if(typeof a=="string")return n[a];if(typeof a>"u"){const i=n[e];return i===void 0?"":i}};let ML=0;class Yn{constructor(e){this.id=ML++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in e)Mn(e,r)&&(this[r]=e[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const r=e.props;if(r&&typeof r.isLeaf<"u"){const i=cs(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||w0(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,a=e.key;a&&n&&n.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||w0(this,e),this.data=e,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=cs(this,"children")||[];for(let n=0,a=r.length;n<a;n++)this.insertChild({data:r[n]})}get label(){return cs(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return cs(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return e.childNodes[r+1]}return null}get previousSibling(){const e=this.parent;if(e){const r=e.childNodes.indexOf(this);if(r>-1)return r>0?e.childNodes[r-1]:null}return null}contains(e,r=!0){return(this.childNodes||[]).some(n=>n===e||r&&n.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,r,n){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Yn)){if(!n){const a=this.getChildren(!0);a.includes(e.data)||(typeof r>"u"||r<0?a.push(e.data):a.splice(r,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=s.reactive(new Yn(e)),e instanceof Yn&&e.initialize()}e.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),this.updateLeafState()}insertBefore(e,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(e,n)}insertAfter(e,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(e,n)}removeChild(e){const r=this.getChildren()||[],n=r.indexOf(e.data);n>-1&&r.splice(n,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(e,r){const n=()=>{if(r){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||zi(this),n())}):n()}doCreateChildren(e,r={}){e.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,r,n,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:o,allWithoutDisable:l}=Ac(this.childNodes);!this.isLeaf&&!o&&l&&(this.checked=!1,e=!1);const u=()=>{if(r){const c=this.childNodes;for(let h=0,v=c.length;h<v;h++){const p=c[h];a=a||e!==!1;const g=p.disabled?p.checked:a;p.setChecked(g,r,!0,a)}const{half:d,all:f}=Ac(c);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{u(),zi(this)},{checked:e!==!1});return}else u()}const i=this.parent;!i||i.level===0||n||zi(i)}getChildren(e=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let a="children";return n&&(a=n.children||"children"),r[a]===void 0&&(r[a]=null),e&&!r[a]&&(r[a]=[]),r[a]}updateChildren(){const e=this.getChildren()||[],r=this.childNodes.map(i=>i.data),n={},a=[];e.forEach((i,o)=>{const l=i[La];!!l&&r.findIndex(c=>c[La]===l)>=0?n[l]={index:o,data:i}:a.push({index:o,data:i})}),this.store.lazy||r.forEach(i=>{n[i[La]]||this.removeChildByData(i)}),a.forEach(({index:i,data:o})=>{this.insertChild({data:o},i)}),this.updateLeafState()}loadData(e,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,n,a)}else e&&e.call(this)}eachNode(e){const r=[this];for(;r.length;){const n=r.shift();r.unshift(...n.childNodes),e(n)}}reInitChecked(){this.store.checkStrictly||zi(this)}}class FL{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const r in e)Mn(e,r)&&(this[r]=e[r]);this.nodesMap={}}initialize(){if(this.root=new Yn({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const r=this.filterNodeMethod,n=this.lazy,a=function(i){const o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(l=>{l.visible=r.call(l,e,l.data,l),a(l)}),!i.visible&&o.length){let l=!0;l=!o.some(u=>u.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!n||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Yn)return e;const r=yt(e)?Bc(this.key,e):e;return this.nodesMap[r]||null}insertBefore(e,r){const n=this.getNode(r);n.parent.insertBefore({data:e},n)}insertAfter(e,r){const n=this.getNode(r);n.parent.insertAfter({data:e},n)}remove(e){const r=this.getNode(e);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(e,r){const n=Ko(r)?this.root:this.getNode(r);n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],r=this.nodesMap;e.forEach(n=>{const a=r[n];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const r=this.key;!e||!e.data||(r?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(n=>{this.deregisterNode(n)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,r=!1){const n=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||r&&l.indeterminate)&&(!e||e&&l.isLeaf)&&n.push(l.data),a(l)})};return a(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const e=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),r(i)})};return r(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],r=this.nodesMap;for(const n in r)Mn(r,n)&&e.push(r[n]);return e}updateChildren(e,r){const n=this.nodesMap[e];if(!n)return;const a=n.childNodes;for(let i=a.length-1;i>=0;i--){const o=a[i];this.remove(o.data)}for(let i=0,o=r.length;i<o;i++){const l=r[i];this.append(l,n.data)}}_setCheckedKeys(e,r=!1,n){const a=this._getAllNodes().sort((u,c)=>u.level-c.level),i=Object.create(null),o=Object.keys(n);a.forEach(u=>u.setChecked(!1,!1));const l=u=>{u.childNodes.forEach(c=>{var d;i[c.data[e]]=!0,(d=c.childNodes)!=null&&d.length&&l(c)})};for(let u=0,c=a.length;u<c;u++){const d=a[u],f=d.data[e].toString();if(!o.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),r){d.setChecked(!1,!1);const v=function(p){p.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,r=!1){const n=this.key,a={};e.forEach(i=>{a[(i||{})[n]]=!0}),this._setCheckedKeys(n,r,a)}setCheckedKeys(e,r=!1){this.defaultCheckedKeys=e;const n=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(n,r,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(e,r,n){const a=this.getNode(e);a&&a.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,r=!0){const n=e[this.key],a=this.nodesMap[n];this.setCurrentNode(a),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,r=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(e);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const $L=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=De("tree"),r=s.inject("NodeInstance"),n=s.inject("RootTree");return()=>{const a=t.node,{data:i,store:o}=a;return t.renderContent?t.renderContent(s.h,{_self:r,node:a,data:i,store:o}):s.renderSlot(n.ctx.slots,"default",{node:a,data:i},()=>[s.h("span",{class:e.be("node","label")},[a.label])])}}});var VL=Be($L,[["__file","tree-node-content.vue"]]);function C0(t){const e=s.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{t.node!==n&&t.node.collapse()},children:[]};return e&&e.children.push(r),s.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(t.accordion)for(const a of r.children)a.treeNodeExpand(n)}}}const E0=Symbol("dragEvents");function qL({props:t,ctx:e,el$:r,dropIndicator$:n,store:a}){const i=De("tree"),o=s.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}o.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},u=({event:d,treeNode:f})=>{const h=f,v=o.value.dropNode;v&&v.node.id!==h.node.id&&zn(v.$el,i.is("drop-inner"));const p=o.value.draggingNode;if(!p||!h)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(p.node,h.node,"prev"),b=y=t.allowDrop(p.node,h.node,"inner"),m=t.allowDrop(p.node,h.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==h.node.id&&(v&&e.emit("node-drag-leave",p.node,v.node,d),e.emit("node-drag-enter",p.node,h.node,d)),g||y||m?o.value.dropNode=h:o.value.dropNode=null,h.node.nextSibling===p.node&&(m=!1),h.node.previousSibling===p.node&&(g=!1),h.node.contains(p.node,!1)&&(y=!1),(p.node===h.node||p.node.contains(h.node))&&(g=!1,y=!1,m=!1);const w=h.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=r.value.getBoundingClientRect();let x;const k=g?y?.25:m?.45:1:-1,E=m?y?.75:g?.55:0:1;let _=-9999;const S=d.clientY-w.top;S<w.height*k?x="before":S>w.height*E?x="after":y?x="inner":x="none";const T=h.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),N=n.value;x==="before"?_=T.top-C.top:x==="after"&&(_=T.bottom-C.top),N.style.top=`${_}px`,N.style.left=`${T.right-C.left}px`,x==="inner"?jl(h.$el,i.is("drop-inner")):zn(h.$el,i.is("drop-inner")),o.value.showDropIndicator=x==="before"||x==="after",o.value.allowDrop=o.value.showDropIndicator||b,o.value.dropType=x,e.emit("node-drag-over",p.node,h.node,d)},c=d=>{const{draggingNode:f,dropType:h,dropNode:v}=o.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const p={data:f.node.data};h!=="none"&&f.node.remove(),h==="before"?v.node.parent.insertBefore(p,v.node):h==="after"?v.node.parent.insertAfter(p,v.node):h==="inner"&&v.node.insertChild(p),h!=="none"&&(a.value.registerNode(p),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),zn(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,h,d),h!=="none"&&e.emit("node-drop",f.node,v.node,h,d)}f&&!v&&e.emit("node-drag-end",f.node,null,h,d),o.value.showDropIndicator=!1,o.value.draggingNode=null,o.value.dropNode=null,o.value.allowDrop=!0};return s.provide(E0,{treeNodeDragStart:l,treeNodeDragOver:u,treeNodeDragEnd:c}),{dragState:o}}const zL=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:ER,ElCheckbox:iR,NodeContent:VL,ElIcon:Xe,Loading:xe.Loading},props:{node:{type:Yn,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const r=De("tree"),{broadcastExpanded:n}=C0(t),a=s.inject("RootTree"),i=s.ref(!1),o=s.ref(!1),l=s.ref(null),u=s.ref(null),c=s.ref(null),d=s.inject(E0),f=s.getCurrentInstance();s.provide("NodeInstance",f),a||it("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,o.value=!0);const h=a.props.props.children||"children";s.watch(()=>{const S=t.node.data[h];return S&&[...S]},()=>{t.node.updateChildren()}),s.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),s.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),s.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),s.watch(()=>t.node.expanded,S=>{s.nextTick(()=>i.value=S),S&&(o.value=!0)});const v=S=>Bc(a.props.nodeKey,S.data),p=S=>{const T=t.props.class;if(!T)return{};let N;if($t(T)){const{data:B}=S;N=T(B,S)}else N=T;return ut(N)?{[N]:!0}:N},g=(S,T)=>{(l.value!==S||u.value!==T)&&a.ctx.emit("check-change",t.node.data,S,T),l.value=S,u.value=T},y=S=>{Dc(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,T)=>{t.node.setChecked(T.target.checked,!a.props.checkStrictly),s.nextTick(()=>{const N=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:N.getCheckedNodes(),checkedKeys:N.getCheckedKeys(),halfCheckedNodes:N.getHalfCheckedNodes(),halfCheckedKeys:N.getHalfCheckedKeys()})})};return{ns:r,node$:c,tree:a,expanded:i,childNodeRendered:o,oldChecked:l,oldIndeterminate:u,getNodeKey:v,getNodeClass:p,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,T,N)=>{n(T),a.ctx.emit("node-expand",S,T,N)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:c.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:xe.CaretRight}}});function HL(t,e,r,n,a,i){const o=s.resolveComponent("el-icon"),l=s.resolveComponent("el-checkbox"),u=s.resolveComponent("loading"),c=s.resolveComponent("node-content"),d=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:s.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:s.withModifiers(t.handleDragStart,["stop"]),onDragover:s.withModifiers(t.handleDragOver,["stop"]),onDragend:s.withModifiers(t.handleDragEnd,["stop"]),onDrop:s.withModifiers(t.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(t.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(s.openBlock(),s.createBlock(o,{key:0,class:s.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:s.withModifiers(t.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),t.showCheckbox?(s.openBlock(),s.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),t.node.loading?(s.openBlock(),s.createBlock(o,{key:2,class:s.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(u)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(c,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.node.childNodes,h=>(s.openBlock(),s.createBlock(d,{key:t.getNodeKey(h),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:h,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,t.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,t.node.visible]])}var KL=Be(zL,[["render",HL],["__file","tree-node.vue"]]);function GL({el$:t},e){const r=De("tree"),n=s.shallowRef([]),a=s.shallowRef([]);s.onMounted(()=>{o()}),s.onUpdated(()=>{n.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),s.watch(a,l=>{l.forEach(u=>{u.setAttribute("tabindex","-1")})}),Qt(t,"keydown",l=>{const u=l.target;if(!u.className.includes(r.b("node")))return;const c=l.code;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const d=n.value.indexOf(u);let f;if([ft.up,ft.down].includes(c)){if(l.preventDefault(),c===ft.up){f=d===-1?0:d!==0?d-1:n.value.length-1;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=n.value.length-1)}}else{f=d===-1?0:d<n.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(n.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=n.value.length&&(f=0)}}f!==-1&&n.value[f].focus()}[ft.left,ft.right].includes(c)&&(l.preventDefault(),u.click());const h=u.querySelector('[type="checkbox"]');[ft.enter,ft.space].includes(c)&&h&&(l.preventDefault(),h.click())});const o=()=>{var l;n.value=Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const u=t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(l=n.value[0])==null||l.setAttribute("tabindex","0")}}const UL=s.defineComponent({name:"ElTree",components:{ElTreeNode:KL},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:dn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:r}=xi(),n=De("tree"),a=s.inject(qi,null),i=s.ref(new FL({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const o=s.ref(i.value.root),l=s.ref(null),u=s.ref(null),c=s.ref(null),{broadcastExpanded:d}=C0(t),{dragState:f}=qL({props:t,ctx:e,el$:u,dropIndicator$:c,store:i});GL({el$:u},i);const h=s.computed(()=>{const{childNodes:P}=o.value,z=a?a.hasFilteredOptions!==0:!1;return(!P||P.length===0||P.every(({visible:W})=>!W))&&!z});s.watch(()=>t.currentNodeKey,P=>{i.value.setCurrentNodeKey(P)}),s.watch(()=>t.defaultCheckedKeys,P=>{i.value.setDefaultCheckedKey(P)}),s.watch(()=>t.defaultExpandedKeys,P=>{i.value.setDefaultExpandedKeys(P)}),s.watch(()=>t.data,P=>{i.value.setData(P)},{deep:!0}),s.watch(()=>t.checkStrictly,P=>{i.value.checkStrictly=P});const v=P=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(P)},p=P=>Bc(t.nodeKey,P.data),g=P=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const z=i.value.getNode(P);if(!z)return[];const W=[z.data];let H=z.parent;for(;H&&H!==o.value;)W.push(H.data),H=H.parent;return W.reverse()},y=(P,z)=>i.value.getCheckedNodes(P,z),m=P=>i.value.getCheckedKeys(P),b=()=>{const P=i.value.getCurrentNode();return P?P.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const P=b();return P?P[t.nodeKey]:null},C=(P,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(P,z)},x=(P,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(P,z)},k=(P,z,W)=>{i.value.setChecked(P,z,W)},E=()=>i.value.getHalfCheckedNodes(),_=()=>i.value.getHalfCheckedKeys(),S=(P,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Dc(i,e.emit,()=>{d(P),i.value.setUserCurrentNode(P,z)})},T=(P,z=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Dc(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(P,z)})},N=P=>i.value.getNode(P),B=P=>{i.value.remove(P)},A=(P,z)=>{i.value.append(P,z)},D=(P,z)=>{i.value.insertBefore(P,z)},R=(P,z)=>{i.value.insertAfter(P,z)},O=(P,z,W)=>{d(z),e.emit("node-expand",P,z,W)},M=(P,z)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(P,z)};return s.provide("RootTree",{ctx:e,props:t,store:i,root:o,currentNode:l,instance:s.getCurrentInstance()}),s.provide(Ai,void 0),{ns:n,store:i,root:o,currentNode:l,dragState:f,el$:u,dropIndicator$:c,isEmpty:h,filter:v,getNodeKey:p,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:x,setChecked:k,getHalfCheckedNodes:E,getHalfCheckedKeys:_,setCurrentNode:S,setCurrentKey:T,t:r,getNode:N,remove:B,append:A,insertBefore:D,insertAfter:R,handleNodeExpand:O,updateKeyChildren:M}}});function WL(t,e,r,n,a,i){const o=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.root.childNodes,l=>(s.openBlock(),s.createBlock(o,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(t.ns.e("empty-block"))},[s.renderSlot(t.$slots,"empty",{},()=>{var l;return[s.createElementVNode("span",{class:s.normalizeClass(t.ns.e("empty-text"))},s.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[s.vShow,t.dragState.showDropIndicator]])],2)}var jL=Be(UL,[["render",WL],["__file","tree.vue"]]);const YL=dt(jL);function ZL(t){let e;const r=s.ref(!1),n=s.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(h){n.text=h}function i(){const h=n.parent,v=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(zn(h,v.bm("parent","relative")),h.removeAttribute("loading-number")),zn(h,v.bm("parent","hidden"))}o(),d.unmount()}function o(){var h,v;(v=(h=f.$el)==null?void 0:h.parentNode)==null||v.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(r.value=!0,clearTimeout(e),e=setTimeout(u,400),n.visible=!1,(h=t.closed)==null||h.call(t))}function u(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,i()}const c=s.defineComponent({name:"ElLoading",setup(h,{expose:v}){const{ns:p,zIndex:g}=$A("loading");return v({ns:p,zIndex:g}),()=>{const y=n.spinner||n.svg,m=s.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[s.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=n.text?s.h("p",{class:p.b("text")},[n.text]):void 0;return s.h(s.Transition,{name:p.b("fade"),onAfterLeave:u},{default:s.withCtx(()=>[s.withDirectives(s.createVNode("div",{style:{backgroundColor:n.background||""},class:[p.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[s.h("div",{class:p.b("spinner")},[m,b])]),[[s.vShow,n.visible]])])})}}}),d=s.createApp(c),f=d.mount(document.createElement("div"));return{...s.toRefs(n),setText:a,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let us;const XL=function(t={}){if(!at)return;const e=JL(t);if(e.fullscreen&&us)return us;const r=ZL({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(us=void 0)}});QL(e,e.parent,r),x0(e,e.parent,r),e.parent.vLoadingAddClassList=()=>x0(e,e.parent,r);let n=e.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",e.parent.setAttribute("loading-number",n),e.parent.appendChild(r.$el),s.nextTick(()=>r.visible.value=e.visible),e.fullscreen&&(us=r),r},JL=t=>{var e,r,n,a;let i;return ut(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((r=t.fullscreen)!=null?r:!0),lock:(n=t.lock)!=null?n:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},QL=async(t,e,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,a={};if(t.fullscreen)r.originalPosition.value=Ci(document.body,"position"),r.originalOverflow.value=Ci(document.body,"overflow"),a.zIndex=n();else if(t.parent===document.body){r.originalPosition.value=Ci(document.body,"position"),await s.nextTick();for(const i of["top","left"]){const o=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[o]+document.documentElement[o]-Number.parseInt(Ci(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else r.originalPosition.value=Ci(e,"position");for(const[i,o]of Object.entries(a))r.$el.style[i]=o},x0=(t,e,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?zn(e,n.bm("parent","relative")):jl(e,n.bm("parent","relative")),t.fullscreen&&t.lock?jl(e,n.bm("parent","hidden")):zn(e,n.bm("parent","hidden"))},ds=Symbol("ElLoading"),k0=(t,e)=>{var r,n,a,i;const o=e.instance,l=h=>yt(e.value)?e.value[h]:void 0,u=h=>{const v=ut(h)&&(o==null?void 0:o[h])||h;return v&&s.ref(v)},c=h=>u(l(h)||t.getAttribute(`element-loading-${dT(h)}`)),d=(r=l("fullscreen"))!=null?r:e.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[ds]={options:f,instance:XL(f)}},eM=(t,e)=>{for(const r of Object.keys(e))s.isRef(e[r])&&(e[r].value=t[r])},Oc={mounted(t,e){e.value&&k0(t,e)},updated(t,e){const r=t[ds];e.oldValue!==e.value&&(e.value&&!e.oldValue?k0(t,e):e.value&&e.oldValue?yt(e.value)&&eM(e.value,r.options):r==null||r.instance.close())},unmounted(t){var e;(e=t[ds])==null||e.instance.close(),t[ds]=null}},qt=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},tM="Copy to clipboard",rM="Copied!",nM={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:tM},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
+ `,""),r=document.createElement("div");r.innerHTML=this.content;const n=r.textContent||r.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([n],{type:"text/plain"}),o=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([o])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?(this.textLabel=rM,this.$emit("copied",{status:"success"})):(this.textLabel="Error trying to copy to clipboard!",this.$emit("copied",{status:"error"}))},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},aM={class:"visually-hidden"};function iM(t,e,r,n,a,i){const o=xe.CopyDocument,l=Xe,u=Bt,c=Oa;return s.openBlock(),s.createBlock(c,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:s.withCtx(()=>[s.createVNode(u,{class:s.normalizeClass(["copy-clipboard-button",r.theme]),size:"small",onClick:i.copyToClipboard,disabled:!r.content},{default:s.withCtx(()=>[s.createVNode(l,{color:r.content?"#8300bf":"#dab3ec"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1},8,["color"]),s.createElementVNode("span",aM,s.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick","disabled"])]),_:1},8,["content","hide-after","onHide","append-to"])}const fs=qt(nM,[["render",iM],["__scopeId","data-v-c791b9aa"]]),oM={name:"AnnotationPopup",props:{annotationEntry:{type:Array}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:"",entryIndex:0}},computed:{entry:function(){return this.annotationEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.annotationEntry[this.entryIndex-1])==null?void 0:t.label},nextLabel:function(){var t;return this.entryIndex===this.annotationEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.annotationEntry[this.entryIndex+1])==null?void 0:t.label},isEditable:function(){return this.entry.resourceId&&this.entry.featureId},isPositionUpdated:function(){return this.entry.resourceId&&this.entry.type==="updated"&&this.entry.positionUpdated},isDeleted:function(){return this.entry.resourceId&&this.entry.type==="deleted"},ontologyLink:function(){const t=this.entry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.entry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()},offlineAnnotationEnabled:function(){return this.entry?this.entry.offline:!1}},methods:{previous:function(){if(this.entryIndex!==0){this.entryIndex=this.entryIndex-1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_previous",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},next:function(){if(this.entryIndex!==this.annotationEntry.length-1){this.entryIndex=this.entryIndex+1,this.emitActiveItemChange();const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_next",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)}},emitActiveItemChange:function(){const t={tabType:"annotation"},e=this.annotationEntry[this.entryIndex],r={...t,...e};this.$emit("hover-changed",r)},processEvidences:function(t){var r;const e=[];return(r=t==null?void 0:t.body)!=null&&r.evidence&&t.body.evidence.forEach(n=>{if(typeof n=="object")e.push(n);else{const a={};if(n.includes("https://doi.org/")){const i=n.replace("https://doi.org/","DOI:");a[i]=n}else if(n.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=n.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=n}Object.keys(a).length>0?e.push(a):e.push(n)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;if(this.offlineAnnotationEnabled){const e=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[];this.prevSubs=e.filter(r=>r.resource===this.entry.resourceId&&r.item.id===this.entry.featureId)}else this.$annotator&&this.authenticated&&this.entry.resourceId&&this.entry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.entry.resourceId,this.entry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.entry.type==="updated"&&this.entry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.entry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.entry.resourceId&&this.entry.featureId){const e=[];this.evidence.forEach(n=>{if(n.includes("DOI:")){const a=n.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(n.includes("PMID:")){const a=n.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(n)});const r={resource:this.entry.resourceId,item:Object.assign({id:this.entry.featureId},Object.fromEntries(Object.entries(this.entry).filter(([n])=>["label","models"].includes(n)))),body:{evidence:e,comment:this.comment},feature:this.entry.feature};Object.assign(r.body,this.entry.body),this.entry.type==="deleted"&&(r.feature=void 0),this.creator&&(r.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,r).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"}),this.$emit("annotation",r)}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.entry)return"";const t=[];if(this.entry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`),this.entry.label&&t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`),this.entry.models&&(t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.entry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
22
22
  <br>`;this.prevSubs.map((r,n)=>{if(r.creator&&(e+=`<div><strong>Created:</strong>${this.formatTime(r.created)}</div>
23
23
  <br>`,e+=`<div><strong>Creator:</strong>${r.creator.name}</div>
24
24
  <br>`,e+=`<div><strong>Email:</strong>${r.creator.email}</div>
@@ -26,33 +26,35 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,curr
26
26
  <br>`}e+=`<div><strong>Comment:</strong>${r.body.comment}</div>
27
27
  <br>`}),t.push(`<div>${e}</div>`)}return t.join(`
28
28
 
29
- <br>`)},onCopied:function(){const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_copy_content",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)},trackEvent:function(t){const e={event:"interaction_event",location:"map_annotation",...t};this.$emit("trackEvent",e)}},watch:{annotationEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0,t!=null&&t.length&&this.emitActiveItemChange())}},entry:{deep:!0,immediate:!0,handler:function(t,e){t&&t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())}}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0):this.errorMessage="",this.updatePrevSubmissions()})}},Yn=t=>(s.pushScopeId("data-v-2a2f8754"),t=t(),s.popScopeId(),t),aF={key:0,class:"toggle-button"},iF={class:"block"},oF=Yn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),sF={class:"title-buttons"},lF={key:0},uF=["href"],cF=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),dF=Yn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),fF=["href"],hF={key:1},pF={key:2},vF=Yn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),gF=Yn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),mF=Yn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),yF=Yn(()=>s.createElementVNode("strong",null,"Comment:",-1)),bF={class:"sub-title"};function wF(t,e,r,n,a,i){const o=Ht,l=Ra,c=cs,u=is,d=Ne.ArrowUp,f=it,h=Ne.ArrowDown,v=Ne.Edit,p=Ne.Delete,g=Ne.Finished,y=Fi,m=Ne.Close,b=SL,w=kL,C=Ai,x=_u;return s.openBlock(),s.createBlock(x,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",aF,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.annotationEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",iF,[s.createVNode(u,{class:"info-field"},{default:s.withCtx(()=>[oF,s.createElementVNode("div",sF,[s.createVNode(c,{onCopied:i.onCopied,content:i.updatedCopyContent},null,8,["onCopied","content"])])]),_:1}),i.entry?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.displayPair,(k,E)=>s.withDirectives((s.openBlock(),s.createBlock(u,{class:"dialog-text",key:k},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(E)+": ",1),s.createTextVNode("  "),E!=="Ontology"?(s.openBlock(),s.createElementBlock("span",lF,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,uF))]),_:2},1024)),[[s.vShow,i.entry[k]]])),128)),t.prevSubs.length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[s.createTextVNode(" Hide previous submissions "),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showSubmissions]]),s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[s.createTextVNode(" Show previous "+s.toDisplayString(t.prevSubs.length)+" submission(s) ",1),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})],512),[[s.vShow,!t.showSubmissions]]),t.showSubmissions?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[cF]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.prevSubs,(k,E)=>(s.openBlock(),s.createElementBlock("div",{class:"entry",key:E},[k.creator?(s.openBlock(),s.createBlock(u,{key:0,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(i.formatTime(k.created)),1),s.createTextVNode(" "+s.toDisplayString(k.creator.name),1)]),_:2},1024)):s.createCommentVNode("",!0),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[dF,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.processEvidences(k),(_,S)=>(s.openBlock(),s.createBlock(u,{key:_,class:"dialog-text"},{default:s.withCtx(()=>[typeof _=="object"?(s.openBlock(),s.createElementBlock("a",{key:0,href:Object.values(_)[0],target:"_blank"},s.toDisplayString(Object.keys(_)[0]),9,fF)):(s.openBlock(),s.createElementBlock("span",hF,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",pF,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[vF,s.createTextVNode(" "+s.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),t.authenticated||i.offlineAnnotationEnabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.isEditable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-spacer"}),t.editing?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[gF]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[mF]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidence,(k,E)=>(s.openBlock(),s.createBlock(u,{key:k},{default:s.withCtx(()=>[s.createVNode(y,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[E]),1)]),_:2},1024),s.createVNode(y,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(m,{onClick:_=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(C,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidencePrefixes,k=>(s.openBlock(),s.createBlock(b,{key:k.label,value:k.value},{default:s.withCtx(()=>[s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(y,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),s.createVNode(u,null,{default:s.withCtx(()=>[yF]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(C,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),s.createVNode(u,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(o,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:s.withCtx(()=>[s.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(s.openBlock(),s.createBlock(u,{key:0},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(v,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(s.openBlock(),s.createBlock(f,{key:0,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(s.openBlock(),s.createBlock(f,{key:1,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(g,{onClick:i.submit},null,8,["onClick"])]),_:1})):s.createCommentVNode("",!0)]),_:1})),t.errorMessage?(s.openBlock(),s.createBlock(u,{key:2,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",bF,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const x0=Yt(nF,[["render",wF],["__scopeId","data-v-2a2f8754"]]),CF={name:"CreateTooltipContent",components:{Autocomplete:zy,Button:Ht,Col:Fi,Container:Su,Header:h0,Input:Ai,Main:_u},props:{createData:{type:Object,default:{drawingBox:!1,renaming:!1,toBeConfirmed:!1,points:[],tempGroupName:void 0,shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1,regionPrefix:"__annotation"}}},watch:{"createData.shape":{handler:function(t,e){this.group=this.createData.tempGroupName?this.createData.tempGroupName:"",e!==void 0&&this.$emit("cancel-create")},immediate:!0},"createData.tempGroupName":{handler:function(t){this.group=t||""},immediate:!0}},computed:{canBeConfirmed:function(){if(this.createData.editingIndex>-1)return!0;if(this.group)if(this.renaming){if(this.group!==this.createData.tempGroupName)return!0}else return!0;return!1},confirmText:function(){return this.createData.editingIndex>-1?"Edit":this.createData.renaming?"Rename":"Confirm"},dialogTitle:function(){return this.createData.editingIndex>-1?`Edit ${this.createData.shape}`:`Create ${this.createData.shape}`},targetRegion:function(){return"regionPrefix"in this.createData?this.createData.regionPrefix:""}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:this.targetRegion+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex,renaming:this.createData.renaming}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")},fetchRegionSuggestions:function(t,e){e([]),this.$emit("create-region-suggestions",{term:t,cb:e})},fetchGroupSuggestions:function(t,e){e([]),this.$emit("create-group-suggestions",{term:t,cb:e,region:this.region})}}},EF=t=>(s.pushScopeId("data-v-4db6ecff"),t=t(),s.popScopeId(),t),xF={key:0,class:"create-text"},kF={class:"suggested-value"},SF={class:"suggested-value"},_F=EF(()=>s.createElementVNode("div",{class:"warning-message"}," Group must be enterd before this action can be confirmed. ",-1));function TF(t,e,r,n,a,i){const o=h0,l=Fi,c=is,u=zy,d=Ht,f=_u,h=Su;return s.openBlock(),s.createBlock(h,{class:"create-container"},{default:s.withCtx(()=>[s.createVNode(o,{height:"30px",class:"header"},{default:s.withCtx(()=>[s.createElementVNode("div",null,s.toDisplayString(i.dialogTitle),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[r.createData.editingIndex===-1&&i.targetRegion?(s.openBlock(),s.createElementBlock("span",xF,s.toDisplayString(`Primitives will be created in the ${i.targetRegion} region`),1)):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Position: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.createData.points,({value:v,i:p})=>(s.openBlock(),s.createBlock(c,{key:p,class:"value"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[s.vShow,t.showPoint]]),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Region: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(u,{class:"autocomplete-box","fit-input-width":!0,modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:i.targetRegion,"fetch-suggestions":i.fetchRegionSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",kF,s.toDisplayString(v.value),1)]),_:1},8,["modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),s.createVNode(c,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Group: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(u,{class:"autocomplete-box",disabled:r.createData.editingIndex>-1,"fit-input-width":!0,modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,"fetch-suggestions":i.fetchGroupSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",SF,s.toDisplayString(v.value),1)]),_:1},8,["disabled","modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),i.canBeConfirmed?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(c,{key:1,class:"row"},{default:s.withCtx(()=>[_F]),_:1})),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.confirm,disabled:!i.canBeConfirmed},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick","disabled"])]),_:1}),s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const NF=Yt(CF,[["render",TF],["__scopeId","data-v-4db6ecff"]]);function ht(t){"@babel/helpers - typeof";return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(t)}function Ou(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Au(t,e,r){return e&&IF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function k0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t,e){return BF(t)||DF(t,e)||S0(t,e)||PF()}function BF(t){if(Array.isArray(t))return t}function DF(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,o,l;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(n.push(o.value),!(e&&n.length===e));a=!0);}catch(c){i=!0,l=c}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function S0(t,e){if(t){if(typeof t=="string")return _0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _0(t,e)}}function _0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function PF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=S0(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,l;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){o=!0,l=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(o)throw l}}}}var pt=typeof window>"u"?null:window,N0=pt?pt.navigator:null;pt&&pt.document;var OF=ht(""),I0=ht({}),AF=ht(function(){}),RF=typeof HTMLElement>"u"?"undefined":ht(HTMLElement),Hi=function(e){return e&&e.instanceString&&Xe(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ht(e)==OF},Xe=function(e){return e!=null&&ht(e)===AF},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ae=function(e){return e!=null&&ht(e)===I0&&!Ke(e)&&e.constructor===Object},LF=function(e){return e!=null&&ht(e)===I0},de=function(e){return e!=null&&ht(e)===ht(1)&&!isNaN(e)},FF=function(e){return de(e)&&Math.floor(e)===e},ds=function(e){if(RF!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return Ki(e)||B0(e)},Ki=function(e){return Hi(e)==="collection"&&e._private.single},B0=function(e){return Hi(e)==="collection"&&!e._private.single},Ru=function(e){return Hi(e)==="core"},D0=function(e){return Hi(e)==="stylesheet"},MF=function(e){return Hi(e)==="event"},mn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$F=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},VF=function(e){return Ae(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},qF=function(e){return LF(e)&&Xe(e.then)},zF=function(){return N0&&N0.userAgent.match(/msie|trident|edge/i)},Gi=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function a(){var i=this,o=arguments,l,c=r.apply(i,o),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,o)),l};return n.cache={},n},Lu=Gi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),fs=Gi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),P0=Gi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),O0=function(e){return mn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",HF="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",KF="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",GF="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",UF="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",jF="\\#[0-9a-fA-F]{3}",WF="\\#[0-9a-fA-F]{6}",A0=function(e,r){return e<r?-1:e>r?1:0},YF=function(e,r){return-1*A0(e,r)},Se=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];t[o]=n[o]}}return t},ZF=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,o=16;return r?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},XF=function(e){var r,n,a,i,o,l,c,u;function d(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}var f=new RegExp("^"+GF+"$").exec(e);if(f){if(n=parseInt(f[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)l=c=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,n+1/3)),c=Math.round(255*d(v,h,n)),u=Math.round(255*d(v,h,n-1/3))}r=[l,c,u,o]}return r},JF=function(e){var r,n=new RegExp("^"+HF+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var l=a[1]||a[2]||a[3],c=a[1]&&a[2]&&a[3];if(l&&!c)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},QF=function(e){return tM[e.toLowerCase()]},eM=function(e){return(Ke(e)?e:null)||QF(e)||ZF(e)||JF(e)||XF(e)},tM={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},R0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to set map with object key");i<n.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},L0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Ae(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r};function rM(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Zn=rM,Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nM(t,e){return e={exports:{}},t(e,e.exports),e.exports}var aM=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,iM=aM,oM=typeof self=="object"&&self&&self.Object===Object&&self,sM=iM||oM||Function("return this")(),hs=sM,lM=function(){return hs.Date.now()},Fu=lM,uM=/\s/;function cM(t){for(var e=t.length;e--&&uM.test(t.charAt(e)););return e}var dM=cM,fM=/^\s+/;function hM(t){return t&&t.slice(0,dM(t)+1).replace(fM,"")}var pM=hM,vM=hs.Symbol,Fa=vM,F0=Object.prototype,gM=F0.hasOwnProperty,mM=F0.toString,ji=Fa?Fa.toStringTag:void 0;function yM(t){var e=gM.call(t,ji),r=t[ji];try{t[ji]=void 0;var n=!0}catch{}var a=mM.call(t);return n&&(e?t[ji]=r:delete t[ji]),a}var bM=yM,wM=Object.prototype,CM=wM.toString;function EM(t){return CM.call(t)}var xM=EM,kM="[object Null]",SM="[object Undefined]",M0=Fa?Fa.toStringTag:void 0;function _M(t){return t==null?t===void 0?SM:kM:M0&&M0 in Object(t)?bM(t):xM(t)}var $0=_M;function TM(t){return t!=null&&typeof t=="object"}var NM=TM,IM="[object Symbol]";function BM(t){return typeof t=="symbol"||NM(t)&&$0(t)==IM}var Wi=BM,V0=NaN,DM=/^[-+]0x[0-9a-f]+$/i,PM=/^0b[01]+$/i,OM=/^0o[0-7]+$/i,AM=parseInt;function RM(t){if(typeof t=="number")return t;if(Wi(t))return V0;if(Zn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=pM(t);var r=PM.test(t);return r||OM.test(t)?AM(t.slice(2),r?2:8):DM.test(t)?V0:+t}var q0=RM,LM="Expected a function",FM=Math.max,MM=Math.min;function $M(t,e,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(LM);e=q0(e)||0,Zn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?FM(q0(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,u=k,o=t.apply(_,E),o}function p(k){return u=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-c,_=k-u,S=e-E;return f?MM(S,i-_):S}function y(k){var E=k-c,_=k-u;return c===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Fu();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function C(){return l===void 0?o:b(Fu())}function x(){var k=Fu(),E=y(k);if(n=arguments,a=this,c=k,E){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}var ps=$M,Mu=pt?pt.performance:null,z0=Mu&&Mu.now?function(){return Mu.now()}:function(){return Date.now()},VM=function(){if(pt){if(pt.requestAnimationFrame)return function(t){pt.requestAnimationFrame(t)};if(pt.mozRequestAnimationFrame)return function(t){pt.mozRequestAnimationFrame(t)};if(pt.webkitRequestAnimationFrame)return function(t){pt.webkitRequestAnimationFrame(t)};if(pt.msRequestAnimationFrame)return function(t){pt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(z0())},1e3/60)}}(),vs=function(e){return VM(e)},Yr=z0,Ma=9261,H0=65599,Yi=5381,K0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ma,n=r,a;a=e.next(),!a.done;)n=n*H0+a.value|0;return n},Zi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ma;return r*H0+e|0},Xi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yi;return(r<<5)+r+e|0},qM=function(e,r){return e*2097152+r},yn=function(e){return e[0]*2097152+e[1]},gs=function(e,r){return[Zi(e[0],r[0]),Xi(e[1],r[1])]},zM=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return K0(o,r)},Xn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return K0(o,r)},G0=function(){return HM(arguments)},HM=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Xn(a):r=Xn(a,r)}return r},U0=!0,KM=console.warn!=null,GM=console.trace!=null,$u=Number.MAX_SAFE_INTEGER||9007199254740991,j0=function(){return!0},ms=function(){return!1},W0=function(){return 0},Vu=function(){},Je=function(e){throw new Error(e)},Y0=function(e){if(e!==void 0)U0=!!e;else return U0},$e=function(e){Y0()&&(KM?console.warn(e):(console.log(e),GM&&console.trace()))},UM=function(e){return Se({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Ae(e)?UM(e):e},jM=function(e){return e.slice()},Z0=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},WM={},X0=function(){return WM},St=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var o=r[i],l=n==null?void 0:n[o];a[o]=l===void 0?e[o]:l}return a}},bn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},qu=function(e){e.splice(0,e.length)},YM=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},gr=function(e,r,n){return n&&(r=P0(n,r)),e[r]},wn=function(e,r,n,a){n&&(r=P0(n,r)),e[r]=a},ZM=function(){function t(){Ou(this,t),this._obj={}}return Au(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),Ir=typeof Map<"u"?Map:ZM,XM="undefined",JM=function(){function t(e){if(Ou(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Au(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t}(),$a=(typeof Set>"u"?"undefined":ht(Set))!==XM?Set:JM,ys=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Ru(e)){Je("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Je("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new $a,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(o.x-l.x)/c,y:(o.y-l.y)/c}}var u=[];Ke(r.classes)?u=r.classes:Ee(r.classes)&&(u=r.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var h=u[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=r.style||r.css;v&&($e("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(n===void 0||n)&&this.restore()},J0=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;Ae(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Xe(a)?a:i,a=Xe(a)?a:function(){};for(var l=this._private.cy,c=n=Ee(n)?this.filter(n):n,u=[],d=[],f={},h={},v={},p=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<c.length;w++){var C=c[w],x=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[x]=!0,d.push(C)),h[x]=0)}for(var k=function(){var P=e.bfs?u.shift():u.pop(),D=P.id();if(e.dfs){if(v[D])return"continue";v[D]=!0,d.push(P)}var R=h[D],O=f[D],F=O!=null?O.source():null,A=O!=null?O.target():null,z=O==null?void 0:P.same(F)?A[0]:F[0],j=void 0;if(j=a(P,O,z,p++,R),j===!0)return g=P,"break";if(j===!1)return"break";for(var H=P.connectedEdges().filter(function(q){return(!i||q.source().same(P))&&b.has(q)}),G=0;G<H.length;G++){var X=H[G],M=X.connectedNodes().filter(function(q){return!q.same(P)&&m.has(q)}),V=M.id();M.length!==0&&!v[V]&&(M=M[0],u.push(M),e.bfs&&(v[V]=!0,d.push(M)),f[V]=X,h[V]=h[D]+1)}};u.length!==0;){var E=k();if(E!=="continue"&&E==="break")break}for(var _=l.collection(),S=0;S<d.length;S++){var T=d[S],N=f[T.id()];N!=null&&_.push(N),_.push(T)}return{path:l.collection(_),found:l.collection(g)}}},Ji={breadthFirstSearch:J0({bfs:!0}),depthFirstSearch:J0({dfs:!0})};Ji.bfs=Ji.breadthFirstSearch,Ji.dfs=Ji.depthFirstSearch;var QM=nM(function(t,e){(function(){var r,n,a,i,o,l,c,u,d,f,h,v,p,g,y;a=Math.floor,f=Math.min,n=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,x){var k;if(w==null&&(w=0),x==null&&(x=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)k=a((w+C)/2),x(b,m[k])<0?C=k:w=k+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=n),m.push(b),g(m,0,m.length-1,w)},o=function(m,b){var w,C;return b==null&&(b=n),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},u=function(m,b,w){var C;return w==null&&(w=n),C=m[0],m[0]=b,y(m,0,w),C},c=function(m,b,w){var C;return w==null&&(w=n),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,x,k,E,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(m.length/2);0<=T?S<T:S>T;0<=T?S++:S--)_.push(S);return _}).apply(this).reverse(),E=[],C=0,x=k.length;C<x;C++)w=k[C],E.push(y(m,w,b));return E},p=function(m,b,w){var C;if(w==null&&(w=n),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},h=function(m,b,w){var C,x,k,E,_;if(w==null&&(w=n),x=m.slice(0,b),!x.length)return x;for(i(x,w),_=m.slice(b),k=0,E=_.length;k<E;k++)C=_[k],c(x,C,w);return x.sort(w).reverse()},v=function(m,b,w){var C,x,k,E,_,S,T,N,B;if(w==null&&(w=n),b*10<=m.length){if(k=m.slice(0,b).sort(w),!k.length)return k;for(x=k[k.length-1],T=m.slice(b),E=0,S=T.length;E<S;E++)C=T[E],w(C,x)<0&&(d(k,C,0,null,w),k.pop(),x=k[k.length-1]);return k}for(i(m,w),B=[],_=0,N=f(b,m.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(m,w));return B},g=function(m,b,w,C){var x,k,E;for(C==null&&(C=n),x=m[w];w>b;){if(E=w-1>>1,k=m[E],C(x,k)<0){m[w]=k,w=E;continue}break}return m[w]=x},y=function(m,b,w){var C,x,k,E,_;for(w==null&&(w=n),x=m.length,_=b,k=m[b],C=2*b+1;C<x;)E=C+1,E<x&&!(w(m[C],m[E])<0)&&(C=E),m[b]=m[C],b=C,C=2*b+1;return m[b]=k,g(m,_,b,w)},r=function(){m.push=l,m.pop=o,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=p,m.nlargest=h,m.nsmallest=v;function m(b){this.cmp=b??n,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return o(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return r})}).call(Ui)}),Qi=QM,e5=St({root:null,weight:function(e){return 1},directed:!1}),t5={dijkstra:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=e5(e),a=n.root,i=n.weight,o=n.directed,l=this,c=i,u=Ee(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(R){return R.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,F){d[O.id()]=F,b.updateItem(O)},b=new Qi(function(R,O){return y(R)-y(O)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var x=function(O,F){for(var A=(o?O.edgesTo(F):O.edgesWith(F)).intersect(g),z=1/0,j,H=0;H<A.length;H++){var G=A[H],X=c(G);(X<z||!j)&&(z=X,j=G)}return{edge:j,dist:z}};b.size()>0;){var k=b.pop(),E=y(k),_=k.id();if(h[_]=E,E!==1/0)for(var S=k.neighborhood().intersect(p),T=0;T<S.length;T++){var N=S[T],B=N.id(),P=x(k,N),D=E+P.dist;D<y(N)&&(m(N,D),f[B]={node:k,edge:P.edge})}}return{distanceTo:function(O){var F=Ee(O)?p.filter(O)[0]:O[0];return h[F.id()]},pathTo:function(O){var F=Ee(O)?p.filter(O)[0]:O[0],A=[],z=F,j=z.id();if(F.length>0)for(A.unshift(F);f[j];){var H=f[j];A.unshift(H.edge),A.unshift(H.node),z=H.node,j=z.id()}return l.spawn(A)}}}},r5={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,o=new Array(i),l=n,c=function(C){for(var x=0;x<o.length;x++){var k=o[x];if(k.has(C))return x}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var h=d[f],v=h.source()[0],p=h.target()[0],g=c(v),y=c(p),m=o[g],b=o[y];g!==y&&(l.merge(h),m.merge(b),o.splice(y,1))}return l}},n5=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),a5={aStar:function(e){var r=this.cy(),n=n5(e),a=n.root,i=n.goal,o=n.heuristic,l=n.directed,c=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var u=a.id(),d=i.id(),f={},h={},v={},p=new Qi(function(j,H){return h[j.id()]-h[H.id()]}),g=new $a,y={},m={},b=function(H,G){p.push(H),g.add(G)},w,C,x=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(H){return g.has(H)};b(a,u),f[u]=0,h[u]=o(a);for(var E=0;p.size()>0;){if(x(),E++,C===d){for(var _=[],S=i,T=d,N=m[T];_.unshift(S),N!=null&&_.unshift(N),S=y[T],S!=null;)T=S.id(),N=m[T];return{found:!0,distance:f[C],path:this.spawn(_),steps:E}}v[C]=!0;for(var B=w._private.edges,P=0;P<B.length;P++){var D=B[P];if(this.hasElementWithId(D.id())&&!(l&&D.data("source")!==C)){var R=D.source(),O=D.target(),F=R.id()!==C?R:O,A=F.id();if(this.hasElementWithId(A)&&!v[A]){var z=f[C]+c(D);if(!k(A)){f[A]=z,h[A]=z+o(F),b(F,A),y[A]=w,m[A]=D;continue}z<f[A]&&(f[A]=z,h[A]=z+o(F),y[A]=w,m[A]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},i5=St({weight:function(e){return 1},directed:!1}),o5={floydWarshall:function(e){for(var r=this.cy(),n=i5(e),a=n.weight,i=n.directed,o=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,h=function(X){return c.indexOf(X)},v=function(X){return c[X]},p=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var x=u[C],k=x.source()[0],E=x.target()[0];if(k!==E){var _=h(k),S=h(E),T=_*d+S,N=o(x);if(p[T]>N&&(p[T]=N,b[T]=S,w[T]=x),!i){var B=S*d+_;!i&&p[B]>N&&(p[B]=N,b[B]=_,w[B]=x)}}}for(var P=0;P<d;P++)for(var D=0;D<d;D++)for(var R=D*d+P,O=0;O<d;O++){var F=D*d+O,A=P*d+O;p[R]+p[A]<p[F]&&(p[F]=p[R]+p[A],b[F]=b[R])}var z=function(X){return(Ee(X)?r.filter(X):X)[0]},j=function(X){return h(z(X))},H={distance:function(X,M){var V=j(X),q=j(M);return p[V*d+q]},path:function(X,M){var V=j(X),q=j(M),$=v(V);if(V===q)return $.collection();if(b[V*d+q]==null)return r.collection();var K=r.collection(),L=V,W;for(K.merge($);V!==q;)L=V,V=b[V*d+q],W=w[L*d+V],K.merge(W),K.merge(v(V));return K}};return H}},s5=St({weight:function(e){return 1},directed:!1,root:null}),l5={bellmanFord:function(e){var r=this,n=s5(e),a=n.weight,i=n.directed,o=n.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new Ir,g=!1,y=[];o=u.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var m=f.length,b=function(fe){var pe=p.get(fe.id());return pe||(pe={},p.set(fe.id(),pe)),pe},w=function(fe){return(Ee(fe)?u.$(fe):fe)[0]},C=function(fe){return b(w(fe)).dist},x=function(fe){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Pe=w(fe),Ie=[],we=Pe;;){if(we==null)return r.spawn();var xe=b(we),re=xe.edge,I=xe.pred;if(Ie.unshift(we[0]),we.same(pe)&&Ie.length>0)break;re!=null&&Ie.unshift(re),we=I}return c.spawn(Ie)},k=0;k<v;k++){var E=h[k],_=b(E);E.same(o)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var S=!1,T=function(fe,pe,Pe,Ie,we,xe){var re=Ie.dist+xe;re<we.dist&&!Pe.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=Pe,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<m;B++){var P=f[B],D=P.source(),R=P.target(),O=l(P),F=b(D),A=b(R);T(D,R,P,F,A,O),i||T(R,D,P,A,F,O)}if(!S)break}if(S)for(var z=[],j=0;j<m;j++){var H=f[j],G=H.source(),X=H.target(),M=l(H),V=b(G).dist,q=b(X).dist;if(V+M<q||!i&&q+M<V)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var $=[];V+M<q&&$.push(G),!i&&q+M<V&&$.push(X);for(var K=$.length,L=0;L<K;L++){var W=$[L],Y=[W];Y.push(b(W).edge);for(var se=b(W).pred;Y.indexOf(se)===-1;)Y.push(se),Y.push(b(se).edge),se=b(se).pred;Y=Y.slice(Y.indexOf(se));for(var ue=Y[0].id(),ae=0,ne=2;ne<Y.length;ne+=2)Y[ne].id()<ue&&(ue=Y[ne].id(),ae=ne);Y=Y.slice(ae).concat(Y.slice(0,ae)),Y.push(Y[0]);var ce=Y.map(function(ie){return ie.id()}).join(",");z.indexOf(ce)===-1&&(y.push(c.spawn(Y)),z.push(ce))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},u5=Math.sqrt(2),c5=function(e,r,n){n.length===0&&Je("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],l=r[i],c=r[o],u=n,d=u.length-1;d>=0;d--){var f=u[d],h=f[1],v=f[2];(r[h]===l&&r[v]===c||r[h]===c&&r[v]===l)&&u.splice(d,1)}for(var p=0;p<u.length;p++){var g=u[p];g[1]===c?(u[p]=g.slice(),u[p][1]=l):g[2]===c&&(u[p]=g.slice(),u[p][2]=l)}for(var y=0;y<r.length;y++)r[y]===c&&(r[y]=l);return u},zu=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=c5(i,e,r),n--}return r},d5={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(A){return A.isLoop()});var i=n.length,o=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/u5);if(i<2){Je("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<o;d++){var f=a[d];u.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),y=new Array(i),m=function(z,j){for(var H=0;H<i;H++)j[H]=z[H]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=zu(g,u.slice(),i,c),x=C.slice();m(g,y);var k=zu(g,C,c,2),E=zu(y,x,c,2);k.length<=E.length&&k.length<h?(h=k.length,v=k,m(g,p)):E.length<=k.length&&E.length<h&&(h=E.length,v=E,m(y,p))}for(var _=this.spawn(v.map(function(A){return a[A[0]]})),S=this.spawn(),T=this.spawn(),N=p[0],B=0;B<p.length;B++){var P=p[B],D=n[B];P===N?S.merge(D):T.merge(D)}var R=function(z){var j=e.spawn();return z.forEach(function(H){j.merge(H),H.connectedEdges().forEach(function(G){e.contains(G)&&!_.contains(G)&&j.merge(G)})}),j},O=[R(S),R(T)],F={cut:_,components:O,partition1:S,partition2:T};return F}},f5=function(e){return{x:e.x,y:e.y}},bs=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},Q0=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Va=function(e){return{x:e[0],y:e[1]}},h5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},p5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},v5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=r;o<n;o++){var l=e[o];isFinite(l)&&(a+=l,i++)}return a/i},g5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var l=0,c=e.length-1;c>=0;c--){var u=e[c];o?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},m5=function(e){return Math.PI*e/180},ws=function(e,r){return Math.atan2(r,e)-Math.PI/2},Hu=Math.log2||function(t){return Math.log(t)/Math.log(2)},eb=function(e){return e>0?1:e<0?-1:0},Jn=function(e,r){return Math.sqrt(Qn(e,r))},Qn=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},y5=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},bt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},qa=function(e,r,n,a){return{x:bt(e.x,r.x,n.x,a),y:bt(e.y,r.y,n.y,a)}},b5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Jn(e,r),l={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+l.x*a,y:e.y+l.y*a}},eo=function(e,r,n){return Math.max(e,Math.min(n,r))},Kt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},w5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},C5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},E5=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},tb=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},x5=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Cs=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Es=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(r.length===1)n=a=i=o=r[0];else if(r.length===2)n=i=r[0],o=a=r[1];else if(r.length===4){var l=vr(r,4);n=l[0],a=l[1],i=l[2],o=l[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rb=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Ku=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},za=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},k5=function(e,r){return za(e,r.x,r.y)},nb=function(e,r){return za(e,r.x1,r.y1)&&za(e,r.x2,r.y2)},ab=function(e,r,n,a,i,o,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?ta(i,o):c,d=i/2,f=o/2;u=Math.min(u,d,f);var h=u!==d,v=u!==f,p;if(h){var g=n-d+u-l,y=a-f-l,m=n+d-u+l,b=y;if(p=Cn(e,r,n,a,g,y,m,b,!1),p.length>0)return p}if(v){var w=n+d+l,C=a-f+u-l,x=w,k=a+f-u+l;if(p=Cn(e,r,n,a,w,C,x,k,!1),p.length>0)return p}if(h){var E=n-d+u-l,_=a+f+l,S=n+d-u+l,T=_;if(p=Cn(e,r,n,a,E,_,S,T,!1),p.length>0)return p}if(v){var N=n-d-l,B=a-f+u-l,P=N,D=a+f-u+l;if(p=Cn(e,r,n,a,N,B,P,D,!1),p.length>0)return p}var R;{var O=n-d+u,F=a-f+u;if(R=to(e,r,n,a,O,F,u+l),R.length>0&&R[0]<=O&&R[1]<=F)return[R[0],R[1]]}{var A=n+d-u,z=a-f+u;if(R=to(e,r,n,a,A,z,u+l),R.length>0&&R[0]>=A&&R[1]<=z)return[R[0],R[1]]}{var j=n+d-u,H=a+f-u;if(R=to(e,r,n,a,j,H,u+l),R.length>0&&R[0]>=j&&R[1]>=H)return[R[0],R[1]]}{var G=n-d+u,X=a+f-u;if(R=to(e,r,n,a,G,X,u+l),R.length>0&&R[0]<=G&&R[1]>=X)return[R[0],R[1]]}return[]},S5=function(e,r,n,a,i,o,l){var c=l,u=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,o),h=Math.max(a,o);return u-c<=e&&e<=d+c&&f-c<=r&&r<=h+c},_5=function(e,r,n,a,i,o,l,c,u){var d={x1:Math.min(n,l,i)-u,x2:Math.max(n,l,i)+u,y1:Math.min(a,c,o)-u,y2:Math.max(a,c,o)+u};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},T5=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var o=Math.sqrt(i),l=2*e,c=(-r+o)/l,u=(-r-o)/l;return[c,u]},N5=function(e,r,n,a,i){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var l,c,u,d,f,h,v,p;if(c=(3*n-r*r)/9,u=-(27*a)+r*(9*n-2*(r*r)),u/=54,l=c*c*c+u*u,i[1]=0,v=r/3,l>0){f=u+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),h=u-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),p=2*Math.sqrt(c),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},I5=function(e,r,n,a,i,o,l,c){var u=1*n*n-4*n*i+2*n*l+4*i*i-4*i*l+l*l+a*a-4*a*o+2*a*c+4*o*o-4*o*c+c*c,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*o-3*a*a-3*a*c-6*o*o+3*o*c,f=1*3*n*n-6*n*i+n*l-n*e+2*i*i+2*i*e-l*e+3*a*a-6*a*o+a*c-a*r+2*o*o+2*o*r-c*r,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*r-o*r,v=[];N5(u,d,f,h,v);for(var p=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<p&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,x=0;x<g.length;x++)b=Math.pow(1-g[x],2)*n+2*(1-g[x])*g[x]*i+g[x]*g[x]*l,w=Math.pow(1-g[x],2)*a+2*(1-g[x])*g[x]*o+g[x]*g[x]*c,C=Math.pow(b-e,2)+Math.pow(w-r,2),m>=0?C<m&&(m=C):m=C;return m},B5=function(e,r,n,a,i,o){var l=[e-n,r-a],c=[i-n,o-a],u=c[0]*c[0]+c[1]*c[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*c[0]+l[1]*c[1],h=f*f/u;return f<0?d:h>u?(e-i)*(e-i)+(r-o)*(r-o):d-h},Gt=function(e,r,n){for(var a,i,o,l,c,u=0,d=0;d<n.length/2;d++)if(a=n[d*2],i=n[d*2+1],d+1<n.length/2?(o=n[(d+1)*2],l=n[(d+1)*2+1]):(o=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)c=(e-a)/(o-a)*(l-i)+i,c>r&&u++;else continue;return u%2!==0},Zr=function(e,r,n,a,i,o,l,c,u){var d=new Array(n.length),f;c[0]!=null?(f=Math.atan(c[1]/c[0]),c[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=c;for(var h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=o/2*(n[p*2]*h-n[p*2+1]*v),d[p*2+1]=l/2*(n[p*2+1]*h+n[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(u>0){var y=ks(d,-u);g=xs(y)}else g=d;return Gt(e,r,g)},D5=function(e,r,n,a,i,o,l,c){for(var u=new Array(n.length*2),d=0;d<c.length;d++){var f=c[d];u[d*4+0]=f.startX,u[d*4+1]=f.startY,u[d*4+2]=f.stopX,u[d*4+3]=f.stopY;var h=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(h<=Math.pow(f.radius,2))return!0}return Gt(e,r,u)},xs=function(e){for(var r=new Array(e.length/2),n,a,i,o,l,c,u,d,f=0;f<e.length/4;f++){n=e[f*4],a=e[f*4+1],i=e[f*4+2],o=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],c=e[(f+1)*4+1],u=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],c=e[1],u=e[2],d=e[3]);var h=Cn(n,a,i,o,l,c,u,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},ks=function(e,r){for(var n=new Array(e.length*2),a,i,o,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(o=e[(c+1)*2],l=e[(c+1)*2+1]):(o=e[0],l=e[1]);var u=l-i,d=-(o-a),f=Math.sqrt(u*u+d*d),h=u/f,v=d/f;n[c*4]=a+h*r,n[c*4+1]=i+v*r,n[c*4+2]=o+h*r,n[c*4+3]=l+v*r}return n},P5=function(e,r,n,a,i,o){var l=n-e,c=a-r;l/=i,c/=o;var u=Math.sqrt(l*l+c*c),d=u-1;if(d<0)return[];var f=d/u;return[(n-e)*f+e,(a-r)*f+r]},ea=function(e,r,n,a,i,o,l){return e-=i,r-=o,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},to=function(e,r,n,a,i,o,l){var c=[n-e,a-r],u=[e-i,r-o],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),h=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(p,g),m=Math.max(p,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*c[0]+e,C=b[0]*c[1]+r;if(b.length>1){if(b[0]==b[1])return[w,C];var x=b[1]*c[0]+e,k=b[1]*c[1]+r;return[w,C,x,k]}else return[w,C]},Gu=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Cn=function(e,r,n,a,i,o,l,c,u){var d=e-i,f=n-e,h=l-i,v=r-o,p=a-r,g=c-o,y=h*v-g*d,m=f*v-p*d,b=g*f-h*p;if(b!==0){var w=y/b,C=m/b,x=.001,k=0-x,E=1+x;return k<=w&&w<=E&&k<=C&&C<=E?[e+w*f,r+w*p]:u?[e+w*f,r+w*p]:[]}else return y===0||m===0?Gu(e,n,l)===l?[l,c]:Gu(e,n,i)===i?[i,o]:Gu(i,l,n)===n?[n,a]:[]:[]},ro=function(e,r,n,a,i,o,l,c){var u=[],d,f=new Array(n.length),h=!0;o==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=n[p*2]*o+a,f[p*2+1]=n[p*2+1]*l+i;if(c>0){var g=ks(f,-c);v=xs(g)}else v=f}else v=n;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=Cn(e,r,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},O5=function(e,r,n,a,i,o,l,c,u){var d=[],f,h=new Array(n.length*2);u.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=to(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=Cn(e,r,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-r,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-r,2);m<=g&&(p[0]=d[y*2],p[1]=d[y*2+1],g=m)}return p}return d},Ss=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[r[0]+o*a[0],r[1]+o*a[1]]},Vt=function(e,r){var n=Uu(e,r);return n=ib(n),n},ib=function(e){for(var r,n,a=e.length/2,i=1/0,o=1/0,l=-1/0,c=-1/0,u=0;u<a;u++)r=e[2*u],n=e[2*u+1],i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),c=Math.max(c,n);for(var d=2/(l-i),f=2/(c-o),h=0;h<a;h++)r=e[2*h]=e[2*h]*d,n=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),c=Math.max(c,n);if(o<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-o);return e},Uu=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),o,l=0;l<e;l++)o=l*n+a,i[2*l]=Math.cos(o),i[2*l+1]=Math.sin(-o);return i},ta=function(e,r){return Math.min(e/4,r/4,8)},ob=function(e,r){return Math.min(e/10,r/10,8)},ju=function(){return 8},A5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Wu=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},R5=St({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),L5={pageRank:function(e){for(var r=R5(e),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,h=f*f,v=d.length,p=new Array(h),g=new Array(f),y=(1-n)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;p[w]=0}g[m]=0}for(var C=0;C<v;C++){var x=d[C],k=x.data("source"),E=x.data("target");if(k!==E){var _=u.indexOfId(k),S=u.indexOfId(E),T=o(x),N=S*f+_;p[N]+=T,g[_]+=T}}for(var B=1/f+y,P=0;P<f;P++)if(g[P]===0)for(var D=0;D<f;D++){var R=D*f+P;p[R]=B}else for(var O=0;O<f;O++){var F=O*f+P;p[F]=p[F]/g[P]+y}for(var A=new Array(f),z=new Array(f),j,H=0;H<f;H++)A[H]=1;for(var G=0;G<i;G++){for(var X=0;X<f;X++)z[X]=0;for(var M=0;M<f;M++)for(var V=0;V<f;V++){var q=M*f+V;z[M]+=p[q]*A[V]}y5(z),j=A,A=z,z=j;for(var $=0,K=0;K<f;K++){var L=j[K]-A[K];$+=L*L}if($<a)break}var W={rank:function(se){return se=l.collection(se)[0],A[u.indexOf(se)]}};return W}},sb=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ha={degreeCentralityNormalized:function(e){e=sb(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=n[p],y=g.id();e.root=g;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return h==0?0:(Ee(w)&&(w=r.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(Ee(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},o=0,l=0;l<a;l++){var c=n[l];e.root=c;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[c.id()]=u.degree}return{degree:function(w){return o===0?0:(Ee(w)&&(w=r.filter(w)),i[w.id()]/o)}}}},degreeCentrality:function(e){e=sb(e);var r=this.cy(),n=this,a=e,i=a.root,o=a.weight,l=a.directed,c=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(k){return k.target().same(i)&&n.has(k)}),g=v.filter(function(k){return k.source().same(i)&&n.has(k)}),y=p.length,m=g.length,b=0,w=0,C=0;C<p.length;C++)b+=o(p[C]);for(var x=0;x<g.length;x++)w+=o(g[x]);return{indegree:Math.pow(y,1-c)*Math.pow(b,c),outdegree:Math.pow(m,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(n),d=u.length,f=0,h=0;h<u.length;h++)f+=o(u[h]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};Ha.dc=Ha.degreeCentrality,Ha.dcn=Ha.degreeCentralityNormalised=Ha.degreeCentralityNormalized;var lb=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ka={closenessCentralityNormalized:function(e){for(var r=lb(e),n=r.harmonic,a=r.weight,i=r.directed,o=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var h=0,v=u[f],p=0;p<u.length;p++)if(f!==p){var g=d.distance(v,u[p]);n?h+=1/g:h+=g}n||(h=1/h),c<h&&(c=h),l[v.id()]=h}return{closeness:function(m){return c==0?0:(Ee(m)?m=o.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var r=lb(e),n=r.root,a=r.weight,i=r.directed,o=r.harmonic;n=this.filter(n)[0];for(var l=this.dijkstra({root:n,weight:a,directed:i}),c=0,u=this.nodes(),d=0;d<u.length;d++){var f=u[d];if(!f.same(n)){var h=l.distanceTo(f);o?c+=1/h:c+=h}}return o?c:1/c}};Ka.cc=Ka.closenessCentrality,Ka.ccn=Ka.closenessCentralityNormalised=Ka.closenessCentralityNormalized;var F5=St({weight:null,directed:!1}),Yu={betweennessCentrality:function(e){for(var r=F5(e),n=r.directed,a=r.weight,i=a!=null,o=this.cy(),l=this.nodes(),c={},u={},d=0,f={set:function(w,C){u[w]=C,C>d&&(d=C)},get:function(w){return u[w]}},h=0;h<l.length;h++){var v=l[h],p=v.id();n?c[p]=v.outgoers().nodes():c[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),x=[],k={},E={},_={},S=new Qi(function(V,q){return _[V]-_[q]}),T=0;T<l.length;T++){var N=l[T].id();k[N]=[],E[N]=0,_[N]=1/0}for(E[C]=1,_[C]=0,S.push(C);!S.empty();){var B=S.pop();if(x.push(B),i)for(var P=0;P<c[B].length;P++){var D=c[B][P],R=o.getElementById(B),O=void 0;R.edgesTo(D).length>0?O=R.edgesTo(D)[0]:O=D.edgesTo(R)[0];var F=a(O);D=D.id(),_[D]>_[B]+F&&(_[D]=_[B]+F,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),E[D]=0,k[D]=[]),_[D]==_[B]+F&&(E[D]=E[D]+E[B],k[D].push(B))}else for(var A=0;A<c[B].length;A++){var z=c[B][A].id();_[z]==1/0&&(S.push(z),_[z]=_[B]+1),_[z]==_[B]+1&&(E[z]=E[z]+E[B],k[z].push(B))}}for(var j={},H=0;H<l.length;H++)j[l[H].id()]=0;for(;x.length>0;){for(var G=x.pop(),X=0;X<k[G].length;X++){var M=k[G][X];j[M]=j[M]+E[M]/E[G]*(1+j[G])}G!=l[w].id()&&f.set(G,f.get(G)+j[G])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=o.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=o.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};Yu.bc=Yu.betweennessCentrality;var M5=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),$5=function(e){return M5(e)},V5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},q5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},ub=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var o=0;o<r;o++)e[o*r+a]=e[o*r+a]/n}},z5=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var l=0;l<n;l++)for(var c=0;c<n;c++)a[i*n+c]+=e[i*n+l]*r[l*n+c]}return a},H5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=z5(e,a,r);return e},K5=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return ub(a,r),a},G5=function(e,r,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==l)return!1}return!0},U5=function(e,r,n,a){for(var i=[],o=0;o<r;o++){for(var l=[],c=0;c<r;c++)Math.round(e[o*r+c]*1e3)/1e3>0&&l.push(n[c]);l.length!==0&&i.push(a.collection(l))}return i},j5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},W5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&j5(e[r],e[n])&&e.splice(n,1);return e},cb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=$5(e),o={},l=0;l<r.length;l++)o[r[l].id()]=l;for(var c=r.length,u=c*c,d=new Array(u),f,h=0;h<u;h++)d[h]=0;for(var v=0;v<n.length;v++){var p=n[v],g=o[p.source().id()],y=o[p.target().id()],m=V5(p,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}q5(d,c,i.multFactor),ub(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=H5(d,c,i.expandFactor),d=K5(f,c,i.inflateFactor),G5(d,f,u,4)||(b=!0),w++;var C=U5(d,c,r,a);return C=W5(C),C},Y5={markovClustering:cb,mcl:cb},Z5=function(e){return e},db=function(e,r){return Math.abs(r-e)},fb=function(e,r,n){return e+db(r,n)},hb=function(e,r,n){return e+Math.pow(n-r,2)},X5=function(e){return Math.sqrt(e)},J5=function(e,r,n){return Math.max(e,db(r,n))},no=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Z5,l=a,c,u,d=0;d<e;d++)c=r(d),u=n(d),l=i(l,c,u);return o(l)},Ga={euclidean:function(e,r,n){return e>=2?no(e,r,n,0,hb,X5):no(e,r,n,0,fb)},squaredEuclidean:function(e,r,n){return no(e,r,n,0,hb)},manhattan:function(e,r,n){return no(e,r,n,0,fb)},max:function(e,r,n){return no(e,r,n,-1/0,J5)}};Ga["squared-euclidean"]=Ga.squaredEuclidean,Ga.squaredeuclidean=Ga.squaredEuclidean;function _s(t,e,r,n,a,i){var o;return Xe(t)?o=t:o=Ga[t]||Ga.euclidean,e===0&&Xe(t)?o(a,i):o(e,r,n,a,i)}var Q5=St({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Zu=function(e){return Q5(e)},Ts=function(e,r,n,a,i){var o=i!=="kMedoids",l=o?function(f){return n[f]}:function(f){return a[f](n)},c=function(h){return a[h](r)},u=n,d=r;return _s(e,a.length,l,c,u,d)},Xu=function(e,r,n){for(var a=n.length,i=new Array(a),o=new Array(a),l=new Array(r),c=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var d=0;d<r;d++){c=[];for(var f=0;f<a;f++)c[f]=Math.random()*(o[f]-i[f])+i[f];l[d]=c}return l},pb=function(e,r,n,a,i){for(var o=1/0,l=0,c=0;c<r.length;c++){var u=Ts(n,e,r[c],a,i);u<o&&(o=u,l=c)}return l},vb=function(e,r,n){for(var a=[],i=null,o=0;o<r.length;o++)i=r[o],n[i.id()]===e&&a.push(i);return a},e$=function(e,r,n){return Math.abs(r-e)<=n},t$=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-r[a][i]);if(o>n)return!1}return!0},r$=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},gb=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];r$(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<r;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},mb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Ts("manhattan",r[i],e,n,"kMedoids");return a},n$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=Xu(n,i.k,i.attributes)):ht(i.testCentroids)==="object"?c=i.testCentroids:c=Xu(n,i.k,i.attributes):c=Xu(n,i.k,i.attributes);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<n.length;f++)a=n[f],l[a.id()]=pb(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var v=vb(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=c[h],y=new Array(p),m=new Array(p),b=0;b<p;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,e$(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[h]=y,o[h]=r.collection(v)}}d++}return o},a$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Zu(e),o=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ht(i.testCentroids)==="object"?l=i.testCentroids:l=gb(n,i.k)):l=gb(n,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],c[a.id()]=pb(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=vb(p,n,c);if(g.length!==0){d[p]=mb(l[p],g,i.attributes);for(var y=0;y<g.length;y++)u=mb(g[y],g,i.attributes),u<d[p]&&(d[p]=u,l[p]=g[y],f=!0);o[p]=r.collection(g)}}h++}return o},i$=function(e,r,n,a,i){for(var o,l,c=0;c<r.length;c++)for(var u=0;u<e.length;u++)a[c][u]=Math.pow(n[c][u],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){o=0,l=0;for(var h=0;h<r.length;h++)o+=a[h][d]*i.attributes[f](r[h]),l+=a[h][d];e[d][f]=o/l}},o$=function(e,r,n,a,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<n.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<n.length;v++)c=Ts(i.distance,a[h],n[f],i.attributes,"cmeans"),u=Ts(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[h][f]=1/l}},s$=function(e,r,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var l,c,u=0;u<r.length;u++){l=-1/0,c=-1;for(var d=0;d<r[0].length;d++)r[u][d]>l&&(l=r[u][d],c=d);i[c].push(e[u])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},yb=function(e){var r=this.cy(),n=this.nodes(),a=Zu(e),i,o,l,c,u;c=new Array(n.length);for(var d=0;d<n.length;d++)c[d]=new Array(a.k);l=new Array(n.length);for(var f=0;f<n.length;f++)l[f]=new Array(a.k);for(var h=0;h<n.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}o=new Array(a.k);for(var y=0;y<a.k;y++)o[y]=new Array(a.attributes.length);u=new Array(n.length);for(var m=0;m<n.length;m++)u[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,i$(o,n,l,u,a),o$(l,c,o,n,a),t$(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=s$(n,l,a,r),{clusters:i,degreeOfMembership:l}},l$={kMeans:n$,kMedoids:a$,fuzzyCMeans:yb,fcm:yb},u$=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),c$={single:"min",complete:"max"},d$=function(e){var r=u$(e),n=c$[r.linkage];return n!=null&&(r.linkage=n),r},bb=function(e,r,n,a,i){for(var o=0,l=1/0,c,u=i.attributes,d=function(S,T){return _s(i.distance,u.length,function(N){return u[N](S)},function(N){return u[N](T)},S,T)},f=0;f<e.length;f++){var h=e[f].key,v=n[h][a[h]];v<l&&(o=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[o],g=r[a[o]],y;i.mode==="dendrogram"?y={left:p,right:g,key:p.key}:y={value:p.value.concat(g.value),key:p.key},e[p.index]=y,e.splice(g.index,1),r[p.key]=y;for(var m=0;m<e.length;m++){var b=e[m];p.key===b.key?c=1/0:i.linkage==="min"?(c=n[p.key][b.key],n[p.key][b.key]>n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="max"?(c=n[p.key][b.key],n[p.key][b.key]<n[g.key][b.key]&&(c=n[g.key][b.key])):i.linkage==="mean"?c=(n[p.key][b.key]*p.size+n[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?c=d(b.value,p.value):c=d(b.value[0],p.value[0]),n[p.key][b.key]=n[b.key][p.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var x=C,k=0;k<e.length;k++){var E=e[k].key;n[C][E]<n[C][x]&&(x=E)}a[C]=x}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Ns=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},f$=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},h$=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Ns(e.left,a),e.right&&Ns(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Ns(e.left,a),e.right&&Ns(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},wb=function(e){for(var r=this.cy(),n=this.nodes(),a=d$(e),i=a.attributes,o=function(w,C){return _s(a.distance,i.length,function(x){return i[x](w)},function(x){return i[x](C)},w,C)},l=[],c=[],u=[],d=[],f=0;f<n.length;f++){var h={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=h,d[f]=h,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:o(l[v].value,l[p].value):g=v===p?1/0:o(l[v].value[0],l[p].value[0]),c[v][p]=g,c[p][v]=g,g<c[v][u[v]]&&(u[v]=p)}for(var y=bb(l,d,c,u,a);y;)y=bb(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=h$(l[0],a.dendrogramDepth,r),a.addDendrogram&&f$(l[0],r)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=r.collection(b.value)})),m},p$={hierarchicalClustering:wb,hca:wb},v$=St({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),g$=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Je("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||de(n)||Je("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),v$(e)},m$=function(e,r,n,a){var i=function(l,c){return a[c](l)};return-_s(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},y$=function(e,r){var n=null;return r==="median"?n=g5(e):r==="mean"?n=v5(e):r==="min"?n=h5(e):r==="max"?n=p5(e):n=r,n},b$=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},Cb=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var o=-1,l=-1/0,c=0;c<n.length;c++){var u=n[c];r[i*e+u]>l&&(o=u,l=r[i*e+u])}o>0&&a.push(o)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},w$=function(e,r,n){for(var a=Cb(e,r,n),i=0;i<n.length;i++){for(var o=[],l=0;l<a.length;l++)a[l]===n[i]&&o.push(l);for(var c=-1,u=-1/0,d=0;d<o.length;d++){for(var f=0,h=0;h<o.length;h++)f+=r[o[h]*e+o[d]];f>u&&(c=d,u=f)}n[i]=o[c]}return a=Cb(e,r,n),a},Eb=function(e){for(var r=this.cy(),n=this.nodes(),a=g$(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var l,c,u,d,f,h;l=n.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(u[p*l+g]=m$(a.distance,n[p],n[g],a.attributes));d=y$(u,a.preference);for(var y=0;y<l;y++)u[y*l+y]=d;f=new Array(c);for(var m=0;m<c;m++)f[m]=0;h=new Array(c);for(var b=0;b<c;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),k=0;k<l;k++)w[k]=0,C[k]=0,x[k]=0;for(var E=new Array(l*a.minIterations),_=0;_<E.length;_++)E[_]=0;var S;for(S=0;S<a.maxIterations;S++){for(var T=0;T<l;T++){for(var N=-1/0,B=-1/0,P=-1,D=0,R=0;R<l;R++)w[R]=f[T*l+R],D=h[T*l+R]+u[T*l+R],D>=N?(B=N,N=D,P=R):D>B&&(B=D);for(var O=0;O<l;O++)f[T*l+O]=(1-a.damping)*(u[T*l+O]-N)+a.damping*w[O];f[T*l+P]=(1-a.damping)*(u[T*l+P]-B)+a.damping*w[P]}for(var F=0;F<l;F++){for(var A=0,z=0;z<l;z++)w[z]=h[z*l+F],C[z]=Math.max(0,f[z*l+F]),A+=C[z];A-=C[F],C[F]=f[F*l+F],A+=C[F];for(var j=0;j<l;j++)h[j*l+F]=(1-a.damping)*Math.min(0,A-C[j])+a.damping*w[j];h[F*l+F]=(1-a.damping)*(A-C[F])+a.damping*w[F]}for(var H=0,G=0;G<l;G++){var X=h[G*l+G]+f[G*l+G]>0?1:0;E[S%a.minIterations*l+G]=X,H+=X}if(H>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var M=0,V=0;V<l;V++){x[V]=0;for(var q=0;q<a.minIterations;q++)x[V]+=E[q*l+V];(x[V]===0||x[V]===a.minIterations)&&M++}if(M===l)break}}for(var $=b$(l,f,h),K=w$(l,u,$),L={},W=0;W<$.length;W++)L[$[W]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ue=K[se];ue!=null&&L[ue].push(n[Y])}for(var ae=new Array($.length),ne=0;ne<$.length;ne++)ae[ne]=r.collection(L[$[ne]]);return ae},C$={affinityPropagation:Eb,ap:Eb},E$=St({root:void 0,directed:!1}),x$={hierholzer:function(e){if(!Ae(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=E$(e),a=n.root,i=n.directed,o=this,l=!1,c,u,d;a&&(d=Ee(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),k=C-x,E=x-C;k==1?c?l=!0:c=w:E==1?u?l=!0:u=w:(E>1||k>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(_){_.isEdge()&&f[w].push(_.id())})}else h[w]=[void 0,b.target().id()]}):o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(c?u?l=!0:u=w:c=w),f[w]=[],b.connectedEdges().forEach(function(x){return f[w].push(x.id())})}else h[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(u&&c)if(i){if(d&&u!=d)return v;d=u}else{if(d&&u!=d&&c!=d)return v;d||(d=u)}else d||(d=o[0].id());var p=function(w){for(var C=w,x=[w],k,E,_;f[C].length;)k=f[C].shift(),E=h[k][0],_=h[k][1],C!=_?(f[_]=f[_].filter(function(S){return S!=k}),C=_):!i&&C!=E&&(f[E]=f[E].filter(function(S){return S!=k}),C=E),x.unshift(k),x.unshift(C);return x},g=[],y=[];for(y=p(d);y.length!=1;)f[y[0]].length==0?(g.unshift(o.getElementById(y.shift())),g.unshift(o.getElementById(y.shift()))):y=p(y.shift()).concat(y);g.unshift(o.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Is=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},c=function(h,v){for(var p=o.length-1,g=[],y=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),x=w.connectedEdges().intersection(e);y.merge(w),r[C].cutVertex?y.merge(x.filter(function(k){return k.isLoop()})):y.merge(x)})}),i.push(y)},u=function f(h,v,p){h===p&&(a+=1),r[v]={id:n,low:n++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==p&&(w=C.id(),l[w]||(l[w]=!0,o.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(h,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,c(v,b))))})}};e.forEach(function(f){if(f.isNode()){var h=f.id();h in r||(a=0,u(h,h),r[h].cutVertex=a>1)}});var d=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},k$={hopcroftTarjanBiconnected:Is,htbc:Is,htb:Is,hopcroftTarjanBiconnectedComponents:Is},Bs=function(){var e=this,r={},n=0,a=[],i=[],o=e.spawn(e),l=function c(u){i.push(u),r[u]={index:n,low:n++,explored:!1};var d=e.getElementById(u).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in r||c(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var f=e.spawn();;){var h=i.pop();if(f.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),o=o.difference(p)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in r||l(u)}}),{cut:o,components:a}},S$={tarjanStronglyConnected:Bs,tsc:Bs,tscc:Bs,tarjanStronglyConnectedComponents:Bs},xb={};[Ji,t5,r5,a5,o5,l5,d5,L5,Ha,Ka,Yu,Y5,l$,p$,C$,x$,k$,S$].forEach(function(t){Se(xb,t)});/*!
29
+ <br>`)},onCopied:function(){const t=this.annotationEntry[this.entryIndex],e={event_name:"portal_maps_annotation_copy_content",category:String((t==null?void 0:t.featureId)||"")};this.trackEvent(e)},trackEvent:function(t){const e={event:"interaction_event",location:"map_annotation",...t};this.$emit("trackEvent",e)}},watch:{annotationEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0,t!=null&&t.length&&this.emitActiveItemChange())}},entry:{deep:!0,immediate:!0,handler:function(t,e){t&&t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())}}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0):this.errorMessage="",this.updatePrevSubmissions()})}},Zn=t=>(s.pushScopeId("data-v-2a2f8754"),t=t(),s.popScopeId(),t),sM={key:0,class:"toggle-button"},lM={class:"block"},cM=Zn(()=>s.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),uM={class:"title-buttons"},dM={key:0},fM=["href"],hM=Zn(()=>s.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),pM=Zn(()=>s.createElementVNode("strong",null,"Evidence:  ",-1)),vM=["href"],gM={key:1},mM={key:2},yM=Zn(()=>s.createElementVNode("strong",null,"Comment:  ",-1)),bM=Zn(()=>s.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),wM=Zn(()=>s.createElementVNode("strong",null,"Evidence:",-1)),CM=Zn(()=>s.createElementVNode("strong",null,"Comment:",-1)),EM={class:"sub-title"};function xM(t,e,r,n,a,i){const o=Bt,l=mn,u=fs,c=os,d=xe.ArrowUp,f=Xe,h=xe.ArrowDown,v=xe.Edit,p=xe.Delete,g=xe.Finished,y=Mi,m=xe.Close,b=NL,w=TL,C=Pi,x=Tc;return s.openBlock(),s.createBlock(x,{class:"main"},{default:s.withCtx(()=>[r.annotationEntry.length>1?(s.openBlock(),s.createElementBlock("div",sM,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.annotationEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",lM,[s.createVNode(c,{class:"info-field"},{default:s.withCtx(()=>[cM,s.createElementVNode("div",uM,[s.createVNode(u,{onCopied:i.onCopied,content:i.updatedCopyContent},null,8,["onCopied","content"])])]),_:1}),i.entry?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.displayPair,(k,E)=>s.withDirectives((s.openBlock(),s.createBlock(c,{class:"dialog-text",key:k},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(E)+": ",1),s.createTextVNode("  "),E!=="Ontology"?(s.openBlock(),s.createElementBlock("span",dM,s.toDisplayString(i.entry[k]),1)):(s.openBlock(),s.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},s.toDisplayString(i.entry[k]),9,fM))]),_:2},1024)),[[s.vShow,i.entry[k]]])),128)),t.prevSubs.length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[s.createTextVNode(" Hide previous submissions "),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showSubmissions]]),s.withDirectives(s.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[s.createTextVNode(" Show previous "+s.toDisplayString(t.prevSubs.length)+" submission(s) ",1),s.createVNode(f,null,{default:s.withCtx(()=>[s.createVNode(h)]),_:1})],512),[[s.vShow,!t.showSubmissions]]),t.showSubmissions?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(c,{class:"dialog-spacer"}),s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[hM]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.prevSubs,(k,E)=>(s.openBlock(),s.createElementBlock("div",{class:"entry",key:E},[k.creator?(s.openBlock(),s.createBlock(c,{key:0,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(i.formatTime(k.created)),1),s.createTextVNode(" "+s.toDisplayString(k.creator.name),1)]),_:2},1024)):s.createCommentVNode("",!0),s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[pM,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.processEvidences(k),(_,S)=>(s.openBlock(),s.createBlock(c,{key:_,class:"dialog-text"},{default:s.withCtx(()=>[typeof _=="object"?(s.openBlock(),s.createElementBlock("a",{key:0,href:Object.values(_)[0],target:"_blank"},s.toDisplayString(Object.keys(_)[0]),9,vM)):(s.openBlock(),s.createElementBlock("span",gM,s.toDisplayString(_),1)),S!==k.body.evidence.length-1?(s.openBlock(),s.createElementBlock("span",mM,", ")):s.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[yM,s.createTextVNode(" "+s.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),t.authenticated||i.offlineAnnotationEnabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[i.isEditable?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(c,{class:"dialog-spacer"}),t.editing?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[bM]),_:1}),i.isDeleted?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[wM]),_:1}),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidence,(k,E)=>(s.openBlock(),s.createBlock(c,{key:k},{default:s.withCtx(()=>[s.createVNode(y,{span:20},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.evidence[E]),1)]),_:2},1024),s.createVNode(y,{span:4},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(m,{onClick:_=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(C,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.evidencePrefixes,k=>(s.openBlock(),s.createBlock(b,{key:k.label,value:k.value},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(y,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),s.createVNode(c,null,{default:s.withCtx(()=>[CM]),_:1}),s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(C,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),s.createVNode(c,{class:"dialog-text"},{default:s.withCtx(()=>[s.createVNode(o,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:s.withCtx(()=>[s.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(f,{class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(v,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(s.openBlock(),s.createBlock(f,{key:0,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(s.openBlock(),s.createBlock(f,{key:1,class:"standard-icon"},{default:s.withCtx(()=>[s.createVNode(g,{onClick:i.submit},null,8,["onClick"])]),_:1})):s.createCommentVNode("",!0)]),_:1})),t.errorMessage?(s.openBlock(),s.createBlock(c,{key:2,class:"dialog-text"},{default:s.withCtx(()=>[s.createElementVNode("strong",EM,s.toDisplayString(t.errorMessage),1)]),_:1})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)])]),_:1})}const S0=qt(oM,[["render",xM],["__scopeId","data-v-2a2f8754"]]),kM={name:"CreateTooltipContent",components:{Autocomplete:Ky,Button:Bt,Col:Mi,Container:ls,Header:v0,Input:Pi,Main:Tc},props:{createData:{type:Object,default:{drawingBox:!1,renaming:!1,toBeConfirmed:!1,points:[],tempGroupName:void 0,shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1,regionPrefix:"__annotation"}}},watch:{"createData.shape":{handler:function(t,e){this.group=this.createData.tempGroupName?this.createData.tempGroupName:"",e!==void 0&&this.$emit("cancel-create")},immediate:!0},"createData.tempGroupName":{handler:function(t){this.group=t||""},immediate:!0}},computed:{canBeConfirmed:function(){if(this.createData.editingIndex>-1)return!0;if(this.group)if(this.renaming){if(this.group!==this.createData.tempGroupName)return!0}else return!0;return!1},confirmText:function(){return this.createData.editingIndex>-1?"Edit":this.createData.renaming?"Rename":this.createData.toBeDeleted?"Delete":"Confirm"},creating:function(){return!(this.createData.editingIndex>-1||this.createData.renaming||this.createData.toBeDeleted)},dialogTitle:function(){const t=this.confirmText;return this.createData.toBeDeleted||this.createData.renaming?t:`${t} ${this.createData.shape}`},targetRegion:function(){return"regionPrefix"in this.createData?this.createData.regionPrefix:""}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:this.targetRegion+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex,renaming:this.createData.renaming,deleting:this.createData.toBeDeleted}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")},fetchRegionSuggestions:function(t,e){e([]),this.$emit("create-region-suggestions",{term:t,cb:e})},fetchGroupSuggestions:function(t,e){e([]),this.$emit("create-group-suggestions",{term:t,cb:e,region:this.region})}}},SM=t=>(s.pushScopeId("data-v-1f36d377"),t=t(),s.popScopeId(),t),_M={key:0,class:"create-text"},TM={class:"suggested-value"},NM={class:"suggested-value"},IM=SM(()=>s.createElementVNode("div",{class:"warning-message"}," Group must be enterd before this action can be confirmed. ",-1));function BM(t,e,r,n,a,i){const o=v0,l=Mi,u=os,c=Ky,d=Bt,f=Tc,h=ls;return s.openBlock(),s.createBlock(h,{class:"create-container"},{default:s.withCtx(()=>[s.createVNode(o,{height:"30px",class:"header"},{default:s.withCtx(()=>[s.createElementVNode("div",null,s.toDisplayString(i.dialogTitle),1)]),_:1}),s.createVNode(f,{class:"slides-block"},{default:s.withCtx(()=>[i.creating&&i.targetRegion?(s.openBlock(),s.createElementBlock("span",_M,s.toDisplayString(`Primitives will be created in the ${i.targetRegion} region`),1)):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(u,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Position: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.createData.points,({value:v,i:p})=>(s.openBlock(),s.createBlock(u,{key:p,class:"value"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(p),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[s.vShow,t.showPoint]]),s.createVNode(u,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Region: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(c,{class:"autocomplete-box","fit-input-width":!0,modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:i.targetRegion,"fetch-suggestions":i.fetchRegionSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",TM,s.toDisplayString(v.value),1)]),_:1},8,["modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),s.createVNode(u,{class:"row"},{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:8},{default:s.withCtx(()=>[s.createTextVNode(" Group: ")]),_:1}),s.createVNode(l,{offset:0,span:16},{default:s.withCtx(()=>[s.createVNode(c,{class:"autocomplete-box",disabled:r.createData.editingIndex>-1||r.createData.toBeDeleted,"fit-input-width":!0,modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:r.createData.shape,"fetch-suggestions":i.fetchGroupSuggestions,teleported:!0,"popper-class":"autocomplete-popper"},{default:s.withCtx(({item:v})=>[s.createElementVNode("div",NM,s.toDisplayString(v.value),1)]),_:1},8,["disabled","modelValue","placeholder","fetch-suggestions"])]),_:1})]),_:1}),i.canBeConfirmed?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(u,{key:1,class:"row"},{default:s.withCtx(()=>[IM]),_:1})),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.confirm,disabled:!i.canBeConfirmed},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.confirmText),1)]),_:1},8,["onClick","disabled"])]),_:1}),s.createVNode(l,{offset:0,span:12},{default:s.withCtx(()=>[s.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const DM=qt(kM,[["render",BM],["__scopeId","data-v-1f36d377"]]);function ht(t){"@babel/helpers - typeof";return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ht(t)}function Pc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AM(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rc(t,e,r){return e&&AM(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t,e){return OM(t)||PM(t,e)||T0(t,e)||RM()}function OM(t){if(Array.isArray(t))return t}function PM(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,o,l;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(n.push(o.value),!(e&&n.length===e));a=!0);}catch(u){i=!0,l=u}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function T0(t,e){if(t){if(typeof t=="string")return N0(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N0(t,e)}}function N0(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function RM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=T0(t))||e){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,l;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return i=u.done,u},e:function(u){o=!0,l=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(o)throw l}}}}var pt=typeof window>"u"?null:window,B0=pt?pt.navigator:null;pt&&pt.document;var LM=ht(""),D0=ht({}),MM=ht(function(){}),FM=typeof HTMLElement>"u"?"undefined":ht(HTMLElement),Hi=function(e){return e&&e.instanceString&&Je(e.instanceString)?e.instanceString():null},Ee=function(e){return e!=null&&ht(e)==LM},Je=function(e){return e!=null&&ht(e)===MM},Ke=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Pe=function(e){return e!=null&&ht(e)===D0&&!Ke(e)&&e.constructor===Object},$M=function(e){return e!=null&&ht(e)===D0},de=function(e){return e!=null&&ht(e)===ht(1)&&!isNaN(e)},VM=function(e){return de(e)&&Math.floor(e)===e},hs=function(e){if(FM!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return Ki(e)||A0(e)},Ki=function(e){return Hi(e)==="collection"&&e._private.single},A0=function(e){return Hi(e)==="collection"&&!e._private.single},Lc=function(e){return Hi(e)==="core"},O0=function(e){return Hi(e)==="stylesheet"},qM=function(e){return Hi(e)==="event"},yn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},zM=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},HM=function(e){return Pe(e)&&de(e.x1)&&de(e.x2)&&de(e.y1)&&de(e.y2)},KM=function(e){return $M(e)&&Je(e.then)},GM=function(){return B0&&B0.userAgent.match(/msie|trident|edge/i)},Gi=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function a(){var i=this,o=arguments,l,u=r.apply(i,o),c=a.cache;return(l=c[u])||(l=c[u]=e.apply(i,o)),l};return n.cache={},n},Mc=Gi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ps=Gi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),P0=Gi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),R0=function(e){return yn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",UM="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",WM="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",jM="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",YM="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",ZM="\\#[0-9a-fA-F]{3}",XM="\\#[0-9a-fA-F]{6}",L0=function(e,r){return e<r?-1:e>r?1:0},JM=function(e,r){return-1*L0(e,r)},Te=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];t[o]=n[o]}}return t},QM=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,o=16;return r?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},eF=function(e){var r,n,a,i,o,l,u,c;function d(p,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(g-p)*6*y:y<1/2?g:y<2/3?p+(g-p)*(2/3-y)*6:p}var f=new RegExp("^"+jM+"$").exec(e);if(f){if(n=parseInt(f[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)l=u=c=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,v=2*i-h;l=Math.round(255*d(v,h,n+1/3)),u=Math.round(255*d(v,h,n)),c=Math.round(255*d(v,h,n-1/3))}r=[l,u,c,o]}return r},tF=function(e){var r,n=new RegExp("^"+UM+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var l=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(l&&!u)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;r.push(c)}}return r},rF=function(e){return aF[e.toLowerCase()]},nF=function(e){return(Ke(e)?e:null)||rF(e)||QM(e)||tF(e)||eF(e)},aF={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},M0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Pe(o))throw Error("Tried to set map with object key");i<n.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},F0=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(Pe(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r};function iF(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Xn=iF,Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oF(t,e){return e={exports:{}},t(e,e.exports),e.exports}var sF=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,lF=sF,cF=typeof self=="object"&&self&&self.Object===Object&&self,uF=lF||cF||Function("return this")(),vs=uF,dF=function(){return vs.Date.now()},Fc=dF,fF=/\s/;function hF(t){for(var e=t.length;e--&&fF.test(t.charAt(e)););return e}var pF=hF,vF=/^\s+/;function gF(t){return t&&t.slice(0,pF(t)+1).replace(vF,"")}var mF=gF,yF=vs.Symbol,Ma=yF,$0=Object.prototype,bF=$0.hasOwnProperty,wF=$0.toString,Wi=Ma?Ma.toStringTag:void 0;function CF(t){var e=bF.call(t,Wi),r=t[Wi];try{t[Wi]=void 0;var n=!0}catch{}var a=wF.call(t);return n&&(e?t[Wi]=r:delete t[Wi]),a}var EF=CF,xF=Object.prototype,kF=xF.toString;function SF(t){return kF.call(t)}var _F=SF,TF="[object Null]",NF="[object Undefined]",V0=Ma?Ma.toStringTag:void 0;function IF(t){return t==null?t===void 0?NF:TF:V0&&V0 in Object(t)?EF(t):_F(t)}var q0=IF;function BF(t){return t!=null&&typeof t=="object"}var DF=BF,AF="[object Symbol]";function OF(t){return typeof t=="symbol"||DF(t)&&q0(t)==AF}var ji=OF,z0=NaN,PF=/^[-+]0x[0-9a-f]+$/i,RF=/^0b[01]+$/i,LF=/^0o[0-7]+$/i,MF=parseInt;function FF(t){if(typeof t=="number")return t;if(ji(t))return z0;if(Xn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=mF(t);var r=RF.test(t);return r||LF.test(t)?MF(t.slice(2),r?2:8):PF.test(t)?z0:+t}var H0=FF,$F="Expected a function",VF=Math.max,qF=Math.min;function zF(t,e,r){var n,a,i,o,l,u,c=0,d=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError($F);e=H0(e)||0,Xn(r)&&(d=!!r.leading,f="maxWait"in r,i=f?VF(H0(r.maxWait)||0,e):i,h="trailing"in r?!!r.trailing:h);function v(k){var E=n,_=a;return n=a=void 0,c=k,o=t.apply(_,E),o}function p(k){return c=k,l=setTimeout(m,e),d?v(k):o}function g(k){var E=k-u,_=k-c,S=e-E;return f?qF(S,i-_):S}function y(k){var E=k-u,_=k-c;return u===void 0||E>=e||E<0||f&&_>=i}function m(){var k=Fc();if(y(k))return b(k);l=setTimeout(m,g(k))}function b(k){return l=void 0,h&&n?v(k):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),c=0,n=u=a=l=void 0}function C(){return l===void 0?o:b(Fc())}function x(){var k=Fc(),E=y(k);if(n=arguments,a=this,u=k,E){if(l===void 0)return p(u);if(f)return clearTimeout(l),l=setTimeout(m,e),v(u)}return l===void 0&&(l=setTimeout(m,e)),o}return x.cancel=w,x.flush=C,x}var gs=zF,$c=pt?pt.performance:null,K0=$c&&$c.now?function(){return $c.now()}:function(){return Date.now()},HF=function(){if(pt){if(pt.requestAnimationFrame)return function(t){pt.requestAnimationFrame(t)};if(pt.mozRequestAnimationFrame)return function(t){pt.mozRequestAnimationFrame(t)};if(pt.webkitRequestAnimationFrame)return function(t){pt.webkitRequestAnimationFrame(t)};if(pt.msRequestAnimationFrame)return function(t){pt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(K0())},1e3/60)}}(),ms=function(e){return HF(e)},Zr=K0,Fa=9261,G0=65599,Yi=5381,U0=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fa,n=r,a;a=e.next(),!a.done;)n=n*G0+a.value|0;return n},Zi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fa;return r*G0+e|0},Xi=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yi;return(r<<5)+r+e|0},KF=function(e,r){return e*2097152+r},bn=function(e){return e[0]*2097152+e[1]},ys=function(e,r){return[Zi(e[0],r[0]),Xi(e[1],r[1])]},GF=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return U0(o,r)},Jn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return U0(o,r)},W0=function(){return UF(arguments)},UF=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=Jn(a):r=Jn(a,r)}return r},j0=!0,WF=console.warn!=null,jF=console.trace!=null,Vc=Number.MAX_SAFE_INTEGER||9007199254740991,Y0=function(){return!0},bs=function(){return!1},Z0=function(){return 0},qc=function(){},Qe=function(e){throw new Error(e)},X0=function(e){if(e!==void 0)j0=!!e;else return j0},$e=function(e){X0()&&(WF?console.warn(e):(console.log(e),jF&&console.trace()))},YF=function(e){return Te({},e)},Nr=function(e){return e==null?e:Ke(e)?e.slice():Pe(e)?YF(e):e},ZF=function(e){return e.slice()},J0=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},XF={},Q0=function(){return XF},St=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var o=r[i],l=n==null?void 0:n[o];a[o]=l===void 0?e[o]:l}return a}},wn=function(e,r,n){for(var a=e.length-1;a>=0;a--)e[a]===r&&e.splice(a,1)},zc=function(e){e.splice(0,e.length)},JF=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},gr=function(e,r,n){return n&&(r=P0(n,r)),e[r]},Cn=function(e,r,n,a){n&&(r=P0(n,r)),e[r]=a},QF=function(){function t(){Pc(this,t),this._obj={}}return Rc(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),Ir=typeof Map<"u"?Map:QF,e5="undefined",t5=function(){function t(e){if(Pc(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Rc(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t}(),$a=(typeof Set>"u"?"undefined":ht(Set))!==e5?Set:t5,ws=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Lc(e)){Qe("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Qe("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new $a,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,l=e.pan(),u=e.zoom();i.position={x:(o.x-l.x)/u,y:(o.y-l.y)/u}}var c=[];Ke(r.classes)?c=r.classes:Ee(r.classes)&&(c=r.classes.split(/\s+/));for(var d=0,f=c.length;d<f;d++){var h=c[d];!h||h===""||i.classes.add(h)}this.createEmitter();var v=r.style||r.css;v&&($e("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(n===void 0||n)&&this.restore()},eb=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;Pe(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Je(a)?a:i,a=Je(a)?a:function(){};for(var l=this._private.cy,u=n=Ee(n)?this.filter(n):n,c=[],d=[],f={},h={},v={},p=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<u.length;w++){var C=u[w],x=C.id();C.isNode()&&(c.unshift(C),e.bfs&&(v[x]=!0,d.push(C)),h[x]=0)}for(var k=function(){var A=e.bfs?c.shift():c.pop(),D=A.id();if(e.dfs){if(v[D])return"continue";v[D]=!0,d.push(A)}var R=h[D],O=f[D],M=O!=null?O.source():null,P=O!=null?O.target():null,z=O==null?void 0:A.same(M)?P[0]:M[0],W=void 0;if(W=a(A,O,z,p++,R),W===!0)return g=A,"break";if(W===!1)return"break";for(var H=A.connectedEdges().filter(function(q){return(!i||q.source().same(A))&&b.has(q)}),G=0;G<H.length;G++){var X=H[G],F=X.connectedNodes().filter(function(q){return!q.same(A)&&m.has(q)}),V=F.id();F.length!==0&&!v[V]&&(F=F[0],c.push(F),e.bfs&&(v[V]=!0,d.push(F)),f[V]=X,h[V]=h[D]+1)}};c.length!==0;){var E=k();if(E!=="continue"&&E==="break")break}for(var _=l.collection(),S=0;S<d.length;S++){var T=d[S],N=f[T.id()];N!=null&&_.push(N),_.push(T)}return{path:l.collection(_),found:l.collection(g)}}},Ji={breadthFirstSearch:eb({bfs:!0}),depthFirstSearch:eb({dfs:!0})};Ji.bfs=Ji.breadthFirstSearch,Ji.dfs=Ji.depthFirstSearch;var r5=oF(function(t,e){(function(){var r,n,a,i,o,l,u,c,d,f,h,v,p,g,y;a=Math.floor,f=Math.min,n=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,x){var k;if(w==null&&(w=0),x==null&&(x=n),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)k=a((w+C)/2),x(b,m[k])<0?C=k:w=k+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=n),m.push(b),g(m,0,m.length-1,w)},o=function(m,b){var w,C;return b==null&&(b=n),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},c=function(m,b,w){var C;return w==null&&(w=n),C=m[0],m[0]=b,y(m,0,w),C},u=function(m,b,w){var C;return w==null&&(w=n),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,x,k,E,_;for(b==null&&(b=n),k=(function(){_=[];for(var S=0,T=a(m.length/2);0<=T?S<T:S>T;0<=T?S++:S--)_.push(S);return _}).apply(this).reverse(),E=[],C=0,x=k.length;C<x;C++)w=k[C],E.push(y(m,w,b));return E},p=function(m,b,w){var C;if(w==null&&(w=n),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},h=function(m,b,w){var C,x,k,E,_;if(w==null&&(w=n),x=m.slice(0,b),!x.length)return x;for(i(x,w),_=m.slice(b),k=0,E=_.length;k<E;k++)C=_[k],u(x,C,w);return x.sort(w).reverse()},v=function(m,b,w){var C,x,k,E,_,S,T,N,B;if(w==null&&(w=n),b*10<=m.length){if(k=m.slice(0,b).sort(w),!k.length)return k;for(x=k[k.length-1],T=m.slice(b),E=0,S=T.length;E<S;E++)C=T[E],w(C,x)<0&&(d(k,C,0,null,w),k.pop(),x=k[k.length-1]);return k}for(i(m,w),B=[],_=0,N=f(b,m.length);0<=N?_<N:_>N;0<=N?++_:--_)B.push(o(m,w));return B},g=function(m,b,w,C){var x,k,E;for(C==null&&(C=n),x=m[w];w>b;){if(E=w-1>>1,k=m[E],C(x,k)<0){m[w]=k,w=E;continue}break}return m[w]=x},y=function(m,b,w){var C,x,k,E,_;for(w==null&&(w=n),x=m.length,_=b,k=m[b],C=2*b+1;C<x;)E=C+1,E<x&&!(w(m[C],m[E])<0)&&(C=E),m[b]=m[C],b=C,C=2*b+1;return m[b]=k,g(m,_,b,w)},r=function(){m.push=l,m.pop=o,m.replace=c,m.pushpop=u,m.heapify=i,m.updateItem=p,m.nlargest=h,m.nsmallest=v;function m(b){this.cmp=b??n,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return o(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return c(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return p(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return r})}).call(Ui)}),Qi=r5,n5=St({root:null,weight:function(e){return 1},directed:!1}),a5={dijkstra:function(e){if(!Pe(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=n5(e),a=n.root,i=n.weight,o=n.directed,l=this,u=i,c=Ee(a)?this.filter(a)[0]:a[0],d={},f={},h={},v=this.byGroup(),p=v.nodes,g=v.edges;g.unmergeBy(function(R){return R.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,M){d[O.id()]=M,b.updateItem(O)},b=new Qi(function(R,O){return y(R)-y(O)}),w=0;w<p.length;w++){var C=p[w];d[C.id()]=C.same(c)?0:1/0,b.push(C)}for(var x=function(O,M){for(var P=(o?O.edgesTo(M):O.edgesWith(M)).intersect(g),z=1/0,W,H=0;H<P.length;H++){var G=P[H],X=u(G);(X<z||!W)&&(z=X,W=G)}return{edge:W,dist:z}};b.size()>0;){var k=b.pop(),E=y(k),_=k.id();if(h[_]=E,E!==1/0)for(var S=k.neighborhood().intersect(p),T=0;T<S.length;T++){var N=S[T],B=N.id(),A=x(k,N),D=E+A.dist;D<y(N)&&(m(N,D),f[B]={node:k,edge:A.edge})}}return{distanceTo:function(O){var M=Ee(O)?p.filter(O)[0]:O[0];return h[M.id()]},pathTo:function(O){var M=Ee(O)?p.filter(O)[0]:O[0],P=[],z=M,W=z.id();if(M.length>0)for(P.unshift(M);f[W];){var H=f[W];P.unshift(H.edge),P.unshift(H.node),z=H.node,W=z.id()}return l.spawn(P)}}}},i5={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,o=new Array(i),l=n,u=function(C){for(var x=0;x<o.length;x++){var k=o[x];if(k.has(C))return x}},c=0;c<i;c++)o[c]=this.spawn(n[c]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var h=d[f],v=h.source()[0],p=h.target()[0],g=u(v),y=u(p),m=o[g],b=o[y];g!==y&&(l.merge(h),m.merge(b),o.splice(y,1))}return l}},o5=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),s5={aStar:function(e){var r=this.cy(),n=o5(e),a=n.root,i=n.goal,o=n.heuristic,l=n.directed,u=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var c=a.id(),d=i.id(),f={},h={},v={},p=new Qi(function(W,H){return h[W.id()]-h[H.id()]}),g=new $a,y={},m={},b=function(H,G){p.push(H),g.add(G)},w,C,x=function(){w=p.pop(),C=w.id(),g.delete(C)},k=function(H){return g.has(H)};b(a,c),f[c]=0,h[c]=o(a);for(var E=0;p.size()>0;){if(x(),E++,C===d){for(var _=[],S=i,T=d,N=m[T];_.unshift(S),N!=null&&_.unshift(N),S=y[T],S!=null;)T=S.id(),N=m[T];return{found:!0,distance:f[C],path:this.spawn(_),steps:E}}v[C]=!0;for(var B=w._private.edges,A=0;A<B.length;A++){var D=B[A];if(this.hasElementWithId(D.id())&&!(l&&D.data("source")!==C)){var R=D.source(),O=D.target(),M=R.id()!==C?R:O,P=M.id();if(this.hasElementWithId(P)&&!v[P]){var z=f[C]+u(D);if(!k(P)){f[P]=z,h[P]=z+o(M),b(M,P),y[P]=w,m[P]=D;continue}z<f[P]&&(f[P]=z,h[P]=z+o(M),y[P]=w,m[P]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},l5=St({weight:function(e){return 1},directed:!1}),c5={floydWarshall:function(e){for(var r=this.cy(),n=l5(e),a=n.weight,i=n.directed,o=a,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=d*d,h=function(X){return u.indexOf(X)},v=function(X){return u[X]},p=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?p[g]=0:p[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<c.length;C++){var x=c[C],k=x.source()[0],E=x.target()[0];if(k!==E){var _=h(k),S=h(E),T=_*d+S,N=o(x);if(p[T]>N&&(p[T]=N,b[T]=S,w[T]=x),!i){var B=S*d+_;!i&&p[B]>N&&(p[B]=N,b[B]=_,w[B]=x)}}}for(var A=0;A<d;A++)for(var D=0;D<d;D++)for(var R=D*d+A,O=0;O<d;O++){var M=D*d+O,P=A*d+O;p[R]+p[P]<p[M]&&(p[M]=p[R]+p[P],b[M]=b[R])}var z=function(X){return(Ee(X)?r.filter(X):X)[0]},W=function(X){return h(z(X))},H={distance:function(X,F){var V=W(X),q=W(F);return p[V*d+q]},path:function(X,F){var V=W(X),q=W(F),$=v(V);if(V===q)return $.collection();if(b[V*d+q]==null)return r.collection();var K=r.collection(),L=V,j;for(K.merge($);V!==q;)L=V,V=b[V*d+q],j=w[L*d+V],K.merge(j),K.merge(v(V));return K}};return H}},u5=St({weight:function(e){return 1},directed:!1,root:null}),d5={bellmanFord:function(e){var r=this,n=u5(e),a=n.weight,i=n.directed,o=n.root,l=a,u=this,c=this.cy(),d=this.byGroup(),f=d.edges,h=d.nodes,v=h.length,p=new Ir,g=!1,y=[];o=c.collection(o)[0],f.unmergeBy(function(ie){return ie.isLoop()});for(var m=f.length,b=function(fe){var pe=p.get(fe.id());return pe||(pe={},p.set(fe.id(),pe)),pe},w=function(fe){return(Ee(fe)?c.$(fe):fe)[0]},C=function(fe){return b(w(fe)).dist},x=function(fe){for(var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Ae=w(fe),Ie=[],we=Ae;;){if(we==null)return r.spawn();var ke=b(we),re=ke.edge,I=ke.pred;if(Ie.unshift(we[0]),we.same(pe)&&Ie.length>0)break;re!=null&&Ie.unshift(re),we=I}return u.spawn(Ie)},k=0;k<v;k++){var E=h[k],_=b(E);E.same(o)?_.dist=0:_.dist=1/0,_.pred=null,_.edge=null}for(var S=!1,T=function(fe,pe,Ae,Ie,we,ke){var re=Ie.dist+ke;re<we.dist&&!Ae.same(Ie.edge)&&(we.dist=re,we.pred=fe,we.edge=Ae,S=!0)},N=1;N<v;N++){S=!1;for(var B=0;B<m;B++){var A=f[B],D=A.source(),R=A.target(),O=l(A),M=b(D),P=b(R);T(D,R,A,M,P,O),i||T(R,D,A,P,M,O)}if(!S)break}if(S)for(var z=[],W=0;W<m;W++){var H=f[W],G=H.source(),X=H.target(),F=l(H),V=b(G).dist,q=b(X).dist;if(V+F<q||!i&&q+F<V)if(g||($e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var $=[];V+F<q&&$.push(G),!i&&q+F<V&&$.push(X);for(var K=$.length,L=0;L<K;L++){var j=$[L],Y=[j];Y.push(b(j).edge);for(var se=b(j).pred;Y.indexOf(se)===-1;)Y.push(se),Y.push(b(se).edge),se=b(se).pred;Y=Y.slice(Y.indexOf(se));for(var ce=Y[0].id(),ae=0,ne=2;ne<Y.length;ne+=2)Y[ne].id()<ce&&(ce=Y[ne].id(),ae=ne);Y=Y.slice(ae).concat(Y.slice(0,ae)),Y.push(Y[0]);var ue=Y.map(function(ie){return ie.id()}).join(",");z.indexOf(ue)===-1&&(y.push(u.spawn(Y)),z.push(ue))}}else break}return{distanceTo:C,pathTo:x,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},f5=Math.sqrt(2),h5=function(e,r,n){n.length===0&&Qe("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],l=r[i],u=r[o],c=n,d=c.length-1;d>=0;d--){var f=c[d],h=f[1],v=f[2];(r[h]===l&&r[v]===u||r[h]===u&&r[v]===l)&&c.splice(d,1)}for(var p=0;p<c.length;p++){var g=c[p];g[1]===u?(c[p]=g.slice(),c[p][1]=l):g[2]===u&&(c[p]=g.slice(),c[p][2]=l)}for(var y=0;y<r.length;y++)r[y]===u&&(r[y]=l);return c},Hc=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=h5(i,e,r),n--}return r},p5={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(P){return P.isLoop()});var i=n.length,o=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/f5);if(i<2){Qe("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d<o;d++){var f=a[d];c.push([d,n.indexOf(f.source()),n.indexOf(f.target())])}for(var h=1/0,v=[],p=new Array(i),g=new Array(i),y=new Array(i),m=function(z,W){for(var H=0;H<i;H++)W[H]=z[H]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=Hc(g,c.slice(),i,u),x=C.slice();m(g,y);var k=Hc(g,C,u,2),E=Hc(y,x,u,2);k.length<=E.length&&k.length<h?(h=k.length,v=k,m(g,p)):E.length<=k.length&&E.length<h&&(h=E.length,v=E,m(y,p))}for(var _=this.spawn(v.map(function(P){return a[P[0]]})),S=this.spawn(),T=this.spawn(),N=p[0],B=0;B<p.length;B++){var A=p[B],D=n[B];A===N?S.merge(D):T.merge(D)}var R=function(z){var W=e.spawn();return z.forEach(function(H){W.merge(H),H.connectedEdges().forEach(function(G){e.contains(G)&&!_.contains(G)&&W.merge(G)})}),W},O=[R(S),R(T)],M={cut:_,components:O,partition1:S,partition2:T};return M}},v5=function(e){return{x:e.x,y:e.y}},Cs=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},tb=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Va=function(e){return{x:e[0],y:e[1]}},g5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},m5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},y5=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=r;o<n;o++){var l=e[o];isFinite(l)&&(a+=l,i++)}return a/i},b5=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var l=0,u=e.length-1;u>=0;u--){var c=e[u];o?isFinite(c)||(e[u]=-1/0,l++):e.splice(u,1)}i&&e.sort(function(h,v){return h-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},w5=function(e){return Math.PI*e/180},Es=function(e,r){return Math.atan2(r,e)-Math.PI/2},Kc=Math.log2||function(t){return Math.log(t)/Math.log(2)},rb=function(e){return e>0?1:e<0?-1:0},Qn=function(e,r){return Math.sqrt(ea(e,r))},ea=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},C5=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},bt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},qa=function(e,r,n,a){return{x:bt(e.x,r.x,n.x,a),y:bt(e.y,r.y,n.y,a)}},E5=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},o=Qn(e,r),l={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+l.x*a,y:e.y+l.y*a}},eo=function(e,r,n){return Math.max(e,Math.min(n,r))},Gt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},x5=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},k5=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},S5=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},nb=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},_5=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},xs=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ks=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(r.length===1)n=a=i=o=r[0];else if(r.length===2)n=i=r[0],o=a=r[1];else if(r.length===4){var l=vr(r,4);n=l[0],a=l[1],i=l[2],o=l[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ab=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Gc=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},za=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},T5=function(e,r){return za(e,r.x,r.y)},ib=function(e,r){return za(e,r.x1,r.y1)&&za(e,r.x2,r.y2)},ob=function(e,r,n,a,i,o,l){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=u==="auto"?ra(i,o):u,d=i/2,f=o/2;c=Math.min(c,d,f);var h=c!==d,v=c!==f,p;if(h){var g=n-d+c-l,y=a-f-l,m=n+d-c+l,b=y;if(p=En(e,r,n,a,g,y,m,b,!1),p.length>0)return p}if(v){var w=n+d+l,C=a-f+c-l,x=w,k=a+f-c+l;if(p=En(e,r,n,a,w,C,x,k,!1),p.length>0)return p}if(h){var E=n-d+c-l,_=a+f+l,S=n+d-c+l,T=_;if(p=En(e,r,n,a,E,_,S,T,!1),p.length>0)return p}if(v){var N=n-d-l,B=a-f+c-l,A=N,D=a+f-c+l;if(p=En(e,r,n,a,N,B,A,D,!1),p.length>0)return p}var R;{var O=n-d+c,M=a-f+c;if(R=to(e,r,n,a,O,M,c+l),R.length>0&&R[0]<=O&&R[1]<=M)return[R[0],R[1]]}{var P=n+d-c,z=a-f+c;if(R=to(e,r,n,a,P,z,c+l),R.length>0&&R[0]>=P&&R[1]<=z)return[R[0],R[1]]}{var W=n+d-c,H=a+f-c;if(R=to(e,r,n,a,W,H,c+l),R.length>0&&R[0]>=W&&R[1]>=H)return[R[0],R[1]]}{var G=n-d+c,X=a+f-c;if(R=to(e,r,n,a,G,X,c+l),R.length>0&&R[0]<=G&&R[1]>=X)return[R[0],R[1]]}return[]},N5=function(e,r,n,a,i,o,l){var u=l,c=Math.min(n,i),d=Math.max(n,i),f=Math.min(a,o),h=Math.max(a,o);return c-u<=e&&e<=d+u&&f-u<=r&&r<=h+u},I5=function(e,r,n,a,i,o,l,u,c){var d={x1:Math.min(n,l,i)-c,x2:Math.max(n,l,i)+c,y1:Math.min(a,u,o)-c,y2:Math.max(a,u,o)+c};return!(e<d.x1||e>d.x2||r<d.y1||r>d.y2)},B5=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var o=Math.sqrt(i),l=2*e,u=(-r+o)/l,c=(-r-o)/l;return[u,c]},D5=function(e,r,n,a,i){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var l,u,c,d,f,h,v,p;if(u=(3*n-r*r)/9,c=-(27*a)+r*(9*n-2*(r*r)),c/=54,l=u*u*u+c*c,i[1]=0,v=r/3,l>0){f=c+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),h=c-Math.sqrt(l),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-v+f+h,v+=(f+h)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-h+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){p=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-v+2*p,i[4]=i[2]=-(p+v);return}u=-u,d=u*u*u,d=Math.acos(c/Math.sqrt(d)),p=2*Math.sqrt(u),i[0]=-v+p*Math.cos(d/3),i[2]=-v+p*Math.cos((d+2*Math.PI)/3),i[4]=-v+p*Math.cos((d+4*Math.PI)/3)},A5=function(e,r,n,a,i,o,l,u){var c=1*n*n-4*n*i+2*n*l+4*i*i-4*i*l+l*l+a*a-4*a*o+2*a*u+4*o*o-4*o*u+u*u,d=1*9*n*i-3*n*n-3*n*l-6*i*i+3*i*l+9*a*o-3*a*a-3*a*u-6*o*o+3*o*u,f=1*3*n*n-6*n*i+n*l-n*e+2*i*i+2*i*e-l*e+3*a*a-6*a*o+a*u-a*r+2*o*o+2*o*r-u*r,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*r-o*r,v=[];D5(c,d,f,h,v);for(var p=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<p&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,x=0;x<g.length;x++)b=Math.pow(1-g[x],2)*n+2*(1-g[x])*g[x]*i+g[x]*g[x]*l,w=Math.pow(1-g[x],2)*a+2*(1-g[x])*g[x]*o+g[x]*g[x]*u,C=Math.pow(b-e,2)+Math.pow(w-r,2),m>=0?C<m&&(m=C):m=C;return m},O5=function(e,r,n,a,i,o){var l=[e-n,r-a],u=[i-n,o-a],c=u[0]*u[0]+u[1]*u[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*u[0]+l[1]*u[1],h=f*f/c;return f<0?d:h>c?(e-i)*(e-i)+(r-o)*(r-o):d-h},Ut=function(e,r,n){for(var a,i,o,l,u,c=0,d=0;d<n.length/2;d++)if(a=n[d*2],i=n[d*2+1],d+1<n.length/2?(o=n[(d+1)*2],l=n[(d+1)*2+1]):(o=n[(d+1-n.length/2)*2],l=n[(d+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)u=(e-a)/(o-a)*(l-i)+i,u>r&&c++;else continue;return c%2!==0},Xr=function(e,r,n,a,i,o,l,u,c){var d=new Array(n.length),f;u[0]!=null?(f=Math.atan(u[1]/u[0]),u[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=u;for(var h=Math.cos(-f),v=Math.sin(-f),p=0;p<d.length/2;p++)d[p*2]=o/2*(n[p*2]*h-n[p*2+1]*v),d[p*2+1]=l/2*(n[p*2+1]*h+n[p*2]*v),d[p*2]+=a,d[p*2+1]+=i;var g;if(c>0){var y=_s(d,-c);g=Ss(y)}else g=d;return Ut(e,r,g)},P5=function(e,r,n,a,i,o,l,u){for(var c=new Array(n.length*2),d=0;d<u.length;d++){var f=u[d];c[d*4+0]=f.startX,c[d*4+1]=f.startY,c[d*4+2]=f.stopX,c[d*4+3]=f.stopY;var h=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(h<=Math.pow(f.radius,2))return!0}return Ut(e,r,c)},Ss=function(e){for(var r=new Array(e.length/2),n,a,i,o,l,u,c,d,f=0;f<e.length/4;f++){n=e[f*4],a=e[f*4+1],i=e[f*4+2],o=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],u=e[(f+1)*4+1],c=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],u=e[1],c=e[2],d=e[3]);var h=En(n,a,i,o,l,u,c,d,!0);r[f*2]=h[0],r[f*2+1]=h[1]}return r},_s=function(e,r){for(var n=new Array(e.length*2),a,i,o,l,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],l=e[(u+1)*2+1]):(o=e[0],l=e[1]);var c=l-i,d=-(o-a),f=Math.sqrt(c*c+d*d),h=c/f,v=d/f;n[u*4]=a+h*r,n[u*4+1]=i+v*r,n[u*4+2]=o+h*r,n[u*4+3]=l+v*r}return n},R5=function(e,r,n,a,i,o){var l=n-e,u=a-r;l/=i,u/=o;var c=Math.sqrt(l*l+u*u),d=c-1;if(d<0)return[];var f=d/c;return[(n-e)*f+e,(a-r)*f+r]},ta=function(e,r,n,a,i,o,l){return e-=i,r-=o,e/=n/2+l,r/=a/2+l,e*e+r*r<=1},to=function(e,r,n,a,i,o,l){var u=[n-e,a-r],c=[e-i,r-o],d=u[0]*u[0]+u[1]*u[1],f=2*(c[0]*u[0]+c[1]*u[1]),h=c[0]*c[0]+c[1]*c[1]-l*l,v=f*f-4*d*h;if(v<0)return[];var p=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(p,g),m=Math.max(p,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*u[0]+e,C=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[w,C];var x=b[1]*u[0]+e,k=b[1]*u[1]+r;return[w,C,x,k]}else return[w,C]},Uc=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},En=function(e,r,n,a,i,o,l,u,c){var d=e-i,f=n-e,h=l-i,v=r-o,p=a-r,g=u-o,y=h*v-g*d,m=f*v-p*d,b=g*f-h*p;if(b!==0){var w=y/b,C=m/b,x=.001,k=0-x,E=1+x;return k<=w&&w<=E&&k<=C&&C<=E?[e+w*f,r+w*p]:c?[e+w*f,r+w*p]:[]}else return y===0||m===0?Uc(e,n,l)===l?[l,u]:Uc(e,n,i)===i?[i,o]:Uc(i,l,n)===n?[n,a]:[]:[]},ro=function(e,r,n,a,i,o,l,u){var c=[],d,f=new Array(n.length),h=!0;o==null&&(h=!1);var v;if(h){for(var p=0;p<f.length/2;p++)f[p*2]=n[p*2]*o+a,f[p*2+1]=n[p*2+1]*l+i;if(u>0){var g=_s(f,-u);v=Ss(g)}else v=f}else v=n;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=En(e,r,a,i,y,m,b,w),d.length!==0&&c.push(d[0],d[1]);return c},L5=function(e,r,n,a,i,o,l,u,c){var d=[],f,h=new Array(n.length*2);c.forEach(function(b,w){w===0?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[w*4-2]=b.startX,h[w*4-1]=b.startY),h[w*4]=b.stopX,h[w*4+1]=b.stopY,f=to(e,r,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<h.length/4;v++)f=En(e,r,a,i,h[v*4],h[v*4+1],h[v*4+2],h[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var p=[d[0],d[1]],g=Math.pow(p[0]-e,2)+Math.pow(p[1]-r,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-r,2);m<=g&&(p[0]=d[y*2],p[1]=d[y*2+1],g=m)}return p}return d},Ts=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=(i-n)/i;return o<0&&(o=1e-5),[r[0]+o*a[0],r[1]+o*a[1]]},zt=function(e,r){var n=Wc(e,r);return n=sb(n),n},sb=function(e){for(var r,n,a=e.length/2,i=1/0,o=1/0,l=-1/0,u=-1/0,c=0;c<a;c++)r=e[2*c],n=e[2*c+1],i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),u=Math.max(u,n);for(var d=2/(l-i),f=2/(u-o),h=0;h<a;h++)r=e[2*h]=e[2*h]*d,n=e[2*h+1]=e[2*h+1]*f,i=Math.min(i,r),l=Math.max(l,r),o=Math.min(o,n),u=Math.max(u,n);if(o<-1)for(var v=0;v<a;v++)n=e[2*v+1]=e[2*v+1]+(-1-o);return e},Wc=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),o,l=0;l<e;l++)o=l*n+a,i[2*l]=Math.cos(o),i[2*l+1]=Math.sin(-o);return i},ra=function(e,r){return Math.min(e/4,r/4,8)},lb=function(e,r){return Math.min(e/10,r/10,8)},jc=function(){return 8},M5=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Yc=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},F5=St({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),$5={pageRank:function(e){for(var r=F5(e),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight,l=this._private.cy,u=this.byGroup(),c=u.nodes,d=u.edges,f=c.length,h=f*f,v=d.length,p=new Array(h),g=new Array(f),y=(1-n)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;p[w]=0}g[m]=0}for(var C=0;C<v;C++){var x=d[C],k=x.data("source"),E=x.data("target");if(k!==E){var _=c.indexOfId(k),S=c.indexOfId(E),T=o(x),N=S*f+_;p[N]+=T,g[_]+=T}}for(var B=1/f+y,A=0;A<f;A++)if(g[A]===0)for(var D=0;D<f;D++){var R=D*f+A;p[R]=B}else for(var O=0;O<f;O++){var M=O*f+A;p[M]=p[M]/g[A]+y}for(var P=new Array(f),z=new Array(f),W,H=0;H<f;H++)P[H]=1;for(var G=0;G<i;G++){for(var X=0;X<f;X++)z[X]=0;for(var F=0;F<f;F++)for(var V=0;V<f;V++){var q=F*f+V;z[F]+=p[q]*P[V]}C5(z),W=P,P=z,z=W;for(var $=0,K=0;K<f;K++){var L=W[K]-P[K];$+=L*L}if($<a)break}var j={rank:function(se){return se=l.collection(se)[0],P[c.indexOf(se)]}};return j}},cb=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ha={degreeCentralityNormalized:function(e){e=cb(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var d={},f={},h=0,v=0,p=0;p<a;p++){var g=n[p],y=g.id();e.root=g;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return h==0?0:(Ee(w)&&(w=r.filter(w)),d[w.id()]/h)},outdegree:function(w){return v===0?0:(Ee(w)&&(w=r.filter(w)),f[w.id()]/v)}}}else{for(var i={},o=0,l=0;l<a;l++){var u=n[l];e.root=u;var c=this.degreeCentrality(e);o<c.degree&&(o=c.degree),i[u.id()]=c.degree}return{degree:function(w){return o===0?0:(Ee(w)&&(w=r.filter(w)),i[w.id()]/o)}}}},degreeCentrality:function(e){e=cb(e);var r=this.cy(),n=this,a=e,i=a.root,o=a.weight,l=a.directed,u=a.alpha;if(i=r.collection(i)[0],l){for(var v=i.connectedEdges(),p=v.filter(function(k){return k.target().same(i)&&n.has(k)}),g=v.filter(function(k){return k.source().same(i)&&n.has(k)}),y=p.length,m=g.length,b=0,w=0,C=0;C<p.length;C++)b+=o(p[C]);for(var x=0;x<g.length;x++)w+=o(g[x]);return{indegree:Math.pow(y,1-u)*Math.pow(b,u),outdegree:Math.pow(m,1-u)*Math.pow(w,u)}}else{for(var c=i.connectedEdges().intersection(n),d=c.length,f=0,h=0;h<c.length;h++)f+=o(c[h]);return{degree:Math.pow(d,1-u)*Math.pow(f,u)}}}};Ha.dc=Ha.degreeCentrality,Ha.dcn=Ha.degreeCentralityNormalised=Ha.degreeCentralityNormalized;var ub=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ka={closenessCentralityNormalized:function(e){for(var r=ub(e),n=r.harmonic,a=r.weight,i=r.directed,o=this.cy(),l={},u=0,c=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<c.length;f++){for(var h=0,v=c[f],p=0;p<c.length;p++)if(f!==p){var g=d.distance(v,c[p]);n?h+=1/g:h+=g}n||(h=1/h),u<h&&(u=h),l[v.id()]=h}return{closeness:function(m){return u==0?0:(Ee(m)?m=o.filter(m)[0].id():m=m.id(),l[m]/u)}}},closenessCentrality:function(e){var r=ub(e),n=r.root,a=r.weight,i=r.directed,o=r.harmonic;n=this.filter(n)[0];for(var l=this.dijkstra({root:n,weight:a,directed:i}),u=0,c=this.nodes(),d=0;d<c.length;d++){var f=c[d];if(!f.same(n)){var h=l.distanceTo(f);o?u+=1/h:u+=h}}return o?u:1/u}};Ka.cc=Ka.closenessCentrality,Ka.ccn=Ka.closenessCentralityNormalised=Ka.closenessCentralityNormalized;var V5=St({weight:null,directed:!1}),Zc={betweennessCentrality:function(e){for(var r=V5(e),n=r.directed,a=r.weight,i=a!=null,o=this.cy(),l=this.nodes(),u={},c={},d=0,f={set:function(w,C){c[w]=C,C>d&&(d=C)},get:function(w){return c[w]}},h=0;h<l.length;h++){var v=l[h],p=v.id();n?u[p]=v.outgoers().nodes():u[p]=v.openNeighborhood().nodes(),f.set(p,0)}for(var g=function(w){for(var C=l[w].id(),x=[],k={},E={},_={},S=new Qi(function(V,q){return _[V]-_[q]}),T=0;T<l.length;T++){var N=l[T].id();k[N]=[],E[N]=0,_[N]=1/0}for(E[C]=1,_[C]=0,S.push(C);!S.empty();){var B=S.pop();if(x.push(B),i)for(var A=0;A<u[B].length;A++){var D=u[B][A],R=o.getElementById(B),O=void 0;R.edgesTo(D).length>0?O=R.edgesTo(D)[0]:O=D.edgesTo(R)[0];var M=a(O);D=D.id(),_[D]>_[B]+M&&(_[D]=_[B]+M,S.nodes.indexOf(D)<0?S.push(D):S.updateItem(D),E[D]=0,k[D]=[]),_[D]==_[B]+M&&(E[D]=E[D]+E[B],k[D].push(B))}else for(var P=0;P<u[B].length;P++){var z=u[B][P].id();_[z]==1/0&&(S.push(z),_[z]=_[B]+1),_[z]==_[B]+1&&(E[z]=E[z]+E[B],k[z].push(B))}}for(var W={},H=0;H<l.length;H++)W[l[H].id()]=0;for(;x.length>0;){for(var G=x.pop(),X=0;X<k[G].length;X++){var F=k[G][X];W[F]=W[F]+E[F]/E[G]*(1+W[G])}G!=l[w].id()&&f.set(G,f.get(G)+W[G])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=o.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=o.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};Zc.bc=Zc.betweennessCentrality;var q5=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),z5=function(e){return q5(e)},H5=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},K5=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},db=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var o=0;o<r;o++)e[o*r+a]=e[o*r+a]/n}},G5=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var l=0;l<n;l++)for(var u=0;u<n;u++)a[i*n+u]+=e[i*n+l]*r[l*n+u]}return a},U5=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=G5(e,a,r);return e},W5=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return db(a,r),a},j5=function(e,r,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==l)return!1}return!0},Y5=function(e,r,n,a){for(var i=[],o=0;o<r;o++){for(var l=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&l.push(n[u]);l.length!==0&&i.push(a.collection(l))}return i},Z5=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},X5=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&Z5(e[r],e[n])&&e.splice(n,1);return e},fb=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=z5(e),o={},l=0;l<r.length;l++)o[r[l].id()]=l;for(var u=r.length,c=u*u,d=new Array(c),f,h=0;h<c;h++)d[h]=0;for(var v=0;v<n.length;v++){var p=n[v],g=o[p.source().id()],y=o[p.target().id()],m=H5(p,i.attributes);d[g*u+y]+=m,d[y*u+g]+=m}K5(d,u,i.multFactor),db(d,u);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=U5(d,u,i.expandFactor),d=W5(f,u,i.inflateFactor),j5(d,f,c,4)||(b=!0),w++;var C=Y5(d,u,r,a);return C=X5(C),C},J5={markovClustering:fb,mcl:fb},Q5=function(e){return e},hb=function(e,r){return Math.abs(r-e)},pb=function(e,r,n){return e+hb(r,n)},vb=function(e,r,n){return e+Math.pow(n-r,2)},e$=function(e){return Math.sqrt(e)},t$=function(e,r,n){return Math.max(e,hb(r,n))},no=function(e,r,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Q5,l=a,u,c,d=0;d<e;d++)u=r(d),c=n(d),l=i(l,u,c);return o(l)},Ga={euclidean:function(e,r,n){return e>=2?no(e,r,n,0,vb,e$):no(e,r,n,0,pb)},squaredEuclidean:function(e,r,n){return no(e,r,n,0,vb)},manhattan:function(e,r,n){return no(e,r,n,0,pb)},max:function(e,r,n){return no(e,r,n,-1/0,t$)}};Ga["squared-euclidean"]=Ga.squaredEuclidean,Ga.squaredeuclidean=Ga.squaredEuclidean;function Ns(t,e,r,n,a,i){var o;return Je(t)?o=t:o=Ga[t]||Ga.euclidean,e===0&&Je(t)?o(a,i):o(e,r,n,a,i)}var r$=St({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Xc=function(e){return r$(e)},Is=function(e,r,n,a,i){var o=i!=="kMedoids",l=o?function(f){return n[f]}:function(f){return a[f](n)},u=function(h){return a[h](r)},c=n,d=r;return Ns(e,a.length,l,u,c,d)},Jc=function(e,r,n){for(var a=n.length,i=new Array(a),o=new Array(a),l=new Array(r),u=null,c=0;c<a;c++)i[c]=e.min(n[c]).value,o[c]=e.max(n[c]).value;for(var d=0;d<r;d++){u=[];for(var f=0;f<a;f++)u[f]=Math.random()*(o[f]-i[f])+i[f];l[d]=u}return l},gb=function(e,r,n,a,i){for(var o=1/0,l=0,u=0;u<r.length;u++){var c=Is(n,e,r[u],a,i);c<o&&(o=c,l=u)}return l},mb=function(e,r,n){for(var a=[],i=null,o=0;o<r.length;o++)i=r[o],n[i.id()]===e&&a.push(i);return a},n$=function(e,r,n){return Math.abs(r-e)<=n},a$=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-r[a][i]);if(o>n)return!1}return!0},i$=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},yb=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];i$(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<r;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},bb=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=Is("manhattan",r[i],e,n,"kMedoids");return a},o$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Xc(e),o=new Array(i.k),l={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Jc(n,i.k,i.attributes)):ht(i.testCentroids)==="object"?u=i.testCentroids:u=Jc(n,i.k,i.attributes):u=Jc(n,i.k,i.attributes);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var f=0;f<n.length;f++)a=n[f],l[a.id()]=gb(a,u,i.distance,i.attributes,"kMeans");c=!1;for(var h=0;h<i.k;h++){var v=mb(h,n,l);if(v.length!==0){for(var p=i.attributes.length,g=u[h],y=new Array(p),m=new Array(p),b=0;b<p;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,n$(y[b],g[b],i.sensitivityThreshold)||(c=!0)}u[h]=y,o[h]=r.collection(v)}}d++}return o},s$=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Xc(e),o=new Array(i.k),l,u={},c,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ht(i.testCentroids)==="object"?l=i.testCentroids:l=yb(n,i.k)):l=yb(n,i.k);for(var f=!0,h=0;f&&h<i.maxIterations;){for(var v=0;v<n.length;v++)a=n[v],u[a.id()]=gb(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var p=0;p<l.length;p++){var g=mb(p,n,u);if(g.length!==0){d[p]=bb(l[p],g,i.attributes);for(var y=0;y<g.length;y++)c=bb(g[y],g,i.attributes),c<d[p]&&(d[p]=c,l[p]=g[y],f=!0);o[p]=r.collection(g)}}h++}return o},l$=function(e,r,n,a,i){for(var o,l,u=0;u<r.length;u++)for(var c=0;c<e.length;c++)a[u][c]=Math.pow(n[u][c],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){o=0,l=0;for(var h=0;h<r.length;h++)o+=a[h][d]*i.attributes[f](r[h]),l+=a[h][d];e[d][f]=o/l}},c$=function(e,r,n,a,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var l,u,c,d=2/(i.m-1),f=0;f<n.length;f++)for(var h=0;h<a.length;h++){l=0;for(var v=0;v<n.length;v++)u=Is(i.distance,a[h],n[f],i.attributes,"cmeans"),c=Is(i.distance,a[h],n[v],i.attributes,"cmeans"),l+=Math.pow(u/c,d);e[h][f]=1/l}},u$=function(e,r,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var l,u,c=0;c<r.length;c++){l=-1/0,u=-1;for(var d=0;d<r[0].length;d++)r[c][d]>l&&(l=r[c][d],u=d);i[u].push(e[c])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},wb=function(e){var r=this.cy(),n=this.nodes(),a=Xc(e),i,o,l,u,c;u=new Array(n.length);for(var d=0;d<n.length;d++)u[d]=new Array(a.k);l=new Array(n.length);for(var f=0;f<n.length;f++)l[f]=new Array(a.k);for(var h=0;h<n.length;h++){for(var v=0,p=0;p<a.k;p++)l[h][p]=Math.random(),v+=l[h][p];for(var g=0;g<a.k;g++)l[h][g]=l[h][g]/v}o=new Array(a.k);for(var y=0;y<a.k;y++)o[y]=new Array(a.attributes.length);c=new Array(n.length);for(var m=0;m<n.length;m++)c[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,l$(o,n,l,c,a),c$(l,u,o,n,a),a$(l,u,a.sensitivityThreshold)||(b=!0),w++;return i=u$(n,l,a,r),{clusters:i,degreeOfMembership:l}},d$={kMeans:o$,kMedoids:s$,fuzzyCMeans:wb,fcm:wb},f$=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),h$={single:"min",complete:"max"},p$=function(e){var r=f$(e),n=h$[r.linkage];return n!=null&&(r.linkage=n),r},Cb=function(e,r,n,a,i){for(var o=0,l=1/0,u,c=i.attributes,d=function(S,T){return Ns(i.distance,c.length,function(N){return c[N](S)},function(N){return c[N](T)},S,T)},f=0;f<e.length;f++){var h=e[f].key,v=n[h][a[h]];v<l&&(o=h,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[o],g=r[a[o]],y;i.mode==="dendrogram"?y={left:p,right:g,key:p.key}:y={value:p.value.concat(g.value),key:p.key},e[p.index]=y,e.splice(g.index,1),r[p.key]=y;for(var m=0;m<e.length;m++){var b=e[m];p.key===b.key?u=1/0:i.linkage==="min"?(u=n[p.key][b.key],n[p.key][b.key]>n[g.key][b.key]&&(u=n[g.key][b.key])):i.linkage==="max"?(u=n[p.key][b.key],n[p.key][b.key]<n[g.key][b.key]&&(u=n[g.key][b.key])):i.linkage==="mean"?u=(n[p.key][b.key]*p.size+n[g.key][b.key]*g.size)/(p.size+g.size):i.mode==="dendrogram"?u=d(b.value,p.value):u=d(b.value[0],p.value[0]),n[p.key][b.key]=n[b.key][p.key]=u}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===p.key||a[C]===g.key){for(var x=C,k=0;k<e.length;k++){var E=e[k].key;n[C][E]<n[C][x]&&(x=E)}a[C]=x}e[w].index=w}return p.key=g.key=p.index=g.index=null,!0},Bs=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},v$=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},g$=function t(e,r,n){if(!e)return[];var a=[],i=[],o=[];return r===0?(e.left&&Bs(e.left,a),e.right&&Bs(e.right,i),o=a.concat(i),[n.collection(o)]):r===1?e.value?[n.collection(e.value)]:(e.left&&Bs(e.left,a),e.right&&Bs(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},Eb=function(e){for(var r=this.cy(),n=this.nodes(),a=p$(e),i=a.attributes,o=function(w,C){return Ns(a.distance,i.length,function(x){return i[x](w)},function(x){return i[x](C)},w,C)},l=[],u=[],c=[],d=[],f=0;f<n.length;f++){var h={value:a.mode==="dendrogram"?n[f]:[n[f]],key:f,index:f};l[f]=h,d[f]=h,u[f]=[],c[f]=0}for(var v=0;v<l.length;v++)for(var p=0;p<=v;p++){var g=void 0;a.mode==="dendrogram"?g=v===p?1/0:o(l[v].value,l[p].value):g=v===p?1/0:o(l[v].value[0],l[p].value[0]),u[v][p]=g,u[p][v]=g,g<u[v][c[v]]&&(c[v]=p)}for(var y=Cb(l,d,u,c,a);y;)y=Cb(l,d,u,c,a);var m;return a.mode==="dendrogram"?(m=g$(l[0],a.dendrogramDepth,r),a.addDendrogram&&v$(l[0],r)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=r.collection(b.value)})),m},m$={hierarchicalClustering:Eb,hca:Eb},y$=St({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),b$=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||Qe("Damping must range on [0.5, 1). Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||de(n)||Qe("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),y$(e)},w$=function(e,r,n,a){var i=function(l,u){return a[u](l)};return-Ns(e,a.length,function(o){return i(r,o)},function(o){return i(n,o)},r,n)},C$=function(e,r){var n=null;return r==="median"?n=b5(e):r==="mean"?n=y5(e):r==="min"?n=g5(e):r==="max"?n=m5(e):n=r,n},E$=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},xb=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var o=-1,l=-1/0,u=0;u<n.length;u++){var c=n[u];r[i*e+c]>l&&(o=c,l=r[i*e+c])}o>0&&a.push(o)}for(var d=0;d<n.length;d++)a[n[d]]=n[d];return a},x$=function(e,r,n){for(var a=xb(e,r,n),i=0;i<n.length;i++){for(var o=[],l=0;l<a.length;l++)a[l]===n[i]&&o.push(l);for(var u=-1,c=-1/0,d=0;d<o.length;d++){for(var f=0,h=0;h<o.length;h++)f+=r[o[h]*e+o[d]];f>c&&(u=d,c=f)}n[i]=o[u]}return a=xb(e,r,n),a},kb=function(e){for(var r=this.cy(),n=this.nodes(),a=b$(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var l,u,c,d,f,h;l=n.length,u=l*l,c=new Array(u);for(var v=0;v<u;v++)c[v]=-1/0;for(var p=0;p<l;p++)for(var g=0;g<l;g++)p!==g&&(c[p*l+g]=w$(a.distance,n[p],n[g],a.attributes));d=C$(c,a.preference);for(var y=0;y<l;y++)c[y*l+y]=d;f=new Array(u);for(var m=0;m<u;m++)f[m]=0;h=new Array(u);for(var b=0;b<u;b++)h[b]=0;for(var w=new Array(l),C=new Array(l),x=new Array(l),k=0;k<l;k++)w[k]=0,C[k]=0,x[k]=0;for(var E=new Array(l*a.minIterations),_=0;_<E.length;_++)E[_]=0;var S;for(S=0;S<a.maxIterations;S++){for(var T=0;T<l;T++){for(var N=-1/0,B=-1/0,A=-1,D=0,R=0;R<l;R++)w[R]=f[T*l+R],D=h[T*l+R]+c[T*l+R],D>=N?(B=N,N=D,A=R):D>B&&(B=D);for(var O=0;O<l;O++)f[T*l+O]=(1-a.damping)*(c[T*l+O]-N)+a.damping*w[O];f[T*l+A]=(1-a.damping)*(c[T*l+A]-B)+a.damping*w[A]}for(var M=0;M<l;M++){for(var P=0,z=0;z<l;z++)w[z]=h[z*l+M],C[z]=Math.max(0,f[z*l+M]),P+=C[z];P-=C[M],C[M]=f[M*l+M],P+=C[M];for(var W=0;W<l;W++)h[W*l+M]=(1-a.damping)*Math.min(0,P-C[W])+a.damping*w[W];h[M*l+M]=(1-a.damping)*(P-C[M])+a.damping*w[M]}for(var H=0,G=0;G<l;G++){var X=h[G*l+G]+f[G*l+G]>0?1:0;E[S%a.minIterations*l+G]=X,H+=X}if(H>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var F=0,V=0;V<l;V++){x[V]=0;for(var q=0;q<a.minIterations;q++)x[V]+=E[q*l+V];(x[V]===0||x[V]===a.minIterations)&&F++}if(F===l)break}}for(var $=E$(l,f,h),K=x$(l,c,$),L={},j=0;j<$.length;j++)L[$[j]]=[];for(var Y=0;Y<n.length;Y++){var se=i[n[Y].id()],ce=K[se];ce!=null&&L[ce].push(n[Y])}for(var ae=new Array($.length),ne=0;ne<$.length;ne++)ae[ne]=r.collection(L[$[ne]]);return ae},k$={affinityPropagation:kb,ap:kb},S$=St({root:void 0,directed:!1}),_$={hierholzer:function(e){if(!Pe(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=S$(e),a=n.root,i=n.directed,o=this,l=!1,u,c,d;a&&(d=Ee(a)?this.filter(a)[0].id():a[0].id());var f={},h={};i?o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),x=b.outdegree(!0),k=C-x,E=x-C;k==1?u?l=!0:u=w:E==1?c?l=!0:c=w:(E>1||k>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(_){_.isEdge()&&f[w].push(_.id())})}else h[w]=[void 0,b.target().id()]}):o.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(u?c?l=!0:c=w:u=w),f[w]=[],b.connectedEdges().forEach(function(x){return f[w].push(x.id())})}else h[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(c&&u)if(i){if(d&&c!=d)return v;d=c}else{if(d&&c!=d&&u!=d)return v;d||(d=c)}else d||(d=o[0].id());var p=function(w){for(var C=w,x=[w],k,E,_;f[C].length;)k=f[C].shift(),E=h[k][0],_=h[k][1],C!=_?(f[_]=f[_].filter(function(S){return S!=k}),C=_):!i&&C!=E&&(f[E]=f[E].filter(function(S){return S!=k}),C=E),x.unshift(k),x.unshift(C);return x},g=[],y=[];for(y=p(d);y.length!=1;)f[y[0]].length==0?(g.unshift(o.getElementById(y.shift())),g.unshift(o.getElementById(y.shift()))):y=p(y.shift()).concat(y);g.unshift(o.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ds=function(){var e=this,r={},n=0,a=0,i=[],o=[],l={},u=function(h,v){for(var p=o.length-1,g=[],y=e.spawn();o[p].x!=h||o[p].y!=v;)g.push(o.pop().edge),p--;g.push(o.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),x=w.connectedEdges().intersection(e);y.merge(w),r[C].cutVertex?y.merge(x.filter(function(k){return k.isLoop()})):y.merge(x)})}),i.push(y)},c=function f(h,v,p){h===p&&(a+=1),r[v]={id:n,low:n++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==p&&(w=C.id(),l[w]||(l[w]=!0,o.push({x:v,y:b,edge:C})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(f(h,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,u(v,b))))})}};e.forEach(function(f){if(f.isNode()){var h=f.id();h in r||(a=0,c(h,h),r[h].cutVertex=a>1)}});var d=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},T$={hopcroftTarjanBiconnected:Ds,htbc:Ds,htb:Ds,hopcroftTarjanBiconnectedComponents:Ds},As=function(){var e=this,r={},n=0,a=[],i=[],o=e.spawn(e),l=function u(c){i.push(c),r[c]={index:n,low:n++,explored:!1};var d=e.getElementById(c).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==c&&(y in r||u(y),r[y].explored||(r[c].low=Math.min(r[c].low,r[y].low)))}),r[c].index===r[c].low){for(var f=e.spawn();;){var h=i.pop();if(f.merge(e.getElementById(h)),r[h].low=r[c].index,r[h].explored=!0,h===c)break}var v=f.edgesWith(f),p=f.merge(v);a.push(p),o=o.difference(p)}};return e.forEach(function(u){if(u.isNode()){var c=u.id();c in r||l(c)}}),{cut:o,components:a}},N$={tarjanStronglyConnected:As,tsc:As,tscc:As,tarjanStronglyConnectedComponents:As},Sb={};[Ji,a5,i5,s5,c5,d5,p5,$5,Ha,Ka,Zc,J5,d$,m$,k$,_$,T$,N$].forEach(function(t){Te(Sb,t)});/*!
32
32
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
33
33
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
34
34
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
35
- */var kb=0,Sb=1,_b=2,Xr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=kb,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Xr.prototype={fulfill:function(e){return Tb(this,Sb,"fulfillValue",e)},reject:function(e){return Tb(this,_b,"rejectReason",e)},then:function(e,r){var n=this,a=new Xr;return n.onFulfilled.push(Bb(e,a,"fulfill")),n.onRejected.push(Bb(r,a,"reject")),Nb(n),a.proxy}};var Tb=function(e,r,n,a){return e.state===kb&&(e.state=r,e[n]=a,Nb(e)),e},Nb=function(e){e.state===Sb?Ib(e,"onFulfilled",e.fulfillValue):e.state===_b&&Ib(e,"onRejected",e.rejectReason)},Ib=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Bb=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(o){r.reject(o);return}_$(r,i)}}},_$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ht(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};Xr.all=function(t){return new Xr(function(e,r){for(var n=new Array(t.length),a=0,i=function(c,u){n[c]=u,a++,a===t.length&&e(n)},o=0;o<t.length;o++)(function(l){var c=t[l],u=c!=null&&c.then!=null;if(u)c.then(function(f){i(l,f)},function(f){r(f)});else{var d=c;i(l,d)}})(o)})},Xr.resolve=function(t){return new Xr(function(e,r){e(t)})},Xr.reject=function(t){return new Xr(function(e,r){r(t)})};var Ua=typeof Promise<"u"?Promise:Xr,Ju=function(e,r,n){var a=Ru(e),i=!a,o=this._private=Se({duration:1e3},r,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Xe(o.complete)&&o.completes.push(o.complete),i){var l=e.position();o.startPosition=o.startPosition||{x:l.x,y:l.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var c=e.pan();o.startPan={x:c.x,y:c.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},ra=Ju.prototype;Se(ra,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),Zt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,d){var f=e[u];f!=null&&(e[u]=e[d],e[d]=f)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,l=e.startStyle[o];e.startStyle[o]=i,e.style[a]=l}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new Ua(function(a,i){n.push(function(){a()})})}}),ra.complete=ra.completed,ra.run=ra.play,ra.running=ra.playing;var T$={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var l=a[o];l._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();r=Se({},r,n);var f=Object.keys(r).length===0;if(f)return new Ju(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=d.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var h=r.renderedPosition,v=l.pan(),p=l.zoom();r.position=Q0(h,p,v)}if(c&&r.panBy!=null){var g=r.panBy,y=l.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var m=r.center||r.centre;if(c&&m!=null){var b=l.getCenterPan(m.eles,r.zoom);b!=null&&(r.pan=b)}if(c&&r.fit!=null){var w=r.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(r.pan=C.pan,r.zoom=C.zoom)}if(c&&Ae(r.zoom)){var x=l.getZoomedViewport(r.zoom);x!=null?(x.zoomed&&(r.zoom=x.zoom),x.panned&&(r.pan=x.pan)):r.zoom=null}return new Ju(o[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=Se({},r,n));for(var c=0;c<o.length;c++){var u=o[c],d=u.animated()&&(r.queue===void 0||r.queue),f=u.animation(r,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<o.length;c++){for(var u=o[c],d=u._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;n&&(p.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},N$=Array.isArray,Ds=N$,I$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B$=/^\w*$/;function D$(t,e){if(Ds(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Wi(t)?!0:B$.test(t)||!I$.test(t)||e!=null&&t in Object(e)}var P$=D$,O$="[object AsyncFunction]",A$="[object Function]",R$="[object GeneratorFunction]",L$="[object Proxy]";function F$(t){if(!Zn(t))return!1;var e=$0(t);return e==A$||e==R$||e==O$||e==L$}var M$=F$,$$=hs["__core-js_shared__"],Qu=$$,Db=function(){var t=/[^.]+$/.exec(Qu&&Qu.keys&&Qu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function V$(t){return!!Db&&Db in t}var q$=V$,z$=Function.prototype,H$=z$.toString;function K$(t){if(t!=null){try{return H$.call(t)}catch{}try{return t+""}catch{}}return""}var G$=K$,U$=/[\\^$.*+?()[\]{}|]/g,j$=/^\[object .+?Constructor\]$/,W$=Function.prototype,Y$=Object.prototype,Z$=W$.toString,X$=Y$.hasOwnProperty,J$=RegExp("^"+Z$.call(X$).replace(U$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Q$(t){if(!Zn(t)||q$(t))return!1;var e=M$(t)?J$:j$;return e.test(G$(t))}var eV=Q$;function tV(t,e){return t==null?void 0:t[e]}var rV=tV;function nV(t,e){var r=rV(t,e);return eV(r)?r:void 0}var ec=nV,aV=ec(Object,"create"),ao=aV;function iV(){this.__data__=ao?ao(null):{},this.size=0}var oV=iV;function sV(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var lV=sV,uV="__lodash_hash_undefined__",cV=Object.prototype,dV=cV.hasOwnProperty;function fV(t){var e=this.__data__;if(ao){var r=e[t];return r===uV?void 0:r}return dV.call(e,t)?e[t]:void 0}var hV=fV,pV=Object.prototype,vV=pV.hasOwnProperty;function gV(t){var e=this.__data__;return ao?e[t]!==void 0:vV.call(e,t)}var mV=gV,yV="__lodash_hash_undefined__";function bV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ao&&e===void 0?yV:e,this}var wV=bV;function ja(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ja.prototype.clear=oV,ja.prototype.delete=lV,ja.prototype.get=hV,ja.prototype.has=mV,ja.prototype.set=wV;var Pb=ja;function CV(){this.__data__=[],this.size=0}var EV=CV;function xV(t,e){return t===e||t!==t&&e!==e}var Ob=xV;function kV(t,e){for(var r=t.length;r--;)if(Ob(t[r][0],e))return r;return-1}var Ps=kV,SV=Array.prototype,_V=SV.splice;function TV(t){var e=this.__data__,r=Ps(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():_V.call(e,r,1),--this.size,!0}var NV=TV;function IV(t){var e=this.__data__,r=Ps(e,t);return r<0?void 0:e[r][1]}var BV=IV;function DV(t){return Ps(this.__data__,t)>-1}var PV=DV;function OV(t,e){var r=this.__data__,n=Ps(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var AV=OV;function Wa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Wa.prototype.clear=EV,Wa.prototype.delete=NV,Wa.prototype.get=BV,Wa.prototype.has=PV,Wa.prototype.set=AV;var RV=Wa,LV=ec(hs,"Map"),FV=LV;function MV(){this.size=0,this.__data__={hash:new Pb,map:new(FV||RV),string:new Pb}}var $V=MV;function VV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var qV=VV;function zV(t,e){var r=t.__data__;return qV(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Os=zV;function HV(t){var e=Os(this,t).delete(t);return this.size-=e?1:0,e}var KV=HV;function GV(t){return Os(this,t).get(t)}var UV=GV;function jV(t){return Os(this,t).has(t)}var WV=jV;function YV(t,e){var r=Os(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var ZV=YV;function Ya(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ya.prototype.clear=$V,Ya.prototype.delete=KV,Ya.prototype.get=UV,Ya.prototype.has=WV,Ya.prototype.set=ZV;var Ab=Ya,XV="Expected a function";function tc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(XV);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(tc.Cache||Ab),r}tc.Cache=Ab;var JV=tc,QV=500;function eq(t){var e=JV(t,function(n){return r.size===QV&&r.clear(),n}),r=e.cache;return e}var tq=eq,rq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nq=/\\(\\)?/g,aq=tq(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(rq,function(r,n,a,i){e.push(a?i.replace(nq,"$1"):n||r)}),e}),Rb=aq;function iq(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var Lb=iq,oq=1/0,Fb=Fa?Fa.prototype:void 0,Mb=Fb?Fb.toString:void 0;function $b(t){if(typeof t=="string")return t;if(Ds(t))return Lb(t,$b)+"";if(Wi(t))return Mb?Mb.call(t):"";var e=t+"";return e=="0"&&1/t==-oq?"-0":e}var sq=$b;function lq(t){return t==null?"":sq(t)}var Vb=lq;function uq(t,e){return Ds(t)?t:P$(t,e)?[t]:Rb(Vb(t))}var qb=uq,cq=1/0;function dq(t){if(typeof t=="string"||Wi(t))return t;var e=t+"";return e=="0"&&1/t==-cq?"-0":e}var rc=dq;function fq(t,e){e=qb(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[rc(e[r++])];return r&&r==n?t:void 0}var hq=fq;function pq(t,e,r){var n=t==null?void 0:hq(t,e);return n===void 0?r:n}var vq=pq,gq=function(){try{var t=ec(Object,"defineProperty");return t({},"",{}),t}catch{}}(),zb=gq;function mq(t,e,r){e=="__proto__"&&zb?zb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var yq=mq,bq=Object.prototype,wq=bq.hasOwnProperty;function Cq(t,e,r){var n=t[e];(!(wq.call(t,e)&&Ob(n,r))||r===void 0&&!(e in t))&&yq(t,e,r)}var Eq=Cq,xq=9007199254740991,kq=/^(?:0|[1-9]\d*)$/;function Sq(t,e){var r=typeof t;return e=e??xq,!!e&&(r=="number"||r!="symbol"&&kq.test(t))&&t>-1&&t%1==0&&t<e}var _q=Sq;function Tq(t,e,r,n){if(!Zn(t))return t;e=qb(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var c=rc(e[a]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=Zn(d)?d:_q(e[a+1])?[]:{})}Eq(l,c,u),l=l[c]}return t}var Nq=Tq;function Iq(t,e,r){return t==null?t:Nq(t,e,r)}var Bq=Iq;function Dq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pq=Dq;function Oq(t){return Ds(t)?Lb(t,rc):Wi(t)?[t]:Pq(Rb(Vb(t)))}var Aq=Oq,Rq={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Se({},r,e),function(a,i){var o=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(Ee(a)){var f=a.indexOf(".")!==-1,h=f&&Aq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=vq(d._private[o.field],h):v=d._private[o.field][a]),v}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var g=k0({},a,i);o.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?Bq(b._private[o.field],h,i):b._private[o.field][a]=i)}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ae(a)){var w=a,C,x,k=Object.keys(w);o.beforeSet(l,w);for(var E=0;E<k.length;E++){C=k[E],x=w[C];var _=!o.immutableKeys[C];if(_)for(var S=0;S<u.length;S++){var T=u[S];o.canSet(T)&&(T._private[o.field][C]=x)}}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Xe(a)){var N=a;l.on(o.bindingEvent,N)}else if(o.allowGetting&&a===void 0){var B;return d&&(o.beforeGet(d),B=d._private[o.field]),B}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Se({},r,e),function(a){var i=e,o=this,l=o.length!==void 0,c=l?o:[o];if(Ee(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var h=u[f];if(!mn(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=c.length;p<g;p++)c[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=c.length;y<m;y++)for(var b=c[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var x=w[C],k=!i.immutableKeys[x];k&&(b[x]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},Lq={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,o=Array.prototype.slice.call(arguments,0);return new Ua(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=o.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[T$,Rq,Lq].forEach(function(t){Se(Ve,t)});var Fq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},As={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new $a(e),o=0;o<r.length;o++){for(var l=r[o],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h);if(!v){d=!0;break}}d||(d=u.size!==e.length),d&&(c.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ke(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],o=0,l=n.length;o<l;o++)for(var c=n[o],u=c._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=u.has(h),p=!1;r||a&&!v?(u.add(h),p=!0):(!r||a&&v)&&(u.delete(h),p=!0),!d&&p&&(i.push(c),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};As.className=As.classNames=As.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:vt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+",Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+",Re.value=Re.string+"|"+Re.number,Re.id=Re.variable,function(){var t,e,r;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Re.comparatorOp+="|@"+e;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},ve={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},nc=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return YF(t.selector,e.selector)}),Mq=function(){for(var t={},e,r=0;r<nc.length;r++)e=nc[r],t[e.selector]=e.matches;return t}(),$q=function(e,r){return Mq[e](r)},Vq="("+nc.map(function(t){return t.selector}).join("|")+")",Za=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},En=function(e,r,n){e[e.length-1]=n},ac=[{name:"group",query:!0,regex:"("+Re.group+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Vq,populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Re.id+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.ID,value:Za(i)})}},{name:"className",query:!0,regex:"\\.("+Re.className+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.CLASS,value:Za(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.DATA_EXIST,field:Za(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*("+Re.comparatorOp+")\\s*("+Re.value+")\\s*\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2],c=new RegExp("^"+Re.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:ve.DATA_COMPARE,field:Za(i),operator:o,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Re.boolOp+")\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,2),i=a[0],o=a[1];r.checks.push({type:ve.DATA_BOOL,field:Za(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Re.meta+")\\s*("+Re.comparatorOp+")\\s*("+Re.number+")\\s*\\]\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2];r.checks.push({type:ve.META_COMPARE,field:Za(i),operator:o,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Re.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Re.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.DIRECTED_EDGE,source:a,target:i}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_SOURCE,source:l,target:c}),En(e,r,o),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Re.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.UNDIRECTED_EDGE,nodes:[a,i]}),En(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,c=ze();return o.checks.push({type:ve.NODE_NEIGHBOR,node:l,neighbor:c}),En(e,r,o),c}}},{name:"child",separator:!0,regex:Re.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.CHILD,parent:i,child:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.PARENT,parent:f,child:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.PARENT,parent:h,child:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Re.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.DESCENDANT,ancestor:i,descendant:a}),En(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),c.checks.push({type:ve.ANCESTOR,ancestor:f,descendant:d}),En(e,l,o),e.currentSubject=u,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.ANCESTOR,ancestor:h,descendant:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Re.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return $e("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===ve.DIRECTED_EDGE?a.type=ve.NODE_TARGET:i===ve.UNDIRECTED_EDGE&&(a.type=ve.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];ac.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var qq=function(e){for(var r,n,a,i=0;i<ac.length;i++){var o=ac[i],l=o.name,c=e.match(o.regexObj);if(c!=null){n=c,r=o,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:a,remaining:e}},zq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Hq=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=zq(n);;){var i=qq(n);if(i.expr==null)return $e("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),l=i.expr.populate(r,a,o);if(l===!1)return!1;if(l!=null&&(a=l),n=i.remaining,n.match(/^\s*$/))break}var c=r[r.length-1];r.currentSubject!=null&&(c.subject=r.currentSubject),c.edgeCount=r.edgeCount,c.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var d=r[u];if(d.compoundCount>0&&d.edgeCount>0)return $e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return $e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&$e("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Kq=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return Ee(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case ve.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case ve.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(e(y))+r(v)+"]"}case ve.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case ve.DATA_EXIST:{var w=d.field;return"["+w+"]"}case ve.META_COMPARE:{var C=d.operator,x=d.field;return"[["+x+n(e(C))+r(v)+"]]"}case ve.STATE:return v;case ve.ID:return"#"+v;case ve.CLASS:return"."+v;case ve.PARENT:case ve.CHILD:return i(d.parent,f)+n(">")+i(d.child,f);case ve.ANCESTOR:case ve.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case ve.COMPOUND_SPLIT:{var k=i(d.left,f),E=i(d.subject,f),_=i(d.right,f);return k+(k.length>0?" ":"")+E+_}case ve.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},o="",l=0;l<this.length;l++){var c=this[l];o+=i(c,c.subject),this.length>1&&l<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Gq={parse:Hq,toString:Kq},Hb=function(e,r,n){var a,i=Ee(e),o=de(e),l=Ee(n),c,u,d=!1,f=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!o?"":""+e,u=""+n),d&&(e=c=c.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":a=c.indexOf(u)>=0;break;case"$=":a=c.indexOf(u,c.length-u.length)>=0;break;case"^=":a=c.indexOf(u)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},Uq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},jq=function(e){return e!==void 0},ic=function(e,r){return e.data(r)},Wq=function(e,r){return e[r]()},Qe=[],Ye=function(e,r){return e.checks.every(function(n){return Qe[n.type](n,r)})};Qe[ve.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Qe[ve.STATE]=function(t,e){var r=t.value;return $q(r,e)},Qe[ve.ID]=function(t,e){var r=t.value;return e.id()===r},Qe[ve.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Qe[ve.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Hb(Wq(e,r),n,a)},Qe[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Hb(ic(e,r),n,a)},Qe[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Uq(ic(e,r),n)},Qe[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,jq(ic(e,r))},Qe[ve.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ye(r,a)&&Ye(n,i)||Ye(n,a)&&Ye(r,i)},Qe[ve.NODE_NEIGHBOR]=function(t,e){return Ye(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ye(t.neighbor,r)})},Qe[ve.DIRECTED_EDGE]=function(t,e){return Ye(t.source,e.source())&&Ye(t.target,e.target())},Qe[ve.NODE_SOURCE]=function(t,e){return Ye(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ye(t.target,r)})},Qe[ve.NODE_TARGET]=function(t,e){return Ye(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ye(t.source,r)})},Qe[ve.CHILD]=function(t,e){return Ye(t.child,e)&&Ye(t.parent,e.parent())},Qe[ve.PARENT]=function(t,e){return Ye(t.parent,e)&&e.children().some(function(r){return Ye(t.child,r)})},Qe[ve.DESCENDANT]=function(t,e){return Ye(t.descendant,e)&&e.ancestors().some(function(r){return Ye(t.ancestor,r)})},Qe[ve.ANCESTOR]=function(t,e){return Ye(t.ancestor,e)&&e.descendants().some(function(r){return Ye(t.descendant,r)})},Qe[ve.COMPOUND_SPLIT]=function(t,e){return Ye(t.subject,e)&&Ye(t.left,e)&&Ye(t.right,e)},Qe[ve.TRUE]=function(){return!0},Qe[ve.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},Qe[ve.FILTER]=function(t,e){var r=t.value;return r(e)};var Yq=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ve.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var o=0;o<r.length;o++){var l=r[o];if(Ye(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},Zq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},Xq={matches:Zq,filter:Yq},xn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ee(e)&&e.match(/^\s*$/)||(Zt(e)?this.addQuery({checks:[{type:ve.COLLECTION,value:e.collection()}]}):Xe(e)?this.addQuery({checks:[{type:ve.FILTER,value:e}]}):Ee(e)?this.parse(e)||(this.invalid=!0):Je("A selector must be created from a string; found "))},kn=xn.prototype;[Gq,Xq].forEach(function(t){return Se(kn,t)}),kn.text=function(){return this.inputText},kn.size=function(){return this.length},kn.eq=function(t){return this[t]},kn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},kn.addQuery=function(t){this[this.length++]=t},kn.selector=kn.toString;var Sn={allAre:function(e){var r=new xn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new xn(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};Sn.allAreNeighbours=Sn.allAreNeighbors,Sn.has=Sn.contains,Sn.equal=Sn.equals=Sn.same;var nr=function(e,r){return function(a,i,o,l){var c=a,u=this,d;if(c==null?d="":Zt(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[r]=h[r]||[],p=Xn(d),g=v[p];return g||(v[p]=e.call(u,a,i,o,l))}else return e.call(u,a,i,o,l)}},Xa={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:nr(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];r.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function oc(t,e,r,n){for(var a=[],i=new $a,o=t.cy(),l=o.hasCompoundNodes(),c=0;c<t.length;c++){var u=t[c];r?a.push(u):l&&n(a,i,u)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&n(a,i,d)}return t}function Kb(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}Xa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Kb)};function Gb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Xa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Gb)};function Jq(t,e,r){Gb(t,e,r),Kb(t,e,r)}Xa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return oc(this,t,e,Jq)},Xa.ancestors=Xa.parents;var io,Ub;io=Ub={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},io.attr=io.data,io.removeAttr=io.removeData;var Qq=Ub,Rs={};function sc(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,o=0;o<i.length;o++){var l=i[o];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}Se(Rs,{degree:sc(function(t,e){return e.source().same(e.target())?2:1}),indegree:sc(function(t,e){return e.target().same(t)?1:0}),outdegree:sc(function(t,e){return e.source().same(t)?1:0})});function Ja(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],l=o[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}Se(Rs,{minDegree:Ja("degree",function(t,e){return t<e}),maxDegree:Ja("degree",function(t,e){return t>e}),minIndegree:Ja("indegree",function(t,e){return t<e}),maxIndegree:Ja("indegree",function(t,e){return t>e}),minOutdegree:Ja("outdegree",function(t,e){return t<e}),maxOutdegree:Ja("outdegree",function(t,e){return t>e})}),Se(Rs,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var mr,jb,Wb=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,l={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},Yb={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){Wb(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=jb={position:Ve.data(Yb),silentPosition:Ve.data(Se({},Yb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Wb(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ae(e))r?this.silentPosition(e):this.position(e);else if(Xe(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],l=void 0;(l=n(o,i))&&(r?o.silentPosition(l):o.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Ae(e)?(a={x:de(e.x)?e.x:0,y:de(e.y)?e.y:0},n=r):Ee(e)&&de(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var l=this[o];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var c=l.position(),u={x:c.x+a.x,y:c.y+a.y};n?l.silentPosition(u):l.position(u)}}i.endBatch()}return this},silentShift:function(e,r){return Ae(e)?this.shift(e,!0):Ee(e)&&de(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),l=Ae(e)?e:void 0,c=l!==void 0||r!==void 0&&Ee(e);if(n&&n.isNode())if(c)for(var u=0;u<this.length;u++){var d=this[u];r!==void 0?d.position(e,(r-o[e])/i):l!==void 0&&d.position(Q0(l,i,o))}else{var f=n.position();return l=bs(f,i,o),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Ae(e)?e:void 0,o=i!==void 0||r!==void 0&&Ee(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?d.position():{x:0,y:0};r!==void 0?u.position(e,r+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var p=n.position(),g=l?n.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}},mr.modelPosition=mr.point=mr.position,mr.modelPositions=mr.points=mr.positions,mr.renderedPoint=mr.renderedPosition,mr.relativePoint=mr.relativePosition;var ez=jb,Qa,_n;Qa=_n={},_n.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,l=e.y1*n+a.y,c=e.y2*n+a.y;return{x1:i,x2:o,y1:l,y2:c,w:o-i,h:c-l}},_n.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},_n.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var l=o._private,c=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,T,N){var B=0,P=0,D=T+N;return S>0&&D>0&&(B=T/D*S,P=N/D*S),{biasDiff:B,biasComplementDiff:P}}function p(S,T,N,B){if(N.units==="%")switch(B){case"width":return S>0?N.pfValue*S:0;case"height":return T>0?N.pfValue*T:0;case"average":return S>0&&T>0?N.pfValue*(S+T)/2:0;case"min":return S>0&&T>0?S>T?N.pfValue*T:N.pfValue*S:0;case"max":return S>0&&T>0?S>T?N.pfValue*S:N.pfValue*T:0;default:return 0}else return N.units==="px"?N.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,x=w.biasComplementDiff,k=v(d.height.val-f.h,m,b),E=k.biasDiff,_=k.biasComplementDiff;l.autoPadding=p(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-E+f.y1+f.y2+_)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var ar=function(e){return e===1/0||e===-1/0?0:e},yr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},na=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},oo=function(e,r,n){return gr(e,r,n)},Ls=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,o=i.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,c,u;if(l!=="none"){n==="source"?(c=i.srcX,u=i.srcY):n==="target"?(c=i.tgtX,u=i.tgtY):(c=i.midX,u=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[n]=d[n]||{};f.x1=c-o,f.y1=u-o,f.x2=c+o,f.y2=u+o,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Cs(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},lc=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,o=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var c=r.pstyle("text-halign"),u=r.pstyle("text-valign"),d=oo(o,"labelWidth",n),f=oo(o,"labelHeight",n),h=oo(o,"labelX",n),v=oo(o,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,y=r.isEdge(),m=r.pstyle(a+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,C=w/2,x=r.pstyle("text-background-padding").pfValue,k=2,E=f,_=d,S=_/2,T=E/2,N,B,P,D;if(y)N=h-S,B=h+S,P=v-T,D=v+T;else{switch(c.value){case"left":N=h-_,B=h;break;case"center":N=h-S,B=h+S;break;case"right":N=h,B=h+_;break}switch(u.value){case"top":P=v-E,D=v;break;case"center":P=v-T,D=v+T;break;case"bottom":P=v,D=v+E;break}}N+=p-Math.max(b,C)-x-k,B+=p+Math.max(b,C)+x+k,P+=g-Math.max(b,C)-x-k,D+=g+Math.max(b,C)+x+k;var R=n||"main",O=i.labelBounds,F=O[R]=O[R]||{};F.x1=N,F.y1=P,F.x2=B,F.y2=D,F.w=B-N,F.h=D-P;var A=y&&m.strValue==="autorotate",z=m.pfValue!=null&&m.pfValue!==0;if(A||z){var j=A?oo(i.rstyle,"labelAngle",n):m.pfValue,H=Math.cos(j),G=Math.sin(j),X=(N+B)/2,M=(P+D)/2;if(!y){switch(c.value){case"left":X=B;break;case"right":X=N;break}switch(u.value){case"top":M=D;break;case"bottom":M=P;break}}var V=function(ue,ae){return ue=ue-X,ae=ae-M,{x:ue*H-ae*G+X,y:ue*G+ae*H+M}},q=V(N,P),$=V(N,D),K=V(B,P),L=V(B,D);N=Math.min(q.x,$.x,K.x,L.x),B=Math.max(q.x,$.x,K.x,L.x),P=Math.min(q.y,$.y,K.y,L.y),D=Math.max(q.y,$.y,K.y,L.y)}var W=R+"Rot",Y=O[W]=O[W]||{};Y.x1=N,Y.y1=P,Y.x2=B,Y.y2=D,Y.w=B-N,Y.h=D-P,yr(e,N,P,B,D),yr(i.labelBounds.all,N,P,B,D)}return e}},tz=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,o=r.pstyle("shape").value,l=a+i,c=(e.w+l*2)/e.w,u=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(o)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?c=(e.w+l*2.4)/e.w:o==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):o==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):o==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*u-e.h,v=e.w*c-e.w;if(Es(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=E5(e,d,f);tb(e,p)}}}},rz=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Kt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,h,v,p,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ce){return ce.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,x=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(x=e.pstyle("overlay-padding").value));var k=0,E=0;a&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(E=e.pstyle("underlay-padding").value));var _=Math.max(x,E),S=0,T=0;if(a&&(S=e.pstyle("width").pfValue,T=S/2),c&&r.includeNodes){var N=e.position();p=N.x,g=N.y;var B=e.outerWidth(),P=B/2,D=e.outerHeight(),R=D/2;d=p-P,f=p+P,h=g-R,v=g+R,yr(o,d,h,f,v),a&&r.includeOutlines&&tz(o,e)}else if(u&&r.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),O==="haystack"){var F=y.haystackPts;if(F&&F.length===2){if(d=F[0].x,h=F[0].y,f=F[1].x,v=F[1].y,d>f){var A=d;d=f,f=A}if(h>v){var z=h;h=v,v=z}yr(o,d-T,h-T,f+T,v+T)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var j;switch(O){case"bezier":case"unbundled-bezier":j=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":j=y.linePts;break}if(j!=null)for(var H=0;H<j.length;H++){var G=j[H];d=G.x-T,f=G.x+T,h=G.y-T,v=G.y+T,yr(o,d,h,f,v)}}}else{var X=e.source(),M=X.position(),V=e.target(),q=V.position();if(d=M.x,f=q.x,h=M.y,v=q.y,d>f){var $=d;d=f,f=$}if(h>v){var K=h;h=v,v=K}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&u&&(Ls(o,e,"mid-source"),Ls(o,e,"mid-target"),Ls(o,e,"source"),Ls(o,e,"target")),a){var L=e.pstyle("ghost").value==="yes";if(L){var W=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;yr(o,o.x1+W,o.y1+Y,o.x2+W,o.y2+Y)}}var se=l.bodyBounds=l.bodyBounds||{};rb(se,o),Es(se,m),Cs(se,1),a&&(d=o.x1,f=o.x2,h=o.y1,v=o.y2,yr(o,d-_,h-_,f+_,v+_));var ue=l.overlayBounds=l.overlayBounds||{};rb(ue,o),Es(ue,m),Cs(ue,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?C5(ae.all):ae.all=Kt(),a&&r.includeLabels&&(r.includeMainLabels&&lc(o,e,null),u&&(r.includeSourceLabels&&lc(o,e,"source"),r.includeTargetLabels&&lc(o,e,"target")))}return o.x1=ar(o.x1),o.y1=ar(o.y1),o.x2=ar(o.x2),o.y2=ar(o.y2),o.w=ar(o.x2-o.x1),o.h=ar(o.y2-o.y1),o.w>0&&o.h>0&&w&&(Es(o,m),Cs(o,1)),o},Zb=function(e){var r=0,n=function(o){return(o?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},Xb=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return zM([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},Jb=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?Qb:Zb(r),l=o===Qb,c=Xb(e),u=n.bbCachePosKey===c,d=r.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(u||e.recalculateRenderedStyle(d),a=rz(e,so),n.bbCache=a,n.bbCachePosKey=c):a=n.bbCache,!l){var v=e.isNode();a=Kt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?na(a,n.overlayBounds):na(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?na(a,n.labelBounds.all):(r.includeMainLabels&&na(a,n.labelBounds.mainRot),r.includeSourceLabels&&na(a,n.labelBounds.sourceRot),r.includeTargetLabels&&na(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},so={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Qb=Zb(so),e1=St(so);_n.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=so:t=e1(t),e=Jb(this[0],t);else{e=Kt(),t=t||so;var r=e1(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var o=0;o<n.length;o++){var l=n[o],c=l._private,u=Xb(l),d=c.bbCachePosKey===u,f=r.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var v=n[h];na(e,Jb(v,r))}}return e.x1=ar(e.x1),e.y1=ar(e.y1),e.x2=ar(e.x2),e.y2=ar(e.y2),e.w=ar(e.x2-e.x1),e.h=ar(e.y2-e.y1),e},_n.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},_n.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Ae(t)){var i=t;t=function(){return i}}var o=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=w5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),c},Qa.boundingbox=Qa.bb=Qa.boundingBox,Qa.renderedBoundingbox=Qa.renderedBoundingBox;var nz=_n,lo,uo;lo=uo={};var t1=function(e){e.uppercaseName=O0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=O0(e.outerName),lo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var l=n.pstyle(e.name);switch(l.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},lo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var l=n[e.name](),c=n.pstyle("border-width").pfValue,u=2*n.padding();return l+c+u}else return 1},lo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},lo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};t1({name:"width"}),t1({name:"height"}),uo.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},uo.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},uo.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var az=uo,iz=function(e,r){if(e.isEdge())return r(e)},oz=function(e,r){if(e.isEdge()){var n=e.cy();return bs(r(e),n.zoom(),n.pan())}},sz=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return bs(o,i,a)})}},lz=function(e){return e.renderer().getControlPoints(e)},uz=function(e){return e.renderer().getSegmentPoints(e)},cz=function(e){return e.renderer().getSourceEndpoint(e)},dz=function(e){return e.renderer().getTargetEndpoint(e)},fz=function(e){return e.renderer().getEdgeMidpoint(e)},r1={controlPoints:{get:lz,mult:!0},segmentPoints:{get:uz,mult:!0},sourceEndpoint:{get:cz},targetEndpoint:{get:dz},midpoint:{get:fz}},hz=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},pz=Object.keys(r1).reduce(function(t,e){var r=r1[e],n=hz(e);return t[e]=function(){return iz(this,r.get)},r.mult?t[n]=function(){return sz(this,r.get)}:t[n]=function(){return oz(this,r.get)},t},{}),vz=Se({},ez,nz,az,pz);/*!
35
+ */var _b=0,Tb=1,Nb=2,Jr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=_b,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Jr.prototype={fulfill:function(e){return Ib(this,Tb,"fulfillValue",e)},reject:function(e){return Ib(this,Nb,"rejectReason",e)},then:function(e,r){var n=this,a=new Jr;return n.onFulfilled.push(Ab(e,a,"fulfill")),n.onRejected.push(Ab(r,a,"reject")),Bb(n),a.proxy}};var Ib=function(e,r,n,a){return e.state===_b&&(e.state=r,e[n]=a,Bb(e)),e},Bb=function(e){e.state===Tb?Db(e,"onFulfilled",e.fulfillValue):e.state===Nb&&Db(e,"onRejected",e.rejectReason)},Db=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Ab=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(o){r.reject(o);return}I$(r,i)}}},I$=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ht(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};Jr.all=function(t){return new Jr(function(e,r){for(var n=new Array(t.length),a=0,i=function(u,c){n[u]=c,a++,a===t.length&&e(n)},o=0;o<t.length;o++)(function(l){var u=t[l],c=u!=null&&u.then!=null;if(c)u.then(function(f){i(l,f)},function(f){r(f)});else{var d=u;i(l,d)}})(o)})},Jr.resolve=function(t){return new Jr(function(e,r){e(t)})},Jr.reject=function(t){return new Jr(function(e,r){r(t)})};var Ua=typeof Promise<"u"?Promise:Jr,Qc=function(e,r,n){var a=Lc(e),i=!a,o=this._private=Te({duration:1e3},r,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Je(o.complete)&&o.completes.push(o.complete),i){var l=e.position();o.startPosition=o.startPosition||{x:l.x,y:l.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},na=Qc.prototype;Te(na,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),Zt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(c,d){var f=e[c];f!=null&&(e[c]=e[d],e[d]=f)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,l=e.startStyle[o];e.startStyle[o]=i,e.style[a]=l}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new Ua(function(a,i){n.push(function(){a()})})}}),na.complete=na.completed,na.run=na.play,na.running=na.playing;var B$={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var l=a[o];l._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this,u=!i,c=!u;if(!l.styleEnabled())return this;var d=l.style();r=Te({},r,n);var f=Object.keys(r).length===0;if(f)return new Qc(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(c&&(r.style=d.getPropsList(r.style||r.css),r.css=void 0),c&&r.renderedPosition!=null){var h=r.renderedPosition,v=l.pan(),p=l.zoom();r.position=tb(h,p,v)}if(u&&r.panBy!=null){var g=r.panBy,y=l.pan();r.pan={x:y.x+g.x,y:y.y+g.y}}var m=r.center||r.centre;if(u&&m!=null){var b=l.getCenterPan(m.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var w=r.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(r.pan=C.pan,r.zoom=C.zoom)}if(u&&Pe(r.zoom)){var x=l.getZoomedViewport(r.zoom);x!=null?(x.zoomed&&(r.zoom=x.zoom),x.panned&&(r.pan=x.pan)):r.zoom=null}return new Qc(o[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;n&&(r=Te({},r,n));for(var u=0;u<o.length;u++){var c=o[u],d=c.animated()&&(r.queue===void 0||r.queue),f=c.animation(r,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,o=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var c=o[u],d=c._private,f=d.animation.current,h=0;h<f.length;h++){var v=f[h],p=v._private;n&&(p.duration=0)}r&&(d.animation.queue=[]),n||(d.animation.current=[])}return l.notify("draw"),this}}},D$=Array.isArray,Os=D$,A$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O$=/^\w*$/;function P$(t,e){if(Os(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ji(t)?!0:O$.test(t)||!A$.test(t)||e!=null&&t in Object(e)}var R$=P$,L$="[object AsyncFunction]",M$="[object Function]",F$="[object GeneratorFunction]",$$="[object Proxy]";function V$(t){if(!Xn(t))return!1;var e=q0(t);return e==M$||e==F$||e==L$||e==$$}var q$=V$,z$=vs["__core-js_shared__"],eu=z$,Ob=function(){var t=/[^.]+$/.exec(eu&&eu.keys&&eu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function H$(t){return!!Ob&&Ob in t}var K$=H$,G$=Function.prototype,U$=G$.toString;function W$(t){if(t!=null){try{return U$.call(t)}catch{}try{return t+""}catch{}}return""}var j$=W$,Y$=/[\\^$.*+?()[\]{}|]/g,Z$=/^\[object .+?Constructor\]$/,X$=Function.prototype,J$=Object.prototype,Q$=X$.toString,eV=J$.hasOwnProperty,tV=RegExp("^"+Q$.call(eV).replace(Y$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rV(t){if(!Xn(t)||K$(t))return!1;var e=q$(t)?tV:Z$;return e.test(j$(t))}var nV=rV;function aV(t,e){return t==null?void 0:t[e]}var iV=aV;function oV(t,e){var r=iV(t,e);return nV(r)?r:void 0}var tu=oV,sV=tu(Object,"create"),ao=sV;function lV(){this.__data__=ao?ao(null):{},this.size=0}var cV=lV;function uV(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var dV=uV,fV="__lodash_hash_undefined__",hV=Object.prototype,pV=hV.hasOwnProperty;function vV(t){var e=this.__data__;if(ao){var r=e[t];return r===fV?void 0:r}return pV.call(e,t)?e[t]:void 0}var gV=vV,mV=Object.prototype,yV=mV.hasOwnProperty;function bV(t){var e=this.__data__;return ao?e[t]!==void 0:yV.call(e,t)}var wV=bV,CV="__lodash_hash_undefined__";function EV(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ao&&e===void 0?CV:e,this}var xV=EV;function Wa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Wa.prototype.clear=cV,Wa.prototype.delete=dV,Wa.prototype.get=gV,Wa.prototype.has=wV,Wa.prototype.set=xV;var Pb=Wa;function kV(){this.__data__=[],this.size=0}var SV=kV;function _V(t,e){return t===e||t!==t&&e!==e}var Rb=_V;function TV(t,e){for(var r=t.length;r--;)if(Rb(t[r][0],e))return r;return-1}var Ps=TV,NV=Array.prototype,IV=NV.splice;function BV(t){var e=this.__data__,r=Ps(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():IV.call(e,r,1),--this.size,!0}var DV=BV;function AV(t){var e=this.__data__,r=Ps(e,t);return r<0?void 0:e[r][1]}var OV=AV;function PV(t){return Ps(this.__data__,t)>-1}var RV=PV;function LV(t,e){var r=this.__data__,n=Ps(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var MV=LV;function ja(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ja.prototype.clear=SV,ja.prototype.delete=DV,ja.prototype.get=OV,ja.prototype.has=RV,ja.prototype.set=MV;var FV=ja,$V=tu(vs,"Map"),VV=$V;function qV(){this.size=0,this.__data__={hash:new Pb,map:new(VV||FV),string:new Pb}}var zV=qV;function HV(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var KV=HV;function GV(t,e){var r=t.__data__;return KV(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Rs=GV;function UV(t){var e=Rs(this,t).delete(t);return this.size-=e?1:0,e}var WV=UV;function jV(t){return Rs(this,t).get(t)}var YV=jV;function ZV(t){return Rs(this,t).has(t)}var XV=ZV;function JV(t,e){var r=Rs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var QV=JV;function Ya(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ya.prototype.clear=zV,Ya.prototype.delete=WV,Ya.prototype.get=YV,Ya.prototype.has=XV,Ya.prototype.set=QV;var Lb=Ya,eq="Expected a function";function ru(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(eq);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=t.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(ru.Cache||Lb),r}ru.Cache=Lb;var tq=ru,rq=500;function nq(t){var e=tq(t,function(n){return r.size===rq&&r.clear(),n}),r=e.cache;return e}var aq=nq,iq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oq=/\\(\\)?/g,sq=aq(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iq,function(r,n,a,i){e.push(a?i.replace(oq,"$1"):n||r)}),e}),Mb=sq;function lq(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var Fb=lq,cq=1/0,$b=Ma?Ma.prototype:void 0,Vb=$b?$b.toString:void 0;function qb(t){if(typeof t=="string")return t;if(Os(t))return Fb(t,qb)+"";if(ji(t))return Vb?Vb.call(t):"";var e=t+"";return e=="0"&&1/t==-cq?"-0":e}var uq=qb;function dq(t){return t==null?"":uq(t)}var zb=dq;function fq(t,e){return Os(t)?t:R$(t,e)?[t]:Mb(zb(t))}var Hb=fq,hq=1/0;function pq(t){if(typeof t=="string"||ji(t))return t;var e=t+"";return e=="0"&&1/t==-hq?"-0":e}var nu=pq;function vq(t,e){e=Hb(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[nu(e[r++])];return r&&r==n?t:void 0}var gq=vq;function mq(t,e,r){var n=t==null?void 0:gq(t,e);return n===void 0?r:n}var yq=mq,bq=function(){try{var t=tu(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Kb=bq;function wq(t,e,r){e=="__proto__"&&Kb?Kb(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Cq=wq,Eq=Object.prototype,xq=Eq.hasOwnProperty;function kq(t,e,r){var n=t[e];(!(xq.call(t,e)&&Rb(n,r))||r===void 0&&!(e in t))&&Cq(t,e,r)}var Sq=kq,_q=9007199254740991,Tq=/^(?:0|[1-9]\d*)$/;function Nq(t,e){var r=typeof t;return e=e??_q,!!e&&(r=="number"||r!="symbol"&&Tq.test(t))&&t>-1&&t%1==0&&t<e}var Iq=Nq;function Bq(t,e,r,n){if(!Xn(t))return t;e=Hb(e,t);for(var a=-1,i=e.length,o=i-1,l=t;l!=null&&++a<i;){var u=nu(e[a]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=o){var d=l[u];c=n?n(d,u,l):void 0,c===void 0&&(c=Xn(d)?d:Iq(e[a+1])?[]:{})}Sq(l,u,c),l=l[u]}return t}var Dq=Bq;function Aq(t,e,r){return t==null?t:Dq(t,e,r)}var Oq=Aq;function Pq(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Rq=Pq;function Lq(t){return Os(t)?Fb(t,nu):ji(t)?[t]:Rq(Mb(zb(t)))}var Mq=Lq,Fq={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Te({},r,e),function(a,i){var o=e,l=this,u=l.length!==void 0,c=u?l:[l],d=u?l[0]:l;if(Ee(a)){var f=a.indexOf(".")!==-1,h=f&&Mq(a);if(o.allowGetting&&i===void 0){var v;return d&&(o.beforeGet(d),h&&d._private[o.field][a]===void 0?v=yq(d._private[o.field],h):v=d._private[o.field][a]),v}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var g=_0({},a,i);o.beforeSet(l,g);for(var y=0,m=c.length;y<m;y++){var b=c[y];o.canSet(b)&&(h&&d._private[o.field][a]===void 0?Oq(b._private[o.field],h,i):b._private[o.field][a]=i)}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Pe(a)){var w=a,C,x,k=Object.keys(w);o.beforeSet(l,w);for(var E=0;E<k.length;E++){C=k[E],x=w[C];var _=!o.immutableKeys[C];if(_)for(var S=0;S<c.length;S++){var T=c[S];o.canSet(T)&&(T._private[o.field][C]=x)}}o.updateStyle&&l.updateStyle(),o.onSet(l),o.settingTriggersEvent&&l[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Je(a)){var N=a;l.on(o.bindingEvent,N)}else if(o.allowGetting&&a===void 0){var B;return d&&(o.beforeGet(d),B=d._private[o.field]),B}return l}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Te({},r,e),function(a){var i=e,o=this,l=o.length!==void 0,u=l?o:[o];if(Ee(a)){for(var c=a.split(/\s+/),d=c.length,f=0;f<d;f++){var h=c[f];if(!yn(h)){var v=!i.immutableKeys[h];if(v)for(var p=0,g=u.length;p<g;p++)u[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=u.length;y<m;y++)for(var b=u[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var x=w[C],k=!i.immutableKeys[x];k&&(b[x]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},$q={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,o=Array.prototype.slice.call(arguments,0);return new Ua(function(l,u){var c=function(v){i.off.apply(i,f),l(v)},d=o.concat([c]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[B$,Fq,$q].forEach(function(t){Te(Ve,t)});var Vq={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},Ls={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new $a(e),o=0;o<r.length;o++){for(var l=r[o],u=l._private,c=u.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h);if(!v){d=!0;break}}d||(d=c.size!==e.length),d&&(u.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ke(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],o=0,l=n.length;o<l;o++)for(var u=n[o],c=u._private.classes,d=!1,f=0;f<e.length;f++){var h=e[f],v=c.has(h),p=!1;r||a&&!v?(c.add(h),p=!0):(!r||a&&v)&&(c.delete(h),p=!0),!d&&p&&(i.push(u),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};Ls.className=Ls.classNames=Ls.classes;var Re={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:vt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Re.variable="(?:[\\w-.]|(?:\\\\"+Re.metaChar+"))+",Re.className="(?:[\\w-]|(?:\\\\"+Re.metaChar+"))+",Re.value=Re.string+"|"+Re.number,Re.id=Re.variable,function(){var t,e,r;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Re.comparatorOp+="|@"+e;for(t=Re.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Re.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},ve={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},au=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return JM(t.selector,e.selector)}),qq=function(){for(var t={},e,r=0;r<au.length;r++)e=au[r],t[e.selector]=e.matches;return t}(),zq=function(e,r){return qq[e](r)},Hq="("+au.map(function(t){return t.selector}).join("|")+")",Za=function(e){return e.replace(new RegExp("\\\\("+Re.metaChar+")","g"),function(r,n){return n})},xn=function(e,r,n){e[e.length-1]=n},iu=[{name:"group",query:!0,regex:"("+Re.group+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Hq,populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Re.id+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.ID,value:Za(i)})}},{name:"className",query:!0,regex:"\\.("+Re.className+")",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.CLASS,value:Za(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,1),i=a[0];r.checks.push({type:ve.DATA_EXIST,field:Za(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Re.variable+")\\s*("+Re.comparatorOp+")\\s*("+Re.value+")\\s*\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2],u=new RegExp("^"+Re.string+"$").exec(l)!=null;u?l=l.substring(1,l.length-1):l=parseFloat(l),r.checks.push({type:ve.DATA_COMPARE,field:Za(i),operator:o,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Re.boolOp+")\\s*("+Re.variable+")\\s*\\]",populate:function(e,r,n){var a=vr(n,2),i=a[0],o=a[1];r.checks.push({type:ve.DATA_BOOL,field:Za(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Re.meta+")\\s*("+Re.comparatorOp+")\\s*("+Re.number+")\\s*\\]\\]",populate:function(e,r,n){var a=vr(n,3),i=a[0],o=a[1],l=a[2];r.checks.push({type:ve.META_COMPARE,field:Za(i),operator:o,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Re.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Re.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.DIRECTED_EDGE,source:a,target:i}),xn(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,u=ze();return o.checks.push({type:ve.NODE_SOURCE,source:l,target:u}),xn(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Re.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=r,i=ze();return n.checks.push({type:ve.UNDIRECTED_EDGE,nodes:[a,i]}),xn(e,r,n),e.edgeCount++,i}else{var o=ze(),l=r,u=ze();return o.checks.push({type:ve.NODE_NEIGHBOR,node:l,neighbor:u}),xn(e,r,o),u}}},{name:"child",separator:!0,regex:Re.child,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.CHILD,parent:i,child:a}),xn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),u.checks.push({type:ve.PARENT,parent:f,child:d}),xn(e,l,o),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.PARENT,parent:h,child:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Re.descendant,populate:function(e,r){if(e.currentSubject==null){var n=ze(),a=ze(),i=e[e.length-1];return n.checks.push({type:ve.DESCENDANT,ancestor:i,descendant:a}),xn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var o=ze(),l=e[e.length-1],u=ze(),c=ze(),d=ze(),f=ze();return o.checks.push({type:ve.COMPOUND_SPLIT,left:l,right:u,subject:c}),c.checks=r.checks,r.checks=[{type:ve.TRUE}],f.checks.push({type:ve.TRUE}),u.checks.push({type:ve.ANCESTOR,ancestor:f,descendant:d}),xn(e,l,o),e.currentSubject=c,e.compoundCount++,d}else{var h=ze(),v=ze(),p=[{type:ve.ANCESTOR,ancestor:h,descendant:v}];return h.checks=r.checks,r.checks=p,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Re.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return $e("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===ve.DIRECTED_EDGE?a.type=ve.NODE_TARGET:i===ve.UNDIRECTED_EDGE&&(a.type=ve.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];iu.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Kq=function(e){for(var r,n,a,i=0;i<iu.length;i++){var o=iu[i],l=o.name,u=e.match(o.regexObj);if(u!=null){n=u,r=o,a=l;var c=u[0];e=e.substring(c.length);break}}return{expr:r,match:n,name:a,remaining:e}},Gq=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Uq=function(e){var r=this,n=r.inputText=e,a=r[0]=ze();for(r.length=1,n=Gq(n);;){var i=Kq(n);if(i.expr==null)return $e("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),l=i.expr.populate(r,a,o);if(l===!1)return!1;if(l!=null&&(a=l),n=i.remaining,n.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var c=0;c<r.length;c++){var d=r[c];if(d.compoundCount>0&&d.edgeCount>0)return $e("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return $e("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&$e("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Wq=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return Ee(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,f){var h=d.type,v=d.value;switch(h){case ve.GROUP:{var p=e(v);return p.substring(0,p.length-1)}case ve.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+n(e(y))+r(v)+"]"}case ve.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case ve.DATA_EXIST:{var w=d.field;return"["+w+"]"}case ve.META_COMPARE:{var C=d.operator,x=d.field;return"[["+x+n(e(C))+r(v)+"]]"}case ve.STATE:return v;case ve.ID:return"#"+v;case ve.CLASS:return"."+v;case ve.PARENT:case ve.CHILD:return i(d.parent,f)+n(">")+i(d.child,f);case ve.ANCESTOR:case ve.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case ve.COMPOUND_SPLIT:{var k=i(d.left,f),E=i(d.subject,f),_=i(d.right,f);return k+(k.length>0?" ":"")+E+_}case ve.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(h,v,p){return h+(f===d&&p===0?"$":"")+a(v,f)},"")},o="",l=0;l<this.length;l++){var u=this[l];o+=i(u,u.subject),this.length>1&&l<this.length-1&&(o+=", ")}return this.toStringCache=o,o},jq={parse:Uq,toString:Wq},Gb=function(e,r,n){var a,i=Ee(e),o=de(e),l=Ee(n),u,c,d=!1,f=!1,h=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(i||l||d)&&(u=!i&&!o?"":""+e,c=""+n),d&&(e=u=u.toLowerCase(),n=c=c.toLowerCase()),r){case"*=":a=u.indexOf(c)>=0;break;case"$=":a=u.indexOf(c,u.length-c.length)>=0;break;case"^=":a=u.indexOf(c)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return f&&(e!=null||!h)&&(a=!a),a},Yq=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Zq=function(e){return e!==void 0},ou=function(e,r){return e.data(r)},Xq=function(e,r){return e[r]()},et=[],Ye=function(e,r){return e.checks.every(function(n){return et[n.type](n,r)})};et[ve.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},et[ve.STATE]=function(t,e){var r=t.value;return zq(r,e)},et[ve.ID]=function(t,e){var r=t.value;return e.id()===r},et[ve.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},et[ve.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Gb(Xq(e,r),n,a)},et[ve.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Gb(ou(e,r),n,a)},et[ve.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return Yq(ou(e,r),n)},et[ve.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Zq(ou(e,r))},et[ve.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ye(r,a)&&Ye(n,i)||Ye(n,a)&&Ye(r,i)},et[ve.NODE_NEIGHBOR]=function(t,e){return Ye(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ye(t.neighbor,r)})},et[ve.DIRECTED_EDGE]=function(t,e){return Ye(t.source,e.source())&&Ye(t.target,e.target())},et[ve.NODE_SOURCE]=function(t,e){return Ye(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ye(t.target,r)})},et[ve.NODE_TARGET]=function(t,e){return Ye(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ye(t.source,r)})},et[ve.CHILD]=function(t,e){return Ye(t.child,e)&&Ye(t.parent,e.parent())},et[ve.PARENT]=function(t,e){return Ye(t.parent,e)&&e.children().some(function(r){return Ye(t.child,r)})},et[ve.DESCENDANT]=function(t,e){return Ye(t.descendant,e)&&e.ancestors().some(function(r){return Ye(t.ancestor,r)})},et[ve.ANCESTOR]=function(t,e){return Ye(t.ancestor,e)&&e.descendants().some(function(r){return Ye(t.descendant,r)})},et[ve.COMPOUND_SPLIT]=function(t,e){return Ye(t.subject,e)&&Ye(t.left,e)&&Ye(t.right,e)},et[ve.TRUE]=function(){return!0},et[ve.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},et[ve.FILTER]=function(t,e){var r=t.value;return r(e)};var Jq=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ve.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var o=0;o<r.length;o++){var l=r[o];if(Ye(l,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},Qq=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ye(a,e))return!0}return!1},ez={matches:Qq,filter:Jq},kn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ee(e)&&e.match(/^\s*$/)||(Zt(e)?this.addQuery({checks:[{type:ve.COLLECTION,value:e.collection()}]}):Je(e)?this.addQuery({checks:[{type:ve.FILTER,value:e}]}):Ee(e)?this.parse(e)||(this.invalid=!0):Qe("A selector must be created from a string; found "))},Sn=kn.prototype;[jq,ez].forEach(function(t){return Te(Sn,t)}),Sn.text=function(){return this.inputText},Sn.size=function(){return this.length},Sn.eq=function(t){return this[t]},Sn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},Sn.addQuery=function(t){this[this.length++]=t},Sn.selector=Sn.toString;var _n={allAre:function(e){var r=new kn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new kn(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};_n.allAreNeighbours=_n.allAreNeighbors,_n.has=_n.contains,_n.equal=_n.equals=_n.same;var nr=function(e,r){return function(a,i,o,l){var u=a,c=this,d;if(u==null?d="":Zt(u)&&u.length===1&&(d=u.id()),c.length===1&&d){var f=c[0]._private,h=f.traversalCache=f.traversalCache||{},v=h[r]=h[r]||[],p=Jn(d),g=v[p];return g||(v[p]=e.call(c,a,i,o,l))}else return e.call(c,a,i,o,l)}},Xa={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:nr(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];r.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function su(t,e,r,n){for(var a=[],i=new $a,o=t.cy(),l=o.hasCompoundNodes(),u=0;u<t.length;u++){var c=t[u];r?a.push(c):l&&n(a,i,c)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&n(a,i,d)}return t}function Ub(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}Xa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return su(this,t,e,Ub)};function Wb(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Xa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return su(this,t,e,Wb)};function tz(t,e,r){Wb(t,e,r),Ub(t,e,r)}Xa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return su(this,t,e,tz)},Xa.ancestors=Xa.parents;var io,jb;io=jb={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},io.attr=io.data,io.removeAttr=io.removeData;var rz=jb,Ms={};function lu(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,o=0;o<i.length;o++){var l=i[o];!e&&l.isLoop()||(n+=t(a,l))}return n}else return}}Te(Ms,{degree:lu(function(t,e){return e.source().same(e.target())?2:1}),indegree:lu(function(t,e){return e.target().same(t)?1:0}),outdegree:lu(function(t,e){return e.source().same(t)?1:0})});function Ja(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],l=o[t](r);l!==void 0&&(n===void 0||e(l,n))&&(n=l)}return n}}Te(Ms,{minDegree:Ja("degree",function(t,e){return t<e}),maxDegree:Ja("degree",function(t,e){return t>e}),minIndegree:Ja("indegree",function(t,e){return t<e}),maxIndegree:Ja("indegree",function(t,e){return t>e}),minOutdegree:Ja("outdegree",function(t,e){return t<e}),maxOutdegree:Ja("outdegree",function(t,e){return t>e})}),Te(Ms,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var mr,Yb,Zb=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,l={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,n),i.dirtyBoundingBoxCache()}}},Xb={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){Zb(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=Yb={position:Ve.data(Xb),silentPosition:Ve.data(Te({},Xb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Zb(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Pe(e))r?this.silentPosition(e):this.position(e);else if(Je(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],l=void 0;(l=n(o,i))&&(r?o.silentPosition(l):o.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(Pe(e)?(a={x:de(e.x)?e.x:0,y:de(e.y)?e.y:0},n=r):Ee(e)&&de(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var l=this[o];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var u=l.position(),c={x:u.x+a.x,y:u.y+a.y};n?l.silentPosition(c):l.position(c)}}i.endBatch()}return this},silentShift:function(e,r){return Pe(e)?this.shift(e,!0):Ee(e)&&de(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),l=Pe(e)?e:void 0,u=l!==void 0||r!==void 0&&Ee(e);if(n&&n.isNode())if(u)for(var c=0;c<this.length;c++){var d=this[c];r!==void 0?d.position(e,(r-o[e])/i):l!==void 0&&d.position(tb(l,i,o))}else{var f=n.position();return l=Cs(f,i,o),e===void 0?l:l[e]}else if(!u)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=Pe(e)?e:void 0,o=i!==void 0||r!==void 0&&Ee(e),l=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var u=0;u<this.length;u++){var c=this[u],d=l?c.parent():null,f=d&&d.length>0,h=f;f&&(d=d[0]);var v=h?d.position():{x:0,y:0};r!==void 0?c.position(e,r+v[e]):i!==void 0&&c.position({x:i.x+v.x,y:i.y+v.y})}else{var p=n.position(),g=l?n.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:p.x-b.x,y:p.y-b.y},e===void 0?i:i[e]}else if(!o)return;return this}},mr.modelPosition=mr.point=mr.position,mr.modelPositions=mr.points=mr.positions,mr.renderedPoint=mr.renderedPosition,mr.relativePoint=mr.relativePosition;var nz=Yb,Qa,Tn;Qa=Tn={},Tn.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,l=e.y1*n+a.y,u=e.y2*n+a.y;return{x1:i,x2:o,y1:l,y2:u,w:o-i,h:u-l}},Tn.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},Tn.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var l=o._private,u=o.children(),c=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=u.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),h=l.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=h.x-f.w/2,f.x2=h.x+f.w/2,f.y1=h.y-f.h/2,f.y2=h.y+f.h/2);function v(S,T,N){var B=0,A=0,D=T+N;return S>0&&D>0&&(B=T/D*S,A=N/D*S),{biasDiff:B,biasComplementDiff:A}}function p(S,T,N,B){if(N.units==="%")switch(B){case"width":return S>0?N.pfValue*S:0;case"height":return T>0?N.pfValue*T:0;case"average":return S>0&&T>0?N.pfValue*(S+T)/2:0;case"min":return S>0&&T>0?S>T?N.pfValue*T:N.pfValue*S:0;case"max":return S>0&&T>0?S>T?N.pfValue*S:N.pfValue*T:0;default:return 0}else return N.units==="px"?N.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,x=w.biasComplementDiff,k=v(d.height.val-f.h,m,b),E=k.biasDiff,_=k.biasComplementDiff;l.autoPadding=p(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),h.x=(-C+f.x1+f.x2+x)/2,l.autoHeight=Math.max(f.h,d.height.val),h.y=(-E+f.y1+f.y2+_)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var ar=function(e){return e===1/0||e===-1/0?0:e},yr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},aa=function(e,r){return r==null?e:yr(e,r.x1,r.y1,r.x2,r.y2)},oo=function(e,r,n){return gr(e,r,n)},Fs=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,o=i.arrowWidth/2,l=r.pstyle(n+"-arrow-shape").value,u,c;if(l!=="none"){n==="source"?(u=i.srcX,c=i.srcY):n==="target"?(u=i.tgtX,c=i.tgtY):(u=i.midX,c=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[n]=d[n]||{};f.x1=u-o,f.y1=c-o,f.x2=u+o,f.y2=c+o,f.w=f.x2-f.x1,f.h=f.y2-f.y1,xs(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},cu=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,o=i.rstyle,l=r.pstyle(a+"label").strValue;if(l){var u=r.pstyle("text-halign"),c=r.pstyle("text-valign"),d=oo(o,"labelWidth",n),f=oo(o,"labelHeight",n),h=oo(o,"labelX",n),v=oo(o,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,g=r.pstyle(a+"text-margin-y").pfValue,y=r.isEdge(),m=r.pstyle(a+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,C=w/2,x=r.pstyle("text-background-padding").pfValue,k=2,E=f,_=d,S=_/2,T=E/2,N,B,A,D;if(y)N=h-S,B=h+S,A=v-T,D=v+T;else{switch(u.value){case"left":N=h-_,B=h;break;case"center":N=h-S,B=h+S;break;case"right":N=h,B=h+_;break}switch(c.value){case"top":A=v-E,D=v;break;case"center":A=v-T,D=v+T;break;case"bottom":A=v,D=v+E;break}}N+=p-Math.max(b,C)-x-k,B+=p+Math.max(b,C)+x+k,A+=g-Math.max(b,C)-x-k,D+=g+Math.max(b,C)+x+k;var R=n||"main",O=i.labelBounds,M=O[R]=O[R]||{};M.x1=N,M.y1=A,M.x2=B,M.y2=D,M.w=B-N,M.h=D-A;var P=y&&m.strValue==="autorotate",z=m.pfValue!=null&&m.pfValue!==0;if(P||z){var W=P?oo(i.rstyle,"labelAngle",n):m.pfValue,H=Math.cos(W),G=Math.sin(W),X=(N+B)/2,F=(A+D)/2;if(!y){switch(u.value){case"left":X=B;break;case"right":X=N;break}switch(c.value){case"top":F=D;break;case"bottom":F=A;break}}var V=function(ce,ae){return ce=ce-X,ae=ae-F,{x:ce*H-ae*G+X,y:ce*G+ae*H+F}},q=V(N,A),$=V(N,D),K=V(B,A),L=V(B,D);N=Math.min(q.x,$.x,K.x,L.x),B=Math.max(q.x,$.x,K.x,L.x),A=Math.min(q.y,$.y,K.y,L.y),D=Math.max(q.y,$.y,K.y,L.y)}var j=R+"Rot",Y=O[j]=O[j]||{};Y.x1=N,Y.y1=A,Y.x2=B,Y.y2=D,Y.w=B-N,Y.h=D-A,yr(e,N,A,B,D),yr(i.labelBounds.all,N,A,B,D)}return e}},az=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,o=r.pstyle("shape").value,l=a+i,u=(e.w+l*2)/e.w,c=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(o)?(u=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?u=(e.w+l*2.4)/e.w:o==="star"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.6)/e.h,f=-l/3.8):o==="triangle"?(u=(e.w+l*2.8)/e.w,c=(e.h+l*2.4)/e.h,f=-l/1.4):o==="vee"&&(u=(e.w+l*4.4)/e.w,c=(e.h+l*3.8)/e.h,f=-l*.5);var h=e.h*c-e.h,v=e.w*u-e.w;if(ks(e,[Math.ceil(h/2),Math.ceil(v/2)]),d!=0||f!==0){var p=S5(e,d,f);nb(e,p)}}}},iz=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Gt(),l=e._private,u=e.isNode(),c=e.isEdge(),d,f,h,v,p,g,y=l.rstyle,m=u&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!c||b(e.source())&&b(e.target()));if(w){var C=0,x=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(x=e.pstyle("overlay-padding").value));var k=0,E=0;a&&r.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(E=e.pstyle("underlay-padding").value));var _=Math.max(x,E),S=0,T=0;if(a&&(S=e.pstyle("width").pfValue,T=S/2),u&&r.includeNodes){var N=e.position();p=N.x,g=N.y;var B=e.outerWidth(),A=B/2,D=e.outerHeight(),R=D/2;d=p-A,f=p+A,h=g-R,v=g+R,yr(o,d,h,f,v),a&&r.includeOutlines&&az(o,e)}else if(c&&r.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),h=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,h=M[0].y,f=M[1].x,v=M[1].y,d>f){var P=d;d=f,f=P}if(h>v){var z=h;h=v,v=z}yr(o,d-T,h-T,f+T,v+T)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var W;switch(O){case"bezier":case"unbundled-bezier":W=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":W=y.linePts;break}if(W!=null)for(var H=0;H<W.length;H++){var G=W[H];d=G.x-T,f=G.x+T,h=G.y-T,v=G.y+T,yr(o,d,h,f,v)}}}else{var X=e.source(),F=X.position(),V=e.target(),q=V.position();if(d=F.x,f=q.x,h=F.y,v=q.y,d>f){var $=d;d=f,f=$}if(h>v){var K=h;h=v,v=K}d-=T,f+=T,h-=T,v+=T,yr(o,d,h,f,v)}if(a&&r.includeEdges&&c&&(Fs(o,e,"mid-source"),Fs(o,e,"mid-target"),Fs(o,e,"source"),Fs(o,e,"target")),a){var L=e.pstyle("ghost").value==="yes";if(L){var j=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;yr(o,o.x1+j,o.y1+Y,o.x2+j,o.y2+Y)}}var se=l.bodyBounds=l.bodyBounds||{};ab(se,o),ks(se,m),xs(se,1),a&&(d=o.x1,f=o.x2,h=o.y1,v=o.y2,yr(o,d-_,h-_,f+_,v+_));var ce=l.overlayBounds=l.overlayBounds||{};ab(ce,o),ks(ce,m),xs(ce,1);var ae=l.labelBounds=l.labelBounds||{};ae.all!=null?k5(ae.all):ae.all=Gt(),a&&r.includeLabels&&(r.includeMainLabels&&cu(o,e,null),c&&(r.includeSourceLabels&&cu(o,e,"source"),r.includeTargetLabels&&cu(o,e,"target")))}return o.x1=ar(o.x1),o.y1=ar(o.y1),o.x2=ar(o.x2),o.y2=ar(o.y2),o.w=ar(o.x2-o.x1),o.h=ar(o.y2-o.y1),o.w>0&&o.h>0&&w&&(ks(o,m),xs(o,1)),o},Jb=function(e){var r=0,n=function(o){return(o?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},Qb=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(o){return Math.round(o)};return GF([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},e1=function(e,r){var n=e._private,a,i=e.isEdge(),o=r==null?t1:Jb(r),l=o===t1,u=Qb(e),c=n.bbCachePosKey===u,d=r.useCache&&c,f=function(g){return g._private.bbCache==null||g._private.styleDirty},h=!d||f(e)||i&&f(e.source())||f(e.target());if(h?(c||e.recalculateRenderedStyle(d),a=iz(e,so),n.bbCache=a,n.bbCachePosKey=u):a=n.bbCache,!l){var v=e.isNode();a=Gt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?aa(a,n.overlayBounds):aa(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?aa(a,n.labelBounds.all):(r.includeMainLabels&&aa(a,n.labelBounds.mainRot),r.includeSourceLabels&&aa(a,n.labelBounds.sourceRot),r.includeTargetLabels&&aa(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},so={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},t1=Jb(so),r1=St(so);Tn.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=so:t=r1(t),e=e1(this[0],t);else{e=Gt(),t=t||so;var r=r1(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var o=0;o<n.length;o++){var l=n[o],u=l._private,c=Qb(l),d=u.bbCachePosKey===c,f=r.useCache&&d&&!u.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var h=0;h<n.length;h++){var v=n[h];aa(e,e1(v,r))}}return e.x1=ar(e.x1),e.y1=ar(e.y1),e.x2=ar(e.x2),e.y2=ar(e.y2),e.w=ar(e.x2-e.x1),e.h=ar(e.y2-e.y1),e},Tn.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},Tn.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(c){return c.isParent()}),e=e.not(a)),Pe(t)){var i=t;t=function(){return i}}var o=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=x5(this.boundingBox({useCache:!1}));return e.silentPositions(l),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),u},Qa.boundingbox=Qa.bb=Qa.boundingBox,Qa.renderedBoundingbox=Qa.renderedBoundingBox;var oz=Tn,lo,co;lo=co={};var n1=function(e){e.uppercaseName=R0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=R0(e.outerName),lo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var l=n.pstyle(e.name);switch(l.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},lo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var l=n[e.name](),u=n.pstyle("border-width").pfValue,c=2*n.padding();return l+u+c}else return 1},lo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},lo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};n1({name:"width"}),n1({name:"height"}),co.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},co.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},co.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var sz=co,lz=function(e,r){if(e.isEdge())return r(e)},cz=function(e,r){if(e.isEdge()){var n=e.cy();return Cs(r(e),n.zoom(),n.pan())}},uz=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(o){return Cs(o,i,a)})}},dz=function(e){return e.renderer().getControlPoints(e)},fz=function(e){return e.renderer().getSegmentPoints(e)},hz=function(e){return e.renderer().getSourceEndpoint(e)},pz=function(e){return e.renderer().getTargetEndpoint(e)},vz=function(e){return e.renderer().getEdgeMidpoint(e)},a1={controlPoints:{get:dz,mult:!0},segmentPoints:{get:fz,mult:!0},sourceEndpoint:{get:hz},targetEndpoint:{get:pz},midpoint:{get:vz}},gz=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},mz=Object.keys(a1).reduce(function(t,e){var r=a1[e],n=gz(e);return t[e]=function(){return lz(this,r.get)},r.mult?t[n]=function(){return uz(this,r.get)}:t[n]=function(){return cz(this,r.get)},t},{}),yz=Te({},nz,oz,sz,mz);/*!
36
36
  Event object based on jQuery events, MIT license
37
37
 
38
38
  https://jquery.org/license/
39
39
  https://tldrlegal.com/license/mit-license
40
40
  https://github.com/jquery/jquery/blob/master/src/event.js
41
- */var n1=function(e,r){this.recycle(e,r)};function co(){return!1}function Fs(){return!0}n1.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=co,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Fs:co):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Fs;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Fs;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Fs,this.stopPropagation()},isDefaultPrevented:co,isPropagationStopped:co,isImmediatePropagationStopped:co};var a1=/^([^.]+)(\.(?:[^.]+))?$/,gz=".*",i1={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},o1=Object.keys(i1),mz={};function Ms(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mz,e=arguments.length>1?arguments[1]:void 0,r=0;r<o1.length;r++){var n=o1[r];this[n]=t[n]||i1[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Tn=Ms.prototype,s1=function(e,r,n,a,i,o,l){Xe(a)&&(i=a,a=null),l&&(o==null?o=l:o=Se({},o,l));for(var c=Ke(n)?n:n.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!mn(d)){var f=d.match(a1);if(f){var h=f[1],v=f[2]?f[2]:null,p=r(e,d,h,v,a,i,o);if(p===!1)break}}}},l1=function(e,r){return e.addEventFields(e.context,r),new n1(r.type,r)},yz=function(e,r,n){if(MF(n)){r(e,n);return}else if(Ae(n)){r(e,l1(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!mn(o)){var l=o.match(a1);if(l){var c=l[1],u=l[2]?l[2]:null,d=l1(e,{type:c,namespace:u,target:e.context});r(e,d)}}}};Tn.on=Tn.addListener=function(t,e,r,n,a){return s1(this,function(i,o,l,c,u,d,f){Xe(d)&&i.listeners.push({event:o,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,r,n,a),this},Tn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Tn.removeListener=Tn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=jM(this.listeners));for(var i=this.listeners,o=function(u){var d=i[u];s1(a,function(f,h,v,p,g,y){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},Tn.removeAllListeners=function(){return this.removeListener("*")},Tn.emit=Tn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),yz(this,function(i,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===gz)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&YM(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,o),p=f.callback.apply(v,h);i.afterEmit(i.context,f,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var bz={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ki(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},$s=function(e){return Ee(e)?new xn(e):e},u1={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Ms(bz,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=$s(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ve.eventAliasesOn(u1);var c1={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Ee(e)||Zt(e))return new xn(e).filter(this);if(Xe(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);l&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ee(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ee(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,l=o?a:i,c=o?i:a,u=0;u<l.length;u++){var d=l[u];c.has(d)&&n.push(d)}return n},xor:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,o=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],h=f._private.data.id,v=u.hasElementWithId(h);v||n.push(f)}};return o(a,i),o(i,a),n},diff:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,l=e,c=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,y=f.hasElementWithId(g);y?i.merge(p):h.push(p)}};return c(o,l,n),c(l,o,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],l=!this.has(o);l&&a.push(o)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ee(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,o=0;o<e.length;o++){var l=e[o],c=l._private.data.id,u=!i.has(c);if(u){var d=this.length++;this[d]=l,i.set(c,{ele:l,index:d})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var l=this.length-1,c=this[l],u=c._private.data.id;this[l]=void 0,this[e]=c,i.set(u,{ele:c,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);n.push(l)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c>n&&(n=c,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],c=r?e.apply(r,[l,o,i]):e(l,o,i);c<n&&(n=c,a=l)}return{value:n,ele:a}}},Le=c1;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var wz={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},d1=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?$u:0}var o=i(e)-i(r);if(o!==0)return o;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var c=l(e)-l(r);if(c!==0)return c;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},Vs={forEach:function(e,r){if(Xe(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=r?e.apply(r,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Xe(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(d1)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:$u-1}else{var i=r.source,o=r.target,l=i.zDepth(),c=o.zDepth();return Math.max(l,c,0)}}}};Vs.each=Vs.forEach;var Cz=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ht(Symbol))!=e&&ht(Symbol.iterator)!=e;r&&(Vs[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return k0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};Cz();var Ez=St({nodeDimensionsIncludeLabels:!1}),qs={layoutDimensions:function(e){e=Ez(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(x){return!x.isParent()}),i=this.cy(),o=r.eles,l=function(k){return k.id()},c=Gi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(k,E,_){var S={x:E.x1+E.w/2,y:E.y1+E.h/2},T={x:(_.x-S.x)*k,y:(_.y-S.y)*k};return{x:S.x+T.x,y:S.y+T.y}},d=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var k=Kt(),E=0;E<a.length;E++){var _=a[E],S=c(_,E);x5(k,S.x,S.y)}return k},h=f(),v=Gi(function(x,k){var E=c(x,k);if(d){var _=Math.abs(r.spacingFactor);E=u(_,h,E)}return r.transform!=null&&(E=r.transform(x,E)),E},l);if(r.animate){for(var p=0;p<a.length;p++){var g=a[p],y=v(g,p),m=r.animateFilter==null||r.animateFilter(g,p);if(m){var b=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(y)}if(r.fit){var w=i.animation({fit:{boundingBox:o.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var C=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(C)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ua.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Se({},e,{eles:this}))}};qs.createLayout=qs.makeLayout=qs.layout;function f1(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function zs(t,e){return t=Xn(t),function(n){return f1(t,e,n)}}function Hs(t,e){t=Xn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return f1(t,r,a)}}var _t={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Ae(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ee(e))if(r===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var c=this[0];return c?i.getRawStyle(c):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var l=i[o];a.removeAllBypasses(l,n)}else{e=e.split(/\s+/);for(var c=0;c<i.length;c++){var u=i[c];a.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var o=a.data.parent?n.parents():null;if(o)for(var l=0;l<o.length;l++){var c=o[l],u=c.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function uc(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function cc(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],o=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!o||uc(i,n);var c=l.source,u=l.target;return r(c)&&(!o||uc(c,r))&&(c===u||r(u)&&(!o||uc(u,r)))}}}var ei=zs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});_t.takesUpSpace=Hs("takesUpSpace",cc({ok:ei}));var xz=zs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&ei(t)}),kz=zs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&ei(t)});_t.interactive=Hs("interactive",cc({ok:xz,parentOk:kz,edgeOkViaNode:ei})),_t.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Sz=zs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&ei(t)}),_z=ei;_t.visible=Hs("visible",cc({ok:Sz,edgeOkViaNode:_z})),_t.hidden=function(){var t=this[0];if(t)return!t.visible()},_t.isBundledBezier=Hs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),_t.bypass=_t.css=_t.style,_t.renderedCss=_t.renderedStyle,_t.removeBypass=_t.removeCss=_t.removeStyle,_t.pstyle=_t.parsedStyle;var Nn={};function h1(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&&Xe(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var o=e.length===1?e[0]:null,l=0;l<this.length;l++){var c=this[l],u=!t.ableField||c._private[t.ableField],d=c._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(c);if(f!==void 0&&(u=f,!f))return this}u&&(c._private[t.field]=t.value,d&&r.push(c))}var h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}function ti(t){Nn[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},Nn[t.on]=h1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Nn[t.off]=h1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ti({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),ti({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),ti({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),ti({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Nn.deselect=Nn.unselect,Nn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},ti({field:"active",on:"activate",off:"unactivate"}),ti({field:"pannable",on:"panify",off:"unpanify"}),Nn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Bt={},p1=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var l=a[o];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(n)}},v1=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var l=o.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===o?(a.push(u),a.push(f)):e.incoming&&f===o&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(r)}},g1=function(e){return function(r){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var l=!1,c=0;c<o.length;c++){var u=o[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;n=o}return this.spawn(a,!0).filter(r)}};Bt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Se(Bt,{roots:p1({noIncomingEdges:!0}),leaves:p1({noOutgoingEdges:!0}),outgoers:nr(v1({outgoing:!0}),"outgoers"),successors:g1({outgoing:!0}),incomers:nr(v1({incoming:!0}),"incomers"),predecessors:g1({incoming:!0})}),Se(Bt,{neighborhood:nr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),o=0;o<i.length;o++){var l=i[o],c=l.source(),u=l.target(),d=a===c?u:c;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Bt.neighbourhood=Bt.neighborhood,Bt.closedNeighbourhood=Bt.closedNeighborhood,Bt.openNeighbourhood=Bt.openNeighborhood,Se(Bt,{source:nr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:nr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:m1({attr:"source"}),targets:m1({attr:"target"})});function m1(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(r)}}Se(Bt,{edgesWith:nr(y1(),"edgesWith"),edgesTo:nr(y1({thisIsSrc:!0}),"edgesTo")});function y1(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ee(r)&&(r=a.$(r));for(var o=0;o<r.length;o++)for(var l=r[o]._private.edges,c=0;c<l.length;c++){var u=l[c],d=u._private.data,f=this.hasElementWithId(d.source)&&r.hasElementWithId(d.target),h=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}Se(Bt,{connectedEdges:nr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var l=i[o];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:nr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:nr(b1(),"parallelEdges"),codirectedEdges:nr(b1({codirected:!0}),"codirectedEdges")});function b1(t){var e={codirected:!1};return t=Se({},e,t),function(n){for(var a=[],i=this.edges(),o=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,h=u.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],y=g._private.data,m=y.target,b=y.source,w=m===h&&b===f,C=f===m&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Se(Bt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return r.spawn();var c=function(){var d=n.collection();o.push(d);var f=i[0];l(f,d),r.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(h){h.connectedEdges().forEach(function(v){r.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do c();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Bt.componentsOf=Bt.components;var Tt=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Je("A collection must have a reference to the core");return}var i=new Ir,o=!1;if(!r)r=[];else if(r.length>0&&Ae(r[0])&&!Ki(r[0])){o=!0;for(var l=[],c=new $a,u=0,d=r.length;u<d;u++){var f=r[u];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=Z0();else if(e.hasElementWithId(h.id)||c.has(h.id))continue;var v=new ys(e,f,!1);l.push(v),c.add(h.id)}r=l}this.length=0;for(var p=0,g=r.length;p<g;p++){var y=r[p][0];if(y!=null){var m=y._private.data.id;(!n||!i.has(m))&&(n&&i.set(m,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new Ir,C=this.eles,x=0;x<C.length;x++){var k=C[x];w.set(k.id(),{index:x,ele:k})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ge=ys.prototype=Tt.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new Tt(this.cy(),t,e)},Ge.spawnSelf=function(){return this.spawn(this)},Ge.cy=function(){return this._private.cy},Ge.renderer=function(){return this._private.cy.renderer()},Ge.element=function(){return this[0]},Ge.collection=function(){return B0(this)?this:new Tt(this._private.cy,[this])},Ge.unique=function(){return new Tt(this._private.cy,this,!0)},Ge.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Ge.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Tt(e)},Ge.$id=Ge.getElementById,Ge.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},Ge.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Ge.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Ge.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Ae(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,o={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(o.source=""+l,i=!0),c!=null&&c!=a.target&&(o.target=""+c,i=!0),i&&(e=e.move(o))}else{var u="parent"in t.data,d=t.data.parent;u&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==n[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var h={data:Nr(n.data),position:Nr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var v=0;return n.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},Ge.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},Ge.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new ys(t,a,!1);e.push(i)}return new Tt(t,e)},Ge.copy=Ge.clone,Ge.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],o=[],l,c=0,u=r.length;c<u;c++){var d=r[c];e&&!d.removed()||(d.isNode()?i.push(d):o.push(d))}l=i.concat(o);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=Z0();else if(de(g.id))g.id=""+g.id;else if(mn(g.id)||!Ee(g.id)){Je("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(n.hasElementWithId(g.id)){Je("Can not create second element with ID `"+g.id+"`"),h();continue}}var y=g.id;if(v.isNode()){var m=p.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,x=!1,k=0;k<C;k++){var E=w[k],_=g[E];de(_)&&(_=g[E]=""+g[E]),_==null||_===""?(Je("Can not create edge `"+y+"` with unspecified "+E),x=!0):n.hasElementWithId(_)||(Je("Can not create edge `"+y+"` with nonexistant "+E+" `"+_+"`"),x=!0)}if(x){h();continue}var S=n.getElementById(g.source),T=n.getElementById(g.target);S.same(T)?S._private.edges.push(b):(S._private.edges.push(b),T._private.edges.push(b)),b._private.source=S,b._private.target=T}p.map=new Ir,p.map.set(y,{ele:v,index:0}),p.removed=!1,e&&n.addToPool(v)}for(var N=0;N<i.length;N++){var B=i[N],P=B._private.data;de(P.parent)&&(P.parent=""+P.parent);var D=P.parent,R=D!=null;if(R||B._private.parent){var O=B._private.parent?n.collection().merge(B._private.parent):n.getElementById(D);if(O.empty())P.parent=void 0;else if(O[0].removed())$e("Node added with missing parent, reference to parent removed"),P.parent=void 0,B._private.parent=null;else{for(var F=!1,A=O;!A.empty();){if(B.same(A)){F=!0,P.parent=void 0;break}A=A.parent()}F||(O[0]._private.children.push(B),B._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var z=l.length===r.length?r:new Tt(n,l),j=0;j<z.length;j++){var H=z[j];H.isNode()||(H.parallelEdges().clearTraversalCache(),H.source().clearTraversalCache(),H.target().clearTraversalCache())}var G;a.hasCompoundNodes?G=n.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):G=z,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?z.emitAndNotify("add"):e&&z.emit("add")}return r},Ge.removed=function(){var t=this[0];return t&&t._private.removed},Ge.inside=function(){var t=this[0];return t&&!t._private.removed},Ge.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function o(D){for(var R=D._private.edges,O=0;O<R.length;O++)c(R[O])}function l(D){for(var R=D._private.children,O=0;O<R.length;O++)c(R[O])}function c(D){var R=a[D.id()];e&&D.removed()||R||(a[D.id()]=!0,D.isNode()?(n.push(D),o(D),l(D)):n.unshift(D))}for(var u=0,d=r.length;u<d;u++){var f=r[u];c(f)}function h(D,R){var O=D._private.edges;bn(O,R),D.clearTraversalCache()}function v(D){D.clearTraversalCache()}var p=[];p.ids={};function g(D,R){R=R[0],D=D[0];var O=D._private.children,F=D.id();bn(O,R),R._private.parent=null,p.ids[F]||(p.ids[F]=!0,p.push(D))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var m=n[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];h(b,m),h(w,m);for(var C=m.parallelEdges(),x=0;x<C.length;x++){var k=C[x];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=m.parent();E.length!==0&&g(E,m)}e&&(m._private.removed=!0)}var _=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<_.length;S++){var T=_[S];if(T.isParent()){i._private.hasCompoundNodes=!0;break}}var N=new Tt(this.cy(),n);N.size()>0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var B=0;B<p.length;B++){var P=p[B];(!e||!P.removed())&&P.updateStyle()}return N},Ge.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),l=i(t.target),c=o!=null&&e.hasElementWithId(o),u=l!=null&&e.hasElementWithId(l);(c||u)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var p=r[v],g=p._private.data;p.isEdge()&&(c&&(g.source=o),u&&(g.target=l))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var h=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],y=g._private.data;g.isNode()&&(y.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[xb,Fq,As,Sn,Xa,Qq,Rs,vz,u1,c1,wz,Vs,qs,_t,Nn,Bt].forEach(function(t){Se(Ge,t)});var Tz={add:function(e){var r,n=this;if(Zt(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],o=0;o<a.length;o++){var l=a[o];i.push(l.json())}r=new Tt(n,i)}}else if(Ke(e)){var c=e;r=new Tt(n,c)}else if(Ae(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=u[p];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=Se({group:p},g[y]);d.push(b)}}r=new Tt(n,d)}else{var w=e;r=new ys(n,w).collection()}return r},remove:function(e){if(!Zt(e)){if(Ee(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Nz(t,e,r,n){var a=4,i=.001,o=1e-7,l=10,c=11,u=1/(c-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=d?new Float32Array(c):new Array(c);function v(T,N){return 1-3*N+3*T}function p(T,N){return 3*N-6*T}function g(T){return 3*T}function y(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function m(T,N,B){return 3*v(N,B)*T*T+2*p(N,B)*T+g(N)}function b(T,N){for(var B=0;B<a;++B){var P=m(N,t,r);if(P===0)return N;var D=y(N,t,r)-T;N-=D/P}return N}function w(){for(var T=0;T<c;++T)h[T]=y(T*u,t,r)}function C(T,N,B){var P,D,R=0;do D=N+(B-N)/2,P=y(D,t,r)-T,P>0?B=D:N=D;while(Math.abs(P)>o&&++R<l);return D}function x(T){for(var N=0,B=1,P=c-1;B!==P&&h[B]<=T;++B)N+=u;--B;var D=(T-h[B])/(h[B+1]-h[B]),R=N+D*u,O=m(R,t,r);return O>=i?b(T,R):O===0?R:C(T,N,N+u)}var k=!1;function E(){k=!0,(t!==e||r!==n)&&w()}var _=function(N){return k||E(),t===e&&r===n?N:N===0?0:N===1?1:y(x(N),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return S},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Iz=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var i={dx:n.v,dv:t(n)},o=e(n,a*.5,i),l=e(n,a*.5,o),c=e(n,a,l),u=1/6*(i.dx+2*(o.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(o.dv+l.dv)+c.dv);return n.x=n.x+u*a,n.v=n.v+d*a,n}return function n(a,i,o){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,l.tension=a,l.friction=i,h=o!==null,h?(u=n(a,i),v=u/o*f):v=f;p=r(p||l,v),c.push(1+p.x),u+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,r,n,a){var i=Nz(e,r,n,a);return function(o,l,c){return o+(l-o)*i(c)}},Ks={linear:function(e,r,n){return e+(r-e)*n},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Ks.linear;var a=Iz(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function w1(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function C1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ri(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=C1(t,a),l=C1(e,a);if(de(o)&&de(l))return w1(i,o,l,r,n);if(Ke(o)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=o[u],f=l[u];if(d!=null&&f!=null){var h=w1(i,d,f,r,n);c.push(h)}else c.push(f)}return c}}function Bz(t,e,r,n){var a=!n,i=t._private,o=e._private,l=o.easing,c=o.startTime,u=n?t:t.cy(),d=u.style();if(!o.easingImpl)if(l==null)o.easingImpl=Ks.linear;else{var f;if(Ee(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;Ee(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(z){return+z})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Ks[v].apply(null,p)):o.easingImpl=Ks[v]}var g=o.easingImpl,y;if(o.duration===0?y=1:y=(r-c)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var m=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};fo(m.x,b.x)&&(w.x=ri(m.x,b.x,y,g)),fo(m.y,b.y)&&(w.y=ri(m.y,b.y,y,g)),t.position(w)}var C=o.startPan,x=o.pan,k=i.pan,E=x!=null&&n;E&&(fo(C.x,x.x)&&(k.x=ri(C.x,x.x,y,g)),fo(C.y,x.y)&&(k.y=ri(C.y,x.y,y,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(fo(_,S)&&(i.zoom=eo(i.minZoom,ri(_,S,y,g),i.maxZoom)),t.emit("zoom")),(E||T)&&t.emit("viewport");var N=o.style;if(N&&N.length>0&&a){for(var B=0;B<N.length;B++){var P=N[B],D=P.name,R=P,O=o.startStyle[D],F=d.properties[O.name],A=ri(O,R,y,g,F);d.overrideBypass(t,D,A)}t.emit("style")}}return o.progress=y,y}function fo(t,e){return t==null||e==null?!1:de(t)&&de(e)?!0:!!(t&&e)}function Dz(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function E1(t,e){var r=e._private.aniEles,n=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var y=p.shift();y&&v.push(y)}for(var m=function(k){for(var E=k.length-1;E>=0;E--){var _=k[E];_()}k.splice(0,k.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||Dz(d,w,t),Bz(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&n.push(d),g}for(var i=!1,o=0;o<r.length;o++){var l=r[o],c=a(l);i=i||c}var u=a(e,!0);(i||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Pz={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&vs(function(i){E1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){E1(o,e)},n.beforeRenderPriorities.animations):r()}},Oz={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ki(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Gs=function(e){return Ee(e)?new xn(e):e},x1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ms(Oz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Gs(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Gs(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Gs(r),n),this},once:function(e,r,n){return this.emitter().one(e,Gs(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ve.eventAliasesOn(x1);var dc={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};dc.jpeg=dc.jpg;var Us={layout:function(e){var r=this;if(e==null){Je("Layout options must be specified to make a layout");return}if(e.name==null){Je("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Je("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new a(Se({},e,{cy:r,eles:i}));return o}};Us.createLayout=Us.makeLayout=Us.layout;var Az={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],o=e[i],l=r.getElementById(i);l.data(o)}})}},Rz=St({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),fc={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){Je("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&$e("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=Rz(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};fc.invalidateDimensions=fc.resize;var js={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new Tt(this,e,r.unique,r.removed)):new Tt(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};js.elements=js.filter=js.$;var Dt={},ho="t",Lz="f";Dt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var o=t[i],l=e.getContextMeta(o);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var d=e.updateStyleHints(o);d&&a.push(o)}}return a},Dt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var o=[],l={},c=0;c<r.length;c++){var u=r[c],d=t[c]===ho,f=e[c]===ho,h=d!==f,v=u.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=u.properties:v&&(p=u.mappedProperties);for(var g=0;g<p.length;g++){for(var y=p[g],m=y.name,b=!1,w=c+1;w<r.length;w++){var C=r[w],x=e[w]===ho;if(x&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,o.push(m))}}}return n[a]=o,o},Dt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],l=o.selector&&o.selector.matches(t);l?r+=ho:r+=Lz}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Dt.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],l=e[i]===ho;if(l)for(var c=0;c<o.properties.length;c++){var u=o.properties[c];a[u.name]=u}}return n[e]=a,a},Dt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},o=n.types,l=0;l<a.length;l++){var c=a[l],u=e[c],d=r.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===o.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,h=f.fnValue=u.value(r);if(h===f.prevFnValue)continue}var v=i[c]={prev:d};n.applyParsedProperty(r,u),v.next=r.pstyle(c),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Dt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(Y,se,ue){return r.getPropertiesHash(Y,se,ue)},o=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",c=t._private.style;n=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[Ma,Yi]}for(var f=function(Y,se){return e.styleKeys[se][0]=Zi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Xi(Y,e.styleKeys[se][1])},v=function(Y,se){f(Y,se),h(Y,se)},p=function(Y,se){for(var ue=0;ue<Y.length;ue++){var ae=Y.charCodeAt(ue);f(ae,se),h(ae,se)}},g=2e9,y=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},m=0;m<n.length;m++){var b=n[m],w=c[b];if(w!=null){var C=this.properties[b],x=C.type,k=C.groupKey,E=void 0;C.hashOverride!=null?E=C.hashOverride(t,w):w.pfValue!=null&&(E=w.pfValue);var _=C.enums==null?w.value:null,S=E!=null,T=_!=null,N=S||T,B=w.units;if(x.number&&N&&!x.multiple){var P=S?E:_;v(y(P),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Ma,Yi],R=0;R<a.length;R++){var O=a[R],F=e.styleKeys[O];D[0]=Zi(F[0],D[0]),D[1]=Xi(F[1],D[1])}e.styleKey=qM(D[0],D[1]);var A=e.styleKeys;e.labelDimsKey=yn(A.labelDimensions);var z=i(t,["label"],A.labelDimensions);if(e.labelKey=yn(z),e.labelStyleKey=yn(gs(A.commonLabel,z)),!l){var j=i(t,["source-label"],A.labelDimensions);e.sourceLabelKey=yn(j),e.sourceLabelStyleKey=yn(gs(A.commonLabel,j));var H=i(t,["target-label"],A.labelDimensions);e.targetLabelKey=yn(H),e.targetLabelStyleKey=yn(gs(A.commonLabel,H))}if(l){var G=e.styleKeys,X=G.nodeBody,M=G.nodeBorder,V=G.nodeOutline,q=G.backgroundImage,$=G.compound,K=G.pie,L=[X,M,V,q,$,K].filter(function(W){return W!=null}).reduce(gs,[Ma,Yi]);e.nodeKey=yn(L),e.hasPie=K!=null&&K[0]!==Ma&&K[1]!==Yi}return o!==e.styleKey},Dt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Dt.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,o=r.types,l=r.properties[n.name].type,c=n.bypass,u=a[n.name],d=u&&u.bypass,f=t._private,h="mapping",v=function(X){return X==null?null:X.pfValue!=null?X.pfValue:X.value},p=function(){var X=v(u),M=v(n);r.checkTriggers(t,n.name,X,M)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",c)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var g=function(){$e("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var y=n.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(de(m)){var x=n.fieldMax-n.fieldMin;x===0?C=0:C=(m-n.fieldMin)/x}else return $e("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var k=n.valueMin[0],E=n.valueMax[0],_=n.valueMin[1],S=n.valueMax[1],T=n.valueMin[2],N=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],P=n.valueMax[3]==null?1:n.valueMax[3],D=[Math.round(k+(E-k)*C),Math.round(_+(S-_)*C),Math.round(T+(N-T)*C),Math.round(B+(P-B)*C)];i={bypass:n.bypass,name:n.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else if(l.number){var R=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,R,n.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case o.data:{for(var O=n.field.split("."),F=f.data,A=0;A<O.length&&F;A++){var z=O[A];F=F[z]}if(F!=null&&(i=this.parse(n.name,F,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var j=n.value,H=n.fnValue!=null?n.fnValue:j(t);if(n.prevFnValue=H,H==null)return $e("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,H,n.bypass,h),!i)return $e("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Nr(n),n=i;break}case void 0:break;default:return!1}return c?(d?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):d?u.bypassed=n:a[n.name]=n,p(),!0},Dt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var l=i[o],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Dt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Dt.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},c=!1,u=0;u<a.length;u++){var d=a[u],f=t.pstyle(d),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,y=!1,m=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(y=g.pfValue-p.pfValue,m=p.pfValue+b*y):de(p.value)&&de(g.value)?(y=g.value-p.value,m=p.value+b*y):Ke(p.value)&&Ke(g.value)&&(y=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;n.transitioning=!0,new Ua(function(w){o>0?t.delayAnimation(o).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)},Dt.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},Dt.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Dt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Dt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var po={};po.applyBypass=function(t,e,r,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],u=c.name,d=this.parse(u,r,!0);d&&i.push(d)}}else if(Ee(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Ae(e)){var h=e;n=r;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],y=h[g];if(y===void 0&&(y=h[fs(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],x={},k=void 0,E=0;E<i.length;E++){var _=i[E];if(n){var S=C.pstyle(_.name);k=x[_.name]={prev:S}}b=this.applyParsedProperty(C,Nr(_))||b,n&&(k.next=C.pstyle(_.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,o)}return b},po.overrideBypass=function(t,e,r){e=Lu(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],o=this.properties[e].type,l=o.color,c=o.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),l?i.strValue="rgb("+r.join(",")+")":c?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,u,r)}},po.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},po.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],o={},l=0;l<e.length;l++){var c=e[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var f="",h=this.parse(c,f,!0),v=o[u.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,n)}};var hc={};hc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},hc.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var Br={};Br.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},Br.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(n[i.name]=o,n[fs(i.name)]=o)}return n}},Br.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},Br.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=t.pstyle(a.name);if(o){var l=o.value,c=o.units,u=o.strValue;if(r&&i.number&&l!=null&&de(l)){var d=t.cy().zoom(),f=function(y){return y*d},h=function(y,m){return f(y)+m},v=Ke(l),p=v?c.every(function(g){return g!=null}):c!=null;return p?v?l.map(function(g,y){return h(g,c[y])}).join(" "):h(l,c):v?l.map(function(g){return Ee(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},Br.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=t.pstyle(i);o!==void 0&&(Ae(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r},Br.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var l=i[o],c=n[l],u=a[l]||a[Lu(l)],d=this.parse(u.name,c);d&&r.push(d)}return r},Br.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,o,l,c,u;for(c=0;c<e.length;c++)if(a=e[c],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Zi(l,n[0]),n[1]=Xi(l,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)l=o.charCodeAt(u),n[0]=Zi(l,n[0]),n[1]=Xi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var Ws={};Ws.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,o=Object.keys(i);e.selector(a);for(var l=0;l<o.length;l++){var c=o[l],u=i[c];e.css(c,u)}}return e},Ws.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},Ws.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},o=0;o<a.length;o++){var l=a[o];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var pc={};pc.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function c(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){$e("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=d[0];var f=d[1];if(f!=="core"){var h=new xn(f);if(h.invalid){$e("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){$e("Skipping property: Invalid property name in: "+o),c();continue}var x=r.parse(b,w);if(!x){$e("Skipping property: Invalid property definition in: "+o),c();continue}g.push({name:b,val:w}),c()}if(p){l();break}r.selector(f);for(var k=0;k<g.length;k++){var E=g[k];r.css(E.name,E.val)}l()}return r},pc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Nt={};(function(){var t=vt,e=KF,r=UF,n=jF,a=WF,i=function(L){return"^"+L+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(L){var W=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+L+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+W+")\\s*\\,\\s*("+W+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Nt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(L,W){switch(L.length){case 2:return W[0]!=="deg"&&W[0]!=="rad"&&W[1]!=="deg"&&W[1]!=="rad";case 1:return Ee(L[0])||W[0]==="deg"||W[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(L){var W=L.length;return W===1||W===2||W===4}}};var c={zeroNonZero:function(L,W){return(L==null||W==null)&&L!==W||L==0&&W!=0?!0:L!=0&&W==0},any:function(L,W){return L!=W},emptyNonEmpty:function(L,W){var Y=mn(L),se=mn(W);return Y&&!se||!Y&&se}},u=Nt.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],h=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],p=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],y=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],C=function(L,W){return W.value==="label"?-L.poolIndex():W.pfValue},x=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],k=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],E=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],_=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],S=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],T=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],N=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],B=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],P=[];Nt.pieBackgroundN=16,P.push({name:"pie-size",type:u.sizeMaybePercent});for(var D=1;D<=Nt.pieBackgroundN;D++)P.push({name:"pie-"+D+"-background-color",type:u.color}),P.push({name:"pie-"+D+"-background-size",type:u.percent}),P.push({name:"pie-"+D+"-background-opacity",type:u.zeroOneNumber});var R=[],O=Nt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(K){O.forEach(function(L){var W=L+"-"+K.name,Y=K.type,se=K.triggersBounds;R.push({name:W,type:Y,triggersBounds:se})})},{});var F=Nt.properties=[].concat(g,w,y,m,b,N,p,v,d,f,h,x,k,E,_,P,S,T,R,B),A=Nt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:N,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:x,nodeBorder:k,nodeOutline:E,backgroundImage:_,pie:P,compound:S,edgeLine:T,edgeArrow:R,core:B},z=Nt.propertyGroupNames={},j=Nt.propertyGroupKeys=Object.keys(A);j.forEach(function(K){z[K]=A[K].map(function(L){return L.name}),A[K].forEach(function(L){return L.groupKey=K})});var H=Nt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Nt.propertyNames=F.map(function(K){return K.name});for(var G=0;G<F.length;G++){var X=F[G];F[X.name]=X}for(var M=0;M<H.length;M++){var V=H[M],q=F[V.pointsTo],$={name:V.name,alias:!0,pointsTo:q};F.push($),F[V.name]=$}})(),Nt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},Nt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Se({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(c,u){for(var d=1;d<=Nt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),h=u.value;c[f]=h}return c},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(c,u){return Nt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,h=u.value;c[f]=h}),c},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],l=this.parse(i,o);r[i]=l}}return t.defaultProperties=r,t.defaultProperties},Nt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Ys={};Ys.parse=function(t,e,r,n){var a=this;if(Xe(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=r?"t":"f",l=""+e,c=G0(t,l,o,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Nr(d),d&&(d.value=Nr(d.value))),d},Ys.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&$e("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&$e("The style value of `label` is deprecated for `"+a.name+"`"),a},Ys.parseImpl=function(t,e,r,n){var a=this;t=Lu(t);var i=a.properties[t],o=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var c=Ee(e);c&&(e=e.trim());var u=i.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Xe(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:r};var d,f;if(!(!c||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(r)return!1;var h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,field:d[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(r||u.multiple)return!1;var v=l.mapData;if(!(u.color||u.number))return!1;var p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return $e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(u.color){var y=p.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var w;if(c?w=e.split(/\s+/):Ke(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var C=[],x=[],k=[],E="",_=!1,S=0;S<w.length;S++){var T=a.parse(t,w[S],r,"multiple");_=_||Ee(T.value),C.push(T.value),k.push(T.pfValue!=null?T.pfValue:T.value),x.push(T.units),E+=(S>0?" ":"")+T.strValue}return u.validate&&!u.validate(C,x)?null:u.singleEnum&&_?C.length===1&&Ee(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:k,strValue:E,bypass:r,units:x}}var N=function(){for(var L=0;L<u.enums.length;L++){var W=u.enums[L];if(W===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var B,P="px";if(u.units&&(B=u.units),u.implicitUnits&&(P=u.implicitUnits),!u.unitless)if(c){var D="px|em"+(u.allowPercent?"|\\%":"");B&&(D=B);var R=e.match("^("+vt+")("+D+")?$");R&&(e=R[1],B=R[2]||P)}else(!B||u.implicitUnits)&&(B=P);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,N();if(u.integer&&!FF(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var O={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return u.unitless||B!=="px"&&B!=="em"?O.pfValue=e:O.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(O.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(O.pfValue=B==="rad"?e:m5(e)),B==="%"&&(O.pfValue=e/100),O}else if(u.propList){var F=[],A=""+e;if(A!=="none"){for(var z=A.split(/\s*,\s*|\s+/),j=0;j<z.length;j++){var H=z[j].trim();a.properties[H]?F.push(H):$e("`"+H+"` is not a valid property name")}if(F.length===0)return null}return{name:t,value:F,strValue:F.length===0?"none":F.join(" "),bypass:r}}else if(u.color){var G=eM(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var X=N();if(X)return X}for(var M=u.regexes?u.regexes:[u.regex],V=0;V<M.length;V++){var q=new RegExp(M[V]),$=q.exec(e);if($)return{name:t,value:u.singleRegexMatchValue?$[1]:$,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?N():null};var Pt=function t(e){if(!(this instanceof t))return new t(e);if(!Ru(e)){Je("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Ot=Pt.prototype;Ot.instanceString=function(){return"style"},Ot.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Ot.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Ot.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Ot.selector=function(t){var e=t==="core"?null:new xn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Ot.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[fs(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Ot.style=Ot.css,Ot.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this},Ot.append=function(t){return D0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Pt.fromJson=function(t,e){var r=new Pt(t);return r.fromJson(e),r},Pt.fromString=function(t,e){return new Pt(t).fromString(e)},[Dt,po,hc,Br,Ws,pc,Nt,Ys].forEach(function(t){Se(Ot,t)}),Pt.types=Ot.types,Pt.properties=Ot.properties,Pt.propertyGroups=Ot.propertyGroups,Pt.propertyGroupNames=Ot.propertyGroupNames,Pt.propertyGroupKeys=Ot.propertyGroupKeys;var Fz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return D0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Pt.fromJson(this,e):Ee(e)?r.style=Pt.fromString(this,e):r.style=Pt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Mz="single",aa={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Mz),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,o,l;switch(e.length){case 0:return r;case 1:if(Ee(e[0]))return n=e[0],r[n];if(Ae(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,l=i.y,de(o)&&(r.x=o),de(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&de(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,o,l,c,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Ae(e)&&(l=n[0],c=l.x,u=l.y,de(c)&&(a.x+=c),de(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&de(o)&&(a[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(de(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ee(e)){var a=e;e=this.$(a)}else if(VF(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Zt(e)||(e=this.mutableElements());if(!(Zt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),l=this.height(),c;if(r=de(r)?r:0,!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){c=Math.min((o-2*r)/n.w,(l-2*r)/n.h),c=c>this._private.maxZoom?this._private.maxZoom:c,c=c<this._private.minZoom?this._private.minZoom:c;var u={x:(o-c*(n.x1+n.x2))/2,y:(l-c*(n.y1+n.y2))/2};return{zoom:c,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return de(e)&&de(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):de(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:de(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,i,o,l=!1;if(r.zoomingEnabled||(l=!0),de(e)?o=e:Ae(e)&&(o=e.level,e.position!=null?i=bs(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,l||!de(o)||o===a||i!=null&&(!de(i.x)||!de(i.y)))return null;if(i!=null){var c=n,u=a,d=o,f={x:-d/u*(i.x-c.x)+i.x,y:-d/u*(i.y-c.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],o=!1,l=!1;if(!e)return this;if(de(e.zoom)||(n=!1),Ae(e.pan)||(a=!1),!n&&!a)return this;if(n){var c=e.zoom;c<r.minZoom||c>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=c,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;de(u.x)&&(r.pan.x=u.x,l=!1),de(u.y)&&(r.pan.y=u.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ee(e)){var n=e;e=this.mutableElements().filter(n)}else Zt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return l}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};aa.centre=aa.center,aa.autolockNodes=aa.autolock,aa.autoungrabifyNodes=aa.autoungrabify;var vo={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vo.attr=vo.data,vo.removeAttr=vo.removeData;var go=function(e){var r=this;e=Se({},e);var n=e.container;n&&!ds(n)&&ds(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var o=pt!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=Se({name:o?"grid":"null"},l.layout),l.renderer=Se({name:o?"canvas":"null"},l.renderer);var c=function(p,g,y){return g!==void 0?g:y!==void 0?y:p},u=this._private={container:n,ready:!1,options:l,elements:new Tt(this),listeners:[],aniEles:new Tt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:c(!0,l.zoomingEnabled),userZoomingEnabled:c(!0,l.userZoomingEnabled),panningEnabled:c(!0,l.panningEnabled),userPanningEnabled:c(!0,l.userPanningEnabled),boxSelectionEnabled:c(!0,l.boxSelectionEnabled),autolock:c(!1,l.autolock,l.autolockNodes),autoungrabify:c(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:c(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?o:l.styleEnabled,zoom:de(l.zoom)?l.zoom:1,pan:{x:Ae(l.pan)&&de(l.pan.x)?l.pan.x:0,y:Ae(l.pan)&&de(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:c(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(p,g){var y=p.some(qF);if(y)return Ua.all(p).then(g);g(p)};u.styleEnabled&&r.setStyle([]);var f=Se({},l,l.renderer);r.initRenderer(f);var h=function(p,g,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),p!=null&&(Ae(p)||Ke(p))&&r.add(p),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Se({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];u.styleEnabled&&r.style().append(p),h(g,function(){r.startAnimationLoop(),u.ready=!0,Xe(l.ready)&&r.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];r.on("ready",m)}a&&(a.readies=[]),r.emit("ready")},l.done)})},Zs=go.prototype;Se(Zs,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return pt;var r=this._private.container.ownerDocument;return r===void 0||r==null?pt:r.defaultView||pt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!ds(e)&&ds(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Se({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Nr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Ae(e)){if(r.startBatch(),e.elements){var o={},l=function(C,x){for(var k=[],E=[],_=0;_<C.length;_++){var S=C[_];if(!S.data.id){$e("cy.json() cannot handle elements without an ID attribute");continue}var T=""+S.data.id,N=r.getElementById(T);o[T]=!0,N.length!==0?E.push({ele:N,json:S}):(x&&(S.group=x),k.push(S))}r.add(k);for(var B=0;B<E.length;B++){var P=E[B],D=P.ele,R=P.json;D.json(R)}};if(Ke(e.elements))l(e.elements);else for(var c=["nodes","edges"],u=0;u<c.length;u++){var d=c[u],f=e.elements[d];Ke(f)&&l(f,d)}var h=r.collection();a.filter(function(w){return!o[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<v.length;p++){var g=v[p];e[g]!=null&&r[g](e[g])}return r.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=r.style().json()),m.data=Nr(r.data());var b=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Nr(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Nr(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),Zs.$id=Zs.getElementById,[Tz,Pz,x1,dc,Us,Az,fc,js,Fz,aa,vo].forEach(function(t){Se(Zs,t)});var $z={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Vz={maximal:!1,acyclic:!1},ni=function(e){return e.scratch("breadthfirst")},k1=function(e,r){return e.scratch("breadthfirst",r)};function S1(t){this.options=Se({},$z,Vz,t)}S1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ae){return!ae.isParent()}),i=n,o=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(Zt(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=r.getElementById(h);d.push(v)}u=r.collection(d)}else if(Ee(e.roots))u=r.$(e.roots);else if(o)u=a.roots();else{var p=n.components();u=r.collection();for(var g=function(ne){var ce=p[ne],ie=ce.maxDegree(!1),fe=ce.filter(function(pe){return pe.degree(!1)===ie});u=u.add(fe)},y=0;y<p.length;y++)g(y)}var m=[],b={},w=function(ne,ce){m[ce]==null&&(m[ce]=[]);var ie=m[ce].length;m[ce].push(ne),k1(ne,{index:ie,depth:ce})},C=function(ne,ce){var ie=ni(ne),fe=ie.depth,pe=ie.index;m[fe][pe]=null,w(ne,ce)};i.bfs({roots:u,directed:e.directed,visit:function(ne,ce,ie,fe,pe){var Pe=ne[0],Ie=Pe.id();w(Pe,pe),b[Ie]=!0}});for(var x=[],k=0;k<a.length;k++){var E=a[k];b[E.id()]||x.push(E)}var _=function(ne){for(var ce=m[ne],ie=0;ie<ce.length;ie++){var fe=ce[ie];if(fe==null){ce.splice(ie,1),ie--;continue}k1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<m.length;ne++)_(ne)},T=function(ne,ce){for(var ie=ni(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,Pe=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],xe=ni(we);pe=Math.max(pe,xe.depth)}if(ie.depth<=pe){if(!e.acyclic&&ce[Pe])return null;var re=pe+1;return C(ne,re),ce[Pe]=re,!0}return!1};if(o&&l){var N=[],B={},P=function(ne){return N.push(ne)},D=function(){return N.shift()};for(a.forEach(function(ae){return N.push(ae)});N.length>0;){var R=D(),O=T(R,B);if(O)R.outgoers().filter(function(ae){return ae.isNode()&&n.has(ae)}).forEach(P);else if(O===null){$e("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var F=0;if(e.avoidOverlap)for(var A=0;A<a.length;A++){var z=a[A],j=z.layoutDimensions(e),H=j.w,G=j.h;F=Math.max(F,H,G)}var X={},M=function(ne){if(X[ne.id()])return X[ne.id()];for(var ce=ni(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,Pe=0;Pe<ie.length;Pe++){var Ie=ie[Pe];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=ni(Ie);if(we!=null){var xe=we.index,re=we.depth;if(!(xe==null||re==null)){var I=m[re].length;re<ce&&(fe+=xe/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),X[ne.id()]=fe,fe},V=function(ne,ce){var ie=M(ne),fe=M(ce),pe=ie-fe;return pe===0?A0(ne.id(),ce.id()):pe};e.depthSort!==void 0&&(V=e.depthSort);for(var q=0;q<m.length;q++)m[q].sort(V),_(q);for(var $=[],K=0;K<x.length;K++)$.push(x[K]);m.unshift($),S();for(var L=0,W=0;W<m.length;W++)L=Math.max(m[W].length,L);var Y={x:c.x1+c.w/2,y:c.x1+c.h/2},se=m.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ue=function(ne){var ce=ni(ne),ie=ce.depth,fe=ce.index,pe=m[ie].length,Pe=Math.max(c.w/((e.grid?se:pe)+1),F),Ie=Math.max(c.h/(m.length+1),F),we=Math.min(c.w/2/m.length,c.h/2/m.length);if(we=Math.max(we,F),e.circle){var re=we*ie+we-(m.length>0&&m[0].length<=3?we/2:0),I=2*Math.PI/m[ie].length*fe;return ie===0&&m[0].length===1&&(re=1),{x:Y.x+re*Math.cos(I),y:Y.y+re*Math.sin(I)}}else{var xe={x:Y.x+(fe+1-(pe+1)/2)*Pe,y:(ie+1)*Ie};return xe}};return n.nodes().layoutPositions(this,e,ue),this};var qz={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function _1(t){this.options=Se({},qz,t)}_1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},c=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=c/Math.max(1,i.length-1),d,f=0,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,y=p.h;f=Math.max(f,g,y)}if(de(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(k,E){var _=e.startAngle+E*u*(a?1:-1),S=d*Math.cos(_),T=d*Math.sin(_),N={x:l.x+S,y:l.y+T};return N};return n.nodes().layoutPositions(this,e,C),this};var zz={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function T1(t){this.options=Se({},zz,t)}T1.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),o=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},c=[],u=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(ae,ne){return ne.value-ae.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var x=Math.abs(b[0].value-C.value);x>=y&&(b=[],m.push(b))}b.push(C)}var k=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=m.length>0&&m[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(m.length+E?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<m.length;N++){var B=m[N],P=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,D=B.dTheta=P/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var R=Math.cos(D)-Math.cos(0),O=Math.sin(D)-Math.sin(0),F=Math.sqrt(k*k/(R*R+O*O));T=Math.max(F,T)}B.r=T,T+=k}if(e.equidistant){for(var A=0,z=0,j=0;j<m.length;j++){var H=m[j],G=H.r-z;A=Math.max(A,G)}z=0;for(var X=0;X<m.length;X++){var M=m[X];X===0&&(z=M.r),M.r=z,z+=A}}for(var V={},q=0;q<m.length;q++)for(var $=m[q],K=$.dTheta,L=$.r,W=0;W<$.length;W++){var Y=$[W],se=e.startAngle+(r?1:-1)*K*W,ue={x:l.x+L*Math.cos(se),y:l.y+L*Math.sin(se)};V[Y.node.id()]=ue}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return V[ne]}),this};var vc,Hz={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Xs(t){this.options=Se({},Hz,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===o});return!l||!c});this.options.eles=this.options.eles.not(n)}Xs.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?vc=!0:vc=!1;var n=Kz(e,r,t);vc&&jz(n),t.randomize&&Wz(n);var a=Yr(),i=function(){Yz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Zz(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),v=N1(n,t,h);h.layoutPositions(r,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var h=0;u&&h<t.refresh;)u=o(c),c++,h++;if(!u)B1(n,t),l();else{var v=Yr();v-a>=t.animationThreshold&&i(),vs(f)}};d()}else{for(;u;)u=o(c),c++;B1(n,t),l()}return this},Xs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Xs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Kz=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},c=n.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],h=0;h<f.length;h++){var v=f[h];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(n),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=u[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=Xe(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],x=p.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(p.id):(m[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=m[b++],E=l.idToIndex[k],v=l.layoutNodes[E],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)m[++w]=_[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var T=l.idToIndex[S[h]];l.indexToGraph[T]=d}for(var d=0;d<l.edgeSize;d++){var N=a[d],B={};B.id=N.data("id"),B.sourceId=N.data("source"),B.targetId=N.data("target");var P=Xe(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,D=Xe(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,R=l.idToIndex[B.sourceId],O=l.idToIndex[B.targetId],F=l.indexToGraph[R],A=l.indexToGraph[O];if(F!=A){for(var z=Gz(B.sourceId,B.targetId,l),j=l.graphSet[z],H=0,y=l.layoutNodes[R];j.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;for(y=l.layoutNodes[O];j.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;P*=H*n.nestingFactor}B.idealLength=P,B.elasticity=D,l.layoutEdges.push(B)}return l},Gz=function(e,r,n){var a=Uz(e,r,0,n);return 2>a.count?0:a.graph},Uz=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var o=0,l=0;l<i.length;l++){var c=i[l],u=a.idToIndex[c],d=a.layoutNodes[u].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],h=t(e,r,f,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},jz,Wz=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},N1=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(o){var l=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,l){var c=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var u=(c.positionX-i.x1)/i.w,d=(c.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+d*a.h}}else return{x:c.positionX,y:c.positionY}}},Yz=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=N1(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Zz=function(e,r,n){Xz(e,r),e3(e),t3(e,r),r3(e),n3(e)},Xz=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var l=e.layoutNodes[e.idToIndex[a[o]]],c=o+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];Jz(l,u,e,r)}},I1=function(e){return-e+2*e*Math.random()},Jz=function(e,r,n,a){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!n.isCompound)){var l=r.positionX-e.positionX,c=r.positionY-e.positionY,u=1;l===0&&c===0&&(l=I1(u),c=I1(u));var d=Qz(e,r,l,c);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+c*c),v=f*l/h,p=f*c/h;else var g=Js(e,l,c),y=Js(r,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*m/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},Qz=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Js=function(e,r,n){var a=e.positionX,i=e.positionY,o=e.height||1,l=e.width||1,c=n/r,u=o/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+o/2,d):0<r&&-1*u<=c&&c<=u?(d.x=a+l/2,d.y=i+l*n/2/r,d):0>r&&-1*u<=c&&c<=u?(d.x=a-l/2,d.y=i-l*n/2/r,d):0<n&&(c<=-1*u||c>=u)?(d.x=a+o*r/2/n,d.y=i+o/2,d):(0>n&&(c<=-1*u||c>=u)&&(d.x=a-o*r/2/n,d.y=i-o/2),d)},e3=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-o.positionX,d=c.positionY-o.positionY;if(!(u===0&&d===0)){var f=Js(o,u,d),h=Js(c,-1*u,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*p/g;else var m=0,b=0;o.isLocked||(o.offsetX+=m,o.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},t3=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var l=e.clientHeight/2,c=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[u.parentId]],l=d.positionX,c=d.positionY;for(var f=0;f<o;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=c-h.positionY,g=Math.sqrt(v*v+p*p);if(g>n){var y=r.gravity*v/g,m=r.gravity*p/g;h.offsetX+=y,h.offsetY+=m}}}}},r3=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var o=n[a++],l=e.idToIndex[o],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,h=0;h<u.length;h++){var v=e.layoutNodes[e.idToIndex[u[h]]];v.offsetX+=d,v.offsetY+=f,n[++i]=u[h]}c.offsetX=0,c.offsetY=0}}},n3=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=a3(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,i3(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},a3=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},i3=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,r)}},B1=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],l=o.cmptId,c=a[l]=a[l]||[];c.push(o)}for(var u=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,y=0,m=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,y=Math.max(y,d.h),g>m&&(p+=y+r.componentSpacing,v=0,g=0,y=0)}}},o3={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function D1(t){this.options=Se({},o3,t)}D1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Kt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(X){return{x:i.x1,y:i.y1}});else{var o=a.size(),l=Math.sqrt(o*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(M){if(M==null)return Math.min(c,u);var V=Math.min(c,u);V==c?c=M:u=M},f=function(M){if(M==null)return Math.max(c,u);var V=Math.max(c,u);V==c?c=M:u=M},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)c=h,u=v;else if(h!=null&&v==null)c=h,u=Math.ceil(o/c);else if(h==null&&v!=null)u=v,c=Math.ceil(o/u);else if(u*c>o){var p=d(),g=f();(p-1)*g>=o?d(p-1):(g-1)*p>=o&&f(g-1)}else for(;u*c<o;){var y=d(),m=f();(m+1)*y>=o?f(m+1):d(y+1)}var b=i.w/u,w=i.h/c;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var x=a[C],k=x._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var E=x.layoutDimensions(e),_=e.avoidOverlapPadding,S=E.w+_,T=E.h+_;b=Math.max(b,S),w=Math.max(w,T)}for(var N={},B=function(M,V){return!!N["c-"+M+"-"+V]},P=function(M,V){N["c-"+M+"-"+V]=!0},D=0,R=0,O=function(){R++,R>=u&&(R=0,D++)},F={},A=0;A<a.length;A++){var z=a[A],j=e.position(z);if(j&&(j.row!==void 0||j.col!==void 0)){var H={row:j.row,col:j.col};if(H.col===void 0)for(H.col=0;B(H.row,H.col);)H.col++;else if(H.row===void 0)for(H.row=0;B(H.row,H.col);)H.row++;F[z.id()]=H,P(H.row,H.col)}}var G=function(M,V){var q,$;if(M.locked()||M.isParent())return!1;var K=F[M.id()];if(K)q=K.col*b+b/2+i.x1,$=K.row*w+w/2+i.y1;else{for(;B(D,R);)O();q=R*b+b/2+i.x1,$=D*w+w/2+i.y1,P(D,R),O()}return{x:q,y:$}};a.layoutPositions(this,e,G)}return this};var s3={ready:function(){},stop:function(){}};function gc(t){this.options=Se({},s3,t)}gc.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},gc.prototype.stop=function(){return this};var l3={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function P1(t){this.options=Se({},l3,t)}P1.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Xe(t.positions);function a(i){if(t.positions==null)return f5(i.position());if(n)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var l=a(i);return i.locked()||l==null?!1:l}),this};var u3={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function O1(t){this.options=Se({},u3,t)}O1.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,l){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var c3=[{name:"breadthfirst",impl:S1},{name:"circle",impl:_1},{name:"concentric",impl:T1},{name:"cose",impl:Xs},{name:"grid",impl:D1},{name:"null",impl:gc},{name:"preset",impl:P1},{name:"random",impl:O1}];function A1(t){this.options=t,this.notifications=0}var R1=function(){},L1=function(){throw new Error("A headless instance can not render images")};A1.prototype={recalculateRenderedStyle:R1,notify:function(){this.notifications++},init:R1,isHeadless:function(){return!0},png:L1,jpg:L1};var mc={};mc.arrowShapeWidth=.3,mc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,d,f,h,v,p,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=u&&u<=m&&b<=d&&d<=w;return C},n=function(u,d,f,h,v){var p=u*Math.cos(h)-d*Math.sin(h),g=u*Math.sin(h)+d*Math.cos(h),y=p*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,h){for(var v=[],p=0;p<u.length;p+=2){var g=u[p],y=u[p+1];v.push(n(g,y,d,f,h))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var h=u[f];d.push(h.x,h.y)}return d},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){Ee(d)&&(d=t[d]),t[u]=Se({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,y,m){var b=i(a(this.points,p+2*m,g,y)),w=Gt(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var y=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:ms,roughCollide:ms,draw:Vu,spacing:W0,gap:W0}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,y=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(u,p,y)},gap:function(u){return o(u)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.pointsTee,f+2*g,h,v)),b=Gt(u,d,y)||Gt(u,d,m);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,h,v));return Gt(u,d,b)||m},draw:function(u,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(u,p,h.x,h.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,d){var f=this.baseCrossLinePts.slice(),h=d/u,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(u,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Gt(u,d,y)||Gt(u,d,m);return b},draw:function(u,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(u,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(u,d,f,h,v){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var ia={};ia.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],l=r.pan(),c=r.zoom(),u=((t-a)/o-l.x)/c,d=((e-i)/o-l.y)/c;return[u,d]},ia.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(m){return parseFloat(r.getPropertyValue(m))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(o+d),h=o-c,v=l-u,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},ia.invalidateContainerClientCoordsCache=function(){this.containerBB=null},ia.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},ia.findNearestElements=function(t,e,r,n){var a=this,i=this,o=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(n?24:8)/c,f=(n?8:2)/c,h=(n?8:2)/c,v=1/0,p,g;r&&(o=o.interactive);function y(E,_){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(_==null||_<v))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=E,p=E,v=_??v;break}}}else l.push(E),p=E,v=_??v}function m(E){var _=E.outerWidth()+2*f,S=E.outerHeight()+2*f,T=_/2,N=S/2,B=E.position(),P=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,D=E._private.rscratch;if(B.x-T<=t&&t<=B.x+T&&B.y-N<=e&&e<=B.y+N){var R=i.nodeShapes[a.getNodeShape(E)];if(R.checkPoint(t,e,0,_,S,B.x,B.y,P,D))return y(E,0),!0}}function b(E){var _=E._private,S=_.rscratch,T=E.pstyle("width").pfValue,N=E.pstyle("arrow-scale").value,B=T/2+d,P=B*B,D=B*2,A=_.source,z=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,F=0;F+3<O.length;F+=2)if(S5(t,e,O[F],O[F+1],O[F+2],O[F+3],D)&&P>(R=B5(t,e,O[F],O[F+1],O[F+2],O[F+3])))return y(E,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,F=0;F+5<S.allpts.length;F+=4)if(_5(t,e,O[F],O[F+1],O[F+2],O[F+3],O[F+4],O[F+5],D)&&P>(R=I5(t,e,O[F],O[F+1],O[F+2],O[F+3],O[F+4],O[F+5])))return y(E,R),!0}for(var A=A||_.source,z=z||_.target,j=a.getArrowWidth(T,N),H=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],F=0;F<H.length;F++){var G=H[F],X=i.arrowShapes[E.pstyle(G.name+"-arrow-shape").value],M=E.pstyle("width").pfValue;if(X.roughCollide(t,e,j,G.angle,{x:G.x,y:G.y},M,d)&&X.collide(t,e,j,G.angle,{x:G.x,y:G.y},M,d))return y(E),!0}u&&l.length>0&&(m(A),m(z))}function w(E,_,S){return gr(E,_,S)}function C(E,_){var S=E._private,T=h,N;_?N=_+"-":N="",E.boundingBox();var B=S.labelBounds[_||"main"],P=E.pstyle(N+"label").value,D=E.pstyle("text-events").strValue==="yes";if(!(!D||!P)){var R=w(S.rscratch,"labelX",_),O=w(S.rscratch,"labelY",_),F=w(S.rscratch,"labelAngle",_),A=E.pstyle(N+"text-margin-x").pfValue,z=E.pstyle(N+"text-margin-y").pfValue,j=B.x1-T-A,H=B.x2+T-A,G=B.y1-T-z,X=B.y2+T-z;if(F){var M=Math.cos(F),V=Math.sin(F),q=function(ue,ae){return ue=ue-R,ae=ae-O,{x:ue*M-ae*V+R,y:ue*V+ae*M+O}},$=q(j,G),K=q(j,X),L=q(H,G),W=q(H,X),Y=[$.x+A,$.y+z,L.x+A,L.y+z,W.x+A,W.y+z,K.x+A,K.y+z];if(Gt(t,e,Y))return y(E),!0}else if(za(B,t,e))return y(E),!0}}for(var x=o.length-1;x>=0;x--){var k=o[x];k.isNode()?m(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},ia.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),l=Math.max(t,r),c=Math.min(e,n),u=Math.max(e,n);t=o,r=l,e=c,n=u;for(var d=Kt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Ku(d,p)&&!nb(p,d)&&i.push(v)}else{var g=h,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!za(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!za(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!k5(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var Qs={};Qs.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,h,v,m,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||o||l||n){var p=e.allpts,g=bt(p[0],p[2],p[4],.1),y=bt(p[1],p[3],p[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=ws(c,u);var m=e.midX,b=e.midY;if(r&&(m=(d+h)/2,b=(f+v)/2),c=h-d,u=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=p.length/2-1,C=w-2;c=p[w]-p[C],u=p[w+1]-p[C+1]}}else if(a||o||l){var p=e.allpts,x=e.ctrlpts,k,E,_,S;if(x.length/2%2===0){var T=p.length/2-1,N=T+2,B=N+2;k=bt(p[T],p[N],p[B],0),E=bt(p[T+1],p[N+1],p[B+1],0),_=bt(p[T],p[N],p[B],1e-4),S=bt(p[T+1],p[N+1],p[B+1],1e-4)}else{var N=p.length/2-1,T=N-2,B=N+2;k=bt(p[T],p[N],p[B],.4999),E=bt(p[T+1],p[N+1],p[B+1],.4999),_=bt(p[T],p[N],p[B],.5),S=bt(p[T+1],p[N+1],p[B+1],.5)}c=_-k,u=S-E}if(e.midtgtArrowAngle=ws(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,P=w+2;c=-(p[P]-p[w]),u=-(p[P+1]-p[w+1])}}}if(e.midsrcArrowAngle=ws(c,u),i)c=h-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||o||l||n){var p=e.allpts,D=p.length,g=bt(p[D-6],p[D-4],p[D-2],.9),y=bt(p[D-5],p[D-3],p[D-1],.9);c=h-g,u=v-y}else c=h-m,u=v-b;e.tgtArrowAngle=ws(c,u)},Qs.getArrowWidth=Qs.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var yc,bc,Dr={},ir={},F1,M1,oa,el,Jr,sa,la,Pr,ai,tl,$1,V1,wc,Cc,q1,z1=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},d3=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},f3=function(e,r,n,a,i){if(e!==q1?z1(r,e,Dr):d3(ir,Dr),z1(r,n,ir),F1=Dr.nx*ir.ny-Dr.ny*ir.nx,M1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Jr=Math.asin(Math.max(-1,Math.min(1,F1))),Math.abs(Jr)<1e-6){yc=r.x,bc=r.y,la=ai=0;return}oa=1,el=!1,M1<0?Jr<0?Jr=Math.PI+Jr:(Jr=Math.PI-Jr,oa=-1,el=!0):Jr>0&&(oa=-1,el=!0),r.radius!==void 0?ai=r.radius:ai=a,sa=Jr/2,tl=Math.min(Dr.len/2,ir.len/2),i?(Pr=Math.abs(Math.cos(sa)*ai/Math.sin(sa)),Pr>tl?(Pr=tl,la=Math.abs(Pr*Math.sin(sa)/Math.cos(sa))):la=ai):(Pr=Math.min(tl,ai),la=Math.abs(Pr*Math.sin(sa)/Math.cos(sa))),wc=r.x+ir.nx*Pr,Cc=r.y+ir.ny*Pr,yc=wc-ir.ny*la*oa,bc=Cc+ir.nx*la*oa,$1=r.x+Dr.nx*Pr,V1=r.y+Dr.ny*Pr,q1=r};function H1(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Ec(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(f3(t,e,r,n,a),{cx:yc,cy:bc,radius:la,startX:$1,startY:V1,stopX:wc,stopY:Cc,startAngle:Dr.ang+Math.PI/2*oa,endAngle:ir.ang-Math.PI/2*oa,counterClockwise:el})}var At={};At.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=o.units!=null&&l.units!=null,u=function(x,k,E,_){var S=_-k,T=E-x,N=Math.sqrt(T*T+S*S);return{x:-S/N,y:T/N}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(c){var f=this.manualEndptToPx(t.source()[0],o),h=vr(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),y=vr(g,2),m=y[0],b=y[1],w={x1:v,y1:p,x2:m,y2:b};a=u(v,p,m,b),i=w}else $e("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}},At.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,l=n.target,c=o.position(),u=l.position(),d=o.width(),f=l.width(),h=o.height(),v=l.height(),p=r.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*h*g+c.y,a.target.x*f*g+u.x,a.target.y*v*g+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},At.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*p,y:y.y1*v+y.y2*p};r.segpts.push(b.x+m.x*h,b.y+m.y*h),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),r.isArcRadius.push((o.pfValue[d]!==void 0?o.pfValue[d]:u)==="arc-radius")}},At.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,o=e.srcPos,l=t.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=r,v=f;n&&(h=0,v=c);var p=u-Math.PI/2,g=p-d/2,y=p+d/2,m=u+"_"+d;h=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[o.x+Math.cos(g)*1.4*v*(h/3+1),o.y+Math.sin(g)*1.4*v*(h/3+1),o.x+Math.cos(y)*1.4*v*(h/3+1),o.y+Math.sin(y)*1.4*v*(h/3+1)]},At.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=r,g=f;n&&(p=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:o.x-u/2,y:o.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,x=Math.max(C,Math.log(l*.01)),k=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*x,w.x-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*k,w.y]},At.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},At.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,f=c.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var p=(.5-e.eles.length/2+r)*o*(a?-1:1),g=void 0,y=eb(p);h&&(d=l?l.pfValue[v]:o,f=c.value[v]),n?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,k=C.vectorNormInverse,E={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(E.x+k.x*m,E.y+k.y*m)}},At.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",x=w.pfValue,k=x<0,E=t.pstyle("taxi-turn-min-distance").pfValue,_=y?(f+v)/2:0,S=y?(h+p)/2:0,T=d.x2-d.x1,N=d.y2-d.y1,B=function(me,be){return me>0?Math.max(me-be,0):Math.min(me+be,0)},P=B(T,_),D=B(N,S),R=!1;b===u?m=Math.abs(P)>Math.abs(D)?a:n:b===c||b===l?(m=n,R=!0):(b===i||b===o)&&(m=a,R=!0);var O=m===n,F=O?D:P,A=O?N:T,z=eb(A),j=!1;!(R&&(C||k))&&(b===l&&A<0||b===c&&A>0||b===i&&A>0||b===o&&A<0)&&(z*=-1,F=z*Math.abs(F),j=!0);var H;if(C){var G=x<0?1+x:x;H=G*F}else{var X=x<0?F:0;H=X+x*z}var M=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(F)},V=M(H),q=M(Math.abs(F)-Math.abs(H)),$=V||q;if($&&!j)if(O){var K=Math.abs(A)<=h/2,L=Math.abs(T)<=v/2;if(K){var W=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[W,Y,W,se]}else if(L){var ue=(d.y1+d.y2)/2,ae=d.x1,ne=d.x2;r.segpts=[ae,ue,ne,ue]}else r.segpts=[d.x1,d.y2]}else{var ce=Math.abs(A)<=f/2,ie=Math.abs(N)<=p/2;if(ce){var fe=(d.y1+d.y2)/2,pe=d.x1,Pe=d.x2;r.segpts=[pe,fe,Pe,fe]}else if(ie){var Ie=(d.x1+d.x2)/2,we=d.y1,xe=d.y2;r.segpts=[Ie,we,Ie,xe]}else r.segpts=[d.x2,d.y1]}else if(O){var re=d.y1+H+(y?h/2*z:0),I=d.x1,U=d.x2;r.segpts=[I,re,U,re]}else{var te=d.x1+H+(y?f/2*z:0),Z=d.y1,J=d.y2;r.segpts=[te,Z,te,J]}if(r.isRound){var le=t.pstyle("taxi-radius").value,ee=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(le),r.isArcRadius=new Array(r.segpts.length/2).fill(ee)}},At.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!de(r.startX)||!de(r.startY),y=!de(r.arrowStartX)||!de(r.arrowStartY),m=!de(r.endX)||!de(r.endY),b=!de(r.arrowEndX)||!de(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,k=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<x,_=Jn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<x,T=!1;if(g||y||E){T=!0;var N={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(N.x*N.x+N.y*N.y),P={x:N.x/B,y:N.y/B},D=Math.max(i,o),R={x:r.ctrlpts[0]+P.x*2*D,y:r.ctrlpts[1]+P.y*2*D},O=u.intersectLine(n.x,n.y,i,o,R.x,R.y,0,f,v);E?(r.ctrlpts[0]=r.ctrlpts[0]+P.x*(x-k),r.ctrlpts[1]=r.ctrlpts[1]+P.y*(x-k)):(r.ctrlpts[0]=O[0]+P.x*x,r.ctrlpts[1]=O[1]+P.y*x)}if(m||b||S){T=!0;var F={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(F.x*F.x+F.y*F.y),z={x:F.x/A,y:F.y/A},j=Math.max(i,o),H={x:r.ctrlpts[0]+z.x*2*j,y:r.ctrlpts[1]+z.y*2*j},G=d.intersectLine(a.x,a.y,l,c,H.x,H.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+z.x*(x-_),r.ctrlpts[1]=r.ctrlpts[1]+z.y*(x-_)):(r.ctrlpts[0]=G[0]+z.x*x,r.ctrlpts[1]=G[1]+z.y*x)}T&&this.findEndpoints(t)}},At.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=bt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=bt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(Ec({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,l))}}if(e.segpts.length%4===0){var c=e.segpts.length/2,u=c-2;e.midX=(e.segpts[u]+e.segpts[c])/2,e.midY=(e.segpts[u+1]+e.segpts[c+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},At.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||de(e.startX)&&de(e.startY)&&de(e.endX)&&de(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,$e("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},At.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new Ir,get:function(E){var _=this.map.get(E[0]);return _!=null?_.get(E[1]):null},set:function(E,_){var S=this.map.get(E[0]);S==null&&(S=new Ir,this.map.set(E[0],S)),S.set(E[1],_)}},o=[],l=[],c=0;c<t.length;c++){var u=t[c],d=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){l.push(u);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,y=p.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),o.push(b)),w.eles.push(u),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(E){var _=o[E],S=i.get(_),T=void 0;if(!S.hasUnbundled){var N=S.eles[0].parallelEdges().filter(function(te){return te.isBundledBezier()});qu(S.eles),N.forEach(function(te){return S.eles.push(te)}),S.eles.sort(function(te,Z){return te.poolIndex()-Z.poolIndex()})}var B=S.eles[0],P=B.source(),D=B.target();if(P.poolIndex()>D.poolIndex()){var R=P;P=D,D=R}var O=S.srcPos=P.position(),F=S.tgtPos=D.position(),A=S.srcW=P.outerWidth(),z=S.srcH=P.outerHeight(),j=S.tgtW=D.outerWidth(),H=S.tgtH=D.outerHeight(),G=S.srcShape=r.nodeShapes[e.getNodeShape(P)],X=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],M=S.srcCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,V=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,q=S.tgtRs=D._private.rscratch,$=S.srcRs=P._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var K=0;K<S.eles.length;K++){var L=S.eles[K],W=L[0]._private.rscratch,Y=L.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ue=!P.same(L.source());if(!S.calculatedIntersection&&P!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=G.intersectLine(O.x,O.y,A,z,F.x,F.y,0,M,$),ne=S.srcIntn=ae,ce=X.intersectLine(F.x,F.y,j,H,O.x,O.y,0,V,q),ie=S.tgtIntn=ce,fe=S.intersectionPts={x1:ae[0],x2:ce[0],y1:ae[1],y2:ce[1]},pe=S.posPts={x1:O.x,x2:F.x,y1:O.y,y2:F.y},Pe=ce[1]-ae[1],Ie=ce[0]-ae[0],we=Math.sqrt(Ie*Ie+Pe*Pe),xe=S.vector={x:Ie,y:Pe},re=S.vectorNorm={x:xe.x/we,y:xe.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||X.checkPoint(ae[0],ae[1],0,j,H,F.x,F.y,V,q)||G.checkPoint(ce[0],ce[1],0,A,z,O.x,O.y,M,$),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:F,tgtPos:O,srcW:j,srcH:H,tgtW:A,tgtH:z,srcIntn:ie,tgtIntn:ne,srcShape:X,tgtShape:G,posPts:{x1:pe.x2,y1:pe.y2,x2:pe.x1,y2:pe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-xe.x,y:-xe.y},vectorNorm:{x:-re.x,y:-re.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var U=ue?T:S;W.nodesOverlap=U.nodesOverlap,W.srcIntn=U.srcIntn,W.tgtIntn=U.tgtIntn,W.isRound=Y.startsWith("round"),a&&(P.isParent()||P.isChild()||D.isParent()||D.isChild())&&(P.parents().anySame(D)||D.parents().anySame(P)||P.same(D)&&P.isParent())?e.findCompoundLoopPoints(L,U,K,se):P===D?e.findLoopPoints(L,U,K,se):Y.endsWith("segments")?e.findSegmentsPoints(L,U):Y.endsWith("taxi")?e.findTaxiPoints(L,U):Y==="straight"||!se&&S.eles.length%2===1&&K===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(L):e.findBezierPoints(L,U,K,se,ue),e.findEndpoints(L),e.tryToCorrectInvalidPoints(L,U),e.checkForInvalidEdgeWarning(L),e.storeAllpts(L),e.storeEdgeProjections(L),e.calculateArrowAngles(L),e.recalculateEdgeLabelProjections(L),e.calculateLabelAngles(L)}},x=0;x<o.length;x++)C(x);this.findHaystackPoints(l)}};function K1(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}At.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),K1(e.segpts)},At.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),K1(e.ctrlpts)},At.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var mo={};mo.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=n.x,l[1]+=n.y,l}else{var c=e.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(a,i),d=[n.x+Math.cos(c)*u,n.y+Math.sin(c)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}},mo.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),o=a.position(),l=t.pstyle("target-arrow-shape").value,c=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=n._private.rscratch,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",k=b||w||C,E=m||y,_=t.pstyle("source-endpoint"),S=E?"outside-to-node":_.value,T=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),B=E?"outside-to-node":N.value,P=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=_,p.tgtManEndpt=N;var D,R,O,F;if(b){var A=[p.ctrlpts[0],p.ctrlpts[1]],z=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:A;D=z,R=A}else if(C){var j=x?p.segpts.slice(0,2):[o.x,o.y],H=x?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=H,R=j}if(B==="inside-to-node")r=[o.x,o.y];else if(N.units)r=this.manualEndptToPx(a,N);else if(B==="outside-to-line")r=p.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?O=D:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(O=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,P,h),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var G=a._private.rscratch,X=G.labelWidth,M=G.labelHeight,V=G.labelX,q=G.labelY,$=X/2,K=M/2,L=a.pstyle("text-valign").value;L==="top"?q-=K:L==="bottom"&&(q+=K);var W=a.pstyle("text-halign").value;W==="left"?V-=$:W==="right"&&(V+=$);var Y=ro(O[0],O[1],[V-$,q-K,V+$,q-K,V+$,q+K,V-$,q+K],o.x,o.y);if(Y.length>0){var se=i,ue=Qn(se,Va(r)),ae=Qn(se,Va(Y)),ne=ue;if(ae<ue&&(r=Y,ne=ae),Y.length>2){var ce=Qn(se,{x:Y[2],y:Y[3]});ce<ne&&(r=[Y[2],Y[3]])}}}var ie=Ss(r,D,e.arrowShapes[l].spacing(t)+u),fe=Ss(r,D,e.arrowShapes[l].gap(t)+u);if(p.endX=fe[0],p.endY=fe[1],p.arrowEndX=ie[0],p.arrowEndY=ie[1],S==="inside-to-node")r=[i.x,i.y];else if(_.units)r=this.manualEndptToPx(n,_);else if(S==="outside-to-line")r=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?F=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(F=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),F[0],F[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,Pe=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,xe=pe.labelY,re=Pe/2,I=Ie/2,U=n.pstyle("text-valign").value;U==="top"?xe-=I:U==="bottom"&&(xe+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=ro(F[0],F[1],[we-re,xe-I,we+re,xe-I,we+re,xe+I,we-re,xe+I],i.x,i.y);if(Z.length>0){var J=o,le=Qn(J,Va(r)),ee=Qn(J,Va(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=Qn(J,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=Ss(r,R,e.arrowShapes[c].spacing(t)+d),ye=Ss(r,R,e.arrowShapes[c].gap(t)+d);p.startX=ye[0],p.startY=ye[1],p.arrowStartX=be[0],p.arrowStartY=be[1],k&&(!de(p.startX)||!de(p.startY)||!de(p.endX)||!de(p.endY)?p.badLine=!0:p.badLine=!1)},mo.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},mo.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var xc={};function h3(t,e,r){for(var n=function(u,d,f,h){return bt(u,d,f,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var l=t.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}xc.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)h3(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},xc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Or={};Or.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!mn(e)){var r,n,a=t._private,i=t.width(),o=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(u){case"left":r=c.x-i/2-l;break;case"right":r=c.x+i/2+l;break;default:r=c.x}switch(d){case"top":n=c.y-o/2-l;break;case"bottom":n=c.y+o/2+l;break;default:n=c.y}f.labelX=r,f.labelY=n,h.labelX=r,h.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var G1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},U1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return G1(n,a)},p3=function(e,r,n,a){var i=eo(0,a-.001,1),o=eo(0,a+.001,1),l=qa(e,r,n,i),c=qa(e,r,n,o);return U1(l,c)};Or.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var o=function(f,h,v){wn(r.rscratch,f,h,v),wn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=G1(n.midDispX,n.midDispY);o("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<n.allpts.length;h+=4){var v={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},g={x:n.allpts[h+4],y:n.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(E,_,S,T,N){var B=Jn(_,S),P=E.segments[E.segments.length-1],D={p0:_,p1:S,t0:T,t1:N,startDist:P?P.startDist+P.length:0,length:B};E.segments.push(D),E.length+=B}for(var w=0;w<f.length;w++){var C=f[w],x=f[w-1];x&&(C.startDist=x.startDist+x.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var k=0;k<m-1;k++)b(C,y[w*m+k],y[w*m+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},u=function(f){var h,v=f==="source";if(i[f]){var p=t.pstyle(f+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],x=0;x<C.segments.length;x++){var k=C.segments[v?x:C.segments.length-1-x],E=w===g.length-1&&x===C.segments.length-1;if(m=b,b+=k.length,b>=p||E){y={cp:C,segment:k};break}}if(y)break}var _=y.cp,S=y.segment,T=(p-m)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=eo(0,B,1),e=qa(_.p0,_.p1,_.p2,B),h=p3(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var P=0,D,R,O,F,A=n.allpts.length,z=0;z+3<A&&(v?(O={x:n.allpts[z],y:n.allpts[z+1]},F={x:n.allpts[z+2],y:n.allpts[z+3]}):(O={x:n.allpts[A-2-z],y:n.allpts[A-1-z]},F={x:n.allpts[A-4-z],y:n.allpts[A-3-z]}),D=Jn(O,F),R=P,P+=D,!(P>=p));z+=2);var j=p-R,H=j/D;H=eo(0,H,1),e=b5(O,F,H),h=U1(O,F);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,h)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Or.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Or.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=gr(r.rscratch,"labelWrapCachedLines",e)||[],c=o!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,h=a.height+(c-1)*(i-1)*u;wn(r.rstyle,"labelWidth",e,f),wn(r.rscratch,"labelWidth",e,f),wn(r.rstyle,"labelHeight",e,h),wn(r.rscratch,"labelHeight",e,h),wn(r.rscratch,"labelLineHeight",e,d)},Or.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,o=function(X,M){return M?(wn(r.rscratch,X,e,M),M):gr(r.rscratch,X,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var c=o("labelKey");if(c!=null&&o("labelWrapKey")===c)return o("labelWrapCachedText");for(var u="​",d=a.split(`
42
- `),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(u);m=C}if(w>f){var x=m.matchAll(g),k="",E=0,_=T0(x),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=m.substring(E,T.index);E=T.index+N.length;var P=k.length===0?B:k+B+N,D=this.calculateLabelDimensions(t,P),R=D.width;R<=f?k+=B+N:(k&&p.push(k),k=B+N)}}catch(G){_.e(G)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(m)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
43
- `)),o("labelWrapKey",c)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,F="",A="…",z=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var j=0;j<a.length;j++){var H=this.calculateLabelDimensions(t,F+a[j]+A).width;if(H>O)break;F+=a[j],j===a.length-1&&(z=!0)}return z||(F+=A),F}return a},Or.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Or.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Xn(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),l=o[i];if(l!=null)return l;var c=0,u=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(u," ").concat(h," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
44
- `),w=0;w<b.length;w++){var C=b[w],x=p.measureText(C),k=Math.ceil(x.width),E=d;y=Math.max(k,y),m+=E}return y+=c,m+=c,o[i]={width:y,height:m}},Or.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=o.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:o.pfValue},Or.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var j1={},W1=28,Y1=!1;j1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<W1||t.height()<W1))return Y1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Y1=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var rl={};rl.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),l)for(var c=0;c<o.length;c++){var u=o[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var l=o.target;n(l)}).on("style.* background.*",function(o){var l=o.target;n(l,!1)});var a=function(o){if(o){var l=r.onUpdateEleCalcsFns;e.cleanStyle();for(var c=0;c<e.length;c++){var u=e[c],d=u._private.rstyle;u.isNode()&&!d.cleanConnected&&(n(u.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var h=l[f];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},rl.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},rl.recalculateRenderedStyle=function(t,e){var r=function(C){return C._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],l=o._private,c=l.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(c.clean=!1),!(e&&c.clean||o.removed())&&o.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(o):n.push(o),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var g=n[p],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var nl={};nl.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}},nl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},nl.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(d1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Z1={};[ia,Qs,At,mo,xc,Or,j1,rl,nl].forEach(function(t){Se(Z1,t)});var X1={};X1.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ii={};ii.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ii.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||$F(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var o=function(c,u,d){var f=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:o,addEventListener:o,addListener:o,bind:o}},ii.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ii.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ii.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,U,te,Z){I==null&&(I=t.cy);for(var J=0;J<U.length;J++){var le=U[J];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,U){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;U&&Z<U.length;Z++){var I=U[Z];if(I.isNode()&&I.isParent()&&!I.pannable()){te=!1;break}}else te=!0;return te},o=function(I){I[0]._private.grabbed=!0},l=function(I){I[0]._private.grabbed=!1},c=function(I){I[0]._private.rscratch.inDragLayer=!0},u=function(I){I[0]._private.rscratch.inDragLayer=!1},d=function(I){I[0]._private.rscratch.isGrabTarget=!0},f=function(I){I[0]._private.rscratch.isGrabTarget=!1},h=function(I,U){var te=U.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,U){if(I.cy().hasCompoundNodes()&&!(U.inDragLayer==null&&U.addToList==null)){var te=I.descendants();U.inDragLayer&&(te.forEach(c),te.connectedEdges().forEach(c)),U.addToList&&h(te,U)}},p=function(I,U){U=U||{};var te=I.cy().hasCompoundNodes();U.inDragLayer&&(I.forEach(c),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(c)),U.addToList&&I.forEach(function(Z){h(Z,U)}),v(I,U),m(I,{inDragLayer:U.inDragLayer}),t.updateCachedGrabbedEles()},g=p,y=function(I){I&&(t.getCachedZSortedEles().forEach(function(U){l(U),u(U),f(U)}),t.updateCachedGrabbedEles())},m=function(I,U){if(!(U.inDragLayer==null&&U.addToList==null)&&I.cy().hasCompoundNodes()){var te=I.ancestors().orphans();if(!te.same(I)){var Z=te.descendants().spawnSelf().merge(te).unmerge(I).unmerge(I.descendants()),J=Z.connectedEdges();U.inDragLayer&&(J.forEach(c),Z.forEach(c)),U.addToList&&Z.forEach(function(le){h(le,U)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(re){for(var I=0;I<re.length;I++){var U=re[I],te=U.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var J=te[Z];if(J===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(re){t.destroy()});var x=ps(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(x),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",x),C&&(t.resizeObserver=new ResizeObserver(x),t.resizeObserver.observe(t.container));var k=function(I,U){for(;I!=null;)U(I),I=I.parentNode},E=function(){t.invalidateContainerClientCoordsCache()};k(t.container,function(re){t.registerBinding(re,"transitionend",E),t.registerBinding(re,"animationend",E),t.registerBinding(re,"scroll",E)}),t.registerBinding(t.container,"contextmenu",function(re){re.preventDefault()});var _=function(){return t.selection[4]!==0},S=function(I){for(var U=t.findContainerClientCoords(),te=U[0],Z=U[1],J=U[2],le=U[3],ee=I.touches?I.touches:[I],oe=!1,me=0;me<ee.length;me++){var be=ee[me];if(te<=be.clientX&&be.clientX<=te+J&&Z<=be.clientY&&be.clientY<=Z+le){oe=!0;break}}if(!oe)return!1;for(var ye=t.container,_e=I.target,ge=_e.parentNode,Ce=!1;ge;){if(ge===ye){Ce=!0;break}ge=ge.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(I){if(S(I)&&!(t.hoverData.which===1&&I.which!==1)){I.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=I.which;var U=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),J=t.selection,le=t.findNearestElements(Z[0],Z[1],!0,!1),ee=le[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=Z,t.hoverData.mdownGPos=te;var me=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var je=t.hoverData.down;je?je.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}}):U.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}})}},t.tapholdDuration)};if(I.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:I,type:"cxttapstart",position:{x:Z[0],y:Z[1]}};ee?(ee.activate(),ee.emit(be),t.hoverData.down=ee):U.emit(be),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(I.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var ye=function(je){return{originalEvent:I,type:je,position:{x:Z[0],y:Z[1]}}},_e=function(je){je.emit(ye("grab"))};if(d(ee),!ee.selected())oe=t.dragData.possibleDragElements=U.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=U.collection();var ge=U.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});p(ge,{addToList:oe}),ee.emit(ye("grabon")),ge.forEach(_e)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=le,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],I,{x:Z[0],y:Z[1]}),ee==null?(J[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(J[4]=1),me()}J[0]=J[2]=Z[0],J[1]=J[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var U=t.hoverData.capture;if(!(!U&&!S(I))){var te=!1,Z=t.cy,J=Z.zoom(),le=[I.clientX,I.clientY],ee=t.projectIntoViewport(le[0],le[1]),oe=t.hoverData.mdownPos,me=t.hoverData.mdownGPos,be=t.selection,ye=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ye=t.findNearestElement(ee[0],ee[1],!0,!1));var _e=t.hoverData.last,ge=t.hoverData.down,Ce=[ee[0]-be[2],ee[1]-be[3]],je=t.dragData.possibleDragElements,qe;if(me){var st=le[0]-me[0],lt=st*st,tt=le[1]-me[1],Rt=tt*tt,mt=lt+Rt;t.hoverData.isOverThresholdDrag=qe=mt>=t.desktopTapThreshold2}var wt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Jt=function(){var Q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Q.length===0?(Q.push(Ce[0]),Q.push(Ce[1])):(Q[0]+=Ce[0],Q[1]+=Ce[1])};te=!0,n(ye,["mousemove","vmousemove","tapdrag"],I,{x:ee[0],y:ee[1]});var Lt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:ee[0],y:ee[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(qe){var Ft={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Ft):Z.emit(Ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),t.hoverData.cxtOver=ye,ye&&ye.emit({originalEvent:I,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}}else if(t.hoverData.dragging){if(te=!0,Z.panningEnabled()&&Z.userPanningEnabled()){var lr;if(t.hoverData.justStartedPan){var Cr=t.hoverData.mdownPos;lr={x:(ee[0]-Cr[0])*J,y:(ee[1]-Cr[1])*J},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*J,y:Ce[1]*J};Z.panBy(lr),Z.emit("dragpan"),t.hoverData.dragged=!0}ee=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(ge==null||ge.pannable())){if(qe){if(!t.hoverData.dragging&&Z.boxSelectionEnabled()&&(wt||!Z.panningEnabled()||!Z.userPanningEnabled()))Lt();else if(!t.hoverData.selecting&&Z.panningEnabled()&&Z.userPanningEnabled()){var jt=i(ge,t.hoverData.downs);jt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=Va(oe),t.redrawHint("select",!0),t.redraw())}ge&&ge.pannable()&&ge.active()&&ge.unactivate()}}else{if(ge&&ge.pannable()&&ge.active()&&ge.unactivate(),(!ge||!ge.grabbed())&&ye!=_e&&(_e&&n(_e,["mouseout","tapdragout"],I,{x:ee[0],y:ee[1]}),ye&&n(ye,["mouseover","tapdragover"],I,{x:ee[0],y:ee[1]}),t.hoverData.last=ye),ge)if(qe){if(Z.boxSelectionEnabled()&&wt)ge&&ge.grabbed()&&(y(je),ge.emit("freeon"),je.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),je.emit("dragfree"))),Lt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var rt=!t.dragData.didDrag;rt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(je,{inDragLayer:!0});var ut={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(ut.x+=Ce[0],ut.y+=Ce[1],rt)){var Ct=t.hoverData.dragDelta;Ct&&de(Ct[0])&&de(Ct[1])&&(ut.x+=Ct[0],ut.y+=Ct[1])}t.hoverData.draggingEles=!0,je.silentShift(ut).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Jt();te=!0}if(be[2]=ee[0],be[3]=ee[1],te)return I.stopPropagation&&I.stopPropagation(),I.preventDefault&&I.preventDefault(),!1}},!1);var T,N,B;t.registerBinding(e,"mouseup",function(I){if(!(t.hoverData.which===1&&I.which!==1&&t.hoverData.capture)){var U=t.hoverData.capture;if(U){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),J=t.selection,le=t.findNearestElement(Z[0],Z[1],!0,!1),ee=t.dragData.possibleDragElements,oe=t.hoverData.down,me=a(I);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe&&oe.unactivate(),t.hoverData.which===3){var be={originalEvent:I,type:"cxttapend",position:{x:Z[0],y:Z[1]}};if(oe?oe.emit(be):te.emit(be),!t.hoverData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:Z[0],y:Z[1]}};oe?oe.emit(ye):te.emit(ye)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],I,{x:Z[0],y:Z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],I,{x:Z[0],y:Z[1]}),N=!1,I.timeStamp-B<=te.multiClickDebounceTime()?(T&&clearTimeout(T),N=!0,B=null,n(oe,["dblclick","dbltap","vdblclick"],I,{x:Z[0],y:Z[1]})):(T=setTimeout(function(){N||n(oe,["oneclick","onetap","voneclick"],I,{x:Z[0],y:Z[1]})},te.multiClickDebounceTime()),B=I.timeStamp)),oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(I)&&(te.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=te.collection()),le==oe&&!t.dragData.didDrag&&!t.hoverData.selecting&&le!=null&&le._private.selectable&&(t.hoverData.dragging||(te.selectionType()==="additive"||me?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):me||(te.$(r).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var _e=te.collection(t.getAllInBox(J[0],J[1],J[2],J[3]));t.redrawHint("select",!0),_e.length>0&&t.redrawHint("eles",!0),te.emit({type:"boxend",originalEvent:I,position:{x:Z[0],y:Z[1]}});var ge=function(qe){return qe.selectable()&&!qe.selected()};te.selectionType()==="additive"||me||te.$(r).unmerge(_e).unselect(),_e.emit("box").stdFilter(ge).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!J[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();y(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}J[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var P=function(I){if(!t.scrollingPage){var U=t.cy,te=U.zoom(),Z=U.pan(),J=t.projectIntoViewport(I.clientX,I.clientY),le=[J[0]*te+Z.x,J[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(U.panningEnabled()&&U.userPanningEnabled()&&U.zoomingEnabled()&&U.userZoomingEnabled()){I.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var ee;I.deltaY!=null?ee=I.deltaY/-250:I.wheelDeltaY!=null?ee=I.wheelDeltaY/1e3:ee=I.wheelDelta/1e3,ee=ee*t.wheelSensitivity;var oe=I.deltaMode===1;oe&&(ee*=33);var me=U.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),U.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),U.emit(I.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",P,!0),t.registerBinding(e,"scroll",function(I){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(I){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||I.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||P(re)},!0),t.registerBinding(t.container,"mouseout",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:U[0],y:U[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:U[0],y:U[1]}})},!1);var D,R,O,F,A,z,j,H,G,X,M,V,q,$=function(I,U,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-U)*(Z-U))},K=function(I,U,te,Z){return(te-I)*(te-I)+(Z-U)*(Z-U)},L;t.registerBinding(t.container,"touchstart",L=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var U=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var J=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=J[0],te[1]=J[1]}if(I.touches[1]){var J=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=J[0],te[3]=J[1]}if(I.touches[2]){var J=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=J[0],te[5]=J[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var le=t.findContainerClientCoords();G=le[0],X=le[1],M=le[2],V=le[3],D=I.touches[0].clientX-G,R=I.touches[0].clientY-X,O=I.touches[1].clientX-G,F=I.touches[1].clientY-X,q=0<=D&&D<=M&&0<=O&&O<=M&&0<=R&&R<=V&&0<=F&&F<=V;var ee=U.pan(),oe=U.zoom();A=$(D,R,O,F),z=K(D,R,O,F),j=[(D+O)/2,(R+F)/2],H=[(j[0]-ee.x)/oe,(j[1]-ee.y)/oe];var me=200,be=me*me;if(z<be&&!I.touches[2]){var ye=t.findNearestElement(te[0],te[1],!0,!0),_e=t.findNearestElement(te[2],te[3],!0,!0);ye&&ye.isNode()?(ye.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=ye):_e&&_e.isNode()?(_e.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=_e):U.emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(I.touches[2])U.boxSelectionEnabled()&&I.preventDefault();else if(!I.touches[1]){if(I.touches[0]){var ge=t.findNearestElements(te[0],te[1],!0,!0),Ce=ge[0];if(Ce!=null&&(Ce.activate(),t.touchData.start=Ce,t.touchData.starts=ge,t.nodeIsGrabbable(Ce))){var je=t.dragData.touchDragEles=U.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=U.$(function(mt){return mt.selected()&&t.nodeIsGrabbable(mt)}),p(qe,{addToList:je})):g(Ce,{addToList:je}),d(Ce);var st=function(wt){return{originalEvent:I,type:wt,position:{x:te[0],y:te[1]}}};Ce.emit(st("grabon")),qe?qe.forEach(function(mt){mt.emit(st("grab"))}):Ce.emit(st("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:J[0],y:J[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],I,{x:te[0],y:te[1]})},t.tapholdDuration)}}if(I.touches.length>=1){for(var lt=t.touchData.startPosition=[null,null,null,null,null,null],tt=0;tt<te.length;tt++)lt[tt]=Z[tt]=te[tt];var Rt=I.touches[0];t.touchData.startGPosition=[Rt.clientX,Rt.clientY]}}},!1);var W;t.registerBinding(e,"touchmove",W=function(I){var U=t.touchData.capture;if(!(!U&&!S(I))){var te=t.selection,Z=t.cy,J=t.touchData.now,le=t.touchData.earlier,ee=Z.zoom();if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}var me=t.touchData.startGPosition,be;if(U&&I.touches[0]&&me){for(var ye=[],_e=0;_e<J.length;_e++)ye[_e]=J[_e]-le[_e];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,je=I.touches[0].clientY-me[1],qe=je*je,st=Ce+qe;be=st>=t.touchTapThreshold2}if(U&&t.touchData.cxt){I.preventDefault();var lt=I.touches[0].clientX-G,tt=I.touches[0].clientY-X,Rt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,wt=K(lt,tt,Rt,mt),Jt=wt/z,Lt=150,Ft=Lt*Lt,lr=1.5,Cr=lr*lr;if(Jt>=Cr||wt>=Ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:J[0],y:J[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(U&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:J[0],y:J[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(jt):Z.emit(jt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var rt=t.findNearestElement(J[0],J[1],!0,!0);(!t.touchData.cxtOver||rt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:J[0],y:J[1]}}),t.touchData.cxtOver=rt,rt&&rt.emit({originalEvent:I,type:"cxtdragover",position:{x:J[0],y:J[1]}}))}else if(U&&I.touches[2]&&Z.boxSelectionEnabled())I.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:J[0],y:J[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(J[0]+J[2]+J[4])/3,te[1]=(J[1]+J[3]+J[5])/3,te[2]=(J[0]+J[2]+J[4])/3+1,te[3]=(J[1]+J[3]+J[5])/3+1):(te[2]=(J[0]+J[2]+J[4])/3,te[3]=(J[1]+J[3]+J[5])/3),t.redrawHint("select",!0),t.redraw();else if(U&&I.touches[1]&&!t.touchData.didSelect&&Z.zoomingEnabled()&&Z.panningEnabled()&&Z.userZoomingEnabled()&&Z.userPanningEnabled()){I.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ut=t.dragData.touchDragEles;if(ut){t.redrawHint("drag",!0);for(var Ct=0;Ct<ut.length;Ct++){var On=ut[Ct]._private;On.grabbed=!1,On.rscratch.inDragLayer=!1}}var Q=t.touchData.start,lt=I.touches[0].clientX-G,tt=I.touches[0].clientY-X,Rt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,he=$(lt,tt,Rt,mt),Oe=he/A;if(q){var He=lt-D,Fr=tt-R,An=Rt-O,vi=mt-F,an=(He+An)/2,ur=(Fr+vi)/2,Rn=Z.zoom(),Tg=Rn*Oe,Sl=Z.pan(),M_=H[0]*Rn+Sl.x,$_=H[1]*Rn+Sl.y,pG={x:-Tg/Rn*(M_-Sl.x-an)+M_,y:-Tg/Rn*($_-Sl.y-ur)+$_};if(Q&&Q.active()){var ut=t.dragData.touchDragEles;y(ut),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Q.unactivate().emit("freeon"),ut.emit("free"),t.dragData.didDrag&&(Q.emit("dragfreeon"),ut.emit("dragfree"))}Z.viewport({zoom:Tg,pan:pG,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),A=he,D=lt,R=tt,O=Rt,F=mt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,Ng=t.touchData.last,rt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(rt=t.findNearestElement(J[0],J[1],!0,!0)),U&&Er!=null&&I.preventDefault(),U&&Er!=null&&t.nodeIsDraggable(Er))if(be){var ut=t.dragData.touchDragEles,V_=!t.dragData.didDrag;V_&&p(ut,{inDragLayer:!0}),t.dragData.didDrag=!0;var Bo={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(Bo.x+=ye[0],Bo.y+=ye[1],V_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(Bo.x+=xr[0],Bo.y+=xr[1])}t.hoverData.draggingEles=!0,ut.silentShift(Bo).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==le[0]&&t.touchData.startPosition[1]==le[1]&&t.redrawHint("eles",!0),t.redraw()}else{var xr=t.touchData.dragDelta=t.touchData.dragDelta||[];xr.length===0?(xr.push(ye[0]),xr.push(ye[1])):(xr[0]+=ye[0],xr[1]+=ye[1])}if(n(Er||rt,["touchmove","tapdrag","vmousemove"],I,{x:J[0],y:J[1]}),(!Er||!Er.grabbed())&&rt!=Ng&&(Ng&&Ng.emit({originalEvent:I,type:"tapdragout",position:{x:J[0],y:J[1]}}),rt&&rt.emit({originalEvent:I,type:"tapdragover",position:{x:J[0],y:J[1]}})),t.touchData.last=rt,U)for(var Ct=0;Ct<J.length;Ct++)J[Ct]&&t.touchData.startPosition[Ct]&&be&&(t.touchData.singleTouchMoved=!0);if(U&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var vG=i(Er,t.touchData.starts);vG&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Va(t.touchData.startPosition)),t.swipePanning?(Z.panBy({x:ye[0]*ee,y:ye[1]*ee}),Z.emit("dragpan")):be&&(t.swipePanning=!0,Z.panBy({x:ge*ee,y:je*ee}),Z.emit("dragpan"),Er&&(Er.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}}for(var _e=0;_e<J.length;_e++)le[_e]=J[_e];U&&I.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Y;t.registerBinding(e,"touchcancel",Y=function(I){var U=t.touchData.start;t.touchData.capture=!1,U&&U.unactivate()});var se,ue,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var U=t.touchData.start,te=t.touchData.capture;if(te)I.touches.length===0&&(t.touchData.capture=!1),I.preventDefault();else return;var Z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var J=t.cy,le=J.zoom(),ee=t.touchData.now,oe=t.touchData.earlier;if(I.touches[0]){var me=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);ee[0]=me[0],ee[1]=me[1]}if(I.touches[1]){var me=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);ee[2]=me[0],ee[3]=me[1]}if(I.touches[2]){var me=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);ee[4]=me[0],ee[5]=me[1]}U&&U.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},U?U.emit(be):J.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};U?U.emit(ye):J.emit(ye)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&J.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var _e=J.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));Z[0]=void 0,Z[1]=void 0,Z[2]=void 0,Z[3]=void 0,Z[4]=0,t.redrawHint("select",!0),J.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Ft){return Ft.selectable()&&!Ft.selected()};_e.emit("box").stdFilter(ge).select().emit("boxselect"),_e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(U!=null&&U.unactivate(),I.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!I.touches[1]){if(!I.touches[0]){if(!I.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ce=t.dragData.touchDragEles;if(U!=null){var je=U._private.grabbed;y(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),je&&(U.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(U.emit("dragfreeon"),Ce.emit("dragfree"))),n(U,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),U.unactivate(),t.touchData.start=null}else{var qe=t.findNearestElement(ee[0],ee[1],!0,!0);n(qe,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]})}var st=t.touchData.startPosition[0]-ee[0],lt=st*st,tt=t.touchData.startPosition[1]-ee[1],Rt=tt*tt,mt=lt+Rt,wt=mt*le*le;t.touchData.singleTouchMoved||(U||J.$(":selected").unselect(["tapunselect"]),n(U,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ue=!1,I.timeStamp-ne<=J.multiClickDebounceTime()?(ae&&clearTimeout(ae),ue=!0,ne=null,n(U,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ue||n(U,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},J.multiClickDebounceTime()),ne=I.timeStamp)),U!=null&&!t.dragData.didDrag&&U._private.selectable&&wt<t.touchTapThreshold2&&!t.pinching&&(J.selectionType()==="single"?(J.$(r).unmerge(U).unselect(["tapunselect"]),U.select(["tapselect"])):U.selected()?U.unselect(["tapunselect"]):U.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Jt=0;Jt<ee.length;Jt++)oe[Jt]=ee[Jt];t.dragData.didDrag=!1,I.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),I.touches.length<2&&(I.touches.length===1&&(t.touchData.startGPosition=[I.touches[0].clientX,I.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ce=[],ie=function(I){return{clientX:I.clientX,clientY:I.clientY,force:1,identifier:I.pointerId,pageX:I.pageX,pageY:I.pageY,radiusX:I.width/2,radiusY:I.height/2,screenX:I.screenX,screenY:I.screenY,target:I.target}},fe=function(I){return{event:I,touch:ie(I)}},pe=function(I){ce.push(fe(I))},Pe=function(I){for(var U=0;U<ce.length;U++){var te=ce[U];if(te.event.pointerId===I.pointerId){ce.splice(U,1);return}}},Ie=function(I){var U=ce.filter(function(te){return te.event.pointerId===I.pointerId})[0];U.event=I,U.touch=ie(I)},we=function(I){I.touches=ce.map(function(U){return U.touch})},xe=function(I){return I.pointerType==="mouse"||I.pointerType===4};t.registerBinding(t.container,"pointerdown",function(re){xe(re)||(re.preventDefault(),pe(re),we(re),L(re))}),t.registerBinding(t.container,"pointerup",function(re){xe(re)||(Pe(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){xe(re)||(Pe(re),we(re),Y(re))}),t.registerBinding(t.container,"pointermove",function(re){xe(re)||(re.preventDefault(),Ie(re),we(re),W(re))})}};var Qr={};Qr.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,o,l,c){this.renderer.nodeShapeImpl("polygon",n,a,i,o,l,this.points)},intersectLine:function(n,a,i,o,l,c,u,d){return ro(l,c,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,l,c,u,d){return Zr(n,a,this.points,c,u,o,l,[0,-1],i)}}},Qr.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){return P5(i,o,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,o,l,c){return ea(e,r,a,i,o,l,n)}}},Qr.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,o,l,c,u){if(c[u]!==void 0&&c[u+"-cx"]===n&&c[u+"-cy"]===a)return c[u];c[u]=new Array(e.length/2),c[u+"-cx"]=n,c[u+"-cy"]=a;var d=i/2,f=o/2;l=l==="auto"?ob(i,o):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var p,g,y,m,b=h.length;for(g=h[b-1],p=0;p<b;p++)y=h[p%b],m=h[(p+1)%b],c[u][p]=Ec(g,y,m,l),g=y,y=m;return c[u]},draw:function(n,a,i,o,l,c,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,l,this.points,this.getOrCreateCorners(a,i,o,l,c,u,"drawCorners"))},intersectLine:function(n,a,i,o,l,c,u,d,f){return O5(l,c,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,d,f,"corners"))},checkPoint:function(n,a,i,o,l,c,u,d,f){return D5(n,a,this.points,c,u,o,l,this.getOrCreateCorners(c,u,o,l,d,f,"corners"))}}},Qr.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){return ab(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){var u=a/2,d=i/2;c=c==="auto"?ta(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!(Zr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Zr(e,r,this.points,o,l,a-f,i,[0,-1],n)||ea(e,r,f,f,o-u+c,l-d+c,n)||ea(e,r,f,f,o+u-c,l-d+c,n)||ea(e,r,f,f,o+u-c,l+d-c,n)||ea(e,r,f,f,o-u+c,l+d-c,n))}}},Qr.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:ju(),points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,o)},generateCutTrianglePts:function(e,r,n,a,i){var o=i==="auto"?this.cornerLength:i,l=r/2,c=e/2,u=n-c,d=n+c,f=a-l,h=a+l;return{topLeft:[u,f+o,u+o,f,u+o,f+o],topRight:[d-o,f,d,f+o,d-o,f+o],bottomRight:[d,h-o,d-o,h,d-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,r,n,a,i,o,l,c){var u=this.generateCutTrianglePts(n+2*l,a+2*l,e,r,c),d=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ro(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,c){var u=c==="auto"?this.cornerLength:c;if(Zr(e,r,this.points,o,l,a,i-2*u,[0,-1],n)||Zr(e,r,this.points,o,l,a-2*u,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,o,l);return Gt(e,r,d.topLeft)||Gt(e,r,d.topRight)||Gt(e,r,d.bottomRight)||Gt(e,r,d.bottomLeft)}}},Qr.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,c){var u=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(y){var m=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return ro(i,o,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,o=e/2,l=n-o,c=n+o,u=a-i,d=a+i,f=Wu(e,r),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+h,l+p,u,l+v,u],topRight:[c-v,u,c-p,u,c,u+h],bottomRight:[c,d-h,c-p,d,c-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,o,l,c){var u=Wu(a,i),d=u.heightOffset,f=u.widthOffset;if(Zr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Zr(e,r,this.points,o,l,a-2*f,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,l),v=function(_,S,T){var N=T[4],B=T[2],P=T[0],D=T[5],R=T[1],O=Math.min(N,P),F=Math.max(N,P),A=Math.min(D,R),z=Math.max(D,R);if(O<=_&&_<=F&&A<=S&&S<=z){var j=A5(N,B,P),H=T5(j[0],j[1],j[2],_),G=H.filter(function(X){return 0<=X&&X<=1});if(G.length>0)return G[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var y=p[g],m=h[y],b=v(e,r,m);if(b!=null){var w=m[5],C=m[3],x=m[1],k=bt(w,C,x,b);if(m.isTop&&k<=r||m.isBottom&&r<=k)return!0}}return!1}}},Qr.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Vt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,c){var u=e-(n/2+l),d=r-(a/2+l),f=d,h=e+(n/2+l),v=Cn(i,o,e,r,u,d,h,f,!1);return v.length>0?v:ab(i,o,e,r,n,a,l,c)},checkPoint:function(e,r,n,a,i,o,l,c){c=c==="auto"?ta(a,i):c;var u=2*c;if(Zr(e,r,this.points,o,l,a,i-u,[0,-1],n)||Zr(e,r,this.points,o,l,a-u,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,h=[o-d,l-f,o-d,l,o+d,l,o+d,l-f];return!!(Gt(e,r,h)||ea(e,r,u,u,o+a/2-c,l+i/2-c,n)||ea(e,r,u,u,o-a/2+c,l+i/2-c,n))}}},Qr.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Vt(3,0)),this.generateRoundPolygon("round-triangle",Vt(3,0)),this.generatePolygon("rectangle",Vt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Vt(5,0)),this.generateRoundPolygon("round-pentagon",Vt(5,0)),this.generatePolygon("hexagon",Vt(6,0)),this.generateRoundPolygon("round-hexagon",Vt(6,0)),this.generatePolygon("heptagon",Vt(7,0)),this.generateRoundPolygon("round-heptagon",Vt(7,0)),this.generatePolygon("octagon",Vt(8,0)),this.generateRoundPolygon("round-octagon",Vt(8,0));var n=new Array(20);{var a=Uu(5,0),i=Uu(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=o,i[l*2+1]*=o;for(var l=0;l<20/4;l++)n[l*4]=a[l*2],n[l*4+1]=a[l*2+1],n[l*4+2]=i[l*2],n[l*4+3]=i[l*2+1]}n=ib(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}t.makePolygon=function(u){var d=u.join("$"),f="polygon-"+d,h;return(h=this[f])?h:e.generatePolygon(f,u)}};var yo={};yo.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},yo.redraw=function(t){t=t||X0();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},yo.beforeRender=function(t,e){if(!this.destroyed){e==null&&Je("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var J1=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};yo.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){J1(t,!0,a);var i=Yr();t.render(t.renderOptions);var o=t.lastDrawTime=Yr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=o-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else J1(t,!1,a);t.skipFrame=!1,vs(n)}};vs(r)}};var v3=function(e){this.init(e)},Q1=v3,oi=Q1.prototype;oi.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],oi.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,o="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(o)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!c){var u=a.createElement("style");u.id=o,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&$e("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=de(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},oi.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},oi.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},oi.isHeadless=function(){return!1},[mc,Z1,X1,ii,Qr,yo].forEach(function(t){Se(oi,t)});var kc=1e3/60,ew={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=ps(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,d){var f=Yr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Yr(),b=m-f,w=m-d;if(v<kc){var C=kc-(u?h:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*kc)break;var x=e.deq(n,y,g);if(x.length>0)for(var k=0;k<x.length;k++)p.push(x[k]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,y,g)&&i())},l=e.priority||Vu;a.beforeRender(o,l(n))}}}},g3=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ms;Ou(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Au(t,[{key:"getIdsFor",value:function(r){r==null&&Je("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new $a,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new Ir,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),tw=25,al=50,il=-4,Sc=3,m3=7.99,y3=8,b3=1024,w3=1024,C3=1024,E3=.2,x3=.8,k3=10,S3=.15,_3=.1,T3=.9,N3=.9,I3=100,B3=1,si={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},D3=St({getKey:null,doesEleInvalidateKey:ms,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:j0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),bo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=D3(r);Se(n,a),n.lookup=new g3(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},gt=bo.prototype;gt.reasons=si,gt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},gt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},gt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Qi(function(r,n){return n.reqs-r.reqs});return e},gt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},gt.getElement=function(t,e,r,n,a){var i=this,o=this.renderer,l=o.cy.zoom(),c=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Hu(l*r))),n<il)n=il;else if(l>=m3||n>Sc)return null;var u=Math.pow(2,n),d=e.h*u,f=e.w*u,h=o.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,h))return null;var v=c.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=tw?p=tw:d<=al?p=al:p=Math.ceil(d/al)*al,d>C3||f>w3)return null;var g=i.getTextureQueue(p),y=g[g.length-2],m=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===si.dequeue,C=a&&a===si.highQuality,x=a&&a===si.downscale,k,E=n+1;E<=Sc;E++){var _=c.get(t,E);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,p),b(S))T();else if(b(k))if(C){for(var N=k.level;N>n;N--)S=i.getElement(t,e,r,N,si.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!x)for(var P=n-1;P>=il;P--){var D=c.get(t,P);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:n,scale:u,width:f,height:d,scaledLabelShown:h},y.usedWidth+=Math.ceil(f+y3),y.eleCaches.push(v),c.set(t,n,v),i.checkTextureFullness(y),v},gt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},gt.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=il;i<=Sc;i++){var o=r.getForCachedKey(t,i);o&&n.push(o)}var l=r.invalidate(t);if(l)for(var c=0;c<n.length;c++){var u=n[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},gt.checkTextureUtility=function(t){t.invalidatedWidth>=E3*t.width&&this.retireTexture(t)},gt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>x3&&t.fullnessChecks>=k3?bn(r,t):t.fullnessChecks++},gt.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;bn(n,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var l=i[o];a.deleteCache(l.key,l.level)}qu(i);var c=e.getRetiredTextureQueue(r);c.push(t)},gt.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(b3,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},gt.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,qu(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),bn(a,o),n.push(o),o}},gt.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},gt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<B3&&r.size()>0;o++){var l=r.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(n[c]=null,d)continue;a.push(l);var f=e.getBoundingBox(u);e.getElement(u,f,t,l.level,si.dequeue)}return a},gt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=$u,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},gt.onDequeue=function(t){this.onDequeues.push(t)},gt.offDequeue=function(t){bn(this.onDequeues,t)},gt.setupDequeueing=ew.setupDequeueing({deqRedrawThreshold:I3,deqCost:S3,deqAvgCost:_3,deqNoDrawCost:T3,deqFastCost:N3,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var o=r[i].eles,l=0;l<o.length;l++){var c=o[l].boundingBox();if(Ku(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var P3=1,wo=-4,ol=2,O3=3.99,A3=50,R3=50,L3=.15,F3=.1,M3=.9,$3=.9,V3=1,rw=250,q3=4e3*4e3,z3=!0,nw=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Yr()-2*rw,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=ps(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},R3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=rw?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};r.layersQueue=new Qi(i),r.setupDequeueing()},It=nw.prototype,aw=0,H3=Math.pow(2,53)-1;It.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),o={id:aw=++aw%H3,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=o.context,c=-o.bb.x1,u=-o.bb.y1;return l.scale(r,r),l.translate(c,u),o},It.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Hu(o*e)),r<wo)r=wo;else if(o>=O3||r>ol)return null}n.validateLayersElesOrdering(r,t);var c=n.layersByLevel,u=Math.pow(2,r),d=c[r]=c[r]||[],f,h=n.levelIsComplete(r,t),v,p=function(){var T=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return v=c[R],!0},N=function(R){if(!v)for(var O=r+R;wo<=O&&O<=ol&&!T(O);O+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var P=d[B];P.invalid&&bn(d,P)}};if(!h)p();else return d;var g=function(){if(!f){f=Kt();for(var T=0;T<t.length;T++)tb(f,t[T].boundingBox())}return f},y=function(T){T=T||{};var N=T.after;g();var B=f.w*u*(f.h*u);if(B>q3)return null;var P=n.makeLayer(f,r);if(N!=null){var D=d.indexOf(N)+1;d.splice(D,0,P)}else(T.insert===void 0||T.insert)&&d.unshift(P);return P};if(n.skipping&&!l)return null;for(var m=null,b=t.length/P3,w=!l,C=0;C<t.length;C++){var x=t[C],k=x._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},_=E[r];if(_){m=_;continue}if((!m||m.eles.length>=b||!nb(m.bb,x.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?n.queueLayer(m,x):n.drawEleInLayer(m,x,r,e),m.eles.push(x),E[r]=m}return v||(w?null:d)},It.getEleLevelForLayerLevel=function(t,e){return t},It.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,o=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,z3),i.setImgSmoothing(o,!0))},It.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length},It.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[l+o]){this.invalidateLayer(a);break}}},It.updateElementsInLayers=function(t,e){for(var r=this,n=Ki(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],o=n?t[a]:t[a].ele,l=o._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=wo;u<=ol;u++){var d=c[u];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},It.haveLayers=function(){for(var t=this,e=!1,r=wo;r<=ol;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},It.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Yr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},It.invalidateLayer=function(t){if(this.lastInvalidationTime=Yr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];bn(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},It.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var l=0;l<o.eles.length;l++)e.queueLayer(o,o.eles[l])})},It.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},It.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}},It.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<V3&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n},It.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,l=o.imgLayerCaches=o.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},It.requestRedraw=ps(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),It.setupDequeueing=ew.setupDequeueing({deqRedrawThreshold:A3,deqCost:L3,deqAvgCost:F3,deqNoDrawCost:M3,deqFastCost:$3,deq:function(e,r){return e.dequeue(r)},onDeqd:Vu,shouldRedraw:j0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var iw={},ow;function K3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function G3(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function sw(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var o=r,l=r[0];t.moveTo(l.x,l.y);for(var a=1;a<o.length;a++){var i=o[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function U3(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var l=0;l<i.length;l++){var c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function j3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}iw.arrowShapeImpl=function(t){return(ow||(ow={polygon:K3,"triangle-backcurve":G3,"triangle-tee":sw,"circle-triangle":U3,"triangle-cross":sw,circle:j3}))[t]};var Ar={};Ar.drawElement=function(t,e,r,n,a,i){var o=this;e.isNode()?o.drawNode(t,e,r,n,a,i):o.drawEdge(t,e,r,n,a,i)},Ar.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Ar.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Ar.drawCachedElementPortion=function(t,e,r,n,a,i,o,l){var c=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var d=r.getElement(e,u,n,a,i);if(d!=null){var f=l(c,e);if(f===0)return;var h=o(c,e),v=u.x1,p=u.y1,g=u.w,y=u.h,m,b,w,C,x;if(h!==0){var k=r.getRotationPoint(e);w=k.x,C=k.y,t.translate(w,C),t.rotate(h),x=c.getImgSmoothing(t),x||c.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);m=E.x,b=E.y}else m=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),x||c.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var W3=function(){return 0},Y3=function(e,r){return e.getTextAngle(r,null)},Z3=function(e,r){return e.getTextAngle(r,"source")},X3=function(e,r){return e.getTextAngle(r,"target")},J3=function(e,r){return r.effectiveOpacity()},_c=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Ar.drawCachedElement=function(t,e,r,n,a,i){var o=this,l=o.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Ku(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,c,r,a,v,W3,J3),(!p||!g)&&o.drawCachedElementPortion(t,e,u,r,a,v,Y3,_c),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,Z3,_c),o.drawCachedElementPortion(t,e,f,r,a,v,X3,_c)),o.drawElementOverlay(t,e)}},Ar.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Ar.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(t,o,r,n)}},Ar.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(t,o,r,n)}},Ar.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var l=i[o],c=l.bb;c.w===0||c.h===0||t.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(t,e,r,n)};var en={};en.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var c;r&&(c=r,t.translate(-c.x1,-c.y1));var u=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(o.eleStrokeStyle(t,e,R),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,o.eleStrokeStyle(t,e,R),o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}f==="straight-triangle"?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},x=function(){a&&o.drawEdgeOverlay(t,e)},k=function(){a&&o.drawEdgeUnderlay(t,e)},E=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,R)},_=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var T=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,P=m*B;t.translate(T,N),w(P),E(P),t.translate(-T,-N)}else C();k(),w(),E(),x(),_(),r&&t.translate(c.x1,c.y1)}};var lw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,o=i.usePaths(),l=n._private.rscratch,c=n.pstyle("".concat(e,"-padding")).pfValue,u=2*c,d=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,l.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};en.drawEdgeOverlay=lw("overlay"),en.drawEdgeUnderlay=lw("underlay"),en.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,o,l=!1,c=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(c){var f=r.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(o=e=a.pathCache,l=!0):(o=e=new Path2D,a.pathCacheKey=f,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var g=T0(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;H1(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,c?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])},en.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/o,-i[0]/o],c=[l[0]*n/2,l[1]*n/2];e.beginPath(),e.moveTo(r[a]-c[0],r[a+1]-c[1]),e.lineTo(r[a]+c[0],r[a+1]+c[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}},en.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},en.drawArrowhead=function(t,e,r,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=e.pstyle(r+"-arrow-shape").value;if(c!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(r+"-arrow-fill").value,f=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var g=t.globalCompositeOperation;(o!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,u,f,c,v,n,a,i),t.globalCompositeOperation=g);var y=e.pstyle(r+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],o),l.colorStrokeStyle(t,y[0],y[1],y[2],o),l.drawArrowShape(e,t,d,f,c,v,n,a,i)}}},en.drawArrowShape=function(t,e,r,n,a,i,o,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:o,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(n,g),m=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Xn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(c),e.scale(y,y)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-o,-l))};var Tc={};Tc.safeDrawImage=function(t,e,r,n,a,i,o,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,r,n,a,i,o,l,c,u)}catch(d){$e(d)}},Tc.drawInscribedImage=function(t,e,r,n,a){var i=this,o=r.position(),l=o.x,c=o.y,u=r.cy().style(),d=u.getIndexedStyle.bind(u),f=d(r,"background-fit","value",n),h=d(r,"background-repeat","value",n),v=r.width(),p=r.height(),g=r.padding()*2,y=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),m=p+(d(r,"background-height-relative-to","value",n)==="inner"?0:g),b=r._private.rscratch,w=d(r,"background-clip","value",n),C=w==="node",x=d(r,"background-image-opacity","value",n)*a,k=d(r,"background-image-smoothing","value",n),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var _=e.width||e.cachedW,S=e.height||e.cachedH;(_==null||S==null)&&(document.body.appendChild(e),_=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var T=_,N=S;if(d(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?T=d(r,"background-width","pfValue",n)*y:T=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?N=d(r,"background-height","pfValue",n)*m:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(y/T,m/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(y/T,m/N);T*=B,N*=B}var P=l-y/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?P+=(y-T)*R:P+=R;var O=d(r,"background-offset-x","units",n),F=d(r,"background-offset-x","pfValue",n);O==="%"?P+=(y-T)*F:P+=F;var A=c-m/2,z=d(r,"background-position-y","units",n),j=d(r,"background-position-y","pfValue",n);z==="%"?A+=(m-N)*j:A+=j;var H=d(r,"background-offset-y","units",n),G=d(r,"background-offset-y","pfValue",n);H==="%"?A+=(m-N)*G:A+=G,b.pathCache&&(P-=l,A-=c,l=0,c=0);var X=t.globalAlpha;t.globalAlpha=x;var M=i.getImgSmoothing(t),V=!1;if(k==="no"&&M?(i.setImgSmoothing(t,!1),V=!0):k==="yes"&&!M&&(i.setImgSmoothing(t,!0),V=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,E,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,P,A,T,N),C&&t.restore();else{var q=t.createPattern(e,h);t.fillStyle=q,i.nodeShapes[i.getNodeShape(r)].draw(t,l,c,y,m,E,b),t.translate(P,A),t.fill(),t.translate(-P,-A)}t.globalAlpha=X,V&&i.setImgSmoothing(t,M)}};var ua={};ua.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Hu(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)},ua.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=o.getLabelJustification(e);t.textAlign=c,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(o.drawText(t,e,null,v,i),e.isEdge()&&(o.drawText(t,e,"source",v,i),o.drawText(t,e,"target",v,i))):o.drawText(t,e,a,v,i),r&&t.translate(p.x1,p.y1)},ua.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},ua.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,l=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,c=e.pstyle("text-outline-opacity").value*l,u=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],c)};function Nc(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),o?t.stroke():t.fill()}ua.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=gr(a,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?l:0:o.strValue==="none"?r=0:r=o.pfValue,r},ua.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var c=gr(o,"labelX",r),u=gr(o,"labelY",r),d,f,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",p=gr(o,"labelWidth",r),g=gr(o,"labelHeight",r),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),c+=y,u+=m;var x;switch(n?x=this.getTextAngle(e,r):x=0,x!==0&&(d=c,f=u,t.translate(d,f),t.rotate(x),c=0,u=0),C){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,T=e.pstyle("text-background-shape").strValue,N=T.indexOf("round")===0,B=2;if(k>0||_>0&&E>0){var P=c-S;switch(w){case"left":P-=p;break;case"center":P-=p/2;break}var D=u-g-S,R=p+2*S,O=g+2*S;if(k>0){var F=t.fillStyle,A=e.pstyle("text-background-color").value;t.fillStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+k*l+")",N?Nc(t,P,D,R,O,B):t.fillRect(P,D,R,O),t.fillStyle=F}if(_>0&&E>0){var z=t.strokeStyle,j=t.lineWidth,H=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+H[0]+","+H[1]+","+H[2]+","+E*l+")",t.lineWidth=_,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(N?Nc(t,P,D,R,O,B,"stroke"):t.strokeRect(P,D,R,O),G==="double"){var X=_/2;N?Nc(t,P+X,D+X,R-X*2,O-X*2,B,"stroke"):t.strokeRect(P+X,D+X,R-X*2,O-X*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=j,t.strokeStyle=z}}var M=2*e.pstyle("text-outline-width").pfValue;if(M>0&&(t.lineWidth=M),e.pstyle("text-wrap").value==="wrap"){var V=gr(o,"labelWrapCachedLines",r),q=gr(o,"labelLineHeight",r),$=p/2,K=this.getLabelJustification(e);switch(K==="auto"||(w==="left"?K==="left"?c+=-p:K==="center"&&(c+=-$):w==="center"?K==="left"?c+=-$:K==="right"&&(c+=$):w==="right"&&(K==="center"?c+=$:K==="right"&&(c+=p))),C){case"top":u-=(V.length-1)*q;break;case"center":case"bottom":u-=(V.length-1)*q;break}for(var L=0;L<V.length;L++)M>0&&t.strokeText(V[L],c,u),t.fillText(V[L],c,u),u+=q}else M>0&&t.strokeText(h,c,u),t.fillText(h,c,u);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var li={};li.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,l,c,u=e._private,d=u.rscratch,f=e.position();if(!(!de(f.x)||!de(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=o.usePaths(),p,g=!1,y=e.padding();l=e.width()+2*y,c=e.height()+2*y;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),x=new Array(w.length),k=0,E=0;E<w.length;E++){var _=w[E],S=C[E]=_!=null&&_!=="none";if(S){var T=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);k++,x[E]=o.getCachedImage(_,T,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var N=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*h,D=e.pstyle("border-color").value,R=e.pstyle("border-style").value,O=e.pstyle("border-join").value,F=e.pstyle("border-cap").value,A=e.pstyle("border-position").value,z=e.pstyle("border-dash-pattern").pfValue,j=e.pstyle("border-dash-offset").pfValue,H=e.pstyle("border-opacity").value*h,G=e.pstyle("outline-width").pfValue,X=e.pstyle("outline-color").value,M=e.pstyle("outline-style").value,V=e.pstyle("outline-opacity").value*h,q=e.pstyle("outline-offset").value,$=e.pstyle("corner-radius").value;$!=="auto"&&($=e.pstyle("corner-radius").pfValue);var K=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,le)},L=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},W=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(t,X[0],X[1],X[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=G0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+$),_e=be[ye],ge,Ce=!1;return _e!=null?(ge=_e,Ce=!0,d.pathCache=ge):(ge=new Path2D,be[ye]=d.pathCache=ge),{path:ge,cacheHit:Ce}},se=e.pstyle("shape").strValue,ue=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,c,se,ue);p=ae.path,g=ae.cacheHit}var ne=function(){if(!g){var le=f;v&&(le={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||t,le.x,le.y,l,c,$,d)}v?t.fill(p):t.fill()},ce=function(){for(var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=u.backgrounding,me=0,be=0;be<x.length;be++){var ye=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(ee&&ye==="over"||!ee&&ye==="inside"){me++;continue}C[be]&&x[be].complete&&!x[be].error&&(me++,o.drawInscribedImage(t,x[be],e,be,le))}u.backgrounding=me!==k,oe!==u.backgrounding&&e.updateStyle(!1)},ie=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,ee),le&&(v||o.nodeShapes[o.getNodeShape(e)].draw(t,f.x,f.y,l,c,$,d)))},fe=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=(N>0?N:-N)*le,oe=N>0?0:255;N!==0&&(o.colorFillStyle(t,oe,oe,oe,ee),v?t.fill(p):t.fill())},pe=function(){if(B>0){if(t.lineWidth=B,t.lineCap=F,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(z),t.lineDashOffset=j;break;case"solid":case"double":t.setLineDash([]);break}if(A!=="center"){if(t.save(),t.lineWidth*=2,A==="inside")v?t.clip(p):t.clip();else{var le=new Path2D;le.rect(-l/2-B,-c/2-B,l+2*B,c+2*B),le.addPath(p),t.clip(le,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(R==="double"){t.lineWidth=B/3;var ee=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=ee}t.setLineDash&&t.setLineDash([])}},Pe=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var le=f;v&&(le={x:0,y:0});var ee=o.getNodeShape(e),oe=B;A==="inside"&&(oe=0),A==="outside"&&(oe*=2);var me=(l+oe+(G+q))/l,be=(c+oe+(G+q))/c,ye=l*me,_e=c*be,ge=o.nodeShapes[ee].points,Ce;if(v){var je=Y(ye,_e,ee,ge);Ce=je.path}if(ee==="ellipse")o.drawEllipsePath(Ce||t,le.x,le.y,ye,_e);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ee)){var qe=0,st=0,lt=0;ee==="round-diamond"?qe=(oe+q+G)*1.4:ee==="round-heptagon"?(qe=(oe+q+G)*1.075,lt=-(oe/2+q+G)/35):ee==="round-hexagon"?qe=(oe+q+G)*1.12:ee==="round-pentagon"?(qe=(oe+q+G)*1.13,lt=-(oe/2+q+G)/15):ee==="round-tag"?(qe=(oe+q+G)*1.12,st=(oe/2+G+q)*.07):ee==="round-triangle"&&(qe=(oe+q+G)*(Math.PI/2),lt=-(oe+q/2+G)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(c+qe)/c,_e=c*be)),$=$==="auto"?ob(ye,_e):$;for(var tt=ye/2,Rt=_e/2,mt=$+(oe+G+q)/2,wt=new Array(ge.length/2),Jt=new Array(ge.length/2),Lt=0;Lt<ge.length/2;Lt++)wt[Lt]={x:le.x+st+tt*ge[Lt*2],y:le.y+lt+Rt*ge[Lt*2+1]};var Ft,lr,Cr,jt,rt=wt.length;for(lr=wt[rt-1],Ft=0;Ft<rt;Ft++)Cr=wt[Ft%rt],jt=wt[(Ft+1)%rt],Jt[Ft]=Ec(lr,Cr,jt,mt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+st,le.y+lt,l*me,c*be,ge,Jt)}else if(["roundrectangle","round-rectangle"].includes(ee))$=$==="auto"?ta(ye,_e):$,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,$+(oe+G+q)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))$=$==="auto"?ju():$,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,_e,null,$+(oe+G+q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))$=$==="auto"?ta(ye,_e):$,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,_e,$+(oe+G+q)/2);else if(ee==="barrel")o.drawBarrelPath(Ce||t,le.x,le.y,ye,_e);else if(ee.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ee)){var ut=(oe+G+q)/l;ge=xs(ks(ge,ut)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}else{var Ct=(oe+G+q)/l;ge=xs(ks(ge,-Ct)),o.drawPolygonPath(Ce||t,le.x,le.y,l,c,ge)}if(v?t.stroke(Ce):t.stroke(),M==="double"){t.lineWidth=oe/3;var On=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(Ce):t.stroke(),t.globalCompositeOperation=On}t.setLineDash&&t.setLineDash([])}},Ie=function(){a&&o.drawNodeOverlay(t,e,f,l,c)},we=function(){a&&o.drawNodeUnderlay(t,e,f,l,c)},xe=function(){o.drawElementText(t,e,null,n)},re=e.pstyle("ghost").value==="yes";if(re){var I=e.pstyle("ghost-offset-x").pfValue,U=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,U),W(),Pe(),K(te*P),ne(),ce(Z,!0),L(te*H),pe(),ie(N!==0||B!==0),ce(Z,!1),fe(Z),t.translate(-I,-U)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),W(),Pe(),K(),ne(),ce(h,!0),L(),pe(),ie(N!==0||B!==0),ce(h,!1),fe(),v&&t.translate(-f.x,-f.y),xe(),Ie(),r&&t.translate(m.x1,m.y1)}};var uw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,o){var l=this;if(n.visible()){var c=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,f=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var v=n.padding();i=n.width()+2*v,o=n.height()+2*v}l.colorFillStyle(r,d[0],d[1],d[2],u),l.nodeShapes[f].draw(r,a.x,a.y,i+c*2,o+c*2,h),r.fill()}}}};li.drawNodeOverlay=uw("overlay"),li.drawNodeUnderlay=uw("underlay"),li.hasPie=function(t){return t=t[0],t._private.hasPie},li.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=n.x,l=n.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,h=this.usePaths();h&&(o=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*r,m=p/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;p===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(o,l),t.arc(o,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Xt={},Q3=100;Xt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Xt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n},Xt.createGradientStyleFor=function(t,e,r,n,a){var i,o=this.usePaths(),l=r.pstyle(e+"-gradient-stop-colors").value,c=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),d=r.targetEndpoint(),f=r.midpoint(),h=Jn(u,f),v=Jn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=o?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,y))}else if(r.isEdge()){var m=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=o?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),k=C/2,E=x/2,_=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=t.createLinearGradient(w.x,w.y-E,w.x,w.y+E);break;case"to-top":i=t.createLinearGradient(w.x,w.y+E,w.x,w.y-E);break;case"to-left":i=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":i=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-k,w.y-E,w.x+k,w.y+E);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-k,w.y+E,w.x+k,w.y-E);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+k,w.y-E,w.x-k,w.y+E);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+k,w.y+E,w.x-k,w.y-E);break}}if(!i)return null;for(var S=c.length===l.length,T=l.length,N=0;N<T;N++)i.addColorStop(S?c[N]:N/(T-1),"rgba("+l[N][0]+","+l[N][1]+","+l[N][2]+","+a+")");return i},Xt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Xt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}},Xt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Xt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}},Xt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=l);var c=a*o,u=i*o,d;if(!(c===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=r.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)d=r.canvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=r.bufferCanvases[h],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,o<=1&&(d=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=c*e.textureMult,d.height=u*e.textureMult),e.canvasWidth=c,e.canvasHeight=u}},Xt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Xt.render=function(t){t=t||X0();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,o=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=o.cy,u=o.data,d=u.canvasNeedsRedraw,f=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,v=o.motionBlurPxRatio,p=c.hasCompoundNodes(),g=o.hoverData.draggingEles,y=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!y;var m=h;e||(o.prevPxRatio!==l&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=l),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),h&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(m=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!f&&(d[o.NODE]=!0,d[o.SELECT_BOX]=!0);var b=c.style(),w=c.zoom(),C=a!==void 0?a:w,x=c.pan(),k={x:x.x,y:x.y},E={zoom:w,pan:{x:x.x,y:x.y}},_=o.prevViewport,S=_===void 0||E.zoom!==_.zoom||E.pan.x!==_.pan.x||E.pan.y!==_.pan.y;!S&&!(g&&!p)&&(o.motionBlurPxRatio=1),i&&(k=i),C*=l,k.x*=l,k.y*=l;var T=o.getCachedZSortedEles();function N(ae,ne,ce,ie,fe){var pe=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",o.colorFillStyle(ae,255,255,255,o.motionBlurTransparency),ae.fillRect(ne,ce,ie,fe),ae.globalCompositeOperation=pe}function B(ae,ne){var ce,ie,fe,pe;!o.clearingMotionBlur&&(ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(ce={x:x.x*v,y:x.y*v},ie=w*v,fe=o.canvasWidth*v,pe=o.canvasHeight*v):(ce=k,ie=C,fe=o.canvasWidth,pe=o.canvasHeight),ae.setTransform(1,0,0,1,0,0),ne==="motionBlur"?N(ae,0,0,fe,pe):!e&&(ne===void 0||ne)&&ae.clearRect(0,0,fe,pe),r||(ae.translate(ce.x,ce.y),ae.scale(ie,ie)),i&&ae.translate(i.x,i.y),a&&ae.scale(a,a)}if(f||(o.textureDrawLastFrame=!1),f){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=c.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var P=o.data.bufferContexts[o.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult});var E=o.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:o.canvasWidth,height:o.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[o.DRAG]=!1,d[o.NODE]=!1;var D=u.contexts[o.NODE],R=o.textureCache.texture,E=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?N(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var O=b.core("outside-texture-bg-color").value,F=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,O[0],O[1],O[2],F),D.fillRect(0,0,E.width,E.height);var w=c.zoom();B(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),D.drawImage(R,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var A=c.extent(),z=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),j=o.hideEdgesOnViewport&&z,H=[];if(H[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,H[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),H[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,H[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||H[o.NODE]){var G=h&&!H[o.NODE]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),X=h&&!G?"motionBlur":void 0;B(D,X),j?o.drawCachedNodes(D,T.nondrag,l,A):o.drawLayeredElements(D,T.nondrag,l,A),o.debug&&o.drawDebugPoints(D,T.nondrag),!r&&!h&&(d[o.NODE]=!1)}if(!n&&(d[o.DRAG]||r||H[o.DRAG])){var G=h&&!H[o.DRAG]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);B(D,h&&!G?"motionBlur":void 0),j?o.drawCachedNodes(D,T.drag,l,A):o.drawCachedElements(D,T.drag,l,A),o.debug&&o.drawDebugPoints(D,T.drag),!r&&!h&&(d[o.DRAG]=!1)}if(o.showFps||!n&&d[o.SELECT_BOX]&&!r){var D=e||u.contexts[o.SELECT_BOX];if(B(D),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var w=o.cy.zoom(),M=b.core("selection-box-border-width").value/w;D.lineWidth=M,D.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",D.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),M>0&&(D.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",D.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),V=u.bgActivePosistion;D.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",D.beginPath(),D.arc(V.x,V.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var q=o.lastRedrawTime;if(o.showFps&&q){q=Math.round(q);var $=Math.round(1e3/q);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+q+" ms = "+$+" fps",0,20);var K=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min($/K,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var L=u.contexts[o.NODE],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=u.contexts[o.DRAG],se=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],ue=function(ne,ce,ie){ne.setTransform(1,0,0,1,0,0),ie||!m?ne.clearRect(0,0,o.canvasWidth,o.canvasHeight):N(ne,0,0,o.canvasWidth,o.canvasHeight);var fe=v;ne.drawImage(ce,0,0,o.canvasWidth*fe,o.canvasHeight*fe,0,0,o.canvasWidth,o.canvasHeight)};(d[o.NODE]||H[o.NODE])&&(ue(L,W,H[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||H[o.DRAG])&&(ue(Y,se,H[o.DRAG]),d[o.DRAG]=!1)}o.prevViewport=E,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!f,o.mbFrames=0,d[o.NODE]=!0,d[o.DRAG]=!0,o.redraw()},Q3)),e||c.emit("render")};var In={};In.drawPolygonPath=function(t,e,r,n,a,i){var o=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+o*i[c*2],r+l*i[c*2+1]);t.closePath()},In.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return H1(t,l)}),t.closePath()},In.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):Math.min(i,l,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+o,r-l,e+o,r,c),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.arcTo(e-o,r-l,e,r-l,c),t.lineTo(e,r-l),t.closePath()},In.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,c=i==="auto"?ta(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+o,r-l),t.lineTo(e+o,r),t.arcTo(e+o,r+l,e,r+l,c),t.arcTo(e-o,r+l,e-o,r,c),t.lineTo(e-o,r-l),t.lineTo(e,r-l),t.closePath()},In.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,c=a/2,u=o==="auto"?ju():o;t.beginPath&&t.beginPath(),t.moveTo(e-l+u,r-c),t.lineTo(e+l-u,r-c),t.lineTo(e+l,r-c+u),t.lineTo(e+l,r+c-u),t.lineTo(e+l-u,r+c),t.lineTo(e-l+u,r+c),t.lineTo(e-l,r+c-u),t.lineTo(e-l,r-c+u),t.closePath()},In.drawBarrelPath=function(t,e,r,n,a){var i=n/2,o=a/2,l=e-i,c=e+i,u=r-o,d=r+o,f=Wu(n,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(c-h,d),t.quadraticCurveTo(c-p,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-p,u,c-h,u),t.lineTo(l+h,u),t.quadraticCurveTo(l+p,u,l,u+v),t.closePath()};for(var cw=Math.sin(0),dw=Math.cos(0),Ic={},Bc={},fw=Math.PI/40,ui=0*Math.PI;ui<2*Math.PI;ui+=fw)Ic[ui]=Math.sin(ui),Bc[ui]=Math.cos(ui);In.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,o,l=n/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=fw)i=e-l*Ic[u]*cw+l*Bc[u]*dw,o=r+c*Bc[u]*cw+c*Ic[u]*dw,u===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Co={};Co.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Co.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],o=t.full?Math.ceil(n.h):a[3],l=de(t.maxWidth)||de(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;de(t.maxWidth)&&(d=u*t.maxWidth/i),de(t.maxHeight)&&(f=u*t.maxHeight/o),u=Math.min(d,f),i*=u,o*=u}l||(i*=c,o*=c,u*=c);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var v=h.getContext("2d");if(i>0&&o>0){v.clearRect(0,0,i,o),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*u,-n.y1*u),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(n.x1*u,n.y1*u);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(y.x,y.y),v.scale(u,u),this.drawElements(v,p),v.scale(1/u,1/u),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,o),v.fill())}return h};function e4(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function hw(t){var e=t.indexOf(",");return t.substr(e+1)}function pw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ua(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return e4(hw(n()),r);case"base64":return hw(n());case"base64uri":default:return n()}}Co.png=function(t){return pw(t,this.bufferCanvasImage(t),"image/png")},Co.jpg=function(t){return pw(t,this.bufferCanvasImage(t),"image/jpeg")};var vw={};vw.nodeShapeImpl=function(t,e,r,n,a,i,o,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,o,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,o,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,l);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var t4=gw,Fe=gw.prototype;Fe.CANVAS_LAYERS=3,Fe.SELECT_BOX=0,Fe.DRAG=1,Fe.NODE=2,Fe.BUFFER_COUNT=3,Fe.TEXTURE_BUFFER=0,Fe.MOTIONBLUR_BUFFER_NODE=1,Fe.MOTIONBLUR_BUFFER_DRAG=2;function gw(t){var e=this,r=e.cy.window(),n=r.document;e.data={canvases:new Array(Fe.CANVAS_LAYERS),contexts:new Array(Fe.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Fe.CANVAS_LAYERS),bufferCanvases:new Array(Fe.BUFFER_COUNT),bufferContexts:new Array(Fe.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};zF()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Fe.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=n.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(K){d.style[K]=c[K]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Fe.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Fe.NODE].setAttribute("data-id","layer"+Fe.NODE+"-node"),e.data.canvases[Fe.SELECT_BOX].setAttribute("data-id","layer"+Fe.SELECT_BOX+"-selectbox"),e.data.canvases[Fe.DRAG].setAttribute("data-id","layer"+Fe.DRAG+"-drag");for(var u=0;u<Fe.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=Kt(),h=function(L){return{x:(L.x1+L.x2)/2,y:(L.y1+L.y2)/2}},v=function(L){return{x:-L.w/2,y:-L.h/2}},p=function(L){var W=L[0]._private,Y=W.oldBackgroundTimestamp===W.backgroundTimestamp;return!Y},g=function(L){return L[0]._private.nodeKey},y=function(L){return L[0]._private.labelStyleKey},m=function(L){return L[0]._private.sourceLabelStyleKey},b=function(L){return L[0]._private.targetLabelStyleKey},w=function(L,W,Y,se,ue){return e.drawElement(L,W,Y,!1,!1,ue)},C=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"main",ue)},x=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"source",ue)},k=function(L,W,Y,se,ue){return e.drawElementText(L,W,Y,se,"target",ue)},E=function(L){return L.boundingBox(),L[0]._private.bodyBounds},_=function(L){return L.boundingBox(),L[0]._private.labelBounds.main||f},S=function(L){return L.boundingBox(),L[0]._private.labelBounds.source||f},T=function(L){return L.boundingBox(),L[0]._private.labelBounds.target||f},N=function(L,W){return W},B=function(L){return h(E(L))},P=function(L,W,Y){var se=L?L+"-":"";return{x:W.x+Y.pstyle(se+"text-margin-x").pfValue,y:W.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(L,W,Y){var se=L[0]._private.rscratch;return{x:se[W],y:se[Y]}},R=function(L){return P("",D(L,"labelX","labelY"),L)},O=function(L){return P("source",D(L,"sourceLabelX","sourceLabelY"),L)},F=function(L){return P("target",D(L,"targetLabelX","targetLabelY"),L)},A=function(L){return v(E(L))},z=function(L){return v(S(L))},j=function(L){return v(T(L))},H=function(L){var W=_(L),Y=v(_(L));if(L.isNode()){switch(L.pstyle("text-halign").value){case"left":Y.x=-W.w;break;case"right":Y.x=0;break}switch(L.pstyle("text-valign").value){case"top":Y.y=-W.h;break;case"bottom":Y.y=0;break}}return Y},G=e.data.eleTxrCache=new bo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:E,getRotationPoint:B,getRotationOffset:A,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),X=e.data.lblTxrCache=new bo(e,{getKey:y,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:H,isVisible:N}),M=e.data.slbTxrCache=new bo(e,{getKey:m,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:z,isVisible:N}),V=e.data.tlbTxrCache=new bo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:F,getRotationOffset:j,isVisible:N}),q=e.data.lyrTxrCache=new nw(e);e.onUpdateEleCalcs(function(L,W){G.invalidateElements(W),X.invalidateElements(W),M.invalidateElements(W),V.invalidateElements(W),q.invalidateElements(W);for(var Y=0;Y<W.length;Y++){var se=W[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var $=function(L){for(var W=0;W<L.length;W++)q.enqueueElementRefinement(L[W].ele)};G.onDequeue($),X.onDequeue($),M.onDequeue($),V.onDequeue($)}Fe.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Fe.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Fe.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Fe.SELECT_BOX]=e;break}};var r4=typeof Path2D<"u";Fe.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Fe.usePaths=function(){return r4&&this.pathsEnabled},Fe.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Fe.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Fe.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":ht(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r},[iw,Ar,en,Tc,ua,li,Xt,In,Co,vw].forEach(function(t){Se(Fe,t)});var n4=[{name:"null",impl:A1},{name:"base",impl:Q1},{name:"canvas",impl:t4}],a4=[{type:"layout",extensions:c3},{type:"renderer",extensions:n4}],mw={},yw={};function bw(t,e,r){var n=r,a=function(_){$e("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(go.prototype[e])return a(e);go.prototype[e]=r}else if(t==="collection"){if(Tt.prototype[e])return a(e);Tt.prototype[e]=r}else if(t==="layout"){for(var i=function(_){this.options=_,r.call(this,_),Ae(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),l=[],c=0;c<l.length;c++){var u=l[c];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var d=r.prototype.stop;o.stop=function(){var E=this.options;if(E&&E.animate){var _=this.animations;if(_)for(var S=0;S<_.length;S++)_[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(_){return _._private.cy},h={addEventFields:function(_,S){S.layout=_,S.cy=f(_),S.target=_},bubble:function(){return!0},parent:function(_){return f(_)}};Se(o,{createEmitter:function(){return this._private.emitter=new Ms(h,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ve.eventAliasesOn(o),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=ww("renderer","base"),p=v.prototype,g=r,y=r.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in p){var C=p[w],x=y[w]!=null;if(x)return a(w);b[w]=C}for(var k in y)b[k]=y[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Je("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Je(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return R0({map:mw,keys:[t,e],value:n})}function ww(t,e){return L0({map:mw,keys:[t,e]})}function i4(t,e,r,n,a){return R0({map:yw,keys:[t,e,r,n],value:a})}function o4(t,e,r,n){return L0({map:yw,keys:[t,e,r,n]})}var Dc=function(){if(arguments.length===2)return ww.apply(null,arguments);if(arguments.length===3)return bw.apply(null,arguments);if(arguments.length===4)return o4.apply(null,arguments);if(arguments.length===5)return i4.apply(null,arguments);Je("Invalid extension access syntax")};go.prototype.extension=Dc,a4.forEach(function(t){t.extensions.forEach(function(e){bw(t.type,e.name,e.impl)})});var Cw=function t(){if(!(this instanceof t))return new t;this.length=0},ca=Cw.prototype;ca.instanceString=function(){return"stylesheet"},ca.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},ca.css=function(t,e){var r=this.length-1;if(Ee(t))this[r].properties.push({name:t,value:e});else if(Ae(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],l=n[o];if(l!=null){var c=Pt.properties[o]||Pt.properties[fs(o)];if(c!=null){var u=c.name,d=l;this[r].properties.push({name:u,value:d})}}}return this},ca.style=ca.css,ca.generateStyle=function(t){var e=new Pt(t);return this.appendToStyle(e)},ca.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var o=a[i];t.css(o.name,o.value)}}return t};var s4="3.30.2",Bn=function(e){if(e===void 0&&(e={}),Ae(e))return new go(e);if(Ee(e))return Dc.apply(Dc,arguments)};Bn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Bn),t.apply(null,e),this},Bn.warnings=function(t){return Y0(t)},Bn.version=s4,Bn.stylesheet=Bn.Stylesheet=Cw;var Ew={exports:{}};function Pc(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Oc,xw;function l4(){if(xw)return Oc;xw=1;function t(){this.__data__=[],this.size=0}return Oc=t,Oc}var Ac,kw;function ci(){if(kw)return Ac;kw=1;function t(e,r){return e===r||e!==e&&r!==r}return Ac=t,Ac}var Rc,Sw;function sl(){if(Sw)return Rc;Sw=1;var t=ci();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Rc=e,Rc}var Lc,_w;function u4(){if(_w)return Lc;_w=1;var t=sl(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,o=t(i,a);if(o<0)return!1;var l=i.length-1;return o==l?i.pop():r.call(i,o,1),--this.size,!0}return Lc=n,Lc}var Fc,Tw;function c4(){if(Tw)return Fc;Tw=1;var t=sl();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Fc=e,Fc}var Mc,Nw;function d4(){if(Nw)return Mc;Nw=1;var t=sl();function e(r){return t(this.__data__,r)>-1}return Mc=e,Mc}var $c,Iw;function f4(){if(Iw)return $c;Iw=1;var t=sl();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return $c=e,$c}var Vc,Bw;function ll(){if(Bw)return Vc;Bw=1;var t=l4(),e=u4(),r=c4(),n=d4(),a=f4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Vc=i,Vc}var qc,Dw;function h4(){if(Dw)return qc;Dw=1;var t=ll();function e(){this.__data__=new t,this.size=0}return qc=e,qc}var zc,Pw;function p4(){if(Pw)return zc;Pw=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return zc=t,zc}var Hc,Ow;function v4(){if(Ow)return Hc;Ow=1;function t(e){return this.__data__.get(e)}return Hc=t,Hc}var Kc,Aw;function g4(){if(Aw)return Kc;Aw=1;function t(e){return this.__data__.has(e)}return Kc=t,Kc}var Gc,Rw;function Lw(){if(Rw)return Gc;Rw=1;var t=typeof Li=="object"&&Li&&Li.Object===Object&&Li;return Gc=t,Gc}var Uc,Fw;function br(){if(Fw)return Uc;Fw=1;var t=Lw(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Uc=r,Uc}var jc,Mw;function di(){if(Mw)return jc;Mw=1;var t=br(),e=t.Symbol;return jc=e,jc}var Wc,$w;function m4(){if($w)return Wc;$w=1;var t=di(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(o){var l=r.call(o,a),c=o[a];try{o[a]=void 0;var u=!0}catch{}var d=n.call(o);return u&&(l?o[a]=c:delete o[a]),d}return Wc=i,Wc}var Yc,Vw;function y4(){if(Vw)return Yc;Vw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Yc=r,Yc}var Zc,qw;function da(){if(qw)return Zc;qw=1;var t=di(),e=m4(),r=y4(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?a:n:i&&i in Object(l)?e(l):r(l)}return Zc=o,Zc}var Xc,zw;function or(){if(zw)return Xc;zw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Xc=t,Xc}var Jc,Hw;function Eo(){if(Hw)return Jc;Hw=1;var t=da(),e=or(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!e(l))return!1;var c=t(l);return c==n||c==a||c==r||c==i}return Jc=o,Jc}var Qc,Kw;function b4(){if(Kw)return Qc;Kw=1;var t=br(),e=t["__core-js_shared__"];return Qc=e,Qc}var ed,Gw;function w4(){if(Gw)return ed;Gw=1;var t=b4(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return ed=r,ed}var td,Uw;function jw(){if(Uw)return td;Uw=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return td=r,td}var rd,Ww;function C4(){if(Ww)return rd;Ww=1;var t=Eo(),e=w4(),r=or(),n=jw(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||e(h))return!1;var v=t(h)?d:i;return v.test(n(h))}return rd=f,rd}var nd,Yw;function E4(){if(Yw)return nd;Yw=1;function t(e,r){return e==null?void 0:e[r]}return nd=t,nd}var ad,Zw;function fa(){if(Zw)return ad;Zw=1;var t=C4(),e=E4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return ad=r,ad}var id,Xw;function od(){if(Xw)return id;Xw=1;var t=fa(),e=br(),r=t(e,"Map");return id=r,id}var sd,Jw;function ul(){if(Jw)return sd;Jw=1;var t=fa(),e=t(Object,"create");return sd=e,sd}var ld,Qw;function x4(){if(Qw)return ld;Qw=1;var t=ul();function e(){this.__data__=t?t(null):{},this.size=0}return ld=e,ld}var ud,eC;function k4(){if(eC)return ud;eC=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return ud=t,ud}var cd,tC;function S4(){if(tC)return cd;tC=1;var t=ul(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(t){var l=o[i];return l===e?void 0:l}return n.call(o,i)?o[i]:void 0}return cd=a,cd}var dd,rC;function _4(){if(rC)return dd;rC=1;var t=ul(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return dd=n,dd}var fd,nC;function T4(){if(nC)return fd;nC=1;var t=ul(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return fd=r,fd}var hd,aC;function N4(){if(aC)return hd;aC=1;var t=x4(),e=k4(),r=S4(),n=_4(),a=T4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,hd=i,hd}var pd,iC;function I4(){if(iC)return pd;iC=1;var t=N4(),e=ll(),r=od();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return pd=n,pd}var vd,oC;function B4(){if(oC)return vd;oC=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return vd=t,vd}var gd,sC;function cl(){if(sC)return gd;sC=1;var t=B4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return gd=e,gd}var md,lC;function D4(){if(lC)return md;lC=1;var t=cl();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return md=e,md}var yd,uC;function P4(){if(uC)return yd;uC=1;var t=cl();function e(r){return t(this,r).get(r)}return yd=e,yd}var bd,cC;function O4(){if(cC)return bd;cC=1;var t=cl();function e(r){return t(this,r).has(r)}return bd=e,bd}var wd,dC;function A4(){if(dC)return wd;dC=1;var t=cl();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return wd=e,wd}var Cd,fC;function Ed(){if(fC)return Cd;fC=1;var t=I4(),e=D4(),r=P4(),n=O4(),a=A4();function i(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Cd=i,Cd}var xd,hC;function R4(){if(hC)return xd;hC=1;var t=ll(),e=od(),r=Ed(),n=200;function a(i,o){var l=this.__data__;if(l instanceof t){var c=l.__data__;if(!e||c.length<n-1)return c.push([i,o]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(i,o),this.size=l.size,this}return xd=a,xd}var kd,pC;function dl(){if(pC)return kd;pC=1;var t=ll(),e=h4(),r=p4(),n=v4(),a=g4(),i=R4();function o(l){var c=this.__data__=new t(l);this.size=c.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,kd=o,kd}var Sd,vC;function _d(){if(vC)return Sd;vC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return Sd=t,Sd}var Td,gC;function mC(){if(gC)return Td;gC=1;var t=fa(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Td=e,Td}var Nd,yC;function fl(){if(yC)return Nd;yC=1;var t=mC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Nd=e,Nd}var Id,bC;function hl(){if(bC)return Id;bC=1;var t=fl(),e=ci(),r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l){var c=i[o];(!(n.call(i,o)&&e(c,l))||l===void 0&&!(o in i))&&t(i,o,l)}return Id=a,Id}var Bd,wC;function xo(){if(wC)return Bd;wC=1;var t=hl(),e=fl();function r(n,a,i,o){var l=!i;i||(i={});for(var c=-1,u=a.length;++c<u;){var d=a[c],f=o?o(i[d],n[d],d,i,n):void 0;f===void 0&&(f=n[d]),l?e(i,d,f):t(i,d,f)}return i}return Bd=r,Bd}var Dd,CC;function L4(){if(CC)return Dd;CC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Dd=t,Dd}var Pd,EC;function Rr(){if(EC)return Pd;EC=1;function t(e){return e!=null&&typeof e=="object"}return Pd=t,Pd}var Od,xC;function F4(){if(xC)return Od;xC=1;var t=da(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Od=n,Od}var Ad,kC;function ko(){if(kC)return Ad;kC=1;var t=F4(),e=Rr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Ad=i,Ad}var Rd,SC;function ot(){if(SC)return Rd;SC=1;var t=Array.isArray;return Rd=t,Rd}var So={exports:{}},Ld,_C;function M4(){if(_C)return Ld;_C=1;function t(){return!1}return Ld=t,Ld}So.exports;var TC;function fi(){return TC||(TC=1,function(t,e){var r=br(),n=M4(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;t.exports=u}(So,So.exports)),So.exports}var Fd,NC;function pl(){if(NC)return Fd;NC=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Fd=r,Fd}var Md,IC;function $d(){if(IC)return Md;IC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Md=e,Md}var Vd,BC;function $4(){if(BC)return Vd;BC=1;var t=da(),e=$d(),r=Rr(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",v="[object Set]",p="[object String]",g="[object WeakMap]",y="[object ArrayBuffer]",m="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",T="[object Uint32Array]",N={};N[b]=N[w]=N[C]=N[x]=N[k]=N[E]=N[_]=N[S]=N[T]=!0,N[n]=N[a]=N[y]=N[i]=N[m]=N[o]=N[l]=N[c]=N[u]=N[d]=N[f]=N[h]=N[v]=N[p]=N[g]=!1;function B(P){return r(P)&&e(P.length)&&!!N[t(P)]}return Vd=B,Vd}var qd,DC;function vl(){if(DC)return qd;DC=1;function t(e){return function(r){return e(r)}}return qd=t,qd}var _o={exports:{}};_o.exports;var PC;function zd(){return PC||(PC=1,function(t,e){var r=Lw(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=l}(_o,_o.exports)),_o.exports}var Hd,OC;function To(){if(OC)return Hd;OC=1;var t=$4(),e=vl(),r=zd(),n=r&&r.isTypedArray,a=n?e(n):t;return Hd=a,Hd}var Kd,AC;function RC(){if(AC)return Kd;AC=1;var t=L4(),e=ko(),r=ot(),n=fi(),a=pl(),i=To(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&e(u),v=!f&&!h&&n(u),p=!f&&!h&&!v&&i(u),g=f||h||v||p,y=g?t(u.length,String):[],m=y.length;for(var b in u)(d||l.call(u,b))&&!(g&&(b=="length"||v&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||a(b,m)))&&y.push(b);return y}return Kd=c,Kd}var Gd,LC;function gl(){if(LC)return Gd;LC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Gd=e,Gd}var Ud,FC;function MC(){if(FC)return Ud;FC=1;function t(e,r){return function(n){return e(r(n))}}return Ud=t,Ud}var jd,$C;function V4(){if($C)return jd;$C=1;var t=MC(),e=t(Object.keys,Object);return jd=e,jd}var Wd,VC;function Yd(){if(VC)return Wd;VC=1;var t=gl(),e=V4(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var o=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&o.push(l);return o}return Wd=a,Wd}var Zd,qC;function tn(){if(qC)return Zd;qC=1;var t=Eo(),e=$d();function r(n){return n!=null&&e(n.length)&&!t(n)}return Zd=r,Zd}var Xd,zC;function Dn(){if(zC)return Xd;zC=1;var t=RC(),e=Yd(),r=tn();function n(a){return r(a)?t(a):e(a)}return Xd=n,Xd}var Jd,HC;function q4(){if(HC)return Jd;HC=1;var t=xo(),e=Dn();function r(n,a){return n&&t(a,e(a),n)}return Jd=r,Jd}var Qd,KC;function z4(){if(KC)return Qd;KC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return Qd=t,Qd}var ef,GC;function H4(){if(GC)return ef;GC=1;var t=or(),e=gl(),r=z4(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!t(o))return r(o);var l=e(o),c=[];for(var u in o)u=="constructor"&&(l||!a.call(o,u))||c.push(u);return c}return ef=i,ef}var tf,UC;function ha(){if(UC)return tf;UC=1;var t=RC(),e=H4(),r=tn();function n(a){return r(a)?t(a,!0):e(a)}return tf=n,tf}var rf,jC;function K4(){if(jC)return rf;jC=1;var t=xo(),e=ha();function r(n,a){return n&&t(a,e(a),n)}return rf=r,rf}var No={exports:{}};No.exports;var WC;function YC(){return WC||(WC=1,function(t,e){var r=br(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,h=l?l(f):new u.constructor(f);return u.copy(h),h}t.exports=c}(No,No.exports)),No.exports}var nf,ZC;function XC(){if(ZC)return nf;ZC=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return nf=t,nf}var af,JC;function QC(){if(JC)return af;JC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var l=e[n];r(l,n,e)&&(o[i++]=l)}return o}return af=t,af}var of,eE;function tE(){if(eE)return of;eE=1;function t(){return[]}return of=t,of}var sf,rE;function lf(){if(rE)return sf;rE=1;var t=QC(),e=tE(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),t(a(o),function(l){return n.call(o,l)}))}:e;return sf=i,sf}var uf,nE;function G4(){if(nE)return uf;nE=1;var t=xo(),e=lf();function r(n,a){return t(n,e(n),a)}return uf=r,uf}var cf,aE;function df(){if(aE)return cf;aE=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return cf=t,cf}var ff,iE;function ml(){if(iE)return ff;iE=1;var t=MC(),e=t(Object.getPrototypeOf,Object);return ff=e,ff}var hf,oE;function sE(){if(oE)return hf;oE=1;var t=df(),e=ml(),r=lf(),n=tE(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return hf=i,hf}var pf,lE;function U4(){if(lE)return pf;lE=1;var t=xo(),e=sE();function r(n,a){return t(n,e(n),a)}return pf=r,pf}var vf,uE;function cE(){if(uE)return vf;uE=1;var t=df(),e=ot();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return vf=r,vf}var gf,dE;function fE(){if(dE)return gf;dE=1;var t=cE(),e=lf(),r=Dn();function n(a){return t(a,r,e)}return gf=n,gf}var mf,hE;function j4(){if(hE)return mf;hE=1;var t=cE(),e=sE(),r=ha();function n(a){return t(a,r,e)}return mf=n,mf}var yf,pE;function W4(){if(pE)return yf;pE=1;var t=fa(),e=br(),r=t(e,"DataView");return yf=r,yf}var bf,vE;function Y4(){if(vE)return bf;vE=1;var t=fa(),e=br(),r=t(e,"Promise");return bf=r,bf}var wf,gE;function mE(){if(gE)return wf;gE=1;var t=fa(),e=br(),r=t(e,"Set");return wf=r,wf}var Cf,yE;function Z4(){if(yE)return Cf;yE=1;var t=fa(),e=br(),r=t(e,"WeakMap");return Cf=r,Cf}var Ef,bE;function hi(){if(bE)return Ef;bE=1;var t=W4(),e=od(),r=Y4(),n=mE(),a=Z4(),i=da(),o=jw(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",v=o(t),p=o(e),g=o(r),y=o(n),m=o(a),b=i;return(t&&b(new t(new ArrayBuffer(1)))!=h||e&&b(new e)!=l||r&&b(r.resolve())!=u||n&&b(new n)!=d||a&&b(new a)!=f)&&(b=function(w){var C=i(w),x=C==c?w.constructor:void 0,k=x?o(x):"";if(k)switch(k){case v:return h;case p:return l;case g:return u;case y:return d;case m:return f}return C}),Ef=b,Ef}var xf,wE;function X4(){if(wE)return xf;wE=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return xf=r,xf}var kf,CE;function EE(){if(CE)return kf;CE=1;var t=br(),e=t.Uint8Array;return kf=e,kf}var Sf,xE;function _f(){if(xE)return Sf;xE=1;var t=EE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return Sf=e,Sf}var Tf,kE;function J4(){if(kE)return Tf;kE=1;var t=_f();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Tf=e,Tf}var Nf,SE;function Q4(){if(SE)return Nf;SE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return Nf=e,Nf}var If,_E;function e8(){if(_E)return If;_E=1;var t=di(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return If=n,If}var Bf,TE;function NE(){if(TE)return Bf;TE=1;var t=_f();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Bf=e,Bf}var Df,IE;function t8(){if(IE)return Df;IE=1;var t=_f(),e=J4(),r=Q4(),n=e8(),a=NE(),i="[object Boolean]",o="[object Date]",l="[object Map]",c="[object Number]",u="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",v="[object ArrayBuffer]",p="[object DataView]",g="[object Float32Array]",y="[object Float64Array]",m="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",C="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",E="[object Uint32Array]";function _(S,T,N){var B=S.constructor;switch(T){case v:return t(S);case i:case o:return new B(+S);case p:return e(S,N);case g:case y:case m:case b:case w:case C:case x:case k:case E:return a(S,N);case l:return new B;case c:case f:return new B(S);case u:return r(S);case d:return new B;case h:return n(S)}}return Df=_,Df}var Pf,BE;function DE(){if(BE)return Pf;BE=1;var t=or(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Pf=r,Pf}var Of,PE;function OE(){if(PE)return Of;PE=1;var t=DE(),e=ml(),r=gl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Of=n,Of}var Af,AE;function r8(){if(AE)return Af;AE=1;var t=hi(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Af=n,Af}var Rf,RE;function n8(){if(RE)return Rf;RE=1;var t=r8(),e=vl(),r=zd(),n=r&&r.isMap,a=n?e(n):t;return Rf=a,Rf}var Lf,LE;function a8(){if(LE)return Lf;LE=1;var t=hi(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Lf=n,Lf}var Ff,FE;function i8(){if(FE)return Ff;FE=1;var t=a8(),e=vl(),r=zd(),n=r&&r.isSet,a=n?e(n):t;return Ff=a,Ff}var Mf,ME;function $E(){if(ME)return Mf;ME=1;var t=dl(),e=_d(),r=hl(),n=q4(),a=K4(),i=YC(),o=XC(),l=G4(),c=U4(),u=fE(),d=j4(),f=hi(),h=X4(),v=t8(),p=OE(),g=ot(),y=fi(),m=n8(),b=or(),w=i8(),C=Dn(),x=ha(),k=1,E=2,_=4,S="[object Arguments]",T="[object Array]",N="[object Boolean]",B="[object Date]",P="[object Error]",D="[object Function]",R="[object GeneratorFunction]",O="[object Map]",F="[object Number]",A="[object Object]",z="[object RegExp]",j="[object Set]",H="[object String]",G="[object Symbol]",X="[object WeakMap]",M="[object ArrayBuffer]",V="[object DataView]",q="[object Float32Array]",$="[object Float64Array]",K="[object Int8Array]",L="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ue="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[M]=ne[V]=ne[N]=ne[B]=ne[q]=ne[$]=ne[K]=ne[L]=ne[W]=ne[O]=ne[F]=ne[A]=ne[z]=ne[j]=ne[H]=ne[G]=ne[Y]=ne[se]=ne[ue]=ne[ae]=!0,ne[P]=ne[D]=ne[X]=!1;function ce(ie,fe,pe,Pe,Ie,we){var xe,re=fe&k,I=fe&E,U=fe&_;if(pe&&(xe=Ie?pe(ie,Pe,Ie,we):pe(ie)),xe!==void 0)return xe;if(!b(ie))return ie;var te=g(ie);if(te){if(xe=h(ie),!re)return o(ie,xe)}else{var Z=f(ie),J=Z==D||Z==R;if(y(ie))return i(ie,re);if(Z==A||Z==S||J&&!Ie){if(xe=I||J?{}:p(ie),!re)return I?c(ie,a(xe,ie)):l(ie,n(xe,ie))}else{if(!ne[Z])return Ie?ie:{};xe=v(ie,Z,re)}}we||(we=new t);var le=we.get(ie);if(le)return le;we.set(ie,xe),w(ie)?ie.forEach(function(me){xe.add(ce(me,fe,pe,me,ie,we))}):m(ie)&&ie.forEach(function(me,be){xe.set(be,ce(me,fe,pe,be,ie,we))});var ee=U?I?d:u:I?x:C,oe=te?void 0:ee(ie);return e(oe||ie,function(me,be){oe&&(be=me,me=ie[be]),r(xe,be,ce(me,fe,pe,be,ie,we))}),xe}return Mf=ce,Mf}var $f,VE;function o8(){if(VE)return $f;VE=1;var t=$E(),e=4;function r(n){return t(n,e)}return $f=r,$f}var Vf,qE;function qf(){if(qE)return Vf;qE=1;function t(e){return function(){return e}}return Vf=t,Vf}var zf,zE;function s8(){if(zE)return zf;zE=1;function t(e){return function(r,n,a){for(var i=-1,o=Object(r),l=a(r),c=l.length;c--;){var u=l[e?c:++i];if(n(o[u],u,o)===!1)break}return r}}return zf=t,zf}var Hf,HE;function Kf(){if(HE)return Hf;HE=1;var t=s8(),e=t();return Hf=e,Hf}var Gf,KE;function Uf(){if(KE)return Gf;KE=1;var t=Kf(),e=Dn();function r(n,a){return n&&t(n,a,e)}return Gf=r,Gf}var jf,GE;function l8(){if(GE)return jf;GE=1;var t=tn();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var o=a.length,l=n?o:-1,c=Object(a);(n?l--:++l<o)&&i(c[l],l,c)!==!1;);return a}}return jf=e,jf}var Wf,UE;function yl(){if(UE)return Wf;UE=1;var t=Uf(),e=l8(),r=e(t);return Wf=r,Wf}var Yf,jE;function pa(){if(jE)return Yf;jE=1;function t(e){return e}return Yf=t,Yf}var Zf,WE;function YE(){if(WE)return Zf;WE=1;var t=pa();function e(r){return typeof r=="function"?r:t}return Zf=e,Zf}var Xf,ZE;function XE(){if(ZE)return Xf;ZE=1;var t=_d(),e=yl(),r=YE(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Xf=a,Xf}var Jf,JE;function QE(){return JE||(JE=1,Jf=XE()),Jf}var Qf,ex;function u8(){if(ex)return Qf;ex=1;var t=yl();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return Qf=e,Qf}var eh,tx;function c8(){if(tx)return eh;tx=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return eh=e,eh}var th,rx;function d8(){if(rx)return th;rx=1;function t(e){return this.__data__.has(e)}return th=t,th}var rh,nx;function ax(){if(nx)return rh;nx=1;var t=Ed(),e=c8(),r=d8();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new t;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,rh=n,rh}var nh,ix;function f8(){if(ix)return nh;ix=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return nh=t,nh}var ah,ox;function sx(){if(ox)return ah;ox=1;function t(e,r){return e.has(r)}return ah=t,ah}var ih,lx;function ux(){if(lx)return ih;lx=1;var t=ax(),e=f8(),r=sx(),n=1,a=2;function i(o,l,c,u,d,f){var h=c&n,v=o.length,p=l.length;if(v!=p&&!(h&&p>v))return!1;var g=f.get(o),y=f.get(l);if(g&&y)return g==l&&y==o;var m=-1,b=!0,w=c&a?new t:void 0;for(f.set(o,l),f.set(l,o);++m<v;){var C=o[m],x=l[m];if(u)var k=h?u(x,C,m,l,o,f):u(C,x,m,o,l,f);if(k!==void 0){if(k)continue;b=!1;break}if(w){if(!e(l,function(E,_){if(!r(w,_)&&(C===E||d(C,E,c,u,f)))return w.push(_)})){b=!1;break}}else if(!(C===x||d(C,x,c,u,f))){b=!1;break}}return f.delete(o),f.delete(l),b}return ih=i,ih}var oh,cx;function h8(){if(cx)return oh;cx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return oh=t,oh}var sh,dx;function lh(){if(dx)return sh;dx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return sh=t,sh}var uh,fx;function p8(){if(fx)return uh;fx=1;var t=di(),e=EE(),r=ci(),n=ux(),a=h8(),i=lh(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",v="[object RegExp]",p="[object Set]",g="[object String]",y="[object Symbol]",m="[object ArrayBuffer]",b="[object DataView]",w=t?t.prototype:void 0,C=w?w.valueOf:void 0;function x(k,E,_,S,T,N,B){switch(_){case b:if(k.byteLength!=E.byteLength||k.byteOffset!=E.byteOffset)return!1;k=k.buffer,E=E.buffer;case m:return!(k.byteLength!=E.byteLength||!N(new e(k),new e(E)));case c:case u:case h:return r(+k,+E);case d:return k.name==E.name&&k.message==E.message;case v:case g:return k==E+"";case f:var P=a;case p:var D=S&o;if(P||(P=i),k.size!=E.size&&!D)return!1;var R=B.get(k);if(R)return R==E;S|=l,B.set(k,E);var O=n(P(k),P(E),S,T,N,B);return B.delete(k),O;case y:if(C)return C.call(k)==C.call(E)}return!1}return uh=x,uh}var ch,hx;function v8(){if(hx)return ch;hx=1;var t=fE(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l,c,u,d){var f=l&e,h=t(i),v=h.length,p=t(o),g=p.length;if(v!=g&&!f)return!1;for(var y=v;y--;){var m=h[y];if(!(f?m in o:n.call(o,m)))return!1}var b=d.get(i),w=d.get(o);if(b&&w)return b==o&&w==i;var C=!0;d.set(i,o),d.set(o,i);for(var x=f;++y<v;){m=h[y];var k=i[m],E=o[m];if(c)var _=f?c(E,k,m,o,i,d):c(k,E,m,i,o,d);if(!(_===void 0?k===E||u(k,E,l,c,d):_)){C=!1;break}x||(x=m=="constructor")}if(C&&!x){var S=i.constructor,T=o.constructor;S!=T&&"constructor"in i&&"constructor"in o&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(C=!1)}return d.delete(i),d.delete(o),C}return ch=a,ch}var dh,px;function g8(){if(px)return dh;px=1;var t=dl(),e=ux(),r=p8(),n=v8(),a=hi(),i=ot(),o=fi(),l=To(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,y,m,b,w,C){var x=i(g),k=i(y),E=x?d:a(g),_=k?d:a(y);E=E==u?f:E,_=_==u?f:_;var S=E==f,T=_==f,N=E==_;if(N&&o(g)){if(!o(y))return!1;x=!0,S=!1}if(N&&!S)return C||(C=new t),x||l(g)?e(g,y,m,b,w,C):r(g,y,E,m,b,w,C);if(!(m&c)){var B=S&&v.call(g,"__wrapped__"),P=T&&v.call(y,"__wrapped__");if(B||P){var D=B?g.value():g,R=P?y.value():y;return C||(C=new t),w(D,R,m,b,C)}}return N?(C||(C=new t),n(g,y,m,b,w,C)):!1}return dh=p,dh}var fh,vx;function gx(){if(vx)return fh;vx=1;var t=g8(),e=Rr();function r(n,a,i,o,l){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,o,r,l)}return fh=r,fh}var hh,mx;function m8(){if(mx)return hh;mx=1;var t=dl(),e=gx(),r=1,n=2;function a(i,o,l,c){var u=l.length,d=u,f=!c;if(i==null)return!d;for(i=Object(i);u--;){var h=l[u];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<d;){h=l[u];var v=h[0],p=i[v],g=h[1];if(f&&h[2]){if(p===void 0&&!(v in i))return!1}else{var y=new t;if(c)var m=c(p,g,v,i,o,y);if(!(m===void 0?e(g,p,r|n,c,y):m))return!1}}return!0}return hh=a,hh}var ph,yx;function bx(){if(yx)return ph;yx=1;var t=or();function e(r){return r===r&&!t(r)}return ph=e,ph}var vh,wx;function y8(){if(wx)return vh;wx=1;var t=bx(),e=Dn();function r(n){for(var a=e(n),i=a.length;i--;){var o=a[i],l=n[o];a[i]=[o,l,t(l)]}return a}return vh=r,vh}var gh,Cx;function Ex(){if(Cx)return gh;Cx=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return gh=t,gh}var mh,xx;function b8(){if(xx)return mh;xx=1;var t=m8(),e=y8(),r=Ex();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===a||t(o,a,i)}}return mh=n,mh}var yh,kx;function pi(){if(kx)return yh;kx=1;var t=da(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return yh=n,yh}var bh,Sx;function wh(){if(Sx)return bh;Sx=1;var t=ot(),e=pi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(t(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return bh=a,bh}var Ch,_x;function w8(){if(_x)return Ch;_x=1;var t=Ed(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,l=a?a.apply(this,o):o[0],c=i.cache;if(c.has(l))return c.get(l);var u=n.apply(this,o);return i.cache=c.set(l,u)||c,u};return i.cache=new(r.Cache||t),i}return r.Cache=t,Ch=r,Ch}var Eh,Tx;function C8(){if(Tx)return Eh;Tx=1;var t=w8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return Eh=r,Eh}var xh,Nx;function E8(){if(Nx)return xh;Nx=1;var t=C8(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,l,c,u){i.push(c?u.replace(r,"$1"):l||o)}),i});return xh=n,xh}var kh,Ix;function bl(){if(Ix)return kh;Ix=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return kh=t,kh}var Sh,Bx;function x8(){if(Bx)return Sh;Bx=1;var t=di(),e=bl(),r=ot(),n=pi(),a=1/0,i=t?t.prototype:void 0,o=i?i.toString:void 0;function l(c){if(typeof c=="string")return c;if(r(c))return e(c,l)+"";if(n(c))return o?o.call(c):"";var u=c+"";return u=="0"&&1/c==-a?"-0":u}return Sh=l,Sh}var _h,Dx;function Px(){if(Dx)return _h;Dx=1;var t=x8();function e(r){return r==null?"":t(r)}return _h=e,_h}var Th,Ox;function wl(){if(Ox)return Th;Ox=1;var t=ot(),e=wh(),r=E8(),n=Px();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Th=a,Th}var Nh,Ax;function Io(){if(Ax)return Nh;Ax=1;var t=pi(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var a=n+"";return a=="0"&&1/n==-e?"-0":a}return Nh=r,Nh}var Ih,Rx;function Cl(){if(Rx)return Ih;Rx=1;var t=wl(),e=Io();function r(n,a){a=t(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Ih=r,Ih}var Bh,Lx;function k8(){if(Lx)return Bh;Lx=1;var t=Cl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Bh=e,Bh}var Dh,Fx;function S8(){if(Fx)return Dh;Fx=1;function t(e,r){return e!=null&&r in Object(e)}return Dh=t,Dh}var Ph,Mx;function $x(){if(Mx)return Ph;Mx=1;var t=wl(),e=ko(),r=ot(),n=pl(),a=$d(),i=Io();function o(l,c,u){c=t(c,l);for(var d=-1,f=c.length,h=!1;++d<f;){var v=i(c[d]);if(!(h=l!=null&&u(l,v)))break;l=l[v]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&a(f)&&n(v,f)&&(r(l)||e(l)))}return Ph=o,Ph}var Oh,Vx;function qx(){if(Vx)return Oh;Vx=1;var t=S8(),e=$x();function r(n,a){return n!=null&&e(n,a,t)}return Oh=r,Oh}var Ah,zx;function _8(){if(zx)return Ah;zx=1;var t=gx(),e=k8(),r=qx(),n=wh(),a=bx(),i=Ex(),o=Io(),l=1,c=2;function u(d,f){return n(d)&&a(f)?i(o(d),f):function(h){var v=e(h,d);return v===void 0&&v===f?r(h,d):t(f,v,l|c)}}return Ah=u,Ah}var Rh,Hx;function Kx(){if(Hx)return Rh;Hx=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Rh=t,Rh}var Lh,Gx;function T8(){if(Gx)return Lh;Gx=1;var t=Cl();function e(r){return function(n){return t(n,r)}}return Lh=e,Lh}var Fh,Ux;function N8(){if(Ux)return Fh;Ux=1;var t=Kx(),e=T8(),r=wh(),n=Io();function a(i){return r(i)?t(n(i)):e(i)}return Fh=a,Fh}var Mh,jx;function rn(){if(jx)return Mh;jx=1;var t=b8(),e=_8(),r=pa(),n=ot(),a=N8();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):a(o)}return Mh=i,Mh}var $h,Wx;function Yx(){if(Wx)return $h;Wx=1;var t=QC(),e=u8(),r=rn(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return $h=a,$h}var Vh,Zx;function I8(){if(Zx)return Vh;Zx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return Vh=r,Vh}var qh,Xx;function Jx(){if(Xx)return qh;Xx=1;var t=I8(),e=$x();function r(n,a){return n!=null&&e(n,a,t)}return qh=r,qh}var zh,Qx;function B8(){if(Qx)return zh;Qx=1;var t=Yd(),e=hi(),r=ko(),n=ot(),a=tn(),i=fi(),o=gl(),l=To(),c="[object Map]",u="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(v){if(v==null)return!0;if(a(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||l(v)||r(v)))return!v.length;var p=e(v);if(p==c||p==u)return!v.size;if(o(v))return!t(v).length;for(var g in v)if(f.call(v,g))return!1;return!0}return zh=h,zh}var Hh,ek;function tk(){if(ek)return Hh;ek=1;function t(e){return e===void 0}return Hh=t,Hh}var Kh,rk;function nk(){if(rk)return Kh;rk=1;var t=yl(),e=tn();function r(n,a){var i=-1,o=e(n)?Array(n.length):[];return t(n,function(l,c,u){o[++i]=a(l,c,u)}),o}return Kh=r,Kh}var Gh,ak;function ik(){if(ak)return Gh;ak=1;var t=bl(),e=rn(),r=nk(),n=ot();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Gh=a,Gh}var Uh,ok;function D8(){if(ok)return Uh;ok=1;function t(e,r,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=r(n,e[i],i,e);return n}return Uh=t,Uh}var jh,sk;function P8(){if(sk)return jh;sk=1;function t(e,r,n,a,i){return i(e,function(o,l,c){n=a?(a=!1,o):r(n,o,l,c)}),n}return jh=t,jh}var Wh,lk;function uk(){if(lk)return Wh;lk=1;var t=D8(),e=yl(),r=rn(),n=P8(),a=ot();function i(o,l,c){var u=a(o)?t:n,d=arguments.length<3;return u(o,r(l,4),c,d,e)}return Wh=i,Wh}var Yh,ck;function O8(){if(ck)return Yh;ck=1;var t=da(),e=ot(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return Yh=a,Yh}var Zh,dk;function A8(){if(dk)return Zh;dk=1;var t=Kx(),e=t("length");return Zh=e,Zh}var Xh,fk;function R8(){if(fk)return Xh;fk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+a+i+"]");function c(u){return l.test(u)}return Xh=c,Xh}var Jh,hk;function L8(){if(hk)return Jh;hk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="["+t+"]",l="["+a+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",p=u+"?",g="["+i+"]?",y="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",m=g+p+y,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+b+m,"g");function C(x){for(var k=w.lastIndex=0;w.test(x);)++k;return k}return Jh=C,Jh}var Qh,pk;function F8(){if(pk)return Qh;pk=1;var t=A8(),e=R8(),r=L8();function n(a){return e(a)?r(a):t(a)}return Qh=n,Qh}var ep,vk;function M8(){if(vk)return ep;vk=1;var t=Yd(),e=hi(),r=tn(),n=O8(),a=F8(),i="[object Map]",o="[object Set]";function l(c){if(c==null)return 0;if(r(c))return n(c)?a(c):c.length;var u=e(c);return u==i||u==o?c.size:t(c).length}return ep=l,ep}var tp,gk;function $8(){if(gk)return tp;gk=1;var t=_d(),e=DE(),r=Uf(),n=rn(),a=ml(),i=ot(),o=fi(),l=Eo(),c=or(),u=To();function d(f,h,v){var p=i(f),g=p||o(f)||u(f);if(h=n(h,4),v==null){var y=f&&f.constructor;g?v=p?new y:[]:c(f)?v=l(y)?e(a(f)):{}:v={}}return(g?t:r)(f,function(m,b,w){return h(v,m,b,w)}),v}return tp=d,tp}var rp,mk;function V8(){if(mk)return rp;mk=1;var t=di(),e=ko(),r=ot(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return rp=a,rp}var np,yk;function ap(){if(yk)return np;yk=1;var t=df(),e=V8();function r(n,a,i,o,l){var c=-1,u=n.length;for(i||(i=e),l||(l=[]);++c<u;){var d=n[c];a>0&&i(d)?a>1?r(d,a-1,i,o,l):t(l,d):o||(l[l.length]=d)}return l}return np=r,np}var ip,bk;function q8(){if(bk)return ip;bk=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return ip=t,ip}var op,wk;function Ck(){if(wk)return op;wk=1;var t=q8(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,l=-1,c=e(o.length-a,0),u=Array(c);++l<c;)u[l]=o[a+l];l=-1;for(var d=Array(a+1);++l<a;)d[l]=o[l];return d[a]=i(u),t(n,this,d)}}return op=r,op}var sp,Ek;function z8(){if(Ek)return sp;Ek=1;var t=qf(),e=mC(),r=pa(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return sp=n,sp}var lp,xk;function H8(){if(xk)return lp;xk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,o=0;return function(){var l=r(),c=e-(l-o);if(o=l,c>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return lp=n,lp}var up,kk;function Sk(){if(kk)return up;kk=1;var t=z8(),e=H8(),r=e(t);return up=r,up}var cp,_k;function El(){if(_k)return cp;_k=1;var t=pa(),e=Ck(),r=Sk();function n(a,i){return r(e(a,i,t),a+"")}return cp=n,cp}var dp,Tk;function Nk(){if(Tk)return dp;Tk=1;function t(e,r,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return dp=t,dp}var fp,Ik;function K8(){if(Ik)return fp;Ik=1;function t(e){return e!==e}return fp=t,fp}var hp,Bk;function G8(){if(Bk)return hp;Bk=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return hp=t,hp}var pp,Dk;function U8(){if(Dk)return pp;Dk=1;var t=Nk(),e=K8(),r=G8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return pp=n,pp}var vp,Pk;function j8(){if(Pk)return vp;Pk=1;var t=U8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return vp=e,vp}var gp,Ok;function W8(){if(Ok)return gp;Ok=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return gp=t,gp}var mp,Ak;function Y8(){if(Ak)return mp;Ak=1;function t(){}return mp=t,mp}var yp,Rk;function Z8(){if(Rk)return yp;Rk=1;var t=mE(),e=Y8(),r=lh(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return yp=a,yp}var bp,Lk;function X8(){if(Lk)return bp;Lk=1;var t=ax(),e=j8(),r=W8(),n=sx(),a=Z8(),i=lh(),o=200;function l(c,u,d){var f=-1,h=e,v=c.length,p=!0,g=[],y=g;if(d)p=!1,h=r;else if(v>=o){var m=u?null:a(c);if(m)return i(m);p=!1,h=n,y=new t}else y=u?[]:g;e:for(;++f<v;){var b=c[f],w=u?u(b):b;if(b=d||b!==0?b:0,p&&w===w){for(var C=y.length;C--;)if(y[C]===w)continue e;u&&y.push(w),g.push(b)}else h(y,w,d)||(y!==g&&y.push(w),g.push(b))}return g}return bp=l,bp}var wp,Fk;function Mk(){if(Fk)return wp;Fk=1;var t=tn(),e=Rr();function r(n){return e(n)&&t(n)}return wp=r,wp}var Cp,$k;function J8(){if($k)return Cp;$k=1;var t=ap(),e=El(),r=X8(),n=Mk(),a=e(function(i){return r(t(i,1,n,!0))});return Cp=a,Cp}var Ep,Vk;function Q8(){if(Vk)return Ep;Vk=1;var t=bl();function e(r,n){return t(n,function(a){return r[a]})}return Ep=e,Ep}var xp,qk;function zk(){if(qk)return xp;qk=1;var t=Q8(),e=Dn();function r(n){return n==null?[]:t(n,e(n))}return xp=r,xp}var kp,Hk;function sr(){if(Hk)return kp;Hk=1;var t;if(typeof Pc=="function")try{t={clone:o8(),constant:qf(),each:QE(),filter:Yx(),has:Jx(),isArray:ot(),isEmpty:B8(),isFunction:Eo(),isUndefined:tk(),keys:Dn(),map:ik(),reduce:uk(),size:M8(),transform:$8(),union:J8(),values:zk()}}catch{}return t||(t=window._),kp=t,kp}var Sp,Kk;function _p(){if(Kk)return Sp;Kk=1;var t=sr();Sp=a;var e="\0",r="\0",n="";function a(d){this._isDirected=t.has(d,"directed")?d.directed:!0,this._isMultigraph=t.has(d,"multigraph")?d.multigraph:!1,this._isCompound=t.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,v=this;return t.each(d,function(p){h.length>1?v.setNode(p,f):v.setNode(p)}),this},a.prototype.setNode=function(d,f){return t.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return t.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(t.has(this._nodes,d)){var h=function(v){f.removeEdge(f._edgeObjs[v])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],t.each(this.children(d),function(v){f.setParent(v)}),delete this._children[d]),t.each(t.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],t.each(t.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(f))f=r;else{f+="";for(var h=f;!t.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(t.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return t.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return t.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return t.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return t.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;t.each(this._nodes,function(g,y){d(y)&&f.setNode(y,g)}),t.each(this._edgeObjs,function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdge(g,h.edge(g))});var v={};function p(g){var y=h.parent(g);return y===void 0||f.hasNode(y)?(v[g]=y,y):y in v?v[y]:p(y)}return this._isCompound&&t.each(f.nodes(),function(g){f.setParent(g,p(g))}),f},a.prototype.setDefaultEdgeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,v=arguments;return t.reduce(d,function(p,g){return v.length>1?h.setEdge(p,g,f):h.setEdge(p,g),g}),this},a.prototype.setEdge=function(){var d,f,h,v,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(d=g.v,f=g.w,h=g.name,arguments.length===2&&(v=arguments[1],p=!0)):(d=g,f=arguments[1],h=arguments[3],arguments.length>2&&(v=arguments[2],p=!0)),d=""+d,f=""+f,t.isUndefined(h)||(h=""+h);var y=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=v),this;if(!t.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[y]=p?v:this._defaultEdgeLabelFn(d,f,h);var m=c(this._isDirected,d,f,h);return d=m.v,f=m.w,Object.freeze(m),this._edgeObjs[y]=m,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][y]=m,this._out[d][y]=m,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return this._edgeLabels[v]},a.prototype.hasEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return t.has(this._edgeLabels,v)},a.prototype.removeEdge=function(d,f,h){var v=arguments.length===1?u(this._isDirected,arguments[0]):l(this._isDirected,d,f,h),p=this._edgeObjs[v];return p&&(d=p.v,f=p.w,delete this._edgeLabels[v],delete this._edgeObjs[v],o(this._preds[f],d),o(this._sucs[d],f),delete this._in[f][v],delete this._out[d][v],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.v===f}):v}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.w===f}):v}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function o(d,f){--d[f]||delete d[f]}function l(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}return p+n+g+n+(t.isUndefined(v)?e:v)}function c(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}var m={v:p,w:g};return v&&(m.name=v),m}function u(d,f){return l(d,f.v,f.w,f.name)}return Sp}var Tp,Gk;function e6(){return Gk||(Gk=1,Tp="2.1.8"),Tp}var Np,Uk;function t6(){return Uk||(Uk=1,Np={Graph:_p(),version:e6()}),Np}var Ip,jk;function r6(){if(jk)return Ip;jk=1;var t=sr(),e=_p();Ip={write:r,read:i};function r(o){var l={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return t.isUndefined(o.graph())||(l.value=t.clone(o.graph())),l}function n(o){return t.map(o.nodes(),function(l){var c=o.node(l),u=o.parent(l),d={v:l};return t.isUndefined(c)||(d.value=c),t.isUndefined(u)||(d.parent=u),d})}function a(o){return t.map(o.edges(),function(l){var c=o.edge(l),u={v:l.v,w:l.w};return t.isUndefined(l.name)||(u.name=l.name),t.isUndefined(c)||(u.value=c),u})}function i(o){var l=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(c){l.setNode(c.v,c.value),c.parent&&l.setParent(c.v,c.parent)}),t.each(o.edges,function(c){l.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),l}return Ip}var Bp,Wk;function n6(){if(Wk)return Bp;Wk=1;var t=sr();Bp=e;function e(r){var n={},a=[],i;function o(l){t.has(n,l)||(n[l]=!0,i.push(l),t.each(r.successors(l),o),t.each(r.predecessors(l),o))}return t.each(r.nodes(),function(l){i=[],o(l),i.length&&a.push(i)}),a}return Bp}var Dp,Yk;function Zk(){if(Yk)return Dp;Yk=1;var t=sr();Dp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,o=i.length;return a[r]=o,i.push({key:r,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,o=r;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==r&&(this._swap(r,o),this._heapify(o)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,o=a[r],l=a[n];a[r]=l,a[n]=o,i[l.key]=r,i[o.key]=n},Dp}var Pp,Xk;function Jk(){if(Xk)return Pp;Xk=1;var t=sr(),e=Zk();Pp=n;var r=t.constant(1);function n(i,o,l,c){return a(i,String(o),l||r,c||function(u){return i.outEdges(u)})}function a(i,o,l,c){var u={},d=new e,f,h,v=function(p){var g=p.v!==f?p.v:p.w,y=u[g],m=l(p),b=h.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+m);b<y.distance&&(y.distance=b,y.predecessor=f,d.decrease(g,b))};for(i.nodes().forEach(function(p){var g=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:g},d.add(p,g)});d.size()>0&&(f=d.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)c(f).forEach(v);return u}return Pp}var Op,Qk;function a6(){if(Qk)return Op;Qk=1;var t=Jk(),e=sr();Op=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Op}var Ap,eS;function tS(){if(eS)return Ap;eS=1;var t=sr();Ap=e;function e(r){var n=0,a=[],i={},o=[];function l(c){var u=i[c]={onStack:!0,lowlink:n,index:n++};if(a.push(c),r.successors(c).forEach(function(h){t.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(l(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(c!==f);o.push(d)}}return r.nodes().forEach(function(c){t.has(i,c)||l(c)}),o}return Ap}var Rp,rS;function i6(){if(rS)return Rp;rS=1;var t=sr(),e=tS();Rp=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Rp}var Lp,nS;function o6(){if(nS)return Lp;nS=1;var t=sr();Lp=r;var e=t.constant(1);function r(a,i,o){return n(a,i||e,o||function(l){return a.outEdges(l)})}function n(a,i,o){var l={},c=a.nodes();return c.forEach(function(u){l[u]={},l[u][u]={distance:0},c.forEach(function(d){u!==d&&(l[u][d]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(d){var f=d.v===u?d.w:d.v,h=i(d);l[u][f]={distance:h,predecessor:u}})}),c.forEach(function(u){var d=l[u];c.forEach(function(f){var h=l[f];c.forEach(function(v){var p=h[u],g=d[v],y=h[v],m=p.distance+g.distance;m<y.distance&&(y.distance=m,y.predecessor=g.predecessor)})})}),l}return Lp}var Fp,aS;function iS(){if(aS)return Fp;aS=1;var t=sr();Fp=e,e.CycleException=r;function e(n){var a={},i={},o=[];function l(c){if(t.has(i,c))throw new r;t.has(a,c)||(i[c]=!0,a[c]=!0,t.each(n.predecessors(c),l),delete i[c],o.push(c))}if(t.each(n.sinks(),l),t.size(a)!==n.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,Fp}var Mp,oS;function s6(){if(oS)return Mp;oS=1;var t=iS();Mp=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return Mp}var $p,sS;function lS(){if(sS)return $p;sS=1;var t=sr();$p=e;function e(n,a,i){t.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),l=[],c={};return t.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);r(n,u,i==="post",c,o,l)}),l}function r(n,a,i,o,l,c){t.has(o,a)||(o[a]=!0,i||c.push(a),t.each(l(a),function(u){r(n,u,i,o,l,c)}),i&&c.push(a))}return $p}var Vp,uS;function l6(){if(uS)return Vp;uS=1;var t=lS();Vp=e;function e(r,n){return t(r,n,"post")}return Vp}var qp,cS;function u6(){if(cS)return qp;cS=1;var t=lS();qp=e;function e(r,n){return t(r,n,"pre")}return qp}var zp,dS;function c6(){if(dS)return zp;dS=1;var t=sr(),e=_p(),r=Zk();zp=n;function n(a,i){var o=new e,l={},c=new r,u;function d(h){var v=h.v===u?h.w:h.v,p=c.priority(v);if(p!==void 0){var g=i(h);g<p&&(l[v]=u,c.decrease(v,g))}}if(a.nodeCount()===0)return o;t.each(a.nodes(),function(h){c.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),c.decrease(a.nodes()[0],0);for(var f=!1;c.size()>0;){if(u=c.removeMin(),t.has(l,u))o.setEdge(u,l[u]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(u).forEach(d)}return o}return zp}var Hp,fS;function d6(){return fS||(fS=1,Hp={components:n6(),dijkstra:Jk(),dijkstraAll:a6(),findCycles:i6(),floydWarshall:o6(),isAcyclic:s6(),postorder:l6(),preorder:u6(),prim:c6(),tarjan:tS(),topsort:iS()}),Hp}var Kp,hS;function f6(){if(hS)return Kp;hS=1;var t=t6();return Kp={Graph:t.Graph,json:r6(),alg:d6(),version:t.version},Kp}var Gp,pS;function wr(){if(pS)return Gp;pS=1;var t;if(typeof Pc=="function")try{t=f6()}catch{}return t||(t=window.graphlib),Gp=t,Gp}var Up,vS;function h6(){if(vS)return Up;vS=1;var t=$E(),e=1,r=4;function n(a){return t(a,e|r)}return Up=n,Up}var jp,gS;function xl(){if(gS)return jp;gS=1;var t=ci(),e=tn(),r=pl(),n=or();function a(i,o,l){if(!n(l))return!1;var c=typeof o;return(c=="number"?e(l)&&r(o,l.length):c=="string"&&o in l)?t(l[o],i):!1}return jp=a,jp}var Wp,mS;function p6(){if(mS)return Wp;mS=1;var t=El(),e=ci(),r=xl(),n=ha(),a=Object.prototype,i=a.hasOwnProperty,o=t(function(l,c){l=Object(l);var u=-1,d=c.length,f=d>2?c[2]:void 0;for(f&&r(c[0],c[1],f)&&(d=1);++u<d;)for(var h=c[u],v=n(h),p=-1,g=v.length;++p<g;){var y=v[p],m=l[y];(m===void 0||e(m,a[y])&&!i.call(l,y))&&(l[y]=h[y])}return l});return Wp=o,Wp}var Yp,yS;function v6(){if(yS)return Yp;yS=1;var t=rn(),e=tn(),r=Dn();function n(a){return function(i,o,l){var c=Object(i);if(!e(i)){var u=t(o,3);i=r(i),o=function(f){return u(c[f],f,c)}}var d=a(i,o,l);return d>-1?c[u?i[d]:d]:void 0}}return Yp=n,Yp}var Zp,bS;function g6(){if(bS)return Zp;bS=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Zp=e,Zp}var Xp,wS;function m6(){if(wS)return Xp;wS=1;var t=g6(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Xp=r,Xp}var Jp,CS;function y6(){if(CS)return Jp;CS=1;var t=m6(),e=or(),r=pi(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=e(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=t(u);var f=i.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):a.test(u)?n:+u}return Jp=c,Jp}var Qp,ES;function xS(){if(ES)return Qp;ES=1;var t=y6(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return Qp=n,Qp}var ev,kS;function b6(){if(kS)return ev;kS=1;var t=xS();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return ev=e,ev}var tv,SS;function w6(){if(SS)return tv;SS=1;var t=Nk(),e=rn(),r=b6(),n=Math.max;function a(i,o,l){var c=i==null?0:i.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),t(i,e(o,3),u)}return tv=a,tv}var rv,_S;function C6(){if(_S)return rv;_S=1;var t=v6(),e=w6(),r=t(e);return rv=r,rv}var nv,TS;function NS(){if(TS)return nv;TS=1;var t=ap();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return nv=e,nv}var av,IS;function E6(){if(IS)return av;IS=1;var t=Kf(),e=YE(),r=ha();function n(a,i){return a==null?a:t(a,e(i),r)}return av=n,av}var iv,BS;function x6(){if(BS)return iv;BS=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return iv=t,iv}var ov,DS;function k6(){if(DS)return ov;DS=1;var t=fl(),e=Uf(),r=rn();function n(a,i){var o={};return i=r(i,3),e(a,function(l,c,u){t(o,c,i(l,c,u))}),o}return ov=n,ov}var sv,PS;function lv(){if(PS)return sv;PS=1;var t=pi();function e(r,n,a){for(var i=-1,o=r.length;++i<o;){var l=r[i],c=n(l);if(c!=null&&(u===void 0?c===c&&!t(c):a(c,u)))var u=c,d=l}return d}return sv=e,sv}var uv,OS;function S6(){if(OS)return uv;OS=1;function t(e,r){return e>r}return uv=t,uv}var cv,AS;function _6(){if(AS)return cv;AS=1;var t=lv(),e=S6(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return cv=n,cv}var dv,RS;function LS(){if(RS)return dv;RS=1;var t=fl(),e=ci();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return dv=r,dv}var fv,FS;function T6(){if(FS)return fv;FS=1;var t=da(),e=ml(),r=Rr(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,l=i.hasOwnProperty,c=o.call(Object);function u(d){if(!r(d)||t(d)!=n)return!1;var f=e(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==c}return fv=u,fv}var hv,MS;function $S(){if(MS)return hv;MS=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return hv=t,hv}var pv,VS;function N6(){if(VS)return pv;VS=1;var t=xo(),e=ha();function r(n){return t(n,e(n))}return pv=r,pv}var vv,qS;function I6(){if(qS)return vv;qS=1;var t=LS(),e=YC(),r=NE(),n=XC(),a=OE(),i=ko(),o=ot(),l=Mk(),c=fi(),u=Eo(),d=or(),f=T6(),h=To(),v=$S(),p=N6();function g(y,m,b,w,C,x,k){var E=v(y,b),_=v(m,b),S=k.get(_);if(S){t(y,b,S);return}var T=x?x(E,_,b+"",y,m,k):void 0,N=T===void 0;if(N){var B=o(_),P=!B&&c(_),D=!B&&!P&&h(_);T=_,B||P||D?o(E)?T=E:l(E)?T=n(E):P?(N=!1,T=e(_,!0)):D?(N=!1,T=r(_,!0)):T=[]:f(_)||i(_)?(T=E,i(E)?T=p(E):(!d(E)||u(E))&&(T=a(_))):N=!1}N&&(k.set(_,T),C(T,_,w,x,k),k.delete(_)),t(y,b,T)}return vv=g,vv}var gv,zS;function B6(){if(zS)return gv;zS=1;var t=dl(),e=LS(),r=Kf(),n=I6(),a=or(),i=ha(),o=$S();function l(c,u,d,f,h){c!==u&&r(u,function(v,p){if(h||(h=new t),a(v))n(c,u,p,d,l,f,h);else{var g=f?f(o(c,p),v,p+"",c,u,h):void 0;g===void 0&&(g=v),e(c,p,g)}},i)}return gv=l,gv}var mv,HS;function D6(){if(HS)return mv;HS=1;var t=El(),e=xl();function r(n){return t(function(a,i){var o=-1,l=i.length,c=l>1?i[l-1]:void 0,u=l>2?i[2]:void 0;for(c=n.length>3&&typeof c=="function"?(l--,c):void 0,u&&e(i[0],i[1],u)&&(c=l<3?void 0:c,l=1),a=Object(a);++o<l;){var d=i[o];d&&n(a,d,o,c)}return a})}return mv=r,mv}var yv,KS;function P6(){if(KS)return yv;KS=1;var t=B6(),e=D6(),r=e(function(n,a,i){t(n,a,i)});return yv=r,yv}var bv,GS;function US(){if(GS)return bv;GS=1;function t(e,r){return e<r}return bv=t,bv}var wv,jS;function O6(){if(jS)return wv;jS=1;var t=lv(),e=US(),r=pa();function n(a){return a&&a.length?t(a,r,e):void 0}return wv=n,wv}var Cv,WS;function A6(){if(WS)return Cv;WS=1;var t=lv(),e=rn(),r=US();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return Cv=n,Cv}var Ev,YS;function R6(){if(YS)return Ev;YS=1;var t=br(),e=function(){return t.Date.now()};return Ev=e,Ev}var xv,ZS;function L6(){if(ZS)return xv;ZS=1;var t=hl(),e=wl(),r=pl(),n=or(),a=Io();function i(o,l,c,u){if(!n(o))return o;l=e(l,o);for(var d=-1,f=l.length,h=f-1,v=o;v!=null&&++d<f;){var p=a(l[d]),g=c;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(d!=h){var y=v[p];g=u?u(y,p,v):void 0,g===void 0&&(g=n(y)?y:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return xv=i,xv}var kv,XS;function F6(){if(XS)return kv;XS=1;var t=Cl(),e=L6(),r=wl();function n(a,i,o){for(var l=-1,c=i.length,u={};++l<c;){var d=i[l],f=t(a,d);o(f,d)&&e(u,r(d,a),f)}return u}return kv=n,kv}var Sv,JS;function M6(){if(JS)return Sv;JS=1;var t=F6(),e=qx();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return Sv=r,Sv}var _v,QS;function $6(){if(QS)return _v;QS=1;var t=NS(),e=Ck(),r=Sk();function n(a){return r(e(a,void 0,t),a+"")}return _v=n,_v}var Tv,e2;function V6(){if(e2)return Tv;e2=1;var t=M6(),e=$6(),r=e(function(n,a){return n==null?{}:t(n,a)});return Tv=r,Tv}var Nv,t2;function q6(){if(t2)return Nv;t2=1;var t=Math.ceil,e=Math.max;function r(n,a,i,o){for(var l=-1,c=e(t((a-n)/(i||1)),0),u=Array(c);c--;)u[o?c:++l]=n,n+=i;return u}return Nv=r,Nv}var Iv,r2;function z6(){if(r2)return Iv;r2=1;var t=q6(),e=xl(),r=xS();function n(a){return function(i,o,l){return l&&typeof l!="number"&&e(i,o,l)&&(o=l=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),l=l===void 0?i<o?1:-1:r(l),t(i,o,l,a)}}return Iv=n,Iv}var Bv,n2;function H6(){if(n2)return Bv;n2=1;var t=z6(),e=t();return Bv=e,Bv}var Dv,a2;function K6(){if(a2)return Dv;a2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Dv=t,Dv}var Pv,i2;function G6(){if(i2)return Pv;i2=1;var t=pi();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,o=r===r,l=t(r),c=n!==void 0,u=n===null,d=n===n,f=t(n);if(!u&&!f&&!l&&r>n||l&&c&&d&&!u&&!f||i&&c&&d||!a&&d||!o)return 1;if(!i&&!l&&!f&&r<n||f&&a&&o&&!i&&!l||u&&a&&o||!c&&o||!d)return-1}return 0}return Pv=e,Pv}var Ov,o2;function U6(){if(o2)return Ov;o2=1;var t=G6();function e(r,n,a){for(var i=-1,o=r.criteria,l=n.criteria,c=o.length,u=a.length;++i<c;){var d=t(o[i],l[i]);if(d){if(i>=u)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return Ov=e,Ov}var Av,s2;function j6(){if(s2)return Av;s2=1;var t=bl(),e=Cl(),r=rn(),n=nk(),a=K6(),i=vl(),o=U6(),l=pa(),c=ot();function u(d,f,h){f.length?f=t(f,function(g){return c(g)?function(y){return e(y,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,y,m){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,y){return o(g,y,h)})}return Av=u,Av}var Rv,l2;function W6(){if(l2)return Rv;l2=1;var t=ap(),e=j6(),r=El(),n=xl(),a=r(function(i,o){if(i==null)return[];var l=o.length;return l>1&&n(i,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return Rv=a,Rv}var Lv,u2;function Y6(){if(u2)return Lv;u2=1;var t=Px(),e=0;function r(n){var a=++e;return t(n)+a}return Lv=r,Lv}var Fv,c2;function Z6(){if(c2)return Fv;c2=1;function t(e,r,n){for(var a=-1,i=e.length,o=r.length,l={};++a<i;){var c=a<o?r[a]:void 0;n(l,e[a],c)}return l}return Fv=t,Fv}var Mv,d2;function X6(){if(d2)return Mv;d2=1;var t=hl(),e=Z6();function r(n,a){return e(n||[],a||[],t)}return Mv=r,Mv}var $v,f2;function Ze(){if(f2)return $v;f2=1;var t;if(typeof Pc=="function")try{t={cloneDeep:h6(),constant:qf(),defaults:p6(),each:QE(),filter:Yx(),find:C6(),flatten:NS(),forEach:XE(),forIn:E6(),has:Jx(),isUndefined:tk(),last:x6(),map:ik(),mapValues:k6(),max:_6(),merge:P6(),min:O6(),minBy:A6(),now:R6(),pick:V6(),range:H6(),reduce:uk(),sortBy:W6(),uniqueId:Y6(),values:zk(),zipObject:X6()}}catch{}return t||(t=window._),$v=t,$v}var Vv,h2;function J6(){if(h2)return Vv;h2=1,Vv=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return Vv}var qv,p2;function Q6(){if(p2)return qv;p2=1;var t=Ze(),e=wr().Graph,r=J6();qv=a;var n=t.constant(1);function a(u,d){if(u.nodeCount()<=1)return[];var f=l(u,d||n),h=i(f.graph,f.buckets,f.zeroIdx);return t.flatten(t.map(h,function(v){return u.outEdges(v.v,v.w)}),!0)}function i(u,d,f){for(var h=[],v=d[d.length-1],p=d[0],g;u.nodeCount();){for(;g=p.dequeue();)o(u,d,f,g);for(;g=v.dequeue();)o(u,d,f,g);if(u.nodeCount()){for(var y=d.length-2;y>0;--y)if(g=d[y].dequeue(),g){h=h.concat(o(u,d,f,g,!0));break}}}return h}function o(u,d,f,h,v){var p=v?[]:void 0;return t.forEach(u.inEdges(h.v),function(g){var y=u.edge(g),m=u.node(g.v);v&&p.push({v:g.v,w:g.w}),m.out-=y,c(d,f,m)}),t.forEach(u.outEdges(h.v),function(g){var y=u.edge(g),m=g.w,b=u.node(m);b.in-=y,c(d,f,b)}),u.removeNode(h.v),p}function l(u,d){var f=new e,h=0,v=0;t.forEach(u.nodes(),function(y){f.setNode(y,{v:y,in:0,out:0})}),t.forEach(u.edges(),function(y){var m=f.edge(y.v,y.w)||0,b=d(y),w=m+b;f.setEdge(y.v,y.w,w),v=Math.max(v,f.node(y.v).out+=b),h=Math.max(h,f.node(y.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(y){c(p,g,f.node(y))}),{graph:f,buckets:p,zeroIdx:g}}function c(u,d,f){f.out?f.in?u[f.out-f.in+d].enqueue(f):u[u.length-1].enqueue(f):u[0].enqueue(f)}return qv}var zv,v2;function e9(){if(v2)return zv;v2=1;var t=Ze(),e=Q6();zv={run:r,undo:a};function r(i){var o=i.graph().acyclicer==="greedy"?e(i,l(i)):n(i);t.forEach(o,function(c){var u=i.edge(c);i.removeEdge(c),u.forwardName=c.name,u.reversed=!0,i.setEdge(c.w,c.v,u,t.uniqueId("rev"))});function l(c){return function(u){return c.edge(u).weight}}}function n(i){var o=[],l={},c={};function u(d){t.has(c,d)||(c[d]=!0,l[d]=!0,t.forEach(i.outEdges(d),function(f){t.has(l,f.w)?o.push(f):u(f.w)}),delete l[d])}return t.forEach(i.nodes(),u),o}function a(i){t.forEach(i.edges(),function(o){var l=i.edge(o);if(l.reversed){i.removeEdge(o);var c=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(o.w,o.v,l,c)}})}return zv}var Hv,g2;function Ut(){if(g2)return Hv;g2=1;var t=Ze(),e=wr().Graph;Hv={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:l,buildLayerMatrix:c,normalizeRanks:u,removeEmptyRanks:d,addBorderNode:f,maxRank:h,partition:v,time:p,notime:g};function r(y,m,b,w){var C;do C=t.uniqueId(w);while(y.hasNode(C));return b.dummy=m,y.setNode(C,b),C}function n(y){var m=new e().setGraph(y.graph());return t.forEach(y.nodes(),function(b){m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){var w=m.edge(b.v,b.w)||{weight:0,minlen:1},C=y.edge(b);m.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),m}function a(y){var m=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return t.forEach(y.nodes(),function(b){y.children(b).length||m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){m.setEdge(b,y.edge(b))}),m}function i(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function o(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function l(y,m){var b=y.x,w=y.y,C=m.x-b,x=m.y-w,k=y.width/2,E=y.height/2;if(!C&&!x)throw new Error("Not possible to find intersection inside of the rectangle");var _,S;return Math.abs(x)*k>Math.abs(C)*E?(x<0&&(E=-E),_=E*C/x,S=E):(C<0&&(k=-k),_=k,S=k*x/C),{x:b+_,y:w+S}}function c(y){var m=t.map(t.range(h(y)+1),function(){return[]});return t.forEach(y.nodes(),function(b){var w=y.node(b),C=w.rank;t.isUndefined(C)||(m[C][w.order]=b)}),m}function u(y){var m=t.min(t.map(y.nodes(),function(b){return y.node(b).rank}));t.forEach(y.nodes(),function(b){var w=y.node(b);t.has(w,"rank")&&(w.rank-=m)})}function d(y){var m=t.min(t.map(y.nodes(),function(x){return y.node(x).rank})),b=[];t.forEach(y.nodes(),function(x){var k=y.node(x).rank-m;b[k]||(b[k]=[]),b[k].push(x)});var w=0,C=y.graph().nodeRankFactor;t.forEach(b,function(x,k){t.isUndefined(x)&&k%C!==0?--w:w&&t.forEach(x,function(E){y.node(E).rank+=w})})}function f(y,m,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(y,"border",C,m)}function h(y){return t.max(t.map(y.nodes(),function(m){var b=y.node(m).rank;if(!t.isUndefined(b))return b}))}function v(y,m){var b={lhs:[],rhs:[]};return t.forEach(y,function(w){m(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(y,m){var b=t.now();try{return m()}finally{console.log(y+" time: "+(t.now()-b)+"ms")}}function g(y,m){return m()}return Hv}var Kv,m2;function t9(){if(m2)return Kv;m2=1;var t=Ze(),e=Ut();Kv={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var l=o.v,c=i.node(l).rank,u=o.w,d=i.node(u).rank,f=o.name,h=i.edge(o),v=h.labelRank;if(d!==c+1){i.removeEdge(o);var p,g,y;for(y=0,++c;c<d;++y,++c)h.points=[],g={width:0,height:0,edgeLabel:h,edgeObj:o,rank:c},p=e.addDummyNode(i,"edge",g,"_d"),c===v&&(g.width=h.width,g.height=h.height,g.dummy="edge-label",g.labelpos=h.labelpos),i.setEdge(l,p,{weight:h.weight},f),y===0&&i.graph().dummyChains.push(p),l=p;i.setEdge(l,u,{weight:h.weight},f)}}function a(i){t.forEach(i.graph().dummyChains,function(o){var l=i.node(o),c=l.edgeLabel,u;for(i.setEdge(l.edgeObj,c);l.dummy;)u=i.successors(o)[0],i.removeNode(o),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),o=u,l=i.node(o)})}return Kv}var Gv,y2;function kl(){if(y2)return Gv;y2=1;var t=Ze();Gv={longestPath:e,slack:r};function e(n){var a={};function i(o){var l=n.node(o);if(t.has(a,o))return l.rank;a[o]=!0;var c=t.min(t.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),l.rank=c}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Gv}var Uv,b2;function w2(){if(b2)return Uv;b2=1;var t=Ze(),e=wr().Graph,r=kl().slack;Uv=n;function n(l){var c=new e({directed:!1}),u=l.nodes()[0],d=l.nodeCount();c.setNode(u,{});for(var f,h;a(c,l)<d;)f=i(c,l),h=c.hasNode(f.v)?r(l,f):-r(l,f),o(c,l,h);return c}function a(l,c){function u(d){t.forEach(c.nodeEdges(d),function(f){var h=f.v,v=d===h?f.w:h;!l.hasNode(v)&&!r(c,f)&&(l.setNode(v,{}),l.setEdge(d,v,{}),u(v))})}return t.forEach(l.nodes(),u),l.nodeCount()}function i(l,c){return t.minBy(c.edges(),function(u){if(l.hasNode(u.v)!==l.hasNode(u.w))return r(c,u)})}function o(l,c,u){t.forEach(l.nodes(),function(d){c.node(d).rank+=u})}return Uv}var jv,C2;function r9(){if(C2)return jv;C2=1;var t=Ze(),e=w2(),r=kl().slack,n=kl().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Ut().simplify;jv=l,l.initLowLimValues=f,l.initCutValues=c,l.calcCutValue=d,l.leaveEdge=v,l.enterEdge=p,l.exchangeEdges=g;function l(w){w=o(w),n(w);var C=e(w);f(C),c(C,w);for(var x,k;x=v(C);)k=p(C,w,x),g(C,w,x,k)}function c(w,C){var x=i(w,w.nodes());x=x.slice(0,x.length-1),t.forEach(x,function(k){u(w,C,k)})}function u(w,C,x){var k=w.node(x),E=k.parent;w.edge(x,E).cutvalue=d(w,C,x)}function d(w,C,x){var k=w.node(x),E=k.parent,_=!0,S=C.edge(x,E),T=0;return S||(_=!1,S=C.edge(E,x)),T=S.weight,t.forEach(C.nodeEdges(x),function(N){var B=N.v===x,P=B?N.w:N.v;if(P!==E){var D=B===_,R=C.edge(N).weight;if(T+=D?R:-R,m(w,x,P)){var O=w.edge(x,P).cutvalue;T+=D?-O:O}}}),T}function f(w,C){arguments.length<2&&(C=w.nodes()[0]),h(w,{},1,C)}function h(w,C,x,k,E){var _=x,S=w.node(k);return C[k]=!0,t.forEach(w.neighbors(k),function(T){t.has(C,T)||(x=h(w,C,x,T,k))}),S.low=_,S.lim=x++,E?S.parent=E:delete S.parent,x}function v(w){return t.find(w.edges(),function(C){return w.edge(C).cutvalue<0})}function p(w,C,x){var k=x.v,E=x.w;C.hasEdge(k,E)||(k=x.w,E=x.v);var _=w.node(k),S=w.node(E),T=_,N=!1;_.lim>S.lim&&(T=S,N=!0);var B=t.filter(C.edges(),function(P){return N===b(w,w.node(P.v),T)&&N!==b(w,w.node(P.w),T)});return t.minBy(B,function(P){return r(C,P)})}function g(w,C,x,k){var E=x.v,_=x.w;w.removeEdge(E,_),w.setEdge(k.v,k.w,{}),f(w),c(w,C),y(w,C)}function y(w,C){var x=t.find(w.nodes(),function(E){return!C.node(E).parent}),k=a(w,x);k=k.slice(1),t.forEach(k,function(E){var _=w.node(E).parent,S=C.edge(E,_),T=!1;S||(S=C.edge(_,E),T=!0),C.node(E).rank=C.node(_).rank+(T?S.minlen:-S.minlen)})}function m(w,C,x){return w.hasEdge(C,x)}function b(w,C,x){return x.low<=C.lim&&C.lim<=x.lim}return jv}var Wv,E2;function n9(){if(E2)return Wv;E2=1;var t=kl(),e=t.longestPath,r=w2(),n=r9();Wv=a;function a(c){switch(c.graph().ranker){case"network-simplex":l(c);break;case"tight-tree":o(c);break;case"longest-path":i(c);break;default:l(c)}}var i=e;function o(c){e(c),r(c)}function l(c){n(c)}return Wv}var Yv,x2;function a9(){if(x2)return Yv;x2=1;var t=Ze();Yv=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(o){for(var l=a.node(o),c=l.edgeObj,u=r(a,i,c.v,c.w),d=u.path,f=u.lca,h=0,v=d[h],p=!0;o!==c.w;){if(l=a.node(o),p){for(;(v=d[h])!==f&&a.node(v).maxRank<l.rank;)h++;v===f&&(p=!1)}if(!p){for(;h<d.length-1&&a.node(v=d[h+1]).minRank<=l.rank;)h++;v=d[h]}a.setParent(o,v),o=a.successors(o)[0]}})}function r(a,i,o,l){var c=[],u=[],d=Math.min(i[o].low,i[l].low),f=Math.max(i[o].lim,i[l].lim),h,v;h=o;do h=a.parent(h),c.push(h);while(h&&(i[h].low>d||f>i[h].lim));for(v=h,h=l;(h=a.parent(h))!==v;)u.push(h);return{path:c.concat(u.reverse()),lca:v}}function n(a){var i={},o=0;function l(c){var u=o;t.forEach(a.children(c),l),i[c]={low:u,lim:o++}}return t.forEach(a.children(),l),i}return Yv}var Zv,k2;function i9(){if(k2)return Zv;k2=1;var t=Ze(),e=Ut();Zv={run:r,cleanup:o};function r(l){var c=e.addDummyNode(l,"root",{},"_root"),u=a(l),d=t.max(t.values(u))-1,f=2*d+1;l.graph().nestingRoot=c,t.forEach(l.edges(),function(v){l.edge(v).minlen*=f});var h=i(l)+1;t.forEach(l.children(),function(v){n(l,c,f,h,d,u,v)}),l.graph().nodeRankFactor=f}function n(l,c,u,d,f,h,v){var p=l.children(v);if(!p.length){v!==c&&l.setEdge(c,v,{weight:0,minlen:u});return}var g=e.addBorderNode(l,"_bt"),y=e.addBorderNode(l,"_bb"),m=l.node(v);l.setParent(g,v),m.borderTop=g,l.setParent(y,v),m.borderBottom=y,t.forEach(p,function(b){n(l,c,u,d,f,h,b);var w=l.node(b),C=w.borderTop?w.borderTop:b,x=w.borderBottom?w.borderBottom:b,k=w.borderTop?d:2*d,E=C!==x?1:f-h[v]+1;l.setEdge(g,C,{weight:k,minlen:E,nestingEdge:!0}),l.setEdge(x,y,{weight:k,minlen:E,nestingEdge:!0})}),l.parent(v)||l.setEdge(c,g,{weight:0,minlen:f+h[v]})}function a(l){var c={};function u(d,f){var h=l.children(d);h&&h.length&&t.forEach(h,function(v){u(v,f+1)}),c[d]=f}return t.forEach(l.children(),function(d){u(d,1)}),c}function i(l){return t.reduce(l.edges(),function(c,u){return c+l.edge(u).weight},0)}function o(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(l.edges(),function(u){var d=l.edge(u);d.nestingEdge&&l.removeEdge(u)})}return Zv}var Xv,S2;function o9(){if(S2)return Xv;S2=1;var t=Ze(),e=Ut();Xv=r;function r(a){function i(o){var l=a.children(o),c=a.node(o);if(l.length&&t.forEach(l,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var u=c.minRank,d=c.maxRank+1;u<d;++u)n(a,"borderLeft","_bl",o,c,u),n(a,"borderRight","_br",o,c,u)}}t.forEach(a.children(),i)}function n(a,i,o,l,c,u){var d={width:0,height:0,rank:u,borderType:i},f=c[i][u-1],h=e.addDummyNode(a,"border",d,o);c[i][u]=h,a.setParent(h,l),f&&a.setEdge(f,h,{weight:1})}return Xv}var Jv,_2;function s9(){if(_2)return Jv;_2=1;var t=Ze();Jv={adjust:e,undo:r};function e(u){var d=u.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(u)}function r(u){var d=u.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&i(u),(d==="lr"||d==="rl")&&(l(u),n(u))}function n(u){t.forEach(u.nodes(),function(d){a(u.node(d))}),t.forEach(u.edges(),function(d){a(u.edge(d))})}function a(u){var d=u.width;u.width=u.height,u.height=d}function i(u){t.forEach(u.nodes(),function(d){o(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,o),t.has(f,"y")&&o(f)})}function o(u){u.y=-u.y}function l(u){t.forEach(u.nodes(),function(d){c(u.node(d))}),t.forEach(u.edges(),function(d){var f=u.edge(d);t.forEach(f.points,c),t.has(f,"x")&&c(f)})}function c(u){var d=u.x;u.x=u.y,u.y=d}return Jv}var Qv,T2;function l9(){if(T2)return Qv;T2=1;var t=Ze();Qv=e;function e(r){var n={},a=t.filter(r.nodes(),function(u){return!r.children(u).length}),i=t.max(t.map(a,function(u){return r.node(u).rank})),o=t.map(t.range(i+1),function(){return[]});function l(u){if(!t.has(n,u)){n[u]=!0;var d=r.node(u);o[d.rank].push(u),t.forEach(r.successors(u),l)}}var c=t.sortBy(a,function(u){return r.node(u).rank});return t.forEach(c,l),o}return Qv}var eg,N2;function u9(){if(N2)return eg;N2=1;var t=Ze();eg=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=r(n,a[o-1],a[o]);return i}function r(n,a,i){for(var o=t.zipObject(i,t.map(i,function(h,v){return v})),l=t.flatten(t.map(a,function(h){return t.sortBy(t.map(n.outEdges(h),function(v){return{pos:o[v.w],weight:n.edge(v).weight}}),"pos")}),!0),c=1;c<i.length;)c<<=1;var u=2*c-1;c-=1;var d=t.map(new Array(u),function(){return 0}),f=0;return t.forEach(l.forEach(function(h){var v=h.pos+c;d[v]+=h.weight;for(var p=0;v>0;)v%2&&(p+=d[v+1]),v=v-1>>1,d[v]+=h.weight;f+=h.weight*p})),f}return eg}var tg,I2;function c9(){if(I2)return tg;I2=1;var t=Ze();tg=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var o=t.reduce(i,function(l,c){var u=r.edge(c),d=r.node(c.v);return{sum:l.sum+u.weight*d.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return tg}var rg,B2;function d9(){if(B2)return rg;B2=1;var t=Ze();rg=e;function e(a,i){var o={};t.forEach(a,function(c,u){var d=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:u};t.isUndefined(c.barycenter)||(d.barycenter=c.barycenter,d.weight=c.weight)}),t.forEach(i.edges(),function(c){var u=o[c.v],d=o[c.w];!t.isUndefined(u)&&!t.isUndefined(d)&&(d.indegree++,u.out.push(o[c.w]))});var l=t.filter(o,function(c){return!c.indegree});return r(l)}function r(a){var i=[];function o(u){return function(d){d.merged||(t.isUndefined(d.barycenter)||t.isUndefined(u.barycenter)||d.barycenter>=u.barycenter)&&n(u,d)}}function l(u){return function(d){d.in.push(u),--d.indegree===0&&a.push(d)}}for(;a.length;){var c=a.pop();i.push(c),t.forEach(c.in.reverse(),o(c)),t.forEach(c.out,l(c))}return t.map(t.filter(i,function(u){return!u.merged}),function(u){return t.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,l=0;a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/l,a.weight=l,a.i=Math.min(i.i,a.i),i.merged=!0}return rg}var ng,D2;function f9(){if(D2)return ng;D2=1;var t=Ze(),e=Ut();ng=r;function r(i,o){var l=e.partition(i,function(g){return t.has(g,"barycenter")}),c=l.lhs,u=t.sortBy(l.rhs,function(g){return-g.i}),d=[],f=0,h=0,v=0;c.sort(a(!!o)),v=n(d,u,v),t.forEach(c,function(g){v+=g.vs.length,d.push(g.vs),f+=g.barycenter*g.weight,h+=g.weight,v=n(d,u,v)});var p={vs:t.flatten(d,!0)};return h&&(p.barycenter=f/h,p.weight=h),p}function n(i,o,l){for(var c;o.length&&(c=t.last(o)).i<=l;)o.pop(),i.push(c.vs),l++;return l}function a(i){return function(o,l){return o.barycenter<l.barycenter?-1:o.barycenter>l.barycenter?1:i?l.i-o.i:o.i-l.i}}return ng}var ag,P2;function h9(){if(P2)return ag;P2=1;var t=Ze(),e=c9(),r=d9(),n=f9();ag=a;function a(l,c,u,d){var f=l.children(c),h=l.node(c),v=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,g={};v&&(f=t.filter(f,function(x){return x!==v&&x!==p}));var y=e(l,f);t.forEach(y,function(x){if(l.children(x.v).length){var k=a(l,x.v,u,d);g[x.v]=k,t.has(k,"barycenter")&&o(x,k)}});var m=r(y,u);i(m,g);var b=n(m,d);if(v&&(b.vs=t.flatten([v,b.vs,p],!0),l.predecessors(v).length)){var w=l.node(l.predecessors(v)[0]),C=l.node(l.predecessors(p)[0]);t.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+w.order+C.order)/(b.weight+2),b.weight+=2}return b}function i(l,c){t.forEach(l,function(u){u.vs=t.flatten(u.vs.map(function(d){return c[d]?c[d].vs:d}),!0)})}function o(l,c){t.isUndefined(l.barycenter)?(l.barycenter=c.barycenter,l.weight=c.weight):(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight)}return ag}var ig,O2;function p9(){if(O2)return ig;O2=1;var t=Ze(),e=wr().Graph;ig=r;function r(a,i,o){var l=n(a),c=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(u){return a.node(u)});return t.forEach(a.nodes(),function(u){var d=a.node(u),f=a.parent(u);(d.rank===i||d.minRank<=i&&i<=d.maxRank)&&(c.setNode(u),c.setParent(u,f||l),t.forEach(a[o](u),function(h){var v=h.v===u?h.w:h.v,p=c.edge(v,u),g=t.isUndefined(p)?0:p.weight;c.setEdge(v,u,{weight:a.edge(h).weight+g})}),t.has(d,"minRank")&&c.setNode(u,{borderLeft:d.borderLeft[i],borderRight:d.borderRight[i]}))}),c}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return ig}var og,A2;function v9(){if(A2)return og;A2=1;var t=Ze();og=e;function e(r,n,a){var i={},o;t.forEach(a,function(l){for(var c=r.parent(l),u,d;c;){if(u=r.parent(c),u?(d=i[u],i[u]=c):(d=o,o=c),d&&d!==c){n.setEdge(d,c);return}c=u}})}return og}var sg,R2;function g9(){if(R2)return sg;R2=1;var t=Ze(),e=l9(),r=u9(),n=h9(),a=p9(),i=v9(),o=wr().Graph,l=Ut();sg=c;function c(h){var v=l.maxRank(h),p=u(h,t.range(1,v+1),"inEdges"),g=u(h,t.range(v-1,-1,-1),"outEdges"),y=e(h);f(h,y);for(var m=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),y=l.buildLayerMatrix(h);var x=r(h,y);x<m&&(C=0,b=t.cloneDeep(y),m=x)}f(h,b)}function u(h,v,p){return t.map(v,function(g){return a(h,g,p)})}function d(h,v){var p=new o;t.forEach(h,function(g){var y=g.graph().root,m=n(g,y,p,v);t.forEach(m.vs,function(b,w){g.node(b).order=w}),i(g,p,m.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,y){h.node(g).order=y})})}return sg}var lg,L2;function m9(){if(L2)return lg;L2=1;var t=Ze(),e=wr().Graph,r=Ut();lg={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(m,b){var w={};function C(x,k){var E=0,_=0,S=x.length,T=t.last(k);return t.forEach(k,function(N,B){var P=i(m,N),D=P?m.node(P).order:S;(P||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(m.predecessors(R),function(O){var F=m.node(O),A=F.order;(A<E||D<A)&&!(F.dummy&&m.node(R).dummy)&&o(w,O,R)})}),_=B+1,E=D)}),k}return t.reduce(b,C),w}function a(m,b){var w={};function C(k,E,_,S,T){var N;t.forEach(t.range(E,_),function(B){N=k[B],m.node(N).dummy&&t.forEach(m.predecessors(N),function(P){var D=m.node(P);D.dummy&&(D.order<S||D.order>T)&&o(w,P,N)})})}function x(k,E){var _=-1,S,T=0;return t.forEach(E,function(N,B){if(m.node(N).dummy==="border"){var P=m.predecessors(N);P.length&&(S=m.node(P[0]).order,C(E,T,B,_,S),T=B,_=S)}C(E,T,E.length,S,k.length)}),E}return t.reduce(b,x),w}function i(m,b){if(m.node(b).dummy)return t.find(m.predecessors(b),function(w){return m.node(w).dummy})}function o(m,b,w){if(b>w){var C=b;b=w,w=C}var x=m[b];x||(m[b]=x={}),x[w]=!0}function l(m,b,w){if(b>w){var C=b;b=w,w=C}return t.has(m[b],w)}function c(m,b,w,C){var x={},k={},E={};return t.forEach(b,function(_){t.forEach(_,function(S,T){x[S]=S,k[S]=S,E[S]=T})}),t.forEach(b,function(_){var S=-1;t.forEach(_,function(T){var N=C(T);if(N.length){N=t.sortBy(N,function(O){return E[O]});for(var B=(N.length-1)/2,P=Math.floor(B),D=Math.ceil(B);P<=D;++P){var R=N[P];k[T]===T&&S<E[R]&&!l(w,T,R)&&(k[R]=T,k[T]=x[T]=x[R],S=E[R])}}})}),{root:x,align:k}}function u(m,b,w,C,x){var k={},E=d(m,b,w,x),_=x?"borderLeft":"borderRight";function S(B,P){for(var D=E.nodes(),R=D.pop(),O={};R;)O[R]?B(R):(O[R]=!0,D.push(R),D=D.concat(P(R))),R=D.pop()}function T(B){k[B]=E.inEdges(B).reduce(function(P,D){return Math.max(P,k[D.v]+E.edge(D))},0)}function N(B){var P=E.outEdges(B).reduce(function(R,O){return Math.min(R,k[O.w]-E.edge(O))},Number.POSITIVE_INFINITY),D=m.node(B);P!==Number.POSITIVE_INFINITY&&D.borderType!==_&&(k[B]=Math.max(k[B],P))}return S(T,E.predecessors.bind(E)),S(N,E.successors.bind(E)),t.forEach(C,function(B){k[B]=k[w[B]]}),k}function d(m,b,w,C){var x=new e,k=m.graph(),E=g(k.nodesep,k.edgesep,C);return t.forEach(b,function(_){var S;t.forEach(_,function(T){var N=w[T];if(x.setNode(N),S){var B=w[S],P=x.edge(B,N);x.setEdge(B,N,Math.max(E(m,T,S),P||0))}S=T})}),x}function f(m,b){return t.minBy(t.values(b),function(w){var C=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;return t.forIn(w,function(k,E){var _=y(m,E)/2;C=Math.max(k+_,C),x=Math.min(k-_,x)}),C-x})}function h(m,b){var w=t.values(b),C=t.min(w),x=t.max(w);t.forEach(["u","d"],function(k){t.forEach(["l","r"],function(E){var _=k+E,S=m[_],T;if(S!==b){var N=t.values(S);T=E==="l"?C-t.min(N):x-t.max(N),T&&(m[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(m,b){return t.mapValues(m.ul,function(w,C){if(b)return m[b.toLowerCase()][C];var x=t.sortBy(t.map(m,C));return(x[1]+x[2])/2})}function p(m){var b=r.buildLayerMatrix(m),w=t.merge(n(m,b),a(m,b)),C={},x;t.forEach(["u","d"],function(E){x=E==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(_){_==="r"&&(x=t.map(x,function(B){return t.values(B).reverse()}));var S=(E==="u"?m.predecessors:m.successors).bind(m),T=c(m,x,w,S),N=u(m,x,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[E+_]=N})});var k=f(m,C);return h(C,k),v(C,m.graph().align)}function g(m,b,w){return function(C,x,k){var E=C.node(x),_=C.node(k),S=0,T;if(S+=E.width/2,t.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":T=-E.width/2;break;case"r":T=E.width/2;break}if(T&&(S+=w?T:-T),T=0,S+=(E.dummy?b:m)/2,S+=(_.dummy?b:m)/2,S+=_.width/2,t.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":T=_.width/2;break;case"r":T=-_.width/2;break}return T&&(S+=w?T:-T),T=0,S}}function y(m,b){return m.node(b).width}return lg}var ug,F2;function y9(){if(F2)return ug;F2=1;var t=Ze(),e=Ut(),r=m9().positionX;ug=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(o,l){i.node(l).x=o})}function a(i){var o=e.buildLayerMatrix(i),l=i.graph().ranksep,c=0;t.forEach(o,function(u){var d=t.max(t.map(u,function(f){return i.node(f).height}));t.forEach(u,function(f){i.node(f).y=c+d/2}),c+=d+l})}return ug}var cg,M2;function b9(){if(M2)return cg;M2=1;var t=Ze(),e=e9(),r=t9(),n=n9(),a=Ut().normalizeRanks,i=a9(),o=Ut().removeEmptyRanks,l=i9(),c=o9(),u=s9(),d=g9(),f=y9(),h=Ut(),v=wr().Graph;cg=p;function p(M,V){var q=V&&V.debugTiming?h.time:h.notime;q("layout",function(){var $=q(" buildLayoutGraph",function(){return S(M)});q(" runLayout",function(){g($,q)}),q(" updateInputGraph",function(){y(M,$)})})}function g(M,V){V(" makeSpaceForEdgeLabels",function(){T(M)}),V(" removeSelfEdges",function(){z(M)}),V(" acyclic",function(){e.run(M)}),V(" nestingGraph.run",function(){l.run(M)}),V(" rank",function(){n(h.asNonCompoundGraph(M))}),V(" injectEdgeLabelProxies",function(){N(M)}),V(" removeEmptyRanks",function(){o(M)}),V(" nestingGraph.cleanup",function(){l.cleanup(M)}),V(" normalizeRanks",function(){a(M)}),V(" assignRankMinMax",function(){B(M)}),V(" removeEdgeLabelProxies",function(){P(M)}),V(" normalize.run",function(){r.run(M)}),V(" parentDummyChains",function(){i(M)}),V(" addBorderSegments",function(){c(M)}),V(" order",function(){d(M)}),V(" insertSelfEdges",function(){j(M)}),V(" adjustCoordinateSystem",function(){u.adjust(M)}),V(" position",function(){f(M)}),V(" positionSelfEdges",function(){H(M)}),V(" removeBorderNodes",function(){A(M)}),V(" normalize.undo",function(){r.undo(M)}),V(" fixupEdgeLabelCoords",function(){O(M)}),V(" undoCoordinateSystem",function(){u.undo(M)}),V(" translateGraph",function(){D(M)}),V(" assignNodeIntersects",function(){R(M)}),V(" reversePoints",function(){F(M)}),V(" acyclic.undo",function(){e.undo(M)})}function y(M,V){t.forEach(M.nodes(),function(q){var $=M.node(q),K=V.node(q);$&&($.x=K.x,$.y=K.y,V.children(q).length&&($.width=K.width,$.height=K.height))}),t.forEach(M.edges(),function(q){var $=M.edge(q),K=V.edge(q);$.points=K.points,t.has(K,"x")&&($.x=K.x,$.y=K.y)}),M.graph().width=V.graph().width,M.graph().height=V.graph().height}var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],C=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function S(M){var V=new v({multigraph:!0,compound:!0}),q=X(M.graph());return V.setGraph(t.merge({},b,G(q,m),t.pick(q,w))),t.forEach(M.nodes(),function($){var K=X(M.node($));V.setNode($,t.defaults(G(K,C),x)),V.setParent($,M.parent($))}),t.forEach(M.edges(),function($){var K=X(M.edge($));V.setEdge($,t.merge({},E,G(K,k),t.pick(K,_)))}),V}function T(M){var V=M.graph();V.ranksep/=2,t.forEach(M.edges(),function(q){var $=M.edge(q);$.minlen*=2,$.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?$.width+=$.labeloffset:$.height+=$.labeloffset)})}function N(M){t.forEach(M.edges(),function(V){var q=M.edge(V);if(q.width&&q.height){var $=M.node(V.v),K=M.node(V.w),L={rank:(K.rank-$.rank)/2+$.rank,e:V};h.addDummyNode(M,"edge-proxy",L,"_ep")}})}function B(M){var V=0;t.forEach(M.nodes(),function(q){var $=M.node(q);$.borderTop&&($.minRank=M.node($.borderTop).rank,$.maxRank=M.node($.borderBottom).rank,V=t.max(V,$.maxRank))}),M.graph().maxRank=V}function P(M){t.forEach(M.nodes(),function(V){var q=M.node(V);q.dummy==="edge-proxy"&&(M.edge(q.e).labelRank=q.rank,M.removeNode(V))})}function D(M){var V=Number.POSITIVE_INFINITY,q=0,$=Number.POSITIVE_INFINITY,K=0,L=M.graph(),W=L.marginx||0,Y=L.marginy||0;function se(ue){var ae=ue.x,ne=ue.y,ce=ue.width,ie=ue.height;V=Math.min(V,ae-ce/2),q=Math.max(q,ae+ce/2),$=Math.min($,ne-ie/2),K=Math.max(K,ne+ie/2)}t.forEach(M.nodes(),function(ue){se(M.node(ue))}),t.forEach(M.edges(),function(ue){var ae=M.edge(ue);t.has(ae,"x")&&se(ae)}),V-=W,$-=Y,t.forEach(M.nodes(),function(ue){var ae=M.node(ue);ae.x-=V,ae.y-=$}),t.forEach(M.edges(),function(ue){var ae=M.edge(ue);t.forEach(ae.points,function(ne){ne.x-=V,ne.y-=$}),t.has(ae,"x")&&(ae.x-=V),t.has(ae,"y")&&(ae.y-=$)}),L.width=q-V+W,L.height=K-$+Y}function R(M){t.forEach(M.edges(),function(V){var q=M.edge(V),$=M.node(V.v),K=M.node(V.w),L,W;q.points?(L=q.points[0],W=q.points[q.points.length-1]):(q.points=[],L=K,W=$),q.points.unshift(h.intersectRect($,L)),q.points.push(h.intersectRect(K,W))})}function O(M){t.forEach(M.edges(),function(V){var q=M.edge(V);if(t.has(q,"x"))switch((q.labelpos==="l"||q.labelpos==="r")&&(q.width-=q.labeloffset),q.labelpos){case"l":q.x-=q.width/2+q.labeloffset;break;case"r":q.x+=q.width/2+q.labeloffset;break}})}function F(M){t.forEach(M.edges(),function(V){var q=M.edge(V);q.reversed&&q.points.reverse()})}function A(M){t.forEach(M.nodes(),function(V){if(M.children(V).length){var q=M.node(V),$=M.node(q.borderTop),K=M.node(q.borderBottom),L=M.node(t.last(q.borderLeft)),W=M.node(t.last(q.borderRight));q.width=Math.abs(W.x-L.x),q.height=Math.abs(K.y-$.y),q.x=L.x+q.width/2,q.y=$.y+q.height/2}}),t.forEach(M.nodes(),function(V){M.node(V).dummy==="border"&&M.removeNode(V)})}function z(M){t.forEach(M.edges(),function(V){if(V.v===V.w){var q=M.node(V.v);q.selfEdges||(q.selfEdges=[]),q.selfEdges.push({e:V,label:M.edge(V)}),M.removeEdge(V)}})}function j(M){var V=h.buildLayerMatrix(M);t.forEach(V,function(q){var $=0;t.forEach(q,function(K,L){var W=M.node(K);W.order=L+$,t.forEach(W.selfEdges,function(Y){h.addDummyNode(M,"selfedge",{width:Y.label.width,height:Y.label.height,rank:W.rank,order:L+ ++$,e:Y.e,label:Y.label},"_se")}),delete W.selfEdges})})}function H(M){t.forEach(M.nodes(),function(V){var q=M.node(V);if(q.dummy==="selfedge"){var $=M.node(q.e.v),K=$.x+$.width/2,L=$.y,W=q.x-K,Y=$.height/2;M.setEdge(q.e,q.label),M.removeNode(V),q.label.points=[{x:K+2*W/3,y:L-Y},{x:K+5*W/6,y:L-Y},{x:K+W,y:L},{x:K+5*W/6,y:L+Y},{x:K+2*W/3,y:L+Y}],q.label.x=q.x,q.label.y=q.y}})}function G(M,V){return t.mapValues(t.pick(M,V),Number)}function X(M){var V={};return t.forEach(M,function(q,$){V[$.toLowerCase()]=q}),V}return cg}var dg,$2;function w9(){if($2)return dg;$2=1;var t=Ze(),e=Ut(),r=wr().Graph;dg={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(l){o.setNode(l,{label:l}),o.setParent(l,"layer"+a.node(l).rank)}),t.forEach(a.edges(),function(l){o.setEdge(l.v,l.w,{},l.name)}),t.forEach(i,function(l,c){var u="layer"+c;o.setNode(u,{rank:"same"}),t.reduce(l,function(d,f){return o.setEdge(d,f,{style:"invis"}),f})}),o}return dg}var fg,V2;function C9(){return V2||(V2=1,fg="0.8.5"),fg}var hg,q2;function E9(){return q2||(q2=1,hg={graphlib:wr(),layout:b9(),debug:w9(),util:{time:Ut().time,notime:Ut().notime},version:C9()}),hg}(function(t,e){(function(n,a){t.exports=a(E9())})(Li,function(r){return function(n){var a={};function i(o){if(a[o])return a[o].exports;var l=a[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=a,i.d=function(o,l,c){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:c})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(l&1&&(o=i(o)),l&8||l&4&&typeof o=="object"&&o&&o.__esModule)return o;var c=Object.create(null);if(i.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:o}),l&2&&typeof o!="string")for(var u in o)i.d(c,u,(function(d){return o[d]}).bind(null,u));return c},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=0)}([function(n,a,i){var o=i(1),l=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&l(cytoscape),n.exports=l},function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var l=function(v){return typeof v=="function"},c=i(2),u=i(3),d=i(4);function f(h){this.options=u({},c,h)}f.prototype.run=function(){var h=this.options,v=this,p=h.cy,g=h.eles,y=function(H,G){return l(G)?G.apply(H,[H]):G},m=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};m.x2===void 0&&(m.x2=m.x1+m.w),m.w===void 0&&(m.w=m.x2-m.x1),m.y2===void 0&&(m.y2=m.y1+m.h),m.h===void 0&&(m.h=m.y2-m.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(H,G){G!=null&&(w[H]=G)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),b.setGraph(w),b.setDefaultEdgeLabel(function(){return{}}),b.setDefaultNodeLabel(function(){return{}});var x=g.nodes();l(h.sort)&&(x=x.sort(h.sort));for(var k=0;k<x.length;k++){var E=x[k],_=E.layoutDimensions(h);b.setNode(E.id(),{width:_.w,height:_.h,name:E.id()})}for(var S=0;S<x.length;S++){var T=x[S];T.isChild()&&b.setParent(T.id(),T.parent().id())}var N=g.edges().stdFilter(function(j){return!j.source().isParent()&&!j.target().isParent()});l(h.sort)&&(N=N.sort(h.sort));for(var B=0;B<N.length;B++){var P=N[B];b.setEdge(P.source().id(),P.target().id(),{minlen:y(P,h.minLen),weight:y(P,h.edgeWeight),name:P.id()},P.id())}d.layout(b);for(var D=b.nodes(),R=0;R<D.length;R++){var O=D[R],F=b.node(O);p.getElementById(O).scratch().dagre=F}var A;h.boundingBox?(A={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},x.forEach(function(j){var H=j.scratch().dagre;A.x1=Math.min(A.x1,H.x),A.x2=Math.max(A.x2,H.x),A.y1=Math.min(A.y1,H.y),A.y2=Math.max(A.y2,H.y)}),A.w=A.x2-A.x1,A.h=A.y2-A.y1):A=m;var z=function(H){if(h.boundingBox){var G=A.w===0?0:(H.x-A.x1)/A.w,X=A.h===0?0:(H.y-A.y1)/A.h;return{x:m.x1+G*m.w,y:m.y1+X*m.h}}else return H};return x.layoutPositions(v,h,function(j){j=o(j)==="object"?j:this;var H=j.scratch().dagre;return z({x:H.x,y:H.y})}),this},n.exports=f},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(l){return 1},edgeWeight:function(l){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(l,c){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(l,c){return c},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return l.forEach(function(u){Object.keys(u).forEach(function(d){return i[d]=u[d]})}),i}},function(n,a){n.exports=r}])})})(Ew);var x9=Ew.exports;const k9=FA(x9);Bn.use(k9);const z2=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1},S9=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},_9=function(t,e,r){let n=t.connectivity.flat(),a=S9(n),i=[],o=!1;return a.forEach(l=>{o=!1,z2(e,l)&&(o=!0),z2(r,l)&&(o=!0),o||i.push(l)}),i};let T9=class extends EventTarget{constructor(r,n){super();cr(this,"cyg",null);cr(this,"nodes",[]);cr(this,"edges",[]);cr(this,"axons",[]);cr(this,"dendrites",[]);cr(this,"somas",[]);cr(this,"labelCache",new Map);cr(this,"graphCanvas",null);cr(this,"hasPhenotypes",!1);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(r&&r["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],o=[],l=[];a.forEach(u=>{o.push(...r["node-phenotypes"][u])}),i.forEach(u=>{l.push(...r["node-phenotypes"][u])});const c=_9(r,o,l);this.dendrites=o.map(u=>JSON.stringify(u)),this.axons=l.map(u=>JSON.stringify(u)),c!=null&&c.length&&(this.somas=c.map(u=>JSON.stringify(u))),this.hasPhenotypes=!0}else this.axons=r.axons.map(a=>JSON.stringify(a)),this.dendrites=r.dendrites.map(a=>JSON.stringify(a)),(n=r.somas)!=null&&n.length&&(this.somas=r.somas.map(a=>JSON.stringify(a))),this.hasPhenotypes=!1;if(r.connectivity.length)for(const a of r.connectivity){const i=await this.graphNode(a[0]),o=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(o),this.edges.push({id:`${i.id}_${o.id}`,source:i.id,target:o.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(r){this.cyg=new D9(this,r),this.cyg.on("tap-node",n=>{const a=new CustomEvent("tap-node",{detail:n.detail});this.dispatchEvent(a)})}selectConnectivity(r){var n;if((n=this.cyg)!=null&&n.cy){let a="";this.cyg.cy.elements().forEach(i=>{const o=i.data("label"),l=pg(o);B9(r,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var r;(r=this.cyg)!=null&&r.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.reset()}zoom(r){var n;if((n=this.cyg)!=null&&n.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),o=this.cyg.cy.height(),l={x:i/2,y:o/2};this.cyg.cy.zoom({level:a+r,renderedPosition:l})}}enableZoom(r){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.userZoomingEnabled(r)}get elements(){return[...this.nodes.map(r=>({data:r})),...this.edges.map(r=>({data:r}))]}get roots(){return this.hasPhenotypes?[...this.dendrites]:[...this.dendrites,...this.somas]}async graphNode(r){const n=JSON.stringify(r),a=[r[0],...r[1]],i=[];for(const l of a){const c=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(c)}a.push(...i);const o={id:n,label:a.join(`
45
- `)};return this.hasPhenotypes?this.axons.includes(n)?o.axon=!0:this.dendrites.includes(n)?o.dendrite=!0:o.somas=!0:this.axons.includes(n)?this.dendrites.includes(n)||this.somas.includes(n)?o.somas=!0:o.axon=!0:(this.dendrites.includes(n)||this.somas.includes(n))&&(o.dendrite=!0),o}on(r,n){this.addEventListener(r,n)}};const N9=[{selector:"node",style:{label:function(t){return I9(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function I9(t){const e=t.split(`
46
- `),r=e.length/2,n=e.slice(r);return H2(n.join(`
47
- `))}function H2(t){return t.split(`
41
+ */var i1=function(e,r){this.recycle(e,r)};function uo(){return!1}function $s(){return!0}i1.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=uo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?$s:uo):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=$s;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=$s;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=$s,this.stopPropagation()},isDefaultPrevented:uo,isPropagationStopped:uo,isImmediatePropagationStopped:uo};var o1=/^([^.]+)(\.(?:[^.]+))?$/,bz=".*",s1={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},l1=Object.keys(s1),wz={};function Vs(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wz,e=arguments.length>1?arguments[1]:void 0,r=0;r<l1.length;r++){var n=l1[r];this[n]=t[n]||s1[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Nn=Vs.prototype,c1=function(e,r,n,a,i,o,l){Je(a)&&(i=a,a=null),l&&(o==null?o=l:o=Te({},o,l));for(var u=Ke(n)?n:n.split(/\s+/),c=0;c<u.length;c++){var d=u[c];if(!yn(d)){var f=d.match(o1);if(f){var h=f[1],v=f[2]?f[2]:null,p=r(e,d,h,v,a,i,o);if(p===!1)break}}}},u1=function(e,r){return e.addEventFields(e.context,r),new i1(r.type,r)},Cz=function(e,r,n){if(qM(n)){r(e,n);return}else if(Pe(n)){r(e,u1(e,n));return}for(var a=Ke(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!yn(o)){var l=o.match(o1);if(l){var u=l[1],c=l[2]?l[2]:null,d=u1(e,{type:u,namespace:c,target:e.context});r(e,d)}}}};Nn.on=Nn.addListener=function(t,e,r,n,a){return c1(this,function(i,o,l,u,c,d,f){Je(d)&&i.listeners.push({event:o,callback:d,type:l,namespace:u,qualifier:c,conf:f})},t,e,r,n,a),this},Nn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Nn.removeListener=Nn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=ZF(this.listeners));for(var i=this.listeners,o=function(c){var d=i[c];c1(a,function(f,h,v,p,g,y){if((d.type===v||t==="*")&&(!p&&d.namespace!==".*"||d.namespace===p)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(c,1),!1},t,e,r,n)},l=i.length-1;l>=0;l--)o(l);return this},Nn.removeAllListeners=function(){return this.removeListener("*")},Nn.emit=Nn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,Ke(e)||(e=[e]),Cz(this,function(i,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var l=function(d){var f=n[d];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===bz)&&i.eventMatches(i.context,f,o)){var h=[o];e!=null&&JF(h,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,o),p=f.callback.apply(v,h);i.afterEmit(i.context,f,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<a;u++)l(u);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var Ez={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ki(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},qs=function(e){return Ee(e)?new kn(e):e},d1={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new Vs(Ez,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=qs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=qs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=qs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=qs(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ve.eventAliasesOn(d1);var f1={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(Ee(e)||Zt(e))return new kn(e).filter(this);if(Je(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);l&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ee(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ee(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,l=o?a:i,u=o?i:a,c=0;c<l.length;c++){var d=l[c];u.has(d)&&n.push(d)}return n},xor:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,o=function(u,c){for(var d=0;d<u.length;d++){var f=u[d],h=f._private.data.id,v=c.hasElementWithId(h);v||n.push(f)}};return o(a,i),o(i,a),n},diff:function(e){var r=this._private.cy;Ee(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,l=e,u=function(d,f,h){for(var v=0;v<d.length;v++){var p=d[v],g=p._private.data.id,y=f.hasElementWithId(g);y?i.merge(p):h.push(p)}};return u(o,l,n),u(l,o,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],l=!this.has(o);l&&a.push(o)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&Ee(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,o=0;o<e.length;o++){var l=e[o],u=l._private.data.id,c=!i.has(u);if(c){var d=this.length++;this[d]=l,i.set(u,{ele:l,index:d})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var l=this.length-1,u=this[l],c=u._private.data.id;this[l]=void 0,this[e]=u,i.set(c,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ee(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],l=r?e.apply(r,[o,i,a]):e(o,i,a);n.push(l)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],u=r?e.apply(r,[l,o,i]):e(l,o,i);u>n&&(n=u,a=l)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var l=i[o],u=r?e.apply(r,[l,o,i]):e(l,o,i);u<n&&(n=u,a=l)}return{value:n,ele:a}}},Le=f1;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var xz={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},h1=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Vc:0}var o=i(e)-i(r);if(o!==0)return o;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var u=l(e)-l(r);if(u!==0)return u;var c=e.pstyle("z-index").value-r.pstyle("z-index").value;return c!==0?c:e.poolIndex()-r.poolIndex()},zs={forEach:function(e,r){if(Je(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=r?e.apply(r,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Je(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(h1)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:Vc-1}else{var i=r.source,o=r.target,l=i.zDepth(),u=o.zDepth();return Math.max(l,u,0)}}}};zs.each=zs.forEach;var kz=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ht(Symbol))!=e&&ht(Symbol.iterator)!=e;r&&(zs[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return _0({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};kz();var Sz=St({nodeDimensionsIncludeLabels:!1}),Hs={layoutDimensions:function(e){e=Sz(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(x){return!x.isParent()}),i=this.cy(),o=r.eles,l=function(k){return k.id()},u=Gi(n,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(k,E,_){var S={x:E.x1+E.w/2,y:E.y1+E.h/2},T={x:(_.x-S.x)*k,y:(_.y-S.y)*k};return{x:S.x+T.x,y:S.y+T.y}},d=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!d)return null;for(var k=Gt(),E=0;E<a.length;E++){var _=a[E],S=u(_,E);_5(k,S.x,S.y)}return k},h=f(),v=Gi(function(x,k){var E=u(x,k);if(d){var _=Math.abs(r.spacingFactor);E=c(_,h,E)}return r.transform!=null&&(E=r.transform(x,E)),E},l);if(r.animate){for(var p=0;p<a.length;p++){var g=a[p],y=v(g,p),m=r.animateFilter==null||r.animateFilter(g,p);if(m){var b=g.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else g.position(y)}if(r.fit){var w=i.animation({fit:{boundingBox:o.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}else if(r.zoom!==void 0&&r.pan!==void 0){var C=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(C)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Ua.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Te({},e,{eles:this}))}};Hs.createLayout=Hs.makeLayout=Hs.layout;function p1(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function Ks(t,e){return t=Jn(t),function(n){return p1(t,e,n)}}function Gs(t,e){t=Jn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return p1(t,r,a)}}var _t={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Pe(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ee(e))if(r===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var l=i[o];a.removeAllBypasses(l,n)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var c=i[u];a.removeBypasses(c,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var o=a.data.parent?n.parents():null;if(o)for(var l=0;l<o.length;l++){var u=o[l],c=u.pstyle("opacity").value;i=c*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function uu(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function du(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],o=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!o||uu(i,n);var u=l.source,c=l.target;return r(u)&&(!o||uu(u,r))&&(u===c||r(c)&&(!o||uu(c,r)))}}}var ei=Ks("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});_t.takesUpSpace=Gs("takesUpSpace",du({ok:ei}));var _z=Ks("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&ei(t)}),Tz=Ks("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&ei(t)});_t.interactive=Gs("interactive",du({ok:_z,parentOk:Tz,edgeOkViaNode:ei})),_t.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Nz=Ks("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&ei(t)}),Iz=ei;_t.visible=Gs("visible",du({ok:Nz,edgeOkViaNode:Iz})),_t.hidden=function(){var t=this[0];if(t)return!t.visible()},_t.isBundledBezier=Gs("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),_t.bypass=_t.css=_t.style,_t.renderedCss=_t.renderedStyle,_t.removeBypass=_t.removeCss=_t.removeStyle,_t.pstyle=_t.parsedStyle;var In={};function v1(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&&Je(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var o=e.length===1?e[0]:null,l=0;l<this.length;l++){var u=this[l],c=!t.ableField||u._private[t.ableField],d=u._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(u);if(f!==void 0&&(c=f,!f))return this}c&&(u._private[t.field]=t.value,d&&r.push(u))}var h=this.spawn(r);h.updateStyle(),h.emit(t.event),o&&h.emit(o)}return this}}function ti(t){In[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},In[t.on]=v1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),In[t.off]=v1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}ti({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),ti({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),ti({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),ti({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),In.deselect=In.unselect,In.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},ti({field:"active",on:"activate",off:"unactivate"}),ti({field:"pannable",on:"panify",off:"unpanify"}),In.inactive=function(){var t=this[0];if(t)return!t._private.active};var Dt={},g1=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var l=a[o];if(l.isNode()){for(var u=!1,c=l.connectedEdges(),d=0;d<c.length;d++){var f=c[d],h=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&h!==l||e.noOutgoingEdges&&h===l&&v!==l){u=!0;break}}u||i.push(l)}}return this.spawn(i,!0).filter(n)}},m1=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var l=o.connectedEdges(),u=0;u<l.length;u++){var c=l[u],d=c.source(),f=c.target();e.outgoing&&d===o?(a.push(c),a.push(f)):e.incoming&&f===o&&(a.push(c),a.push(d))}}return this.spawn(a,!0).filter(r)}},y1=function(e){return function(r){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var l=!1,u=0;u<o.length;u++){var c=o[u],d=c.id();i[d]||(i[d]=!0,a.push(c),l=!0)}if(!l)break;n=o}return this.spawn(a,!0).filter(r)}};Dt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Te(Dt,{roots:g1({noIncomingEdges:!0}),leaves:g1({noOutgoingEdges:!0}),outgoers:nr(m1({outgoing:!0}),"outgoers"),successors:y1({outgoing:!0}),incomers:nr(m1({incoming:!0}),"incomers"),predecessors:y1({incoming:!0})}),Te(Dt,{neighborhood:nr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),o=0;o<i.length;o++){var l=i[o],u=l.source(),c=l.target(),d=a===u?c:u;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Dt.neighbourhood=Dt.neighborhood,Dt.closedNeighbourhood=Dt.closedNeighborhood,Dt.openNeighbourhood=Dt.openNeighborhood,Te(Dt,{source:nr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:nr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:b1({attr:"source"}),targets:b1({attr:"target"})});function b1(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(r)}}Te(Dt,{edgesWith:nr(w1(),"edgesWith"),edgesTo:nr(w1({thisIsSrc:!0}),"edgesTo")});function w1(t){return function(r){var n=[],a=this._private.cy,i=t||{};Ee(r)&&(r=a.$(r));for(var o=0;o<r.length;o++)for(var l=r[o]._private.edges,u=0;u<l.length;u++){var c=l[u],d=c._private.data,f=this.hasElementWithId(d.source)&&r.hasElementWithId(d.target),h=r.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||h;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!h)||n.push(c))}return this.spawn(n,!0)}}Te(Dt,{connectedEdges:nr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var l=i[o];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:nr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:nr(C1(),"parallelEdges"),codirectedEdges:nr(C1({codirected:!0}),"codirectedEdges")});function C1(t){var e={codirected:!1};return t=Te({},e,t),function(n){for(var a=[],i=this.edges(),o=t,l=0;l<i.length;l++)for(var u=i[l],c=u._private,d=c.source,f=d._private.data.id,h=c.data.target,v=d._private.edges,p=0;p<v.length;p++){var g=v[p],y=g._private.data,m=y.target,b=y.source,w=m===h&&b===f,C=f===m&&h===b;(o.codirected&&w||!o.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(n)}}Te(Dt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return r.spawn();var u=function(){var d=n.collection();o.push(d);var f=i[0];l(f,d),r.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(h){h.connectedEdges().forEach(function(v){r.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Dt.componentsOf=Dt.components;var Tt=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Qe("A collection must have a reference to the core");return}var i=new Ir,o=!1;if(!r)r=[];else if(r.length>0&&Pe(r[0])&&!Ki(r[0])){o=!0;for(var l=[],u=new $a,c=0,d=r.length;c<d;c++){var f=r[c];f.data==null&&(f.data={});var h=f.data;if(h.id==null)h.id=J0();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var v=new ws(e,f,!1);l.push(v),u.add(h.id)}r=l}this.length=0;for(var p=0,g=r.length;p<g;p++){var y=r[p][0];if(y!=null){var m=y._private.data.id;(!n||!i.has(m))&&(n&&i.set(m,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new Ir,C=this.eles,x=0;x<C.length;x++){var k=C[x];w.set(k.id(),{index:x,ele:k})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ge=ws.prototype=Tt.prototype=Object.create(Array.prototype);Ge.instanceString=function(){return"collection"},Ge.spawn=function(t,e){return new Tt(this.cy(),t,e)},Ge.spawnSelf=function(){return this.spawn(this)},Ge.cy=function(){return this._private.cy},Ge.renderer=function(){return this._private.cy.renderer()},Ge.element=function(){return this[0]},Ge.collection=function(){return A0(this)?this:new Tt(this._private.cy,[this])},Ge.unique=function(){return new Tt(this._private.cy,this,!0)},Ge.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},Ge.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Tt(e)},Ge.$id=Ge.getElementById,Ge.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},Ge.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},Ge.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},Ge.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(Pe(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,o={},l=t.data.source,u=t.data.target;l!=null&&l!=a.source&&(o.source=""+l,i=!0),u!=null&&u!=a.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var c="parent"in t.data,d=t.data.parent;c&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==n[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var h={data:Nr(n.data),position:Nr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var v=0;return n.classes.forEach(function(p){return h.classes+=v++===0?p:" "+p}),h}}},Ge.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},Ge.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new ws(t,a,!1);e.push(i)}return new Tt(t,e)},Ge.copy=Ge.clone,Ge.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],o=[],l,u=0,c=r.length;u<c;u++){var d=r[u];e&&!d.removed()||(d.isNode()?i.push(d):o.push(d))}l=i.concat(o);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],p=v._private,g=p.data;if(v.clearTraversalCache(),!(!e&&!p.removed)){if(g.id===void 0)g.id=J0();else if(de(g.id))g.id=""+g.id;else if(yn(g.id)||!Ee(g.id)){Qe("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(n.hasElementWithId(g.id)){Qe("Can not create second element with ID `"+g.id+"`"),h();continue}}var y=g.id;if(v.isNode()){var m=p.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,x=!1,k=0;k<C;k++){var E=w[k],_=g[E];de(_)&&(_=g[E]=""+g[E]),_==null||_===""?(Qe("Can not create edge `"+y+"` with unspecified "+E),x=!0):n.hasElementWithId(_)||(Qe("Can not create edge `"+y+"` with nonexistant "+E+" `"+_+"`"),x=!0)}if(x){h();continue}var S=n.getElementById(g.source),T=n.getElementById(g.target);S.same(T)?S._private.edges.push(b):(S._private.edges.push(b),T._private.edges.push(b)),b._private.source=S,b._private.target=T}p.map=new Ir,p.map.set(y,{ele:v,index:0}),p.removed=!1,e&&n.addToPool(v)}for(var N=0;N<i.length;N++){var B=i[N],A=B._private.data;de(A.parent)&&(A.parent=""+A.parent);var D=A.parent,R=D!=null;if(R||B._private.parent){var O=B._private.parent?n.collection().merge(B._private.parent):n.getElementById(D);if(O.empty())A.parent=void 0;else if(O[0].removed())$e("Node added with missing parent, reference to parent removed"),A.parent=void 0,B._private.parent=null;else{for(var M=!1,P=O;!P.empty();){if(B.same(P)){M=!0,A.parent=void 0;break}P=P.parent()}M||(O[0]._private.children.push(B),B._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var z=l.length===r.length?r:new Tt(n,l),W=0;W<z.length;W++){var H=z[W];H.isNode()||(H.parallelEdges().clearTraversalCache(),H.source().clearTraversalCache(),H.target().clearTraversalCache())}var G;a.hasCompoundNodes?G=n.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):G=z,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?z.emitAndNotify("add"):e&&z.emit("add")}return r},Ge.removed=function(){var t=this[0];return t&&t._private.removed},Ge.inside=function(){var t=this[0];return t&&!t._private.removed},Ge.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function o(D){for(var R=D._private.edges,O=0;O<R.length;O++)u(R[O])}function l(D){for(var R=D._private.children,O=0;O<R.length;O++)u(R[O])}function u(D){var R=a[D.id()];e&&D.removed()||R||(a[D.id()]=!0,D.isNode()?(n.push(D),o(D),l(D)):n.unshift(D))}for(var c=0,d=r.length;c<d;c++){var f=r[c];u(f)}function h(D,R){var O=D._private.edges;wn(O,R),D.clearTraversalCache()}function v(D){D.clearTraversalCache()}var p=[];p.ids={};function g(D,R){R=R[0],D=D[0];var O=D._private.children,M=D.id();wn(O,R),R._private.parent=null,p.ids[M]||(p.ids[M]=!0,p.push(D))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var m=n[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];h(b,m),h(w,m);for(var C=m.parallelEdges(),x=0;x<C.length;x++){var k=C[x];v(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var E=m.parent();E.length!==0&&g(E,m)}e&&(m._private.removed=!0)}var _=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<_.length;S++){var T=_[S];if(T.isParent()){i._private.hasCompoundNodes=!0;break}}var N=new Tt(this.cy(),n);N.size()>0&&(t?N.emitAndNotify("remove"):e&&N.emit("remove"));for(var B=0;B<p.length;B++){var A=p[B];(!e||!A.removed())&&A.updateStyle()}return N},Ge.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),l=i(t.target),u=o!=null&&e.hasElementWithId(o),c=l!=null&&e.hasElementWithId(l);(u||c)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var p=r[v],g=p._private.data;p.isEdge()&&(u&&(g.source=o),c&&(g.target=l))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var h=d===null?void 0:d;e.batch(function(){var v=r.remove(n,a);v.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],y=g._private.data;g.isNode()&&(y.parent=h)}v.restore(n,a)}),r.emitAndNotify("move")}}return this},[Sb,Vq,Ls,_n,Xa,rz,Ms,yz,d1,f1,xz,zs,Hs,_t,In,Dt].forEach(function(t){Te(Ge,t)});var Bz={add:function(e){var r,n=this;if(Zt(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],o=0;o<a.length;o++){var l=a[o];i.push(l.json())}r=new Tt(n,i)}}else if(Ke(e)){var u=e;r=new Tt(n,u)}else if(Pe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var c=e,d=[],f=["nodes","edges"],h=0,v=f.length;h<v;h++){var p=f[h],g=c[p];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=Te({group:p},g[y]);d.push(b)}}r=new Tt(n,d)}else{var w=e;r=new ws(n,w).collection()}return r},remove:function(e){if(!Zt(e)){if(Ee(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Dz(t,e,r,n){var a=4,i=.001,o=1e-7,l=10,u=11,c=1/(u-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var h=d?new Float32Array(u):new Array(u);function v(T,N){return 1-3*N+3*T}function p(T,N){return 3*N-6*T}function g(T){return 3*T}function y(T,N,B){return((v(N,B)*T+p(N,B))*T+g(N))*T}function m(T,N,B){return 3*v(N,B)*T*T+2*p(N,B)*T+g(N)}function b(T,N){for(var B=0;B<a;++B){var A=m(N,t,r);if(A===0)return N;var D=y(N,t,r)-T;N-=D/A}return N}function w(){for(var T=0;T<u;++T)h[T]=y(T*c,t,r)}function C(T,N,B){var A,D,R=0;do D=N+(B-N)/2,A=y(D,t,r)-T,A>0?B=D:N=D;while(Math.abs(A)>o&&++R<l);return D}function x(T){for(var N=0,B=1,A=u-1;B!==A&&h[B]<=T;++B)N+=c;--B;var D=(T-h[B])/(h[B+1]-h[B]),R=N+D*c,O=m(R,t,r);return O>=i?b(T,R):O===0?R:C(T,N,N+c)}var k=!1;function E(){k=!0,(t!==e||r!==n)&&w()}var _=function(N){return k||E(),t===e&&r===n?N:N===0?0:N===1?1:y(x(N),e,n)};_.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var S="generateBezier("+[t,e,r,n]+")";return _.toString=function(){return S},_}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Az=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var i={dx:n.v,dv:t(n)},o=e(n,a*.5,i),l=e(n,a*.5,o),u=e(n,a,l),c=1/6*(i.dx+2*(o.dx+l.dx)+u.dx),d=1/6*(i.dv+2*(o.dv+l.dv)+u.dv);return n.x=n.x+c*a,n.v=n.v+d*a,n}return function n(a,i,o){var l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1/1e4,f=16/1e3,h,v,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,l.tension=a,l.friction=i,h=o!==null,h?(c=n(a,i),v=c/o*f):v=f;p=r(p||l,v),u.push(1+p.x),c+=16,Math.abs(p.x)>d&&Math.abs(p.v)>d;);return h?function(g){return u[g*(u.length-1)|0]}:c}}(),Ue=function(e,r,n,a){var i=Dz(e,r,n,a);return function(o,l,u){return o+(l-o)*i(u)}},Us={linear:function(e,r,n){return e+(r-e)*n},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Us.linear;var a=Az(e,r,n);return function(i,o,l){return i+(o-i)*a(l)}},"cubic-bezier":Ue};function E1(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function x1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ri(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=x1(t,a),l=x1(e,a);if(de(o)&&de(l))return E1(i,o,l,r,n);if(Ke(o)&&Ke(l)){for(var u=[],c=0;c<l.length;c++){var d=o[c],f=l[c];if(d!=null&&f!=null){var h=E1(i,d,f,r,n);u.push(h)}else u.push(f)}return u}}function Oz(t,e,r,n){var a=!n,i=t._private,o=e._private,l=o.easing,u=o.startTime,c=n?t:t.cy(),d=c.style();if(!o.easingImpl)if(l==null)o.easingImpl=Us.linear;else{var f;if(Ee(l)){var h=d.parse("transition-timing-function",l);f=h.value}else f=l;var v,p;Ee(f)?(v=f,p=[]):(v=f[1],p=f.slice(2).map(function(z){return+z})),p.length>0?(v==="spring"&&p.push(o.duration),o.easingImpl=Us[v].apply(null,p)):o.easingImpl=Us[v]}var g=o.easingImpl,y;if(o.duration===0?y=1:y=(r-u)/o.duration,o.applying&&(y=o.progress),y<0?y=0:y>1&&(y=1),o.delay==null){var m=o.startPosition,b=o.position;if(b&&a&&!t.locked()){var w={};fo(m.x,b.x)&&(w.x=ri(m.x,b.x,y,g)),fo(m.y,b.y)&&(w.y=ri(m.y,b.y,y,g)),t.position(w)}var C=o.startPan,x=o.pan,k=i.pan,E=x!=null&&n;E&&(fo(C.x,x.x)&&(k.x=ri(C.x,x.x,y,g)),fo(C.y,x.y)&&(k.y=ri(C.y,x.y,y,g)),t.emit("pan"));var _=o.startZoom,S=o.zoom,T=S!=null&&n;T&&(fo(_,S)&&(i.zoom=eo(i.minZoom,ri(_,S,y,g),i.maxZoom)),t.emit("zoom")),(E||T)&&t.emit("viewport");var N=o.style;if(N&&N.length>0&&a){for(var B=0;B<N.length;B++){var A=N[B],D=A.name,R=A,O=o.startStyle[D],M=d.properties[O.name],P=ri(O,R,y,g,M);d.overrideBypass(t,D,P)}t.emit("style")}}return o.progress=y,y}function fo(t,e){return t==null||e==null?!1:de(t)&&de(e)?!0:!!(t&&e)}function Pz(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function k1(t,e){var r=e._private.aniEles,n=[];function a(d,f){var h=d._private,v=h.animation.current,p=h.animation.queue,g=!1;if(v.length===0){var y=p.shift();y&&v.push(y)}for(var m=function(k){for(var E=k.length-1;E>=0;E--){var _=k[E];_()}k.splice(0,k.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||Pz(d,w,t),Oz(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&p.length===0&&n.push(d),g}for(var i=!1,o=0;o<r.length;o++){var l=r[o],u=a(l);i=i||u}var c=a(e,!0);(i||c)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Rz={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&ms(function(i){k1(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){k1(o,e)},n.beforeRenderPriorities.animations):r()}},Lz={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ki(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Ws=function(e){return Ee(e)?new kn(e):e},S1={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Vs(Lz,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ws(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ws(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ws(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ws(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Ve.eventAliasesOn(S1);var fu={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};fu.jpeg=fu.jpg;var js={layout:function(e){var r=this;if(e==null){Qe("Layout options must be specified to make a layout");return}if(e.name==null){Qe("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Qe("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ee(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new a(Te({},e,{cy:r,eles:i}));return o}};js.createLayout=js.makeLayout=js.layout;var Mz={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],o=e[i],l=r.getElementById(i);l.data(o)}})}},Fz=St({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),hu={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){Qe("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&$e("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var a=Fz(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};hu.invalidateDimensions=hu.resize;var Ys={collection:function(e,r){return Ee(e)?this.$(e):Zt(e)?e.collection():Ke(e)?(r||(r={}),new Tt(this,e,r.unique,r.removed)):new Tt(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};Ys.elements=Ys.filter=Ys.$;var At={},ho="t",$z="f";At.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var o=t[i],l=e.getContextMeta(o);if(!l.empty){var u=e.getContextStyle(l),c=e.applyContextStyle(l,u,o);o._private.appliedInitStyle?e.updateTransitions(o,c.diffProps):o._private.appliedInitStyle=!0;var d=e.updateStyleHints(o);d&&a.push(o)}}return a},At.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var o=[],l={},u=0;u<r.length;u++){var c=r[u],d=t[u]===ho,f=e[u]===ho,h=d!==f,v=c.mappedProperties.length>0;if(h||f&&v){var p=void 0;h&&v||h?p=c.properties:v&&(p=c.mappedProperties);for(var g=0;g<p.length;g++){for(var y=p[g],m=y.name,b=!1,w=u+1;w<r.length;w++){var C=r[w],x=e[w]===ho;if(x&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,o.push(m))}}}return n[a]=o,o},At.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],l=o.selector&&o.selector.matches(t);l?r+=ho:r+=$z}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},At.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],l=e[i]===ho;if(l)for(var u=0;u<o.properties.length;u++){var c=o.properties[u];a[c.name]=c}}return n[e]=a,a},At.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},o=n.types,l=0;l<a.length;l++){var u=a[l],c=e[u],d=r.pstyle(u);if(!c)if(d)d.bypass?c={name:u,deleteBypassed:!0}:c={name:u,delete:!0};else continue;if(d!==c){if(c.mapped===o.fn&&d!=null&&d.mapping!=null&&d.mapping.value===c.value){var f=d.mapping,h=f.fnValue=c.value(r);if(h===f.prevFnValue)continue}var v=i[u]={prev:d};n.applyParsedProperty(r,c),v.next=r.pstyle(u),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},At.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(Y,se,ce){return r.getPropertiesHash(Y,se,ce)},o=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",u=t._private.style;n=Object.keys(u);for(var c=0;c<a.length;c++){var d=a[c];e.styleKeys[d]=[Fa,Yi]}for(var f=function(Y,se){return e.styleKeys[se][0]=Zi(Y,e.styleKeys[se][0])},h=function(Y,se){return e.styleKeys[se][1]=Xi(Y,e.styleKeys[se][1])},v=function(Y,se){f(Y,se),h(Y,se)},p=function(Y,se){for(var ce=0;ce<Y.length;ce++){var ae=Y.charCodeAt(ce);f(ae,se),h(ae,se)}},g=2e9,y=function(Y){return-128<Y&&Y<128&&Math.floor(Y)!==Y?g-(Y*1024|0):Y},m=0;m<n.length;m++){var b=n[m],w=u[b];if(w!=null){var C=this.properties[b],x=C.type,k=C.groupKey,E=void 0;C.hashOverride!=null?E=C.hashOverride(t,w):w.pfValue!=null&&(E=w.pfValue);var _=C.enums==null?w.value:null,S=E!=null,T=_!=null,N=S||T,B=w.units;if(x.number&&N&&!x.multiple){var A=S?E:_;v(y(A),k),!S&&B!=null&&p(B,k)}else p(w.strValue,k)}}for(var D=[Fa,Yi],R=0;R<a.length;R++){var O=a[R],M=e.styleKeys[O];D[0]=Zi(M[0],D[0]),D[1]=Xi(M[1],D[1])}e.styleKey=KF(D[0],D[1]);var P=e.styleKeys;e.labelDimsKey=bn(P.labelDimensions);var z=i(t,["label"],P.labelDimensions);if(e.labelKey=bn(z),e.labelStyleKey=bn(ys(P.commonLabel,z)),!l){var W=i(t,["source-label"],P.labelDimensions);e.sourceLabelKey=bn(W),e.sourceLabelStyleKey=bn(ys(P.commonLabel,W));var H=i(t,["target-label"],P.labelDimensions);e.targetLabelKey=bn(H),e.targetLabelStyleKey=bn(ys(P.commonLabel,H))}if(l){var G=e.styleKeys,X=G.nodeBody,F=G.nodeBorder,V=G.nodeOutline,q=G.backgroundImage,$=G.compound,K=G.pie,L=[X,F,V,q,$,K].filter(function(j){return j!=null}).reduce(ys,[Fa,Yi]);e.nodeKey=bn(L),e.hasPie=K!=null&&K[0]!==Fa&&K[1]!==Yi}return o!==e.styleKey},At.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},At.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,o=r.types,l=r.properties[n.name].type,u=n.bypass,c=a[n.name],d=c&&c.bypass,f=t._private,h="mapping",v=function(X){return X==null?null:X.pfValue!=null?X.pfValue:X.value},p=function(){var X=v(c),F=v(n);r.checkTriggers(t,n.name,X,F)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",u)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return c?c.bypass?(a[n.name]=c.bypassed,p(),!0):!1:(p(),!0);var g=function(){$e("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var y=n.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(de(m)){var x=n.fieldMax-n.fieldMin;x===0?C=0:C=(m-n.fieldMin)/x}else return $e("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var k=n.valueMin[0],E=n.valueMax[0],_=n.valueMin[1],S=n.valueMax[1],T=n.valueMin[2],N=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],A=n.valueMax[3]==null?1:n.valueMax[3],D=[Math.round(k+(E-k)*C),Math.round(_+(S-_)*C),Math.round(T+(N-T)*C),Math.round(B+(A-B)*C)];i={bypass:n.bypass,name:n.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else if(l.number){var R=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,R,n.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=n,n=i;break}case o.data:{for(var O=n.field.split("."),M=f.data,P=0;P<O.length&&M;P++){var z=O[P];M=M[z]}if(M!=null&&(i=this.parse(n.name,M,n.bypass,h)),!i)return g(),!1;i.mapping=n,n=i;break}case o.fn:{var W=n.value,H=n.fnValue!=null?n.fnValue:W(t);if(n.prevFnValue=H,H==null)return $e("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,H,n.bypass,h),!i)return $e("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Nr(n),n=i;break}case void 0:break;default:return!1}return u?(d?n.bypassed=c.bypassed:n.bypassed=c,a[n.name]=n):d?c.bypassed=n:a[n.name]=n,p(),!0},At.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var l=i[o],u=a[l];u!=null&&(u.bypass?u.bypassed=null:a[l]=null)}}},At.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},At.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},u=!1,c=0;c<a.length;c++){var d=a[c],f=t.pstyle(d),h=e[d];if(h){var v=h.prev,p=v,g=h.next!=null?h.next:f,y=!1,m=void 0,b=1e-6;p&&(de(p.pfValue)&&de(g.pfValue)?(y=g.pfValue-p.pfValue,m=p.pfValue+b*y):de(p.value)&&de(g.value)?(y=g.value-p.value,m=p.value+b*y):Ke(p.value)&&Ke(g.value)&&(y=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],m=p.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),u=!0))}}if(!u)return;n.transitioning=!0,new Ua(function(w){o>0?t.delayAnimation(o).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)},At.checkTrigger=function(t,e,r,n,a,i){var o=this.properties[e],l=a(o);l!=null&&l(r,n)&&i(o)},At.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},At.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},At.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var po={};po.applyBypass=function(t,e,r,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var l=0;l<a.properties.length;l++){var u=a.properties[l],c=u.name,d=this.parse(c,r,!0);d&&i.push(d)}}else if(Ee(e)){var f=this.parse(e,r,!0);f&&i.push(f)}else if(Pe(e)){var h=e;n=r;for(var v=Object.keys(h),p=0;p<v.length;p++){var g=v[p],y=h[g];if(y===void 0&&(y=h[ps(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],x={},k=void 0,E=0;E<i.length;E++){var _=i[E];if(n){var S=C.pstyle(_.name);k=x[_.name]={prev:S}}b=this.applyParsedProperty(C,Nr(_))||b,n&&(k.next=C.pstyle(_.name))}b&&this.updateStyleHints(C),n&&this.updateTransitions(C,x,o)}return b},po.overrideBypass=function(t,e,r){e=Mc(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],o=this.properties[e].type,l=o.color,u=o.mutiple,c=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),l?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,c,r)}},po.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},po.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],o={},l=0;l<e.length;l++){var u=e[l],c=this.properties[u],d=i.pstyle(c.name);if(!(!d||!d.bypass)){var f="",h=this.parse(u,f,!0),v=o[c.name]={prev:d};this.applyParsedProperty(i,h),v.next=i.pstyle(c.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,n)}};var pu={};pu.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},pu.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var Br={};Br.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},Br.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(n[i.name]=o,n[ps(i.name)]=o)}return n}},Br.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},Br.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=t.pstyle(a.name);if(o){var l=o.value,u=o.units,c=o.strValue;if(r&&i.number&&l!=null&&de(l)){var d=t.cy().zoom(),f=function(y){return y*d},h=function(y,m){return f(y)+m},v=Ke(l),p=v?u.every(function(g){return g!=null}):u!=null;return p?v?l.map(function(g,y){return h(g,u[y])}).join(" "):h(l,u):v?l.map(function(g){return Ee(g)?g:""+f(g)}).join(" "):""+f(l)}else if(c!=null)return c}return null}},Br.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=t.pstyle(i);o!==void 0&&(Pe(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r},Br.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var l=i[o],u=n[l],c=a[l]||a[Mc(l)],d=this.parse(c.name,u);d&&r.push(d)}return r},Br.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,o,l,u,c;for(u=0;u<e.length;u++)if(a=e[u],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Zi(l,n[0]),n[1]=Xi(l,n[1]);else for(o=i.strValue,c=0;c<o.length;c++)l=o.charCodeAt(c),n[0]=Zi(l,n[0]),n[1]=Xi(l,n[1]);return n},Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var Zs={};Zs.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,o=Object.keys(i);e.selector(a);for(var l=0;l<o.length;l++){var u=o[l],c=i[u];e.css(u,c)}}return e},Zs.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},Zs.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},o=0;o<a.length;o++){var l=a[o];i[l.name]=l.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var vu={};vu.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){n.length>a.length?n=n.substr(a.length):n=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var c=n.match(/^\s*$/);if(c)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){$e("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=d[0];var f=d[1];if(f!=="core"){var h=new kn(f);if(h.invalid){$e("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],p=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){$e("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),p=!0;break}o=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){$e("Skipping property: Invalid property name in: "+o),u();continue}var x=r.parse(b,w);if(!x){$e("Skipping property: Invalid property definition in: "+o),u();continue}g.push({name:b,val:w}),u()}if(p){l();break}r.selector(f);for(var k=0;k<g.length;k++){var E=g[k];r.css(E.name,E.val)}l()}return r},vu.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Nt={};(function(){var t=vt,e=WM,r=YM,n=ZM,a=XM,i=function(L){return"^"+L+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(L){var j=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+L+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+j+")\\s*\\,\\s*("+j+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Nt.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(L,j){switch(L.length){case 2:return j[0]!=="deg"&&j[0]!=="rad"&&j[1]!=="deg"&&j[1]!=="rad";case 1:return Ee(L[0])||j[0]==="deg"||j[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(L){var j=L.length;return j===1||j===2||j===4}}};var u={zeroNonZero:function(L,j){return(L==null||j==null)&&L!==j||L==0&&j!=0?!0:L!=0&&j==0},any:function(L,j){return L!=j},emptyNonEmpty:function(L,j){var Y=yn(L),se=yn(j);return Y&&!se||!Y&&se}},c=Nt.types,d=[{name:"label",type:c.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any}],f=[{name:"source-label",type:c.text,triggersBounds:u.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:c.size,triggersBounds:u.any}],h=[{name:"target-label",type:c.text,triggersBounds:u.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:c.size,triggersBounds:u.any}],v=[{name:"font-family",type:c.fontFamily,triggersBounds:u.any},{name:"font-style",type:c.fontStyle,triggersBounds:u.any},{name:"font-weight",type:c.fontWeight,triggersBounds:u.any},{name:"font-size",type:c.size,triggersBounds:u.any},{name:"text-transform",type:c.textTransform,triggersBounds:u.any},{name:"text-wrap",type:c.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:c.size,triggersBounds:u.any},{name:"text-outline-width",type:c.size,triggersBounds:u.any},{name:"line-height",type:c.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:c.valign,triggersBounds:u.any},{name:"text-halign",type:c.halign,triggersBounds:u.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:u.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:u.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:c.justification}],g=[{name:"events",type:c.bool,triggersZOrder:u.any},{name:"text-events",type:c.bool,triggersZOrder:u.any}],y=[{name:"display",type:c.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:c.visibility,triggersZOrder:u.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:c.number,triggersZOrder:u.any}],m=[{name:"overlay-padding",type:c.size,triggersBounds:u.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:c.cornerRadius}],b=[{name:"underlay-padding",type:c.size,triggersBounds:u.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:c.cornerRadius}],w=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],C=function(L,j){return j.value==="label"?-L.poolIndex():j.pfValue},x=[{name:"height",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"width",type:c.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"shape",type:c.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:u.any}],k=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:u.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],E=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:u.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:u.any}],_=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],S=[{name:"position",type:c.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:c.size,triggersBounds:u.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:c.size,triggersBounds:u.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:u.any}],T=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:c.size,triggersBounds:u.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:c.numbers,triggersBounds:u.any},{name:"segment-radii",type:c.numbers,triggersBounds:u.any},{name:"radius-type",type:c.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:u.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:c.number,triggersBounds:u.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:c.angle,triggersBounds:u.any},{name:"loop-sweep",type:c.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:c.size,triggersBounds:u.any},{name:"target-distance-from-node",type:c.size,triggersBounds:u.any}],N=[{name:"ghost",type:c.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:c.zeroOneNumber}],B=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],A=[];Nt.pieBackgroundN=16,A.push({name:"pie-size",type:c.sizeMaybePercent});for(var D=1;D<=Nt.pieBackgroundN;D++)A.push({name:"pie-"+D+"-background-color",type:c.color}),A.push({name:"pie-"+D+"-background-size",type:c.percent}),A.push({name:"pie-"+D+"-background-opacity",type:c.zeroOneNumber});var R=[],O=Nt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(K){O.forEach(function(L){var j=L+"-"+K.name,Y=K.type,se=K.triggersBounds;R.push({name:j,type:Y,triggersBounds:se})})},{});var M=Nt.properties=[].concat(g,w,y,m,b,N,p,v,d,f,h,x,k,E,_,A,S,T,R,B),P=Nt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:N,commonLabel:p,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:h,nodeBody:x,nodeBorder:k,nodeOutline:E,backgroundImage:_,pie:A,compound:S,edgeLine:T,edgeArrow:R,core:B},z=Nt.propertyGroupNames={},W=Nt.propertyGroupKeys=Object.keys(P);W.forEach(function(K){z[K]=P[K].map(function(L){return L.name}),P[K].forEach(function(L){return L.groupKey=K})});var H=Nt.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Nt.propertyNames=M.map(function(K){return K.name});for(var G=0;G<M.length;G++){var X=M[G];M[X.name]=X}for(var F=0;F<H.length;F++){var V=H[F],q=M[V.pointsTo],$={name:V.name,alias:!0,pointsTo:q};M.push($),M[V.name]=$}})(),Nt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},Nt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Te({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,c){for(var d=1;d<=Nt.pieBackgroundN;d++){var f=c.name.replace("{{i}}",d),h=c.value;u[f]=h}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,c){return Nt.arrowPrefixes.forEach(function(d){var f=d+"-"+c.name,h=c.value;u[f]=h}),u},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],l=this.parse(i,o);r[i]=l}}return t.defaultProperties=r,t.defaultProperties},Nt.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Xs={};Xs.parse=function(t,e,r,n){var a=this;if(Je(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=r?"t":"f",l=""+e,u=W0(t,l,o,i),c=a.propCache=a.propCache||[],d;return(d=c[u])||(d=c[u]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(d=Nr(d),d&&(d.value=Nr(d.value))),d},Xs.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&$e("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&$e("The style value of `label` is deprecated for `"+a.name+"`"),a},Xs.parseImpl=function(t,e,r,n){var a=this;t=Mc(t);var i=a.properties[t],o=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=Ee(e);u&&(e=e.trim());var c=i.type;if(!c)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Je(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:r};var d,f;if(!(!u||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(r)return!1;var h=l.data;return{name:t,value:d,strValue:""+e,mapped:h,field:d[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(r||c.multiple)return!1;var v=l.mapData;if(!(c.color||c.number))return!1;var p=this.parse(t,f[4]);if(!p||p.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return $e("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(c.color){var y=p.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:r}}}if(c.multiple&&n!=="multiple"){var w;if(u?w=e.split(/\s+/):Ke(e)?w=e:w=[e],c.evenMultiple&&w.length%2!==0)return null;for(var C=[],x=[],k=[],E="",_=!1,S=0;S<w.length;S++){var T=a.parse(t,w[S],r,"multiple");_=_||Ee(T.value),C.push(T.value),k.push(T.pfValue!=null?T.pfValue:T.value),x.push(T.units),E+=(S>0?" ":"")+T.strValue}return c.validate&&!c.validate(C,x)?null:c.singleEnum&&_?C.length===1&&Ee(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:k,strValue:E,bypass:r,units:x}}var N=function(){for(var L=0;L<c.enums.length;L++){var j=c.enums[L];if(j===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(c.number){var B,A="px";if(c.units&&(B=c.units),c.implicitUnits&&(A=c.implicitUnits),!c.unitless)if(u){var D="px|em"+(c.allowPercent?"|\\%":"");B&&(D=B);var R=e.match("^("+vt+")("+D+")?$");R&&(e=R[1],B=R[2]||A)}else(!B||c.implicitUnits)&&(B=A);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=o,N();if(c.integer&&!VM(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var O={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return c.unitless||B!=="px"&&B!=="em"?O.pfValue=e:O.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(O.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(O.pfValue=B==="rad"?e:w5(e)),B==="%"&&(O.pfValue=e/100),O}else if(c.propList){var M=[],P=""+e;if(P!=="none"){for(var z=P.split(/\s*,\s*|\s+/),W=0;W<z.length;W++){var H=z[W].trim();a.properties[H]?M.push(H):$e("`"+H+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:r}}else if(c.color){var G=nF(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:r}:null}else if(c.regex||c.regexes){if(c.enums){var X=N();if(X)return X}for(var F=c.regexes?c.regexes:[c.regex],V=0;V<F.length;V++){var q=new RegExp(F[V]),$=q.exec(e);if($)return{name:t,value:c.singleRegexMatchValue?$[1]:$,strValue:""+e,bypass:r}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:r}:c.enums?N():null};var Ot=function t(e){if(!(this instanceof t))return new t(e);if(!Lc(e)){Qe("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Pt=Ot.prototype;Pt.instanceString=function(){return"style"},Pt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Pt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Pt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Pt.selector=function(t){var e=t==="core"?null:new kn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},Pt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[ps(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Pt.style=Pt.css,Pt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this},Pt.append=function(t){return O0(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):Ee(t)&&this.appendFromString(t),this},Ot.fromJson=function(t,e){var r=new Ot(t);return r.fromJson(e),r},Ot.fromString=function(t,e){return new Ot(t).fromString(e)},[At,po,pu,Br,Zs,vu,Nt,Xs].forEach(function(t){Te(Pt,t)}),Ot.types=Pt.types,Ot.properties=Pt.properties,Ot.propertyGroups=Pt.propertyGroups,Ot.propertyGroupNames=Pt.propertyGroupNames,Ot.propertyGroupKeys=Pt.propertyGroupKeys;var Vz={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return O0(e)?r.style=e.generateStyle(this):Ke(e)?r.style=Ot.fromJson(this,e):Ee(e)?r.style=Ot.fromString(this,e):r.style=Ot(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},qz="single",ia={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=qz),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,o,l;switch(e.length){case 0:return r;case 1:if(Ee(e[0]))return n=e[0],r[n];if(Pe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,l=i.y,de(o)&&(r.x=o),de(l)&&(r.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&de(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,o,l,u,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Pe(e)&&(l=n[0],u=l.x,c=l.y,de(u)&&(a.x+=u),de(c)&&(a.y+=c),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&de(o)&&(a[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(de(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ee(e)){var a=e;e=this.$(a)}else if(HM(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Zt(e)||(e=this.mutableElements());if(!(Zt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),l=this.height(),u;if(r=de(r)?r:0,!isNaN(o)&&!isNaN(l)&&o>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((o-2*r)/n.w,(l-2*r)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var c={x:(o-u*(n.x1+n.x2))/2,y:(l-u*(n.y1+n.y2))/2};return{zoom:u,pan:c}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return de(e)&&de(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):de(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:de(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,i,o,l=!1;if(r.zoomingEnabled||(l=!0),de(e)?o=e:Pe(e)&&(o=e.level,e.position!=null?i=Cs(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(l=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,l||!de(o)||o===a||i!=null&&(!de(i.x)||!de(i.y)))return null;if(i!=null){var u=n,c=a,d=o,f={x:-d/c*(i.x-u.x)+i.x,y:-d/c*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],o=!1,l=!1;if(!e)return this;if(de(e.zoom)||(n=!1),Pe(e.pan)||(a=!1),!n&&!a)return this;if(n){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var c=e.pan;de(c.x)&&(r.pan.x=c.x,l=!1),de(c.y)&&(r.pan.y=c.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ee(e)){var n=e;e=this.mutableElements().filter(n)}else Zt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var l={x:(i-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return l}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};ia.centre=ia.center,ia.autolockNodes=ia.autolock,ia.autoungrabifyNodes=ia.autoungrabify;var vo={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};vo.attr=vo.data,vo.removeAttr=vo.removeData;var go=function(e){var r=this;e=Te({},e);var n=e.container;n&&!hs(n)&&hs(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var o=pt!==void 0&&n!==void 0&&!e.headless,l=e;l.layout=Te({name:o?"grid":"null"},l.layout),l.renderer=Te({name:o?"canvas":"null"},l.renderer);var u=function(p,g,y){return g!==void 0?g:y!==void 0?y:p},c=this._private={container:n,ready:!1,options:l,elements:new Tt(this),listeners:[],aniEles:new Tt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,l.zoomingEnabled),userZoomingEnabled:u(!0,l.userZoomingEnabled),panningEnabled:u(!0,l.panningEnabled),userPanningEnabled:u(!0,l.userPanningEnabled),boxSelectionEnabled:u(!0,l.boxSelectionEnabled),autolock:u(!1,l.autolock,l.autolockNodes),autoungrabify:u(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:u(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?o:l.styleEnabled,zoom:de(l.zoom)?l.zoom:1,pan:{x:Pe(l.pan)&&de(l.pan.x)?l.pan.x:0,y:Pe(l.pan)&&de(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(p,g){var y=p.some(KM);if(y)return Ua.all(p).then(g);g(p)};c.styleEnabled&&r.setStyle([]);var f=Te({},l,l.renderer);r.initRenderer(f);var h=function(p,g,y){r.notifications(!1);var m=r.mutableElements();m.length>0&&m.remove(),p!=null&&(Pe(p)||Ke(p))&&r.add(p),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Te({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};d([l.style,l.elements],function(v){var p=v[0],g=v[1];c.styleEnabled&&r.style().append(p),h(g,function(){r.startAnimationLoop(),c.ready=!0,Je(l.ready)&&r.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];r.on("ready",m)}a&&(a.readies=[]),r.emit("ready")},l.done)})},Js=go.prototype;Te(Js,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return pt;var r=this._private.container.ownerDocument;return r===void 0||r==null?pt:r.defaultView||pt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!hs(e)&&hs(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Te({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Nr(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(C){return r.getElementById(C.id())};if(Pe(e)){if(r.startBatch(),e.elements){var o={},l=function(C,x){for(var k=[],E=[],_=0;_<C.length;_++){var S=C[_];if(!S.data.id){$e("cy.json() cannot handle elements without an ID attribute");continue}var T=""+S.data.id,N=r.getElementById(T);o[T]=!0,N.length!==0?E.push({ele:N,json:S}):(x&&(S.group=x),k.push(S))}r.add(k);for(var B=0;B<E.length;B++){var A=E[B],D=A.ele,R=A.json;D.json(R)}};if(Ke(e.elements))l(e.elements);else for(var u=["nodes","edges"],c=0;c<u.length;c++){var d=u[c],f=e.elements[d];Ke(f)&&l(f,d)}var h=r.collection();a.filter(function(w){return!o[w.id()]}).forEach(function(w){w.isParent()?h.merge(w):w.remove()}),h.forEach(function(w){return w.children().move({parent:null})}),h.forEach(function(w){return i(w).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<v.length;p++){var g=v[p];e[g]!=null&&r[g](e[g])}return r.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=r.style().json()),m.data=Nr(r.data());var b=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Nr(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Nr(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),Js.$id=Js.getElementById,[Bz,Rz,S1,fu,js,Mz,hu,Ys,Vz,ia,vo].forEach(function(t){Te(Js,t)});var zz={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Hz={maximal:!1,acyclic:!1},ni=function(e){return e.scratch("breadthfirst")},_1=function(e,r){return e.scratch("breadthfirst",r)};function T1(t){this.options=Te({},zz,Hz,t)}T1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().filter(function(ae){return!ae.isParent()}),i=n,o=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,u=Gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),c;if(Zt(e.roots))c=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var h=e.roots[f],v=r.getElementById(h);d.push(v)}c=r.collection(d)}else if(Ee(e.roots))c=r.$(e.roots);else if(o)c=a.roots();else{var p=n.components();c=r.collection();for(var g=function(ne){var ue=p[ne],ie=ue.maxDegree(!1),fe=ue.filter(function(pe){return pe.degree(!1)===ie});c=c.add(fe)},y=0;y<p.length;y++)g(y)}var m=[],b={},w=function(ne,ue){m[ue]==null&&(m[ue]=[]);var ie=m[ue].length;m[ue].push(ne),_1(ne,{index:ie,depth:ue})},C=function(ne,ue){var ie=ni(ne),fe=ie.depth,pe=ie.index;m[fe][pe]=null,w(ne,ue)};i.bfs({roots:c,directed:e.directed,visit:function(ne,ue,ie,fe,pe){var Ae=ne[0],Ie=Ae.id();w(Ae,pe),b[Ie]=!0}});for(var x=[],k=0;k<a.length;k++){var E=a[k];b[E.id()]||x.push(E)}var _=function(ne){for(var ue=m[ne],ie=0;ie<ue.length;ie++){var fe=ue[ie];if(fe==null){ue.splice(ie,1),ie--;continue}_1(fe,{depth:ne,index:ie})}},S=function(){for(var ne=0;ne<m.length;ne++)_(ne)},T=function(ne,ue){for(var ie=ni(ne),fe=ne.incomers().filter(function(I){return I.isNode()&&n.has(I)}),pe=-1,Ae=ne.id(),Ie=0;Ie<fe.length;Ie++){var we=fe[Ie],ke=ni(we);pe=Math.max(pe,ke.depth)}if(ie.depth<=pe){if(!e.acyclic&&ue[Ae])return null;var re=pe+1;return C(ne,re),ue[Ae]=re,!0}return!1};if(o&&l){var N=[],B={},A=function(ne){return N.push(ne)},D=function(){return N.shift()};for(a.forEach(function(ae){return N.push(ae)});N.length>0;){var R=D(),O=T(R,B);if(O)R.outgoers().filter(function(ae){return ae.isNode()&&n.has(ae)}).forEach(A);else if(O===null){$e("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(e.avoidOverlap)for(var P=0;P<a.length;P++){var z=a[P],W=z.layoutDimensions(e),H=W.w,G=W.h;M=Math.max(M,H,G)}var X={},F=function(ne){if(X[ne.id()])return X[ne.id()];for(var ue=ni(ne).depth,ie=ne.neighborhood(),fe=0,pe=0,Ae=0;Ae<ie.length;Ae++){var Ie=ie[Ae];if(!(Ie.isEdge()||Ie.isParent()||!a.has(Ie))){var we=ni(Ie);if(we!=null){var ke=we.index,re=we.depth;if(!(ke==null||re==null)){var I=m[re].length;re<ue&&(fe+=ke/I,pe++)}}}}return pe=Math.max(1,pe),fe=fe/pe,pe===0&&(fe=0),X[ne.id()]=fe,fe},V=function(ne,ue){var ie=F(ne),fe=F(ue),pe=ie-fe;return pe===0?L0(ne.id(),ue.id()):pe};e.depthSort!==void 0&&(V=e.depthSort);for(var q=0;q<m.length;q++)m[q].sort(V),_(q);for(var $=[],K=0;K<x.length;K++)$.push(x[K]);m.unshift($),S();for(var L=0,j=0;j<m.length;j++)L=Math.max(m[j].length,L);var Y={x:u.x1+u.w/2,y:u.x1+u.h/2},se=m.reduce(function(ae,ne){return Math.max(ae,ne.length)},0),ce=function(ne){var ue=ni(ne),ie=ue.depth,fe=ue.index,pe=m[ie].length,Ae=Math.max(u.w/((e.grid?se:pe)+1),M),Ie=Math.max(u.h/(m.length+1),M),we=Math.min(u.w/2/m.length,u.h/2/m.length);if(we=Math.max(we,M),e.circle){var re=we*ie+we-(m.length>0&&m[0].length<=3?we/2:0),I=2*Math.PI/m[ie].length*fe;return ie===0&&m[0].length===1&&(re=1),{x:Y.x+re*Math.cos(I),y:Y.y+re*Math.sin(I)}}else{var ke={x:Y.x+(fe+1-(pe+1)/2)*Ae,y:(ie+1)*Ie};return ke}};return n.nodes().layoutPositions(this,e,ce),this};var Kz={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function N1(t){this.options=Te({},Kz,t)}N1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,c=u/Math.max(1,i.length-1),d,f=0,h=0;h<i.length;h++){var v=i[h],p=v.layoutDimensions(e),g=p.w,y=p.h;f=Math.max(f,g,y)}if(de(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(c)-Math.cos(0),b=Math.sin(c)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(k,E){var _=e.startAngle+E*c*(a?1:-1),S=d*Math.cos(_),T=d*Math.sin(_),N={x:l.x+S,y:l.y+T};return N};return n.nodes().layoutPositions(this,e,C),this};var Gz={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function I1(t){this.options=Te({},Gz,t)}I1.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),o=Gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],c=0,d=0;d<i.length;d++){var f=i[d],h=void 0;h=e.concentric(f),u.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var v=0;v<i.length;v++){var p=i[v],g=p.layoutDimensions(e);c=Math.max(c,g.w,g.h)}u.sort(function(ae,ne){return ne.value-ae.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<u.length;w++){var C=u[w];if(b.length>0){var x=Math.abs(b[0].value-C.value);x>=y&&(b=[],m.push(b))}b.push(C)}var k=c+e.minNodeSpacing;if(!e.avoidOverlap){var E=m.length>0&&m[0].length>1,_=Math.min(o.w,o.h)/2-k,S=_/(m.length+E?1:0);k=Math.min(k,S)}for(var T=0,N=0;N<m.length;N++){var B=m[N],A=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,D=B.dTheta=A/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var R=Math.cos(D)-Math.cos(0),O=Math.sin(D)-Math.sin(0),M=Math.sqrt(k*k/(R*R+O*O));T=Math.max(M,T)}B.r=T,T+=k}if(e.equidistant){for(var P=0,z=0,W=0;W<m.length;W++){var H=m[W],G=H.r-z;P=Math.max(P,G)}z=0;for(var X=0;X<m.length;X++){var F=m[X];X===0&&(z=F.r),F.r=z,z+=P}}for(var V={},q=0;q<m.length;q++)for(var $=m[q],K=$.dTheta,L=$.r,j=0;j<$.length;j++){var Y=$[j],se=e.startAngle+(r?1:-1)*K*j,ce={x:l.x+L*Math.cos(se),y:l.y+L*Math.sin(se)};V[Y.node.id()]=ce}return a.nodes().layoutPositions(this,e,function(ae){var ne=ae.id();return V[ne]}),this};var gu,Uz={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Qs(t){this.options=Te({},Uz,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),l=e.some(function(c){return c.data("id")===i}),u=e.some(function(c){return c.data("id")===o});return!l||!u});this.options.eles=this.options.eles.not(n)}Qs.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?gu=!0:gu=!1;var n=Wz(e,r,t);gu&&Zz(n),t.randomize&&Xz(n);var a=Zr(),i=function(){Jz(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(h){return!(r.stopped||h>=t.numIter||(Qz(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var h=t.eles.nodes(),v=B1(n,t,h);h.layoutPositions(r,t,v)}},u=0,c=!0;if(t.animate===!0){var d=function f(){for(var h=0;c&&h<t.refresh;)c=o(u),u++,h++;if(!c)A1(n,t),l();else{var v=Zr();v-a>=t.animationThreshold&&i(),ms(f)}};d()}else{for(;c;)c=o(u),u++;A1(n,t),l()}return this},Qs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Qs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Wz=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Gt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=n.eles.components(),c={},d=0;d<u.length;d++)for(var f=u[d],h=0;h<f.length;h++){var v=f[h];c[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var p=i[d],g=p.layoutDimensions(n),y={};y.isLocked=p.locked(),y.id=p.data("id"),y.parentId=p.data("parent"),y.cmptId=c[p.id()],y.children=[],y.positionX=p.position("x"),y.positionY=p.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(p.style("padding")),y.padRight=parseFloat(p.style("padding")),y.padTop=parseFloat(p.style("padding")),y.padBottom=parseFloat(p.style("padding")),y.nodeRepulsion=Je(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var p=l.layoutNodes[d],x=p.parentId;x!=null?l.layoutNodes[l.idToIndex[x]].children.push(p.id):(m[++w]=p.id,C.push(p.id))}for(l.graphSet.push(C);b<=w;){var k=m[b++],E=l.idToIndex[k],v=l.layoutNodes[E],_=v.children;if(_.length>0){l.graphSet.push(_);for(var d=0;d<_.length;d++)m[++w]=_[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],h=0;h<S.length;h++){var T=l.idToIndex[S[h]];l.indexToGraph[T]=d}for(var d=0;d<l.edgeSize;d++){var N=a[d],B={};B.id=N.data("id"),B.sourceId=N.data("source"),B.targetId=N.data("target");var A=Je(n.idealEdgeLength)?n.idealEdgeLength(N):n.idealEdgeLength,D=Je(n.edgeElasticity)?n.edgeElasticity(N):n.edgeElasticity,R=l.idToIndex[B.sourceId],O=l.idToIndex[B.targetId],M=l.indexToGraph[R],P=l.indexToGraph[O];if(M!=P){for(var z=jz(B.sourceId,B.targetId,l),W=l.graphSet[z],H=0,y=l.layoutNodes[R];W.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;for(y=l.layoutNodes[O];W.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],H++;A*=H*n.nestingFactor}B.idealLength=A,B.elasticity=D,l.layoutEdges.push(B)}return l},jz=function(e,r,n){var a=Yz(e,r,0,n);return 2>a.count?0:a.graph},Yz=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var o=0,l=0;l<i.length;l++){var u=i[l],c=a.idToIndex[u],d=a.layoutNodes[c].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],h=t(e,r,f,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},Zz,Xz=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},B1=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(o){var l=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,l){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var c=(u.positionX-i.x1)/i.w,d=(u.positionY-i.y1)/i.h;return{x:a.x1+c*a.w,y:a.y1+d*a.h}}else return{x:u.positionX,y:u.positionY}}},Jz=function(e,r,n){var a=n.layout,i=n.eles.nodes(),o=B1(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Qz=function(e,r,n){e3(e,r),n3(e),a3(e,r),i3(e),o3(e)},e3=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var l=e.layoutNodes[e.idToIndex[a[o]]],u=o+1;u<i;u++){var c=e.layoutNodes[e.idToIndex[a[u]]];t3(l,c,e,r)}},D1=function(e){return-e+2*e*Math.random()},t3=function(e,r,n,a){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!n.isCompound)){var l=r.positionX-e.positionX,u=r.positionY-e.positionY,c=1;l===0&&u===0&&(l=D1(c),u=D1(c));var d=r3(e,r,l,u);if(d>0)var f=a.nodeOverlap*d,h=Math.sqrt(l*l+u*u),v=f*l/h,p=f*u/h;else var g=el(e,l,u),y=el(r,-1*l,-1*u),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,h=Math.sqrt(w),f=(e.nodeRepulsion+r.nodeRepulsion)/w,v=f*m/h,p=f*b/h;e.isLocked||(e.offsetX-=v,e.offsetY-=p),r.isLocked||(r.offsetX+=v,r.offsetY+=p)}},r3=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},el=function(e,r,n){var a=e.positionX,i=e.positionY,o=e.height||1,l=e.width||1,u=n/r,c=o/l,d={};return r===0&&0<n||r===0&&0>n?(d.x=a,d.y=i+o/2,d):0<r&&-1*c<=u&&u<=c?(d.x=a+l/2,d.y=i+l*n/2/r,d):0>r&&-1*c<=u&&u<=c?(d.x=a-l/2,d.y=i-l*n/2/r,d):0<n&&(u<=-1*c||u>=c)?(d.x=a+o*r/2/n,d.y=i+o/2,d):(0>n&&(u<=-1*c||u>=c)&&(d.x=a-o*r/2/n,d.y=i-o/2),d)},n3=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],l=e.idToIndex[a.targetId],u=e.layoutNodes[l],c=u.positionX-o.positionX,d=u.positionY-o.positionY;if(!(c===0&&d===0)){var f=el(o,c,d),h=el(u,-1*c,-1*d),v=h.x-f.x,p=h.y-f.y,g=Math.sqrt(v*v+p*p),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*p/g;else var m=0,b=0;o.isLocked||(o.offsetX+=m,o.offsetY+=b),u.isLocked||(u.offsetX-=m,u.offsetY-=b)}}},a3=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var l=e.clientHeight/2,u=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[c.parentId]],l=d.positionX,u=d.positionY;for(var f=0;f<o;f++){var h=e.layoutNodes[e.idToIndex[i[f]]];if(!h.isLocked){var v=l-h.positionX,p=u-h.positionY,g=Math.sqrt(v*v+p*p);if(g>n){var y=r.gravity*v/g,m=r.gravity*p/g;h.offsetX+=y,h.offsetY+=m}}}}},i3=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var o=n[a++],l=e.idToIndex[o],u=e.layoutNodes[l],c=u.children;if(0<c.length&&!u.isLocked){for(var d=u.offsetX,f=u.offsetY,h=0;h<c.length;h++){var v=e.layoutNodes[e.idToIndex[c[h]]];v.offsetX+=d,v.offsetY+=f,n[++i]=c[h]}u.offsetX=0,u.offsetY=0}}},o3=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=s3(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,l3(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},s3=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},l3=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,r)}},A1=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],l=o.cmptId,u=a[l]=a[l]||[];u.push(o)}for(var c=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var h=d[f];d.x1=Math.min(d.x1,h.positionX-h.width/2),d.x2=Math.max(d.x2,h.positionX+h.width/2),d.y1=Math.min(d.y1,h.positionY-h.height/2),d.y2=Math.max(d.y2,h.positionY+h.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,p=0,g=0,y=0,m=Math.sqrt(c)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var h=d[f];h.isLocked||(h.positionX+=v-d.x1,h.positionY+=p-d.y1)}v+=d.w+r.componentSpacing,g+=d.w+r.componentSpacing,y=Math.max(y,d.h),g>m&&(p+=y+r.componentSpacing,v=0,g=0,y=0)}}},c3={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function O1(t){this.options=Te({},c3,t)}O1.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=Gt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(X){return{x:i.x1,y:i.y1}});else{var o=a.size(),l=Math.sqrt(o*i.h/i.w),u=Math.round(l),c=Math.round(i.w/i.h*l),d=function(F){if(F==null)return Math.min(u,c);var V=Math.min(u,c);V==u?u=F:c=F},f=function(F){if(F==null)return Math.max(u,c);var V=Math.max(u,c);V==u?u=F:c=F},h=e.rows,v=e.cols!=null?e.cols:e.columns;if(h!=null&&v!=null)u=h,c=v;else if(h!=null&&v==null)u=h,c=Math.ceil(o/u);else if(h==null&&v!=null)c=v,u=Math.ceil(o/c);else if(c*u>o){var p=d(),g=f();(p-1)*g>=o?d(p-1):(g-1)*p>=o&&f(g-1)}else for(;c*u<o;){var y=d(),m=f();(m+1)*y>=o?f(m+1):d(y+1)}var b=i.w/c,w=i.h/u;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var x=a[C],k=x._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var E=x.layoutDimensions(e),_=e.avoidOverlapPadding,S=E.w+_,T=E.h+_;b=Math.max(b,S),w=Math.max(w,T)}for(var N={},B=function(F,V){return!!N["c-"+F+"-"+V]},A=function(F,V){N["c-"+F+"-"+V]=!0},D=0,R=0,O=function(){R++,R>=c&&(R=0,D++)},M={},P=0;P<a.length;P++){var z=a[P],W=e.position(z);if(W&&(W.row!==void 0||W.col!==void 0)){var H={row:W.row,col:W.col};if(H.col===void 0)for(H.col=0;B(H.row,H.col);)H.col++;else if(H.row===void 0)for(H.row=0;B(H.row,H.col);)H.row++;M[z.id()]=H,A(H.row,H.col)}}var G=function(F,V){var q,$;if(F.locked()||F.isParent())return!1;var K=M[F.id()];if(K)q=K.col*b+b/2+i.x1,$=K.row*w+w/2+i.y1;else{for(;B(D,R);)O();q=R*b+b/2+i.x1,$=D*w+w/2+i.y1,A(D,R),O()}return{x:q,y:$}};a.layoutPositions(this,e,G)}return this};var u3={ready:function(){},stop:function(){}};function mu(t){this.options=Te({},u3,t)}mu.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},mu.prototype.stop=function(){return this};var d3={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function P1(t){this.options=Te({},d3,t)}P1.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Je(t.positions);function a(i){if(t.positions==null)return v5(i.position());if(n)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var l=a(i);return i.locked()||l==null?!1:l}),this};var f3={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function R1(t){this.options=Te({},f3,t)}R1.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Gt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,l){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var h3=[{name:"breadthfirst",impl:T1},{name:"circle",impl:N1},{name:"concentric",impl:I1},{name:"cose",impl:Qs},{name:"grid",impl:O1},{name:"null",impl:mu},{name:"preset",impl:P1},{name:"random",impl:R1}];function L1(t){this.options=t,this.notifications=0}var M1=function(){},F1=function(){throw new Error("A headless instance can not render images")};L1.prototype={recalculateRenderedStyle:M1,notify:function(){this.notifications++},init:M1,isHeadless:function(){return!0},png:F1,jpg:F1};var yu={};yu.arrowShapeWidth=.3,yu.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(c,d,f,h,v,p,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=c&&c<=m&&b<=d&&d<=w;return C},n=function(c,d,f,h,v){var p=c*Math.cos(h)-d*Math.sin(h),g=c*Math.sin(h)+d*Math.cos(h),y=p*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(c,d,f,h){for(var v=[],p=0;p<c.length;p+=2){var g=c[p],y=c[p+1];v.push(n(g,y,d,f,h))}return v},i=function(c){for(var d=[],f=0;f<c.length;f++){var h=c[f];d.push(h.x,h.y)}return d},o=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,d){Ee(d)&&(d=t[d]),t[c]=Te({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,v,p,g,y,m){var b=i(a(this.points,p+2*m,g,y)),w=Ut(h,v,b);return w},roughCollide:r,draw:function(h,v,p,g){var y=a(this.points,v,p,g);e.arrowShapeImpl("polygon")(h,y)},spacing:function(h){return 0},gap:o},d)};l("none",{collide:bs,roughCollide:bs,draw:qc,spacing:Z0,gap:Z0}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=this.controlPoint,y=n(g[0],g[1],d,f,h);e.arrowShapeImpl(this.name)(c,p,y)},gap:function(c){return o(c)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.pointsTee,f+2*g,h,v)),b=Ut(c,d,y)||Ut(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.pointsTee,d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,h,v));return Ut(c,d,b)||m},draw:function(c,d,f,h,v){var p=a(this.pointsTr,d,f,h);e.arrowShapeImpl(this.name)(c,p,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,d){var f=this.baseCrossLinePts.slice(),h=d/c,v=3,p=5;return f[v]=f[v]-h,f[p]=f[p]-h,f},collide:function(c,d,f,h,v,p,g){var y=i(a(this.points,f+2*g,h,v)),m=i(a(this.crossLinePts(f,p),f+2*g,h,v)),b=Ut(c,d,y)||Ut(c,d,m);return b},draw:function(c,d,f,h,v){var p=a(this.points,d,f,h),g=a(this.crossLinePts(d,v),d,f,h);e.arrowShapeImpl(this.name)(c,p,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return o(c)*.525}}),l("circle",{radius:.15,collide:function(c,d,f,h,v,p,g){var y=v,m=Math.pow(y.x-c,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(c,d,f,h,v){e.arrowShapeImpl(this.name)(c,h.x,h.y,this.radius*d)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var oa={};oa.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],l=r.pan(),u=r.zoom(),c=((t-a)/o-l.x)/u,d=((e-i)/o-l.y)/u;return[c,d]},oa.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(m){return parseFloat(r.getPropertyValue(m))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=t.clientWidth,l=t.clientHeight,u=a.left+a.right,c=a.top+a.bottom,d=i.left+i.right,f=e.width/(o+d),h=o-u,v=l-c,p=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[p,g,h,v,f]},oa.invalidateContainerClientCoordsCache=function(){this.containerBB=null},oa.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},oa.findNearestElements=function(t,e,r,n){var a=this,i=this,o=i.getCachedZSortedEles(),l=[],u=i.cy.zoom(),c=i.cy.hasCompoundNodes(),d=(n?24:8)/u,f=(n?8:2)/u,h=(n?8:2)/u,v=1/0,p,g;r&&(o=o.interactive);function y(E,_){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(_==null||_<v))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=E,p=E,v=_??v;break}}}else l.push(E),p=E,v=_??v}function m(E){var _=E.outerWidth()+2*f,S=E.outerHeight()+2*f,T=_/2,N=S/2,B=E.position(),A=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,D=E._private.rscratch;if(B.x-T<=t&&t<=B.x+T&&B.y-N<=e&&e<=B.y+N){var R=i.nodeShapes[a.getNodeShape(E)];if(R.checkPoint(t,e,0,_,S,B.x,B.y,A,D))return y(E,0),!0}}function b(E){var _=E._private,S=_.rscratch,T=E.pstyle("width").pfValue,N=E.pstyle("arrow-scale").value,B=T/2+d,A=B*B,D=B*2,P=_.source,z=_.target,R;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,M=0;M+3<O.length;M+=2)if(N5(t,e,O[M],O[M+1],O[M+2],O[M+3],D)&&A>(R=O5(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(E,R),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,M=0;M+5<S.allpts.length;M+=4)if(I5(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],D)&&A>(R=A5(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5])))return y(E,R),!0}for(var P=P||_.source,z=z||_.target,W=a.getArrowWidth(T,N),H=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],M=0;M<H.length;M++){var G=H[M],X=i.arrowShapes[E.pstyle(G.name+"-arrow-shape").value],F=E.pstyle("width").pfValue;if(X.roughCollide(t,e,W,G.angle,{x:G.x,y:G.y},F,d)&&X.collide(t,e,W,G.angle,{x:G.x,y:G.y},F,d))return y(E),!0}c&&l.length>0&&(m(P),m(z))}function w(E,_,S){return gr(E,_,S)}function C(E,_){var S=E._private,T=h,N;_?N=_+"-":N="",E.boundingBox();var B=S.labelBounds[_||"main"],A=E.pstyle(N+"label").value,D=E.pstyle("text-events").strValue==="yes";if(!(!D||!A)){var R=w(S.rscratch,"labelX",_),O=w(S.rscratch,"labelY",_),M=w(S.rscratch,"labelAngle",_),P=E.pstyle(N+"text-margin-x").pfValue,z=E.pstyle(N+"text-margin-y").pfValue,W=B.x1-T-P,H=B.x2+T-P,G=B.y1-T-z,X=B.y2+T-z;if(M){var F=Math.cos(M),V=Math.sin(M),q=function(ce,ae){return ce=ce-R,ae=ae-O,{x:ce*F-ae*V+R,y:ce*V+ae*F+O}},$=q(W,G),K=q(W,X),L=q(H,G),j=q(H,X),Y=[$.x+P,$.y+z,L.x+P,L.y+z,j.x+P,j.y+z,K.x+P,K.y+z];if(Ut(t,e,Y))return y(E),!0}else if(za(B,t,e))return y(E),!0}}for(var x=o.length-1;x>=0;x--){var k=o[x];k.isNode()?m(k)||C(k):b(k)||C(k)||C(k,"source")||C(k,"target")}return l},oa.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),l=Math.max(t,r),u=Math.min(e,n),c=Math.max(e,n);t=o,r=l,e=u,n=c;for(var d=Gt({x1:t,y1:e,x2:r,y2:n}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var v=h,p=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Gc(d,p)&&!ib(p,d)&&i.push(v)}else{var g=h,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!za(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!za(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!T5(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var tl={};tl.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",l=e.edgeType==="self",u,c,d,f,h,v,m,b;if(r?(d=e.haystackPts[0],f=e.haystackPts[1],h=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,h=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)u=d-e.segpts[0],c=f-e.segpts[1];else if(a||o||l||n){var p=e.allpts,g=bt(p[0],p[2],p[4],.1),y=bt(p[1],p[3],p[5],.1);u=d-g,c=f-y}else u=d-m,c=f-b;e.srcArrowAngle=Es(u,c);var m=e.midX,b=e.midY;if(r&&(m=(d+h)/2,b=(f+v)/2),u=h-d,c=v-f,i){var p=e.allpts;if(p.length/2%2===0){var w=p.length/2,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}else if(e.isRound)u=e.midVector[1],c=-e.midVector[0];else{var w=p.length/2-1,C=w-2;u=p[w]-p[C],c=p[w+1]-p[C+1]}}else if(a||o||l){var p=e.allpts,x=e.ctrlpts,k,E,_,S;if(x.length/2%2===0){var T=p.length/2-1,N=T+2,B=N+2;k=bt(p[T],p[N],p[B],0),E=bt(p[T+1],p[N+1],p[B+1],0),_=bt(p[T],p[N],p[B],1e-4),S=bt(p[T+1],p[N+1],p[B+1],1e-4)}else{var N=p.length/2-1,T=N-2,B=N+2;k=bt(p[T],p[N],p[B],.4999),E=bt(p[T+1],p[N+1],p[B+1],.4999),_=bt(p[T],p[N],p[B],.5),S=bt(p[T+1],p[N+1],p[B+1],.5)}u=_-k,c=S-E}if(e.midtgtArrowAngle=Es(u,c),e.midDispX=u,e.midDispY=c,u*=-1,c*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var w=p.length/2-1,A=w+2;u=-(p[A]-p[w]),c=-(p[A+1]-p[w+1])}}}if(e.midsrcArrowAngle=Es(u,c),i)u=h-e.segpts[e.segpts.length-2],c=v-e.segpts[e.segpts.length-1];else if(a||o||l||n){var p=e.allpts,D=p.length,g=bt(p[D-6],p[D-4],p[D-2],.9),y=bt(p[D-5],p[D-3],p[D-1],.9);u=h-g,c=v-y}else u=h-m,c=v-b;e.tgtArrowAngle=Es(u,c)},tl.getArrowWidth=tl.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var bu,wu,Dr={},ir={},$1,V1,sa,rl,Qr,la,ca,Ar,ai,nl,q1,z1,Cu,Eu,H1,K1=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},p3=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},v3=function(e,r,n,a,i){if(e!==H1?K1(r,e,Dr):p3(ir,Dr),K1(r,n,ir),$1=Dr.nx*ir.ny-Dr.ny*ir.nx,V1=Dr.nx*ir.nx-Dr.ny*-ir.ny,Qr=Math.asin(Math.max(-1,Math.min(1,$1))),Math.abs(Qr)<1e-6){bu=r.x,wu=r.y,ca=ai=0;return}sa=1,rl=!1,V1<0?Qr<0?Qr=Math.PI+Qr:(Qr=Math.PI-Qr,sa=-1,rl=!0):Qr>0&&(sa=-1,rl=!0),r.radius!==void 0?ai=r.radius:ai=a,la=Qr/2,nl=Math.min(Dr.len/2,ir.len/2),i?(Ar=Math.abs(Math.cos(la)*ai/Math.sin(la)),Ar>nl?(Ar=nl,ca=Math.abs(Ar*Math.sin(la)/Math.cos(la))):ca=ai):(Ar=Math.min(nl,ai),ca=Math.abs(Ar*Math.sin(la)/Math.cos(la))),Cu=r.x+ir.nx*Ar,Eu=r.y+ir.ny*Ar,bu=Cu-ir.ny*ca*sa,wu=Eu+ir.nx*ca*sa,q1=r.x+Dr.nx*Ar,z1=r.y+Dr.ny*Ar,H1=r};function G1(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function xu(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(v3(t,e,r,n,a),{cx:bu,cy:wu,radius:ca,startX:q1,startY:z1,stopX:Cu,stopY:Eu,startAngle:Dr.ang+Math.PI/2*sa,endAngle:ir.ang-Math.PI/2*sa,counterClockwise:rl})}var Rt={};Rt.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),u=o.units!=null&&l.units!=null,c=function(x,k,E,_){var S=_-k,T=E-x,N=Math.sqrt(T*T+S*S);return{x:-S/N,y:T/N}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(u){var f=this.manualEndptToPx(t.source()[0],o),h=vr(f,2),v=h[0],p=h[1],g=this.manualEndptToPx(t.target()[0],l),y=vr(g,2),m=y[0],b=y[1],w={x1:v,y1:p,x2:m,y2:b};a=c(v,p,m,b),i=w}else $e("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}},Rt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,l=n.target,u=o.position(),c=l.position(),d=o.width(),f=l.width(),h=o.height(),v=l.height(),p=r.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*d*g+u.x,a.source.y*h*g+u.y,a.target.x*f*g+c.x,a.target.y*v*g+c.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},Rt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),l=Math.min(n.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],c=o.pfValue[o.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var d=0;d<l;d++){var f=n.pfValue[d],h=a.pfValue[d],v=1-f,p=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*p,y:y.y1*v+y.y2*p};r.segpts.push(b.x+m.x*h,b.y+m.y*h),r.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:u),r.isArcRadius.push((o.pfValue[d]!==void 0?o.pfValue[d]:c)==="arc-radius")}},Rt.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,o=e.srcPos,l=t.pstyle("control-point-distances"),u=l?l.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=r,v=f;n&&(h=0,v=u);var p=c-Math.PI/2,g=p-d/2,y=p+d/2,m=c+"_"+d;h=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[o.x+Math.cos(g)*1.4*v*(h/3+1),o.y+Math.sin(g)*1.4*v*(h/3+1),o.x+Math.cos(y)*1.4*v*(h/3+1),o.y+Math.sin(y)*1.4*v*(h/3+1)]},Rt.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,l=e.srcW,u=e.srcH,c=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,h=t.pstyle("control-point-distances"),v=h?h.pfValue[0]:void 0,p=r,g=f;n&&(p=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-u/2},b={x:o.x-c/2,y:o.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,x=Math.max(C,Math.log(l*.01)),k=Math.max(C,Math.log(c*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*x,w.x-(1+Math.pow(y,1.12)/100)*g*(p/3+1)*k,w.y]},Rt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},Rt.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),c=l&&u?Math.min(l.value.length,u.value.length):1,d=l?l.pfValue[0]:void 0,f=u.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<c;v++){var p=(.5-e.eles.length/2+r)*o*(a?-1:1),g=void 0,y=rb(p);h&&(d=l?l.pfValue[v]:o,f=u.value[v]),n?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:p,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),x=C.midptPts,k=C.vectorNormInverse,E={x:x.x1*b+x.x2*w,y:x.y1*b+x.y2*w};i.ctrlpts.push(E.x+k.x*m,E.y+k.y*m)}},Rt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",l="downward",u="upward",c="auto",d=e.posPts,f=e.srcW,h=e.srcH,v=e.tgtW,p=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",x=w.pfValue,k=x<0,E=t.pstyle("taxi-turn-min-distance").pfValue,_=y?(f+v)/2:0,S=y?(h+p)/2:0,T=d.x2-d.x1,N=d.y2-d.y1,B=function(me,be){return me>0?Math.max(me-be,0):Math.min(me+be,0)},A=B(T,_),D=B(N,S),R=!1;b===c?m=Math.abs(A)>Math.abs(D)?a:n:b===u||b===l?(m=n,R=!0):(b===i||b===o)&&(m=a,R=!0);var O=m===n,M=O?D:A,P=O?N:T,z=rb(P),W=!1;!(R&&(C||k))&&(b===l&&P<0||b===u&&P>0||b===i&&P>0||b===o&&P<0)&&(z*=-1,M=z*Math.abs(M),W=!0);var H;if(C){var G=x<0?1+x:x;H=G*M}else{var X=x<0?M:0;H=X+x*z}var F=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(M)},V=F(H),q=F(Math.abs(M)-Math.abs(H)),$=V||q;if($&&!W)if(O){var K=Math.abs(P)<=h/2,L=Math.abs(T)<=v/2;if(K){var j=(d.x1+d.x2)/2,Y=d.y1,se=d.y2;r.segpts=[j,Y,j,se]}else if(L){var ce=(d.y1+d.y2)/2,ae=d.x1,ne=d.x2;r.segpts=[ae,ce,ne,ce]}else r.segpts=[d.x1,d.y2]}else{var ue=Math.abs(P)<=f/2,ie=Math.abs(N)<=p/2;if(ue){var fe=(d.y1+d.y2)/2,pe=d.x1,Ae=d.x2;r.segpts=[pe,fe,Ae,fe]}else if(ie){var Ie=(d.x1+d.x2)/2,we=d.y1,ke=d.y2;r.segpts=[Ie,we,Ie,ke]}else r.segpts=[d.x2,d.y1]}else if(O){var re=d.y1+H+(y?h/2*z:0),I=d.x1,U=d.x2;r.segpts=[I,re,U,re]}else{var te=d.x1+H+(y?f/2*z:0),Z=d.y1,J=d.y2;r.segpts=[te,Z,te,J]}if(r.isRound){var le=t.pstyle("taxi-radius").value,ee=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(le),r.isArcRadius=new Array(r.segpts.length/2).fill(ee)}},Rt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,l=e.tgtW,u=e.tgtH,c=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,h=e.tgtCornerRadius,v=e.srcRs,p=e.tgtRs,g=!de(r.startX)||!de(r.startY),y=!de(r.arrowStartX)||!de(r.arrowStartY),m=!de(r.endX)||!de(r.endY),b=!de(r.arrowEndX)||!de(r.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,x=w*C,k=Qn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=k<x,_=Qn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=_<x,T=!1;if(g||y||E){T=!0;var N={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(N.x*N.x+N.y*N.y),A={x:N.x/B,y:N.y/B},D=Math.max(i,o),R={x:r.ctrlpts[0]+A.x*2*D,y:r.ctrlpts[1]+A.y*2*D},O=c.intersectLine(n.x,n.y,i,o,R.x,R.y,0,f,v);E?(r.ctrlpts[0]=r.ctrlpts[0]+A.x*(x-k),r.ctrlpts[1]=r.ctrlpts[1]+A.y*(x-k)):(r.ctrlpts[0]=O[0]+A.x*x,r.ctrlpts[1]=O[1]+A.y*x)}if(m||b||S){T=!0;var M={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},P=Math.sqrt(M.x*M.x+M.y*M.y),z={x:M.x/P,y:M.y/P},W=Math.max(i,o),H={x:r.ctrlpts[0]+z.x*2*W,y:r.ctrlpts[1]+z.y*2*W},G=d.intersectLine(a.x,a.y,l,u,H.x,H.y,0,h,p);S?(r.ctrlpts[0]=r.ctrlpts[0]+z.x*(x-_),r.ctrlpts[1]=r.ctrlpts[1]+z.y*(x-_)):(r.ctrlpts[0]=G[0]+z.x*x,r.ctrlpts[1]=G[1]+z.y*x)}T&&this.findEndpoints(t)}},Rt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=bt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=bt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(xu({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,l))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,c=u-2;e.midX=(e.segpts[c]+e.segpts[u])/2,e.midY=(e.segpts[c+1]+e.segpts[u+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},h=e.roundCorners[d/2],v=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*p}),e.midX=h.cx+v[0],e.midY=h.cy+v[1],e.midVector=v}}}},Rt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||de(e.startX)&&de(e.startY)&&de(e.endX)&&de(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,$e("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Rt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new Ir,get:function(E){var _=this.map.get(E[0]);return _!=null?_.get(E[1]):null},set:function(E,_){var S=this.map.get(E[0]);S==null&&(S=new Ir,this.map.set(E[0],S)),S.set(E[1],_)}},o=[],l=[],u=0;u<t.length;u++){var c=t[u],d=c._private,f=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(f==="haystack"){l.push(c);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",p=d.source,g=d.target,y=p.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),o.push(b)),w.eles.push(c),h&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(E){var _=o[E],S=i.get(_),T=void 0;if(!S.hasUnbundled){var N=S.eles[0].parallelEdges().filter(function(te){return te.isBundledBezier()});zc(S.eles),N.forEach(function(te){return S.eles.push(te)}),S.eles.sort(function(te,Z){return te.poolIndex()-Z.poolIndex()})}var B=S.eles[0],A=B.source(),D=B.target();if(A.poolIndex()>D.poolIndex()){var R=A;A=D,D=R}var O=S.srcPos=A.position(),M=S.tgtPos=D.position(),P=S.srcW=A.outerWidth(),z=S.srcH=A.outerHeight(),W=S.tgtW=D.outerWidth(),H=S.tgtH=D.outerHeight(),G=S.srcShape=r.nodeShapes[e.getNodeShape(A)],X=S.tgtShape=r.nodeShapes[e.getNodeShape(D)],F=S.srcCornerRadius=A.pstyle("corner-radius").value==="auto"?"auto":A.pstyle("corner-radius").pfValue,V=S.tgtCornerRadius=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,q=S.tgtRs=D._private.rscratch,$=S.srcRs=A._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var K=0;K<S.eles.length;K++){var L=S.eles[K],j=L[0]._private.rscratch,Y=L.pstyle("curve-style").value,se=Y==="unbundled-bezier"||Y.endsWith("segments")||Y.endsWith("taxi"),ce=!A.same(L.source());if(!S.calculatedIntersection&&A!==D&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var ae=G.intersectLine(O.x,O.y,P,z,M.x,M.y,0,F,$),ne=S.srcIntn=ae,ue=X.intersectLine(M.x,M.y,W,H,O.x,O.y,0,V,q),ie=S.tgtIntn=ue,fe=S.intersectionPts={x1:ae[0],x2:ue[0],y1:ae[1],y2:ue[1]},pe=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ae=ue[1]-ae[1],Ie=ue[0]-ae[0],we=Math.sqrt(Ie*Ie+Ae*Ae),ke=S.vector={x:Ie,y:Ae},re=S.vectorNorm={x:ke.x/we,y:ke.y/we},I={x:-re.y,y:re.x};S.nodesOverlap=!de(we)||X.checkPoint(ae[0],ae[1],0,W,H,M.x,M.y,V,q)||G.checkPoint(ue[0],ue[1],0,P,z,O.x,O.y,F,$),S.vectorNormInverse=I,T={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:M,tgtPos:O,srcW:W,srcH:H,tgtW:P,tgtH:z,srcIntn:ie,tgtIntn:ne,srcShape:X,tgtShape:G,posPts:{x1:pe.x2,y1:pe.y2,x2:pe.x1,y2:pe.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-ke.x,y:-ke.y},vectorNorm:{x:-re.x,y:-re.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var U=ce?T:S;j.nodesOverlap=U.nodesOverlap,j.srcIntn=U.srcIntn,j.tgtIntn=U.tgtIntn,j.isRound=Y.startsWith("round"),a&&(A.isParent()||A.isChild()||D.isParent()||D.isChild())&&(A.parents().anySame(D)||D.parents().anySame(A)||A.same(D)&&A.isParent())?e.findCompoundLoopPoints(L,U,K,se):A===D?e.findLoopPoints(L,U,K,se):Y.endsWith("segments")?e.findSegmentsPoints(L,U):Y.endsWith("taxi")?e.findTaxiPoints(L,U):Y==="straight"||!se&&S.eles.length%2===1&&K===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(L):e.findBezierPoints(L,U,K,se,ce),e.findEndpoints(L),e.tryToCorrectInvalidPoints(L,U),e.checkForInvalidEdgeWarning(L),e.storeAllpts(L),e.storeEdgeProjections(L),e.calculateArrowAngles(L),e.recalculateEdgeLabelProjections(L),e.calculateLabelAngles(L)}},x=0;x<o.length;x++)C(x);this.findHaystackPoints(l)}};function U1(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}Rt.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),U1(e.segpts)},Rt.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),U1(e.ctrlpts)},Rt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var mo={};mo.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=n.x,l[1]+=n.y,l}else{var u=e.pfValue[0];u=-Math.PI/2+u;var c=2*Math.max(a,i),d=[n.x+Math.cos(u)*c,n.y+Math.sin(u)*c];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}},mo.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),o=a.position(),l=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,c=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=n._private.rscratch,h=a._private.rscratch,v=t.pstyle("curve-style").value,p=t._private.rscratch,g=p.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",x=g==="segments",k=b||w||C,E=m||y,_=t.pstyle("source-endpoint"),S=E?"outside-to-node":_.value,T=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,N=t.pstyle("target-endpoint"),B=E?"outside-to-node":N.value,A=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=_,p.tgtManEndpt=N;var D,R,O,M;if(b){var P=[p.ctrlpts[0],p.ctrlpts[1]],z=w?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:P;D=z,R=P}else if(C){var W=x?p.segpts.slice(0,2):[o.x,o.y],H=x?p.segpts.slice(p.segpts.length-2):[i.x,i.y];D=H,R=W}if(B==="inside-to-node")r=[o.x,o.y];else if(N.units)r=this.manualEndptToPx(a,N);else if(B==="outside-to-line")r=p.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?O=D:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(O=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,A,h),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var G=a._private.rscratch,X=G.labelWidth,F=G.labelHeight,V=G.labelX,q=G.labelY,$=X/2,K=F/2,L=a.pstyle("text-valign").value;L==="top"?q-=K:L==="bottom"&&(q+=K);var j=a.pstyle("text-halign").value;j==="left"?V-=$:j==="right"&&(V+=$);var Y=ro(O[0],O[1],[V-$,q-K,V+$,q-K,V+$,q+K,V-$,q+K],o.x,o.y);if(Y.length>0){var se=i,ce=ea(se,Va(r)),ae=ea(se,Va(Y)),ne=ce;if(ae<ce&&(r=Y,ne=ae),Y.length>2){var ue=ea(se,{x:Y[2],y:Y[3]});ue<ne&&(r=[Y[2],Y[3]])}}}var ie=Ts(r,D,e.arrowShapes[l].spacing(t)+c),fe=Ts(r,D,e.arrowShapes[l].gap(t)+c);if(p.endX=fe[0],p.endY=fe[1],p.arrowEndX=ie[0],p.arrowEndY=ie[1],S==="inside-to-node")r=[i.x,i.y];else if(_.units)r=this.manualEndptToPx(n,_);else if(S==="outside-to-line")r=p.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?M=R:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(M=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),M[0],M[1],0,T,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var pe=n._private.rscratch,Ae=pe.labelWidth,Ie=pe.labelHeight,we=pe.labelX,ke=pe.labelY,re=Ae/2,I=Ie/2,U=n.pstyle("text-valign").value;U==="top"?ke-=I:U==="bottom"&&(ke+=I);var te=n.pstyle("text-halign").value;te==="left"?we-=re:te==="right"&&(we+=re);var Z=ro(M[0],M[1],[we-re,ke-I,we+re,ke-I,we+re,ke+I,we-re,ke+I],i.x,i.y);if(Z.length>0){var J=o,le=ea(J,Va(r)),ee=ea(J,Va(Z)),oe=le;if(ee<le&&(r=[Z[0],Z[1]],oe=ee),Z.length>2){var me=ea(J,{x:Z[2],y:Z[3]});me<oe&&(r=[Z[2],Z[3]])}}}var be=Ts(r,R,e.arrowShapes[u].spacing(t)+d),ye=Ts(r,R,e.arrowShapes[u].gap(t)+d);p.startX=ye[0],p.startY=ye[1],p.arrowStartX=be[0],p.arrowStartY=be[1],k&&(!de(p.startX)||!de(p.startY)||!de(p.endX)||!de(p.endY)?p.badLine=!0:p.badLine=!1)},mo.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},mo.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var ku={};function g3(t,e,r){for(var n=function(c,d,f,h){return bt(c,d,f,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var l=t.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],l),y:n(r[1],r[3],r[5],l)})}}ku.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)g3(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},ku.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Or={};Or.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!yn(e)){var r,n,a=t._private,i=t.width(),o=t.height(),l=t.padding(),u=t.position(),c=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(c){case"left":r=u.x-i/2-l;break;case"right":r=u.x+i/2+l;break;default:r=u.x}switch(d){case"top":n=u.y-o/2-l;break;case"bottom":n=u.y+o/2+l;break;default:n=u.y}f.labelX=r,f.labelY=n,h.labelX=r,h.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var W1=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},j1=function(e,r){var n=r.x-e.x,a=r.y-e.y;return W1(n,a)},m3=function(e,r,n,a){var i=eo(0,a-.001,1),o=eo(0,a+.001,1),l=qa(e,r,n,i),u=qa(e,r,n,o);return j1(l,u)};Or.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var o=function(f,h,v){Cn(r.rscratch,f,h,v),Cn(r.rstyle,f,h,v)};o("labelX",null,e.x),o("labelY",null,e.y);var l=W1(n.midDispX,n.midDispY);o("labelAutoAngle",null,l);var u=function d(){if(d.cache)return d.cache;for(var f=[],h=0;h+5<n.allpts.length;h+=4){var v={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},g={x:n.allpts[h+4],y:n.allpts[h+5]};f.push({p0:v,p1:p,p2:g,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(E,_,S,T,N){var B=Qn(_,S),A=E.segments[E.segments.length-1],D={p0:_,p1:S,t0:T,t1:N,startDist:A?A.startDist+A.length:0,length:B};E.segments.push(D),E.length+=B}for(var w=0;w<f.length;w++){var C=f[w],x=f[w-1];x&&(C.startDist=x.startDist+x.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var k=0;k<m-1;k++)b(C,y[w*m+k],y[w*m+k+1],a.bezierProjPcts[k],a.bezierProjPcts[k+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},c=function(f){var h,v=f==="source";if(i[f]){var p=t.pstyle(f+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=u(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],x=0;x<C.segments.length;x++){var k=C.segments[v?x:C.segments.length-1-x],E=w===g.length-1&&x===C.segments.length-1;if(m=b,b+=k.length,b>=p||E){y={cp:C,segment:k};break}}if(y)break}var _=y.cp,S=y.segment,T=(p-m)/S.length,N=S.t1-S.t0,B=v?S.t0+N*T:S.t1-N*T;B=eo(0,B,1),e=qa(_.p0,_.p1,_.p2,B),h=m3(_.p0,_.p1,_.p2,B);break}case"straight":case"segments":case"haystack":{for(var A=0,D,R,O,M,P=n.allpts.length,z=0;z+3<P&&(v?(O={x:n.allpts[z],y:n.allpts[z+1]},M={x:n.allpts[z+2],y:n.allpts[z+3]}):(O={x:n.allpts[P-2-z],y:n.allpts[P-1-z]},M={x:n.allpts[P-4-z],y:n.allpts[P-3-z]}),D=Qn(O,M),R=A,A+=D,!(A>=p));z+=2);var W=p-R,H=W/D;H=eo(0,H,1),e=E5(O,M,H),h=j1(O,M);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,h)}};c("source"),c("target"),this.applyLabelDimensions(t)}},Or.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Or.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,l=gr(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(l.length,1),c=a.height/u,d=c*i,f=a.width,h=a.height+(u-1)*(i-1)*c;Cn(r.rstyle,"labelWidth",e,f),Cn(r.rscratch,"labelWidth",e,f),Cn(r.rstyle,"labelHeight",e,h),Cn(r.rscratch,"labelHeight",e,h),Cn(r.rscratch,"labelLineHeight",e,d)},Or.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,o=function(X,F){return F?(Cn(r.rscratch,X,e,F),F):gr(r.rscratch,X,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var c="​",d=a.split(`
42
+ `),f=t.pstyle("text-max-width").pfValue,h=t.pstyle("text-overflow-wrap").value,v=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(c);m=C}if(w>f){var x=m.matchAll(g),k="",E=0,_=I0(x),S;try{for(_.s();!(S=_.n()).done;){var T=S.value,N=T[0],B=m.substring(E,T.index);E=T.index+N.length;var A=k.length===0?B:k+B+N,D=this.calculateLabelDimensions(t,A),R=D.width;R<=f?k+=B+N:(k&&p.push(k),k=B+N)}}catch(G){_.e(G)}finally{_.f()}k.match(/^[\s\u200b]+$/)||p.push(k)}else p.push(m)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
43
+ `)),o("labelWrapKey",u)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,M="",P="…",z=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var W=0;W<a.length;W++){var H=this.calculateLabelDimensions(t,M+a[W]+P).width;if(H>O)break;M+=a[W],W===a.length-1&&(z=!0)}return z||(M+=P),M}return a},Or.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Or.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=Jn(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),l=o[i];if(l!=null)return l;var u=0,c=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,h=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(c," ").concat(h," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
44
+ `),w=0;w<b.length;w++){var C=b[w],x=p.measureText(C),k=Math.ceil(x.width),E=d;y=Math.max(k,y),m+=E}return y+=u,m+=u,o[i]={width:y,height:m}},Or.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=o.strValue;return l==="none"?0:a&&l==="autorotate"?n.labelAutoAngle:l==="autorotate"?0:o.pfValue},Or.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Y1={},Z1=28,X1=!1;Y1.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Z1||t.height()<Z1))return X1||($e("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),X1=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var al={};al.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),l)for(var u=0;u<o.length;u++){var c=o[u],d=c._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var l=o.target;n(l)}).on("style.* background.*",function(o){var l=o.target;n(l,!1)});var a=function(o){if(o){var l=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var c=e[u],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(n(c.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var h=l[f];h(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},al.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},al.recalculateRenderedStyle=function(t,e){var r=function(C){return C._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],l=o._private,u=l.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(o):n.push(o),u.clean=!0)}for(var c=0;c<a.length;c++){var d=a[c],f=d._private,h=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),h.nodeX=v.x,h.nodeY=v.y,h.nodeW=d.pstyle("width").pfValue,h.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var g=n[p],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var il={};il.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}},il.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},il.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(h1),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var J1={};[oa,tl,Rt,mo,ku,Or,Y1,al,il].forEach(function(t){Te(J1,t)});var Q1={};Q1.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var l="data:",u=t.substring(0,l.length).toLowerCase()===l;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ii={};ii.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},ii.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||zM(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var o=function(u,c,d){var f=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:o,addEventListener:o,addListener:o,bind:o}},ii.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},ii.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},ii.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},n=function(I,U,te,Z){I==null&&(I=t.cy);for(var J=0;J<U.length;J++){var le=U[J];I.emit({originalEvent:te,type:le,position:Z})}},a=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},i=function(I,U){var te=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var Z=0;U&&Z<U.length;Z++){var I=U[Z];if(I.isNode()&&I.isParent()&&!I.pannable()){te=!1;break}}else te=!0;return te},o=function(I){I[0]._private.grabbed=!0},l=function(I){I[0]._private.grabbed=!1},u=function(I){I[0]._private.rscratch.inDragLayer=!0},c=function(I){I[0]._private.rscratch.inDragLayer=!1},d=function(I){I[0]._private.rscratch.isGrabTarget=!0},f=function(I){I[0]._private.rscratch.isGrabTarget=!1},h=function(I,U){var te=U.addToList,Z=te.has(I);!Z&&I.grabbable()&&!I.locked()&&(te.merge(I),o(I))},v=function(I,U){if(I.cy().hasCompoundNodes()&&!(U.inDragLayer==null&&U.addToList==null)){var te=I.descendants();U.inDragLayer&&(te.forEach(u),te.connectedEdges().forEach(u)),U.addToList&&h(te,U)}},p=function(I,U){U=U||{};var te=I.cy().hasCompoundNodes();U.inDragLayer&&(I.forEach(u),I.neighborhood().stdFilter(function(Z){return!te||Z.isEdge()}).forEach(u)),U.addToList&&I.forEach(function(Z){h(Z,U)}),v(I,U),m(I,{inDragLayer:U.inDragLayer}),t.updateCachedGrabbedEles()},g=p,y=function(I){I&&(t.getCachedZSortedEles().forEach(function(U){l(U),c(U),f(U)}),t.updateCachedGrabbedEles())},m=function(I,U){if(!(U.inDragLayer==null&&U.addToList==null)&&I.cy().hasCompoundNodes()){var te=I.ancestors().orphans();if(!te.same(I)){var Z=te.descendants().spawnSelf().merge(te).unmerge(I).unmerge(I.descendants()),J=Z.connectedEdges();U.inDragLayer&&(J.forEach(u),Z.forEach(u)),U.addToList&&Z.forEach(function(le){h(le,U)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(re){for(var I=0;I<re.length;I++){var U=re[I],te=U.removedNodes;if(te)for(var Z=0;Z<te.length;Z++){var J=te[Z];if(J===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(re){t.destroy()});var x=gs(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(x),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",x),C&&(t.resizeObserver=new ResizeObserver(x),t.resizeObserver.observe(t.container));var k=function(I,U){for(;I!=null;)U(I),I=I.parentNode},E=function(){t.invalidateContainerClientCoordsCache()};k(t.container,function(re){t.registerBinding(re,"transitionend",E),t.registerBinding(re,"animationend",E),t.registerBinding(re,"scroll",E)}),t.registerBinding(t.container,"contextmenu",function(re){re.preventDefault()});var _=function(){return t.selection[4]!==0},S=function(I){for(var U=t.findContainerClientCoords(),te=U[0],Z=U[1],J=U[2],le=U[3],ee=I.touches?I.touches:[I],oe=!1,me=0;me<ee.length;me++){var be=ee[me];if(te<=be.clientX&&be.clientX<=te+J&&Z<=be.clientY&&be.clientY<=Z+le){oe=!0;break}}if(!oe)return!1;for(var ye=t.container,Ne=I.target,ge=Ne.parentNode,Ce=!1;ge;){if(ge===ye){Ce=!0;break}ge=ge.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(I){if(S(I)&&!(t.hoverData.which===1&&I.which!==1)){I.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=I.which;var U=t.cy,te=[I.clientX,I.clientY],Z=t.projectIntoViewport(te[0],te[1]),J=t.selection,le=t.findNearestElements(Z[0],Z[1],!0,!1),ee=le[0],oe=t.dragData.possibleDragElements;t.hoverData.mdownPos=Z,t.hoverData.mdownGPos=te;var me=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var We=t.hoverData.down;We?We.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}}):U.emit({originalEvent:I,type:"taphold",position:{x:Z[0],y:Z[1]}})}},t.tapholdDuration)};if(I.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:I,type:"cxttapstart",position:{x:Z[0],y:Z[1]}};ee?(ee.activate(),ee.emit(be),t.hoverData.down=ee):U.emit(be),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(I.which==1){ee&&ee.activate();{if(ee!=null&&t.nodeIsGrabbable(ee)){var ye=function(We){return{originalEvent:I,type:We,position:{x:Z[0],y:Z[1]}}},Ne=function(We){We.emit(ye("grab"))};if(d(ee),!ee.selected())oe=t.dragData.possibleDragElements=U.collection(),g(ee,{addToList:oe}),ee.emit(ye("grabon")).emit(ye("grab"));else{oe=t.dragData.possibleDragElements=U.collection();var ge=U.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});p(ge,{addToList:oe}),ee.emit(ye("grabon")),ge.forEach(Ne)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ee,t.hoverData.downs=le,t.hoverData.downTime=new Date().getTime()}n(ee,["mousedown","tapstart","vmousedown"],I,{x:Z[0],y:Z[1]}),ee==null?(J[4]=1,t.data.bgActivePosistion={x:Z[0],y:Z[1]},t.redrawHint("select",!0),t.redraw()):ee.pannable()&&(J[4]=1),me()}J[0]=J[2]=Z[0],J[1]=J[3]=Z[1]}},!1),t.registerBinding(e,"mousemove",function(I){var U=t.hoverData.capture;if(!(!U&&!S(I))){var te=!1,Z=t.cy,J=Z.zoom(),le=[I.clientX,I.clientY],ee=t.projectIntoViewport(le[0],le[1]),oe=t.hoverData.mdownPos,me=t.hoverData.mdownGPos,be=t.selection,ye=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ye=t.findNearestElement(ee[0],ee[1],!0,!1));var Ne=t.hoverData.last,ge=t.hoverData.down,Ce=[ee[0]-be[2],ee[1]-be[3]],We=t.dragData.possibleDragElements,qe;if(me){var st=le[0]-me[0],lt=st*st,rt=le[1]-me[1],Lt=rt*rt,mt=lt+Lt;t.hoverData.isOverThresholdDrag=qe=mt>=t.desktopTapThreshold2}var wt=a(I);qe&&(t.hoverData.tapholdCancelled=!0);var Jt=function(){var Q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Q.length===0?(Q.push(Ce[0]),Q.push(Ce[1])):(Q[0]+=Ce[0],Q[1]+=Ce[1])};te=!0,n(ye,["mousemove","vmousemove","tapdrag"],I,{x:ee[0],y:ee[1]});var Mt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:ee[0],y:ee[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(qe){var Ft={originalEvent:I,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};ge?ge.emit(Ft):Z.emit(Ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),t.hoverData.cxtOver=ye,ye&&ye.emit({originalEvent:I,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}}else if(t.hoverData.dragging){if(te=!0,Z.panningEnabled()&&Z.userPanningEnabled()){var lr;if(t.hoverData.justStartedPan){var Cr=t.hoverData.mdownPos;lr={x:(ee[0]-Cr[0])*J,y:(ee[1]-Cr[1])*J},t.hoverData.justStartedPan=!1}else lr={x:Ce[0]*J,y:Ce[1]*J};Z.panBy(lr),Z.emit("dragpan"),t.hoverData.dragged=!0}ee=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(ge==null||ge.pannable())){if(qe){if(!t.hoverData.dragging&&Z.boxSelectionEnabled()&&(wt||!Z.panningEnabled()||!Z.userPanningEnabled()))Mt();else if(!t.hoverData.selecting&&Z.panningEnabled()&&Z.userPanningEnabled()){var jt=i(ge,t.hoverData.downs);jt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=Va(oe),t.redrawHint("select",!0),t.redraw())}ge&&ge.pannable()&&ge.active()&&ge.unactivate()}}else{if(ge&&ge.pannable()&&ge.active()&&ge.unactivate(),(!ge||!ge.grabbed())&&ye!=Ne&&(Ne&&n(Ne,["mouseout","tapdragout"],I,{x:ee[0],y:ee[1]}),ye&&n(ye,["mouseover","tapdragover"],I,{x:ee[0],y:ee[1]}),t.hoverData.last=ye),ge)if(qe){if(Z.boxSelectionEnabled()&&wt)ge&&ge.grabbed()&&(y(We),ge.emit("freeon"),We.emit("free"),t.dragData.didDrag&&(ge.emit("dragfreeon"),We.emit("dragfree"))),Mt();else if(ge&&ge.grabbed()&&t.nodeIsDraggable(ge)){var nt=!t.dragData.didDrag;nt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(We,{inDragLayer:!0});var ct={x:0,y:0};if(de(Ce[0])&&de(Ce[1])&&(ct.x+=Ce[0],ct.y+=Ce[1],nt)){var Ct=t.hoverData.dragDelta;Ct&&de(Ct[0])&&de(Ct[1])&&(ct.x+=Ct[0],ct.y+=Ct[1])}t.hoverData.draggingEles=!0,We.silentShift(ct).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Jt();te=!0}if(be[2]=ee[0],be[3]=ee[1],te)return I.stopPropagation&&I.stopPropagation(),I.preventDefault&&I.preventDefault(),!1}},!1);var T,N,B;t.registerBinding(e,"mouseup",function(I){if(!(t.hoverData.which===1&&I.which!==1&&t.hoverData.capture)){var U=t.hoverData.capture;if(U){t.hoverData.capture=!1;var te=t.cy,Z=t.projectIntoViewport(I.clientX,I.clientY),J=t.selection,le=t.findNearestElement(Z[0],Z[1],!0,!1),ee=t.dragData.possibleDragElements,oe=t.hoverData.down,me=a(I);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,oe&&oe.unactivate(),t.hoverData.which===3){var be={originalEvent:I,type:"cxttapend",position:{x:Z[0],y:Z[1]}};if(oe?oe.emit(be):te.emit(be),!t.hoverData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:Z[0],y:Z[1]}};oe?oe.emit(ye):te.emit(ye)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(n(le,["mouseup","tapend","vmouseup"],I,{x:Z[0],y:Z[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(n(oe,["click","tap","vclick"],I,{x:Z[0],y:Z[1]}),N=!1,I.timeStamp-B<=te.multiClickDebounceTime()?(T&&clearTimeout(T),N=!0,B=null,n(oe,["dblclick","dbltap","vdblclick"],I,{x:Z[0],y:Z[1]})):(T=setTimeout(function(){N||n(oe,["oneclick","onetap","voneclick"],I,{x:Z[0],y:Z[1]})},te.multiClickDebounceTime()),B=I.timeStamp)),oe==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(I)&&(te.$(r).unselect(["tapunselect"]),ee.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ee=te.collection()),le==oe&&!t.dragData.didDrag&&!t.hoverData.selecting&&le!=null&&le._private.selectable&&(t.hoverData.dragging||(te.selectionType()==="additive"||me?le.selected()?le.unselect(["tapunselect"]):le.select(["tapselect"]):me||(te.$(r).unmerge(le).unselect(["tapunselect"]),le.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ne=te.collection(t.getAllInBox(J[0],J[1],J[2],J[3]));t.redrawHint("select",!0),Ne.length>0&&t.redrawHint("eles",!0),te.emit({type:"boxend",originalEvent:I,position:{x:Z[0],y:Z[1]}});var ge=function(qe){return qe.selectable()&&!qe.selected()};te.selectionType()==="additive"||me||te.$(r).unmerge(Ne).unselect(),Ne.emit("box").stdFilter(ge).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!J[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ce=oe&&oe.grabbed();y(ee),Ce&&(oe.emit("freeon"),ee.emit("free"),t.dragData.didDrag&&(oe.emit("dragfreeon"),ee.emit("dragfree")))}}J[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var A=function(I){if(!t.scrollingPage){var U=t.cy,te=U.zoom(),Z=U.pan(),J=t.projectIntoViewport(I.clientX,I.clientY),le=[J[0]*te+Z.x,J[1]*te+Z.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){I.preventDefault();return}if(U.panningEnabled()&&U.userPanningEnabled()&&U.zoomingEnabled()&&U.userZoomingEnabled()){I.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var ee;I.deltaY!=null?ee=I.deltaY/-250:I.wheelDeltaY!=null?ee=I.wheelDeltaY/1e3:ee=I.wheelDelta/1e3,ee=ee*t.wheelSensitivity;var oe=I.deltaMode===1;oe&&(ee*=33);var me=U.zoom()*Math.pow(10,ee);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),U.zoom({level:me,renderedPosition:{x:le[0],y:le[1]}}),U.emit(I.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",A,!0),t.registerBinding(e,"scroll",function(I){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(I){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||I.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(re){t.hasTouchStarted||A(re)},!0),t.registerBinding(t.container,"mouseout",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:U[0],y:U[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var U=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:U[0],y:U[1]}})},!1);var D,R,O,M,P,z,W,H,G,X,F,V,q,$=function(I,U,te,Z){return Math.sqrt((te-I)*(te-I)+(Z-U)*(Z-U))},K=function(I,U,te,Z){return(te-I)*(te-I)+(Z-U)*(Z-U)},L;t.registerBinding(t.container,"touchstart",L=function(I){if(t.hasTouchStarted=!0,!!S(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var U=t.cy,te=t.touchData.now,Z=t.touchData.earlier;if(I.touches[0]){var J=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);te[0]=J[0],te[1]=J[1]}if(I.touches[1]){var J=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);te[2]=J[0],te[3]=J[1]}if(I.touches[2]){var J=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);te[4]=J[0],te[5]=J[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var le=t.findContainerClientCoords();G=le[0],X=le[1],F=le[2],V=le[3],D=I.touches[0].clientX-G,R=I.touches[0].clientY-X,O=I.touches[1].clientX-G,M=I.touches[1].clientY-X,q=0<=D&&D<=F&&0<=O&&O<=F&&0<=R&&R<=V&&0<=M&&M<=V;var ee=U.pan(),oe=U.zoom();P=$(D,R,O,M),z=K(D,R,O,M),W=[(D+O)/2,(R+M)/2],H=[(W[0]-ee.x)/oe,(W[1]-ee.y)/oe];var me=200,be=me*me;if(z<be&&!I.touches[2]){var ye=t.findNearestElement(te[0],te[1],!0,!0),Ne=t.findNearestElement(te[2],te[3],!0,!0);ye&&ye.isNode()?(ye.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=ye):Ne&&Ne.isNode()?(Ne.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start=Ne):U.emit({originalEvent:I,type:"cxttapstart",position:{x:te[0],y:te[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(I.touches[2])U.boxSelectionEnabled()&&I.preventDefault();else if(!I.touches[1]){if(I.touches[0]){var ge=t.findNearestElements(te[0],te[1],!0,!0),Ce=ge[0];if(Ce!=null&&(Ce.activate(),t.touchData.start=Ce,t.touchData.starts=ge,t.nodeIsGrabbable(Ce))){var We=t.dragData.touchDragEles=U.collection(),qe=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ce.selected()?(qe=U.$(function(mt){return mt.selected()&&t.nodeIsGrabbable(mt)}),p(qe,{addToList:We})):g(Ce,{addToList:We}),d(Ce);var st=function(wt){return{originalEvent:I,type:wt,position:{x:te[0],y:te[1]}}};Ce.emit(st("grabon")),qe?qe.forEach(function(mt){mt.emit(st("grab"))}):Ce.emit(st("grab"))}n(Ce,["touchstart","tapstart","vmousedown"],I,{x:te[0],y:te[1]}),Ce==null&&(t.data.bgActivePosistion={x:J[0],y:J[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&n(t.touchData.start,["taphold"],I,{x:te[0],y:te[1]})},t.tapholdDuration)}}if(I.touches.length>=1){for(var lt=t.touchData.startPosition=[null,null,null,null,null,null],rt=0;rt<te.length;rt++)lt[rt]=Z[rt]=te[rt];var Lt=I.touches[0];t.touchData.startGPosition=[Lt.clientX,Lt.clientY]}}},!1);var j;t.registerBinding(e,"touchmove",j=function(I){var U=t.touchData.capture;if(!(!U&&!S(I))){var te=t.selection,Z=t.cy,J=t.touchData.now,le=t.touchData.earlier,ee=Z.zoom();if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}var me=t.touchData.startGPosition,be;if(U&&I.touches[0]&&me){for(var ye=[],Ne=0;Ne<J.length;Ne++)ye[Ne]=J[Ne]-le[Ne];var ge=I.touches[0].clientX-me[0],Ce=ge*ge,We=I.touches[0].clientY-me[1],qe=We*We,st=Ce+qe;be=st>=t.touchTapThreshold2}if(U&&t.touchData.cxt){I.preventDefault();var lt=I.touches[0].clientX-G,rt=I.touches[0].clientY-X,Lt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,wt=K(lt,rt,Lt,mt),Jt=wt/z,Mt=150,Ft=Mt*Mt,lr=1.5,Cr=lr*lr;if(Jt>=Cr||wt>=Ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var jt={originalEvent:I,type:"cxttapend",position:{x:J[0],y:J[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(jt),t.touchData.start=null):Z.emit(jt)}}if(U&&t.touchData.cxt){var jt={originalEvent:I,type:"cxtdrag",position:{x:J[0],y:J[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(jt):Z.emit(jt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var nt=t.findNearestElement(J[0],J[1],!0,!0);(!t.touchData.cxtOver||nt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:J[0],y:J[1]}}),t.touchData.cxtOver=nt,nt&&nt.emit({originalEvent:I,type:"cxtdragover",position:{x:J[0],y:J[1]}}))}else if(U&&I.touches[2]&&Z.boxSelectionEnabled())I.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||Z.emit({originalEvent:I,type:"boxstart",position:{x:J[0],y:J[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,te[4]=1,!te||te.length===0||te[0]===void 0?(te[0]=(J[0]+J[2]+J[4])/3,te[1]=(J[1]+J[3]+J[5])/3,te[2]=(J[0]+J[2]+J[4])/3+1,te[3]=(J[1]+J[3]+J[5])/3+1):(te[2]=(J[0]+J[2]+J[4])/3,te[3]=(J[1]+J[3]+J[5])/3),t.redrawHint("select",!0),t.redraw();else if(U&&I.touches[1]&&!t.touchData.didSelect&&Z.zoomingEnabled()&&Z.panningEnabled()&&Z.userZoomingEnabled()&&Z.userPanningEnabled()){I.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ct=t.dragData.touchDragEles;if(ct){t.redrawHint("drag",!0);for(var Ct=0;Ct<ct.length;Ct++){var Pn=ct[Ct]._private;Pn.grabbed=!1,Pn.rscratch.inDragLayer=!1}}var Q=t.touchData.start,lt=I.touches[0].clientX-G,rt=I.touches[0].clientY-X,Lt=I.touches[1].clientX-G,mt=I.touches[1].clientY-X,he=$(lt,rt,Lt,mt),Oe=he/P;if(q){var He=lt-D,Fr=rt-R,Rn=Lt-O,vi=mt-M,an=(He+Rn)/2,cr=(Fr+vi)/2,Ln=Z.zoom(),Ig=Ln*Oe,Tl=Z.pan(),q_=H[0]*Ln+Tl.x,z_=H[1]*Ln+Tl.y,ZG={x:-Ig/Ln*(q_-Tl.x-an)+q_,y:-Ig/Ln*(z_-Tl.y-cr)+z_};if(Q&&Q.active()){var ct=t.dragData.touchDragEles;y(ct),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Q.unactivate().emit("freeon"),ct.emit("free"),t.dragData.didDrag&&(Q.emit("dragfreeon"),ct.emit("dragfree"))}Z.viewport({zoom:Ig,pan:ZG,cancelOnFailedZoom:!0}),Z.emit("pinchzoom"),P=he,D=lt,R=rt,O=Lt,M=mt,t.pinching=!0}if(I.touches[0]){var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}if(I.touches[1]){var oe=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);J[2]=oe[0],J[3]=oe[1]}if(I.touches[2]){var oe=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);J[4]=oe[0],J[5]=oe[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Er=t.touchData.start,Bg=t.touchData.last,nt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(nt=t.findNearestElement(J[0],J[1],!0,!0)),U&&Er!=null&&I.preventDefault(),U&&Er!=null&&t.nodeIsDraggable(Er))if(be){var ct=t.dragData.touchDragEles,H_=!t.dragData.didDrag;H_&&p(ct,{inDragLayer:!0}),t.dragData.didDrag=!0;var Do={x:0,y:0};if(de(ye[0])&&de(ye[1])&&(Do.x+=ye[0],Do.y+=ye[1],H_)){t.redrawHint("eles",!0);var xr=t.touchData.dragDelta;xr&&de(xr[0])&&de(xr[1])&&(Do.x+=xr[0],Do.y+=xr[1])}t.hoverData.draggingEles=!0,ct.silentShift(Do).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==le[0]&&t.touchData.startPosition[1]==le[1]&&t.redrawHint("eles",!0),t.redraw()}else{var xr=t.touchData.dragDelta=t.touchData.dragDelta||[];xr.length===0?(xr.push(ye[0]),xr.push(ye[1])):(xr[0]+=ye[0],xr[1]+=ye[1])}if(n(Er||nt,["touchmove","tapdrag","vmousemove"],I,{x:J[0],y:J[1]}),(!Er||!Er.grabbed())&&nt!=Bg&&(Bg&&Bg.emit({originalEvent:I,type:"tapdragout",position:{x:J[0],y:J[1]}}),nt&&nt.emit({originalEvent:I,type:"tapdragover",position:{x:J[0],y:J[1]}})),t.touchData.last=nt,U)for(var Ct=0;Ct<J.length;Ct++)J[Ct]&&t.touchData.startPosition[Ct]&&be&&(t.touchData.singleTouchMoved=!0);if(U&&(Er==null||Er.pannable())&&Z.panningEnabled()&&Z.userPanningEnabled()){var XG=i(Er,t.touchData.starts);XG&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Va(t.touchData.startPosition)),t.swipePanning?(Z.panBy({x:ye[0]*ee,y:ye[1]*ee}),Z.emit("dragpan")):be&&(t.swipePanning=!0,Z.panBy({x:ge*ee,y:We*ee}),Z.emit("dragpan"),Er&&(Er.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var oe=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);J[0]=oe[0],J[1]=oe[1]}}for(var Ne=0;Ne<J.length;Ne++)le[Ne]=J[Ne];U&&I.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Y;t.registerBinding(e,"touchcancel",Y=function(I){var U=t.touchData.start;t.touchData.capture=!1,U&&U.unactivate()});var se,ce,ae,ne;if(t.registerBinding(e,"touchend",se=function(I){var U=t.touchData.start,te=t.touchData.capture;if(te)I.touches.length===0&&(t.touchData.capture=!1),I.preventDefault();else return;var Z=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var J=t.cy,le=J.zoom(),ee=t.touchData.now,oe=t.touchData.earlier;if(I.touches[0]){var me=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);ee[0]=me[0],ee[1]=me[1]}if(I.touches[1]){var me=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);ee[2]=me[0],ee[3]=me[1]}if(I.touches[2]){var me=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);ee[4]=me[0],ee[5]=me[1]}U&&U.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:ee[0],y:ee[1]}},U?U.emit(be):J.emit(be),!t.touchData.cxtDragged){var ye={originalEvent:I,type:"cxttap",position:{x:ee[0],y:ee[1]}};U?U.emit(ye):J.emit(ye)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&J.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ne=J.collection(t.getAllInBox(Z[0],Z[1],Z[2],Z[3]));Z[0]=void 0,Z[1]=void 0,Z[2]=void 0,Z[3]=void 0,Z[4]=0,t.redrawHint("select",!0),J.emit({type:"boxend",originalEvent:I,position:{x:ee[0],y:ee[1]}});var ge=function(Ft){return Ft.selectable()&&!Ft.selected()};Ne.emit("box").stdFilter(ge).select().emit("boxselect"),Ne.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(U!=null&&U.unactivate(),I.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!I.touches[1]){if(!I.touches[0]){if(!I.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ce=t.dragData.touchDragEles;if(U!=null){var We=U._private.grabbed;y(Ce),t.redrawHint("drag",!0),t.redrawHint("eles",!0),We&&(U.emit("freeon"),Ce.emit("free"),t.dragData.didDrag&&(U.emit("dragfreeon"),Ce.emit("dragfree"))),n(U,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]}),U.unactivate(),t.touchData.start=null}else{var qe=t.findNearestElement(ee[0],ee[1],!0,!0);n(qe,["touchend","tapend","vmouseup","tapdragout"],I,{x:ee[0],y:ee[1]})}var st=t.touchData.startPosition[0]-ee[0],lt=st*st,rt=t.touchData.startPosition[1]-ee[1],Lt=rt*rt,mt=lt+Lt,wt=mt*le*le;t.touchData.singleTouchMoved||(U||J.$(":selected").unselect(["tapunselect"]),n(U,["tap","vclick"],I,{x:ee[0],y:ee[1]}),ce=!1,I.timeStamp-ne<=J.multiClickDebounceTime()?(ae&&clearTimeout(ae),ce=!0,ne=null,n(U,["dbltap","vdblclick"],I,{x:ee[0],y:ee[1]})):(ae=setTimeout(function(){ce||n(U,["onetap","voneclick"],I,{x:ee[0],y:ee[1]})},J.multiClickDebounceTime()),ne=I.timeStamp)),U!=null&&!t.dragData.didDrag&&U._private.selectable&&wt<t.touchTapThreshold2&&!t.pinching&&(J.selectionType()==="single"?(J.$(r).unmerge(U).unselect(["tapunselect"]),U.select(["tapselect"])):U.selected()?U.unselect(["tapunselect"]):U.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Jt=0;Jt<ee.length;Jt++)oe[Jt]=ee[Jt];t.dragData.didDrag=!1,I.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),I.touches.length<2&&(I.touches.length===1&&(t.touchData.startGPosition=[I.touches[0].clientX,I.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],ie=function(I){return{clientX:I.clientX,clientY:I.clientY,force:1,identifier:I.pointerId,pageX:I.pageX,pageY:I.pageY,radiusX:I.width/2,radiusY:I.height/2,screenX:I.screenX,screenY:I.screenY,target:I.target}},fe=function(I){return{event:I,touch:ie(I)}},pe=function(I){ue.push(fe(I))},Ae=function(I){for(var U=0;U<ue.length;U++){var te=ue[U];if(te.event.pointerId===I.pointerId){ue.splice(U,1);return}}},Ie=function(I){var U=ue.filter(function(te){return te.event.pointerId===I.pointerId})[0];U.event=I,U.touch=ie(I)},we=function(I){I.touches=ue.map(function(U){return U.touch})},ke=function(I){return I.pointerType==="mouse"||I.pointerType===4};t.registerBinding(t.container,"pointerdown",function(re){ke(re)||(re.preventDefault(),pe(re),we(re),L(re))}),t.registerBinding(t.container,"pointerup",function(re){ke(re)||(Ae(re),we(re),se(re))}),t.registerBinding(t.container,"pointercancel",function(re){ke(re)||(Ae(re),we(re),Y(re))}),t.registerBinding(t.container,"pointermove",function(re){ke(re)||(re.preventDefault(),Ie(re),we(re),j(re))})}};var en={};en.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,o,l,u){this.renderer.nodeShapeImpl("polygon",n,a,i,o,l,this.points)},intersectLine:function(n,a,i,o,l,u,c,d){return ro(l,u,this.points,n,a,i/2,o/2,c)},checkPoint:function(n,a,i,o,l,u,c,d){return Xr(n,a,this.points,u,c,o,l,[0,-1],i)}}},en.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,u){return R5(i,o,e,r,n/2+l,a/2+l)},checkPoint:function(e,r,n,a,i,o,l,u){return ta(e,r,a,i,o,l,n)}}},en.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,o,l,u,c){if(u[c]!==void 0&&u[c+"-cx"]===n&&u[c+"-cy"]===a)return u[c];u[c]=new Array(e.length/2),u[c+"-cx"]=n,u[c+"-cy"]=a;var d=i/2,f=o/2;l=l==="auto"?lb(i,o):l;for(var h=new Array(e.length/2),v=0;v<e.length/2;v++)h[v]={x:n+d*e[v*2],y:a+f*e[v*2+1]};var p,g,y,m,b=h.length;for(g=h[b-1],p=0;p<b;p++)y=h[p%b],m=h[(p+1)%b],u[c][p]=xu(g,y,m,l),g=y,y=m;return u[c]},draw:function(n,a,i,o,l,u,c){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,l,this.points,this.getOrCreateCorners(a,i,o,l,u,c,"drawCorners"))},intersectLine:function(n,a,i,o,l,u,c,d,f){return L5(l,u,this.points,n,a,i,o,c,this.getOrCreateCorners(n,a,i,o,d,f,"corners"))},checkPoint:function(n,a,i,o,l,u,c,d,f){return P5(n,a,this.points,u,c,o,l,this.getOrCreateCorners(u,c,o,l,d,f,"corners"))}}},en.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:zt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,u){return ob(i,o,e,r,n,a,l,u)},checkPoint:function(e,r,n,a,i,o,l,u){var c=a/2,d=i/2;u=u==="auto"?ra(a,i):u,u=Math.min(c,d,u);var f=u*2;return!!(Xr(e,r,this.points,o,l,a,i-f,[0,-1],n)||Xr(e,r,this.points,o,l,a-f,i,[0,-1],n)||ta(e,r,f,f,o-c+u,l-d+u,n)||ta(e,r,f,f,o+c-u,l-d+u,n)||ta(e,r,f,f,o+c-u,l+d-u,n)||ta(e,r,f,f,o-c+u,l+d-u,n))}}},en.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:jc(),points:zt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,o)},generateCutTrianglePts:function(e,r,n,a,i){var o=i==="auto"?this.cornerLength:i,l=r/2,u=e/2,c=n-u,d=n+u,f=a-l,h=a+l;return{topLeft:[c,f+o,c+o,f,c+o,f+o],topRight:[d-o,f,d,f+o,d-o,f+o],bottomRight:[d,h-o,d-o,h,d-o,h-o],bottomLeft:[c+o,h,c,h-o,c+o,h-o]}},intersectLine:function(e,r,n,a,i,o,l,u){var c=this.generateCutTrianglePts(n+2*l,a+2*l,e,r,u),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return ro(i,o,d,e,r)},checkPoint:function(e,r,n,a,i,o,l,u){var c=u==="auto"?this.cornerLength:u;if(Xr(e,r,this.points,o,l,a,i-2*c,[0,-1],n)||Xr(e,r,this.points,o,l,a-2*c,i,[0,-1],n))return!0;var d=this.generateCutTrianglePts(a,i,o,l);return Ut(e,r,d.topLeft)||Ut(e,r,d.topRight)||Ut(e,r,d.bottomRight)||Ut(e,r,d.bottomLeft)}}},en.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:zt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,o,l,u){var c=.15,d=.5,f=.85,h=this.generateBarrelBezierPts(n+2*l,a+2*l,e,r),v=function(y){var m=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},c),b=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=qa({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},p=[].concat(v(h.topLeft),v(h.topRight),v(h.bottomRight),v(h.bottomLeft));return ro(i,o,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,o=e/2,l=n-o,u=n+o,c=a-i,d=a+i,f=Yc(e,r),h=f.heightOffset,v=f.widthOffset,p=f.ctrlPtOffsetPct*e,g={topLeft:[l,c+h,l+p,c,l+v,c],topRight:[u-v,c,u-p,c,u,c+h],bottomRight:[u,d-h,u-p,d,u-v,d],bottomLeft:[l+v,d,l+p,d,l,d-h]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,r,n,a,i,o,l,u){var c=Yc(a,i),d=c.heightOffset,f=c.widthOffset;if(Xr(e,r,this.points,o,l,a,i-2*d,[0,-1],n)||Xr(e,r,this.points,o,l,a-2*f,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,l),v=function(_,S,T){var N=T[4],B=T[2],A=T[0],D=T[5],R=T[1],O=Math.min(N,A),M=Math.max(N,A),P=Math.min(D,R),z=Math.max(D,R);if(O<=_&&_<=M&&P<=S&&S<=z){var W=M5(N,B,A),H=B5(W[0],W[1],W[2],_),G=H.filter(function(X){return 0<=X&&X<=1});if(G.length>0)return G[0]}return null},p=Object.keys(h),g=0;g<p.length;g++){var y=p[g],m=h[y],b=v(e,r,m);if(b!=null){var w=m[5],C=m[3],x=m[1],k=bt(w,C,x,b);if(m.isTop&&k<=r||m.isBottom&&r<=k)return!0}}return!1}}},en.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:zt(4,0),draw:function(e,r,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,o)},intersectLine:function(e,r,n,a,i,o,l,u){var c=e-(n/2+l),d=r-(a/2+l),f=d,h=e+(n/2+l),v=En(i,o,e,r,c,d,h,f,!1);return v.length>0?v:ob(i,o,e,r,n,a,l,u)},checkPoint:function(e,r,n,a,i,o,l,u){u=u==="auto"?ra(a,i):u;var c=2*u;if(Xr(e,r,this.points,o,l,a,i-c,[0,-1],n)||Xr(e,r,this.points,o,l,a-c,i,[0,-1],n))return!0;var d=a/2+2*n,f=i/2+2*n,h=[o-d,l-f,o-d,l,o+d,l,o+d,l-f];return!!(Ut(e,r,h)||ta(e,r,c,c,o+a/2-u,l+i/2-u,n)||ta(e,r,c,c,o-a/2+u,l+i/2-u,n))}}},en.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",zt(3,0)),this.generateRoundPolygon("round-triangle",zt(3,0)),this.generatePolygon("rectangle",zt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",zt(5,0)),this.generateRoundPolygon("round-pentagon",zt(5,0)),this.generatePolygon("hexagon",zt(6,0)),this.generateRoundPolygon("round-hexagon",zt(6,0)),this.generatePolygon("heptagon",zt(7,0)),this.generateRoundPolygon("round-heptagon",zt(7,0)),this.generatePolygon("octagon",zt(8,0)),this.generateRoundPolygon("round-octagon",zt(8,0));var n=new Array(20);{var a=Wc(5,0),i=Wc(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=o,i[l*2+1]*=o;for(var l=0;l<20/4;l++)n[l*4]=a[l*2],n[l*4+1]=a[l*2+1],n[l*4+2]=i[l*2],n[l*4+3]=i[l*2+1]}n=sb(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(c){var d=c.join("$"),f="polygon-"+d,h;return(h=this[f])?h:e.generatePolygon(f,c)}};var yo={};yo.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},yo.redraw=function(t){t=t||Q0();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},yo.beforeRender=function(t,e){if(!this.destroyed){e==null&&Qe("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var ew=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};yo.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){ew(t,!0,a);var i=Zr();t.render(t.renderOptions);var o=t.lastDrawTime=Zr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=o-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else ew(t,!1,a);t.skipFrame=!1,ms(n)}};ms(r)}};var y3=function(e){this.init(e)},tw=y3,oi=tw.prototype;oi.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],oi.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,o="__________cytoscape_stylesheet",l="__________cytoscape_container",u=a.getElementById(o)!=null;if(r.className.indexOf(l)<0&&(r.className=(r.className||"")+" "+l),!u){var c=a.createElement("style");c.id=o,c.textContent="."+l+" { position: relative; }",i.insertBefore(c,i.children[0])}var d=n.getComputedStyle(r),f=d.getPropertyValue("position");f==="static"&&$e("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=de(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},oi.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},oi.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},oi.isHeadless=function(){return!1},[yu,J1,Q1,ii,en,yo].forEach(function(t){Te(oi,t)});var Su=1e3/60,rw={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=gs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(c,d){var f=Zr(),h=a.averageRedrawTime,v=a.lastRedrawTime,p=[],g=a.cy.extent(),y=a.getPixelRatio();for(c||a.flushRenderedStyleQueue();;){var m=Zr(),b=m-f,w=m-d;if(v<Su){var C=Su-(c?h:0);if(w>=e.deqFastCost*C)break}else if(c){if(b>=e.deqCost*v||b>=e.deqAvgCost*h)break}else if(w>=e.deqNoDrawCost*Su)break;var x=e.deq(n,y,g);if(x.length>0)for(var k=0;k<x.length;k++)p.push(x[k]);else break}p.length>0&&(e.onDeqd(n,p),!c&&e.shouldRedraw(n,p,y,g)&&i())},l=e.priority||qc;a.beforeRender(o,l(n))}}}},b3=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bs;Pc(this,t),this.idsByKey=new Ir,this.keyForId=new Ir,this.cachesByLvl=new Ir,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Rc(t,[{key:"getIdsFor",value:function(r){r==null&&Qe("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new $a,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new Ir,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),nw=25,ol=50,sl=-4,_u=3,w3=7.99,C3=8,E3=1024,x3=1024,k3=1024,S3=.2,_3=.8,T3=10,N3=.15,I3=.1,B3=.9,D3=.9,A3=100,O3=1,si={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},P3=St({getKey:null,doesEleInvalidateKey:bs,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Y0,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),bo=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=P3(r);Te(n,a),n.lookup=new b3(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},gt=bo.prototype;gt.reasons=si,gt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},gt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},gt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Qi(function(r,n){return n.reqs-r.reqs});return e},gt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},gt.getElement=function(t,e,r,n,a){var i=this,o=this.renderer,l=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Kc(l*r))),n<sl)n=sl;else if(l>=w3||n>_u)return null;var c=Math.pow(2,n),d=e.h*c,f=e.w*c,h=o.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,h))return null;var v=u.get(t,n);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var p;if(d<=nw?p=nw:d<=ol?p=ol:p=Math.ceil(d/ol)*ol,d>k3||f>x3)return null;var g=i.getTextureQueue(p),y=g[g.length-2],m=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===h},w=a&&a===si.dequeue,C=a&&a===si.highQuality,x=a&&a===si.downscale,k,E=n+1;E<=_u;E++){var _=u.get(t,E);if(_){k=_;break}}var S=k&&k.level===n+1?k:null,T=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,p),b(S))T();else if(b(k))if(C){for(var N=k.level;N>n;N--)S=i.getElement(t,e,r,N,si.downscale);T()}else return i.queueElement(t,k.level-1),k;else{var B;if(!w&&!C&&!x)for(var A=n-1;A>=sl;A--){var D=u.get(t,A);if(D){B=D;break}}if(b(B))return i.queueElement(t,n),B;y.context.translate(y.usedWidth,0),y.context.scale(c,c),this.drawElement(y.context,t,e,h,!1),y.context.scale(1/c,1/c),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:n,scale:c,width:f,height:d,scaledLabelShown:h},y.usedWidth+=Math.ceil(f+C3),y.eleCaches.push(v),u.set(t,n,v),i.checkTextureFullness(y),v},gt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},gt.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=sl;i<=_u;i++){var o=r.getForCachedKey(t,i);o&&n.push(o)}var l=r.invalidate(t);if(l)for(var u=0;u<n.length;u++){var c=n[u],d=c.texture;d.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},gt.checkTextureUtility=function(t){t.invalidatedWidth>=S3*t.width&&this.retireTexture(t)},gt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>_3&&t.fullnessChecks>=T3?wn(r,t):t.fullnessChecks++},gt.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;wn(n,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var l=i[o];a.deleteCache(l.key,l.level)}zc(i);var u=e.getRetiredTextureQueue(r);u.push(t)},gt.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(E3,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},gt.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,zc(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),wn(a,o),n.push(o),o}},gt.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(l),a[i]=l}},gt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<O3&&r.size()>0;o++){var l=r.pop(),u=l.key,c=l.eles[0],d=i.hasCache(c,l.level);if(n[u]=null,d)continue;a.push(l);var f=e.getBoundingBox(c);e.getElement(c,f,t,l.level,si.dequeue)}return a},gt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Vc,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},gt.onDequeue=function(t){this.onDequeues.push(t)},gt.offDequeue=function(t){wn(this.onDequeues,t)},gt.setupDequeueing=rw.setupDequeueing({deqRedrawThreshold:A3,deqCost:N3,deqAvgCost:I3,deqNoDrawCost:B3,deqFastCost:D3,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var o=r[i].eles,l=0;l<o.length;l++){var u=o[l].boundingBox();if(Gc(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var R3=1,wo=-4,ll=2,L3=3.99,M3=50,F3=50,$3=.15,V3=.1,q3=.9,z3=.9,H3=1,aw=250,K3=4e3*4e3,G3=!0,iw=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Zr()-2*aw,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=gs(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},F3),n.beforeRender(function(o,l){l-r.lastInvalidationTime<=aw?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(l,u){return u.reqs-l.reqs};r.layersQueue=new Qi(i),r.setupDequeueing()},It=iw.prototype,ow=0,U3=Math.pow(2,53)-1;It.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),o={id:ow=++ow%U3,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=o.context,u=-o.bb.x1,c=-o.bb.y1;return l.scale(r,r),l.translate(u,c),o},It.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),l=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Kc(o*e)),r<wo)r=wo;else if(o>=L3||r>ll)return null}n.validateLayersElesOrdering(r,t);var u=n.layersByLevel,c=Math.pow(2,r),d=u[r]=u[r]||[],f,h=n.levelIsComplete(r,t),v,p=function(){var T=function(R){if(n.validateLayersElesOrdering(R,t),n.levelIsComplete(R,t))return v=u[R],!0},N=function(R){if(!v)for(var O=r+R;wo<=O&&O<=ll&&!T(O);O+=R);};N(1),N(-1);for(var B=d.length-1;B>=0;B--){var A=d[B];A.invalid&&wn(d,A)}};if(!h)p();else return d;var g=function(){if(!f){f=Gt();for(var T=0;T<t.length;T++)nb(f,t[T].boundingBox())}return f},y=function(T){T=T||{};var N=T.after;g();var B=f.w*c*(f.h*c);if(B>K3)return null;var A=n.makeLayer(f,r);if(N!=null){var D=d.indexOf(N)+1;d.splice(D,0,A)}else(T.insert===void 0||T.insert)&&d.unshift(A);return A};if(n.skipping&&!l)return null;for(var m=null,b=t.length/R3,w=!l,C=0;C<t.length;C++){var x=t[C],k=x._private.rscratch,E=k.imgLayerCaches=k.imgLayerCaches||{},_=E[r];if(_){m=_;continue}if((!m||m.eles.length>=b||!ib(m.bb,x.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?n.queueLayer(m,x):n.drawEleInLayer(m,x,r,e),m.eles.push(x),E[r]=m}return v||(w?null:d)},It.getEleLevelForLayerLevel=function(t,e){return t},It.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,o=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,G3),i.setImgSmoothing(o,!0))},It.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length},It.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[l+o]){this.invalidateLayer(a);break}}},It.updateElementsInLayers=function(t,e){for(var r=this,n=Ki(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],o=n?t[a]:t[a].ele,l=o._private.rscratch,u=l.imgLayerCaches=l.imgLayerCaches||{},c=wo;c<=ll;c++){var d=u[c];d&&(i&&r.getEleLevelForLayerLevel(d.level)!==i.level||e(d,o,i))}},It.haveLayers=function(){for(var t=this,e=!1,r=wo;r<=ll;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},It.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Zr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},It.invalidateLayer=function(t){if(this.lastInvalidationTime=Zr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];wn(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},It.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var l=0;l<o.eles.length;l++)e.queueLayer(o,o.eles[l])})},It.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},It.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}},It.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<H3&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n},It.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,l=o.imgLayerCaches=o.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},It.requestRedraw=gs(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),It.setupDequeueing=rw.setupDequeueing({deqRedrawThreshold:M3,deqCost:$3,deqAvgCost:V3,deqNoDrawCost:q3,deqFastCost:z3,deq:function(e,r){return e.dequeue(r)},onDeqd:qc,shouldRedraw:Y0,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var sw={},lw;function W3(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function j3(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function cw(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var o=r,l=r[0];t.moveTo(l.x,l.y);for(var a=1;a<o.length;a++){var i=o[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function Y3(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var l=0;l<i.length;l++){var u=i[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function Z3(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}sw.arrowShapeImpl=function(t){return(lw||(lw={polygon:W3,"triangle-backcurve":j3,"triangle-tee":cw,"circle-triangle":Y3,"triangle-cross":cw,circle:Z3}))[t]};var Pr={};Pr.drawElement=function(t,e,r,n,a,i){var o=this;e.isNode()?o.drawNode(t,e,r,n,a,i):o.drawEdge(t,e,r,n,a,i)},Pr.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Pr.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Pr.drawCachedElementPortion=function(t,e,r,n,a,i,o,l){var u=this,c=r.getBoundingBox(e);if(!(c.w===0||c.h===0)){var d=r.getElement(e,c,n,a,i);if(d!=null){var f=l(u,e);if(f===0)return;var h=o(u,e),v=c.x1,p=c.y1,g=c.w,y=c.h,m,b,w,C,x;if(h!==0){var k=r.getRotationPoint(e);w=k.x,C=k.y,t.translate(w,C),t.rotate(h),x=u.getImgSmoothing(t),x||u.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);m=E.x,b=E.y}else m=v,b=p;var _;f!==1&&(_=t.globalAlpha,t.globalAlpha=_*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=_),h!==0&&(t.rotate(-h),t.translate(-w,-C),x||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var X3=function(){return 0},J3=function(e,r){return e.getTextAngle(r,null)},Q3=function(e,r){return e.getTextAngle(r,"source")},e4=function(e,r){return e.getTextAngle(r,"target")},t4=function(e,r){return r.effectiveOpacity()},Tu=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Pr.drawCachedElement=function(t,e,r,n,a,i){var o=this,l=o.data,u=l.eleTxrCache,c=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,h=e.boundingBox(),v=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Gc(h,n))){var p=e.isEdge(),g=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,a,v,X3,t4),(!p||!g)&&o.drawCachedElementPortion(t,e,c,r,a,v,J3,Tu),p&&!g&&(o.drawCachedElementPortion(t,e,d,r,a,v,Q3,Tu),o.drawCachedElementPortion(t,e,f,r,a,v,e4,Tu)),o.drawElementOverlay(t,e)}},Pr.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Pr.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(t,o,r,n)}},Pr.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(t,o,r,n)}},Pr.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var l=i[o],u=l.bb;u.w===0||u.h===0||t.drawImage(l.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(t,e,r,n)};var tn={};tn.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var c=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=c*d,b=c*d,w=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(o.eleStrokeStyle(t,e,R),o.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=p,o.eleStrokeStyle(t,e,R),o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},C=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=p,g>0)o.colorStrokeStyle(t,y[0],y[1],y[2],R);else{t.lineCap="butt";return}f==="straight-triangle"?o.drawEdgeTrianglePath(e,t,l.allpts):(o.drawEdgePath(e,t,l.allpts,h),t.lineCap="butt")},x=function(){a&&o.drawEdgeOverlay(t,e)},k=function(){a&&o.drawEdgeUnderlay(t,e)},E=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,R)},_=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var T=e.pstyle("ghost-offset-x").pfValue,N=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,A=m*B;t.translate(T,N),w(A),E(A),t.translate(-T,-N)}else C();k(),w(),E(),x(),_(),r&&t.translate(u.x1,u.y1)}};var uw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,o=i.usePaths(),l=n._private.rscratch,u=n.pstyle("".concat(e,"-padding")).pfValue,c=2*u,d=n.pstyle("".concat(e,"-color")).value;r.lineWidth=c,l.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,d[0],d[1],d[2],a),i.drawEdgePath(n,r,l.allpts,"solid")}}}};tn.drawEdgeOverlay=uw("overlay"),tn.drawEdgeUnderlay=uw("underlay"),tn.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,o,l=!1,u=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(u){var f=r.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(o=e=a.pathCache,l=!0):(o=e=new Path2D,a.pathCacheKey=f,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(c),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var g=I0(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;G1(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])},tn.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/o,-i[0]/o],u=[l[0]*n/2,l[1]*n/2];e.beginPath(),e.moveTo(r[a]-u[0],r[a+1]-u[1]),e.lineTo(r[a]+u[0],r[a+1]+u[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}},tn.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},tn.drawArrowhead=function(t,e,r,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var c=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(r+"-arrow-fill").value,f=e.pstyle("width").pfValue,h=e.pstyle(r+"-arrow-width"),v=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(v*=f);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var g=t.globalCompositeOperation;(o!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,c,f,u,v,n,a,i),t.globalCompositeOperation=g);var y=e.pstyle(r+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],o),l.colorStrokeStyle(t,y[0],y[1],y[2],o),l.drawArrowShape(e,t,d,f,u,v,n,a,i)}}},tn.drawArrowShape=function(t,e,r,n,a,i,o,l,u){var c=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,h,v=e,p={x:o,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(n,g),m=c.arrowShapes[a];if(d){var b=c.arrowPathCache=c.arrowPathCache||[],w=Jn(a),C=b[w];C!=null?(h=e=C,f=!0):(h=e=new Path2D,b[w]=h)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,u,p,n),e.closePath&&e.closePath()),e=v,d&&(e.translate(o,l),e.rotate(u),e.scale(y,y)),(r==="filled"||r==="both")&&(d?e.fill(h):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(h):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-u),e.translate(-o,-l))};var Nu={};Nu.safeDrawImage=function(t,e,r,n,a,i,o,l,u,c){if(!(a<=0||i<=0||u<=0||c<=0))try{t.drawImage(e,r,n,a,i,o,l,u,c)}catch(d){$e(d)}},Nu.drawInscribedImage=function(t,e,r,n,a){var i=this,o=r.position(),l=o.x,u=o.y,c=r.cy().style(),d=c.getIndexedStyle.bind(c),f=d(r,"background-fit","value",n),h=d(r,"background-repeat","value",n),v=r.width(),p=r.height(),g=r.padding()*2,y=v+(d(r,"background-width-relative-to","value",n)==="inner"?0:g),m=p+(d(r,"background-height-relative-to","value",n)==="inner"?0:g),b=r._private.rscratch,w=d(r,"background-clip","value",n),C=w==="node",x=d(r,"background-image-opacity","value",n)*a,k=d(r,"background-image-smoothing","value",n),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var _=e.width||e.cachedW,S=e.height||e.cachedH;(_==null||S==null)&&(document.body.appendChild(e),_=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var T=_,N=S;if(d(r,"background-width","value",n)!=="auto"&&(d(r,"background-width","units",n)==="%"?T=d(r,"background-width","pfValue",n)*y:T=d(r,"background-width","pfValue",n)),d(r,"background-height","value",n)!=="auto"&&(d(r,"background-height","units",n)==="%"?N=d(r,"background-height","pfValue",n)*m:N=d(r,"background-height","pfValue",n)),!(T===0||N===0)){if(f==="contain"){var B=Math.min(y/T,m/N);T*=B,N*=B}else if(f==="cover"){var B=Math.max(y/T,m/N);T*=B,N*=B}var A=l-y/2,D=d(r,"background-position-x","units",n),R=d(r,"background-position-x","pfValue",n);D==="%"?A+=(y-T)*R:A+=R;var O=d(r,"background-offset-x","units",n),M=d(r,"background-offset-x","pfValue",n);O==="%"?A+=(y-T)*M:A+=M;var P=u-m/2,z=d(r,"background-position-y","units",n),W=d(r,"background-position-y","pfValue",n);z==="%"?P+=(m-N)*W:P+=W;var H=d(r,"background-offset-y","units",n),G=d(r,"background-offset-y","pfValue",n);H==="%"?P+=(m-N)*G:P+=G,b.pathCache&&(A-=l,P-=u,l=0,u=0);var X=t.globalAlpha;t.globalAlpha=x;var F=i.getImgSmoothing(t),V=!1;if(k==="no"&&F?(i.setImgSmoothing(t,!1),V=!0):k==="yes"&&!F&&(i.setImgSmoothing(t,!0),V=!0),h==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,l,u,y,m,E,b),t.clip())),i.safeDrawImage(t,e,0,0,_,S,A,P,T,N),C&&t.restore();else{var q=t.createPattern(e,h);t.fillStyle=q,i.nodeShapes[i.getNodeShape(r)].draw(t,l,u,y,m,E,b),t.translate(A,P),t.fill(),t.translate(-A,-P)}t.globalAlpha=X,V&&i.setImgSmoothing(t,F)}};var ua={};ua.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Kc(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)},ua.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var u=o.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(o.drawText(t,e,null,v,i),e.isEdge()&&(o.drawText(t,e,"source",v,i),o.drawText(t,e,"target",v,i))):o.drawText(t,e,a,v,i),r&&t.translate(p.x1,p.y1)},ua.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},ua.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,l=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*l,c=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],u)};function Iu(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),o?t.stroke():t.fill()}ua.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),l=gr(a,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?l:0:o.strValue==="none"?r=0:r=o.pfValue,r},ua.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=gr(o,"labelX",r),c=gr(o,"labelY",r),d,f,h=this.getLabelText(e,r);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(t,e,a);var v=r?r+"-":"",p=gr(o,"labelWidth",r),g=gr(o,"labelHeight",r),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),u+=y,c+=m;var x;switch(n?x=this.getTextAngle(e,r):x=0,x!==0&&(d=u,f=c,t.translate(d,f),t.rotate(x),u=0,c=0),C){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g;break}var k=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,_=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,T=e.pstyle("text-background-shape").strValue,N=T.indexOf("round")===0,B=2;if(k>0||_>0&&E>0){var A=u-S;switch(w){case"left":A-=p;break;case"center":A-=p/2;break}var D=c-g-S,R=p+2*S,O=g+2*S;if(k>0){var M=t.fillStyle,P=e.pstyle("text-background-color").value;t.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+k*l+")",N?Iu(t,A,D,R,O,B):t.fillRect(A,D,R,O),t.fillStyle=M}if(_>0&&E>0){var z=t.strokeStyle,W=t.lineWidth,H=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+H[0]+","+H[1]+","+H[2]+","+E*l+")",t.lineWidth=_,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=_/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(N?Iu(t,A,D,R,O,B,"stroke"):t.strokeRect(A,D,R,O),G==="double"){var X=_/2;N?Iu(t,A+X,D+X,R-X*2,O-X*2,B,"stroke"):t.strokeRect(A+X,D+X,R-X*2,O-X*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=W,t.strokeStyle=z}}var F=2*e.pstyle("text-outline-width").pfValue;if(F>0&&(t.lineWidth=F),e.pstyle("text-wrap").value==="wrap"){var V=gr(o,"labelWrapCachedLines",r),q=gr(o,"labelLineHeight",r),$=p/2,K=this.getLabelJustification(e);switch(K==="auto"||(w==="left"?K==="left"?u+=-p:K==="center"&&(u+=-$):w==="center"?K==="left"?u+=-$:K==="right"&&(u+=$):w==="right"&&(K==="center"?u+=$:K==="right"&&(u+=p))),C){case"top":c-=(V.length-1)*q;break;case"center":case"bottom":c-=(V.length-1)*q;break}for(var L=0;L<V.length;L++)F>0&&t.strokeText(V[L],u,c),t.fillText(V[L],u,c),c+=q}else F>0&&t.strokeText(h,u,c),t.fillText(h,u,c);x!==0&&(t.rotate(-x),t.translate(-d,-f))}}};var li={};li.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,l,u,c=e._private,d=c.rscratch,f=e.position();if(!(!de(f.x)||!de(f.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,v=o.usePaths(),p,g=!1,y=e.padding();l=e.width()+2*y,u=e.height()+2*y;var m;r&&(m=r,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),x=new Array(w.length),k=0,E=0;E<w.length;E++){var _=w[E],S=C[E]=_!=null&&_!=="none";if(S){var T=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);k++,x[E]=o.getCachedImage(_,T,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var N=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,A=e.pstyle("background-opacity").value*h,D=e.pstyle("border-color").value,R=e.pstyle("border-style").value,O=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,P=e.pstyle("border-position").value,z=e.pstyle("border-dash-pattern").pfValue,W=e.pstyle("border-dash-offset").pfValue,H=e.pstyle("border-opacity").value*h,G=e.pstyle("outline-width").pfValue,X=e.pstyle("outline-color").value,F=e.pstyle("outline-style").value,V=e.pstyle("outline-opacity").value*h,q=e.pstyle("outline-offset").value,$=e.pstyle("corner-radius").value;$!=="auto"&&($=e.pstyle("corner-radius").pfValue);var K=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:A;o.eleFillStyle(t,e,le)},L=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.colorStrokeStyle(t,D[0],D[1],D[2],le)},j=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(t,X[0],X[1],X[2],le)},Y=function(le,ee,oe,me){var be=o.nodePathCache=o.nodePathCache||[],ye=W0(oe==="polygon"?oe+","+me.join(","):oe,""+ee,""+le,""+$),Ne=be[ye],ge,Ce=!1;return Ne!=null?(ge=Ne,Ce=!0,d.pathCache=ge):(ge=new Path2D,be[ye]=d.pathCache=ge),{path:ge,cacheHit:Ce}},se=e.pstyle("shape").strValue,ce=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var ae=Y(l,u,se,ce);p=ae.path,g=ae.cacheHit}var ne=function(){if(!g){var le=f;v&&(le={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||t,le.x,le.y,l,u,$,d)}v?t.fill(p):t.fill()},ue=function(){for(var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=c.backgrounding,me=0,be=0;be<x.length;be++){var ye=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(ee&&ye==="over"||!ee&&ye==="inside"){me++;continue}C[be]&&x[be].complete&&!x[be].error&&(me++,o.drawInscribedImage(t,x[be],e,be,le))}c.backgrounding=me!==k,oe!==c.backgrounding&&e.updateStyle(!1)},ie=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(t,e,ee),le&&(v||o.nodeShapes[o.getNodeShape(e)].draw(t,f.x,f.y,l,u,$,d)))},fe=function(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ee=(N>0?N:-N)*le,oe=N>0?0:255;N!==0&&(o.colorFillStyle(t,oe,oe,oe,ee),v?t.fill(p):t.fill())},pe=function(){if(B>0){if(t.lineWidth=B,t.lineCap=M,t.lineJoin=O,t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(z),t.lineDashOffset=W;break;case"solid":case"double":t.setLineDash([]);break}if(P!=="center"){if(t.save(),t.lineWidth*=2,P==="inside")v?t.clip(p):t.clip();else{var le=new Path2D;le.rect(-l/2-B,-u/2-B,l+2*B,u+2*B),le.addPath(p),t.clip(le,"evenodd")}v?t.stroke(p):t.stroke(),t.restore()}else v?t.stroke(p):t.stroke();if(R==="double"){t.lineWidth=B/3;var ee=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(p):t.stroke(),t.globalCompositeOperation=ee}t.setLineDash&&t.setLineDash([])}},Ae=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var le=f;v&&(le={x:0,y:0});var ee=o.getNodeShape(e),oe=B;P==="inside"&&(oe=0),P==="outside"&&(oe*=2);var me=(l+oe+(G+q))/l,be=(u+oe+(G+q))/u,ye=l*me,Ne=u*be,ge=o.nodeShapes[ee].points,Ce;if(v){var We=Y(ye,Ne,ee,ge);Ce=We.path}if(ee==="ellipse")o.drawEllipsePath(Ce||t,le.x,le.y,ye,Ne);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ee)){var qe=0,st=0,lt=0;ee==="round-diamond"?qe=(oe+q+G)*1.4:ee==="round-heptagon"?(qe=(oe+q+G)*1.075,lt=-(oe/2+q+G)/35):ee==="round-hexagon"?qe=(oe+q+G)*1.12:ee==="round-pentagon"?(qe=(oe+q+G)*1.13,lt=-(oe/2+q+G)/15):ee==="round-tag"?(qe=(oe+q+G)*1.12,st=(oe/2+G+q)*.07):ee==="round-triangle"&&(qe=(oe+q+G)*(Math.PI/2),lt=-(oe+q/2+G)/Math.PI),qe!==0&&(me=(l+qe)/l,ye=l*me,["round-hexagon","round-tag"].includes(ee)||(be=(u+qe)/u,Ne=u*be)),$=$==="auto"?lb(ye,Ne):$;for(var rt=ye/2,Lt=Ne/2,mt=$+(oe+G+q)/2,wt=new Array(ge.length/2),Jt=new Array(ge.length/2),Mt=0;Mt<ge.length/2;Mt++)wt[Mt]={x:le.x+st+rt*ge[Mt*2],y:le.y+lt+Lt*ge[Mt*2+1]};var Ft,lr,Cr,jt,nt=wt.length;for(lr=wt[nt-1],Ft=0;Ft<nt;Ft++)Cr=wt[Ft%nt],jt=wt[(Ft+1)%nt],Jt[Ft]=xu(lr,Cr,jt,mt),lr=Cr,Cr=jt;o.drawRoundPolygonPath(Ce||t,le.x+st,le.y+lt,l*me,u*be,ge,Jt)}else if(["roundrectangle","round-rectangle"].includes(ee))$=$==="auto"?ra(ye,Ne):$,o.drawRoundRectanglePath(Ce||t,le.x,le.y,ye,Ne,$+(oe+G+q)/2);else if(["cutrectangle","cut-rectangle"].includes(ee))$=$==="auto"?jc():$,o.drawCutRectanglePath(Ce||t,le.x,le.y,ye,Ne,null,$+(oe+G+q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ee))$=$==="auto"?ra(ye,Ne):$,o.drawBottomRoundRectanglePath(Ce||t,le.x,le.y,ye,Ne,$+(oe+G+q)/2);else if(ee==="barrel")o.drawBarrelPath(Ce||t,le.x,le.y,ye,Ne);else if(ee.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ee)){var ct=(oe+G+q)/l;ge=Ss(_s(ge,ct)),o.drawPolygonPath(Ce||t,le.x,le.y,l,u,ge)}else{var Ct=(oe+G+q)/l;ge=Ss(_s(ge,-Ct)),o.drawPolygonPath(Ce||t,le.x,le.y,l,u,ge)}if(v?t.stroke(Ce):t.stroke(),F==="double"){t.lineWidth=oe/3;var Pn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(Ce):t.stroke(),t.globalCompositeOperation=Pn}t.setLineDash&&t.setLineDash([])}},Ie=function(){a&&o.drawNodeOverlay(t,e,f,l,u)},we=function(){a&&o.drawNodeUnderlay(t,e,f,l,u)},ke=function(){o.drawElementText(t,e,null,n)},re=e.pstyle("ghost").value==="yes";if(re){var I=e.pstyle("ghost-offset-x").pfValue,U=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,Z=te*h;t.translate(I,U),j(),Ae(),K(te*A),ne(),ue(Z,!0),L(te*H),pe(),ie(N!==0||B!==0),ue(Z,!1),fe(Z),t.translate(-I,-U)}v&&t.translate(-f.x,-f.y),we(),v&&t.translate(f.x,f.y),j(),Ae(),K(),ne(),ue(h,!0),L(),pe(),ie(N!==0||B!==0),ue(h,!1),fe(),v&&t.translate(-f.x,-f.y),ke(),Ie(),r&&t.translate(m.x1,m.y1)}};var dw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,o){var l=this;if(n.visible()){var u=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,f=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(a=a||n.position(),i==null||o==null){var v=n.padding();i=n.width()+2*v,o=n.height()+2*v}l.colorFillStyle(r,d[0],d[1],d[2],c),l.nodeShapes[f].draw(r,a.x,a.y,i+u*2,o+u*2,h),r.fill()}}}};li.drawNodeOverlay=dw("overlay"),li.drawNodeUnderlay=dw("underlay"),li.hasPie=function(t){return t=t[0],t._private.hasPie},li.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=n.x,l=n.y,u=e.width(),c=e.height(),d=Math.min(u,c)/2,f=0,h=this.usePaths();h&&(o=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var p=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*r,m=p/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;p===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(o,l),t.arc(o,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Xt={},r4=100;Xt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},Xt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n},Xt.createGradientStyleFor=function(t,e,r,n,a){var i,o=this.usePaths(),l=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var c=r.sourceEndpoint(),d=r.targetEndpoint(),f=r.midpoint(),h=Qn(c,f),v=Qn(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,v))}else{var p=o?{x:0,y:0}:r.position(),g=r.paddedWidth(),y=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,y))}else if(r.isEdge()){var m=r.sourceEndpoint(),b=r.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=o?{x:0,y:0}:r.position(),C=r.paddedWidth(),x=r.paddedHeight(),k=C/2,E=x/2,_=r.pstyle("background-gradient-direction").value;switch(_){case"to-bottom":i=t.createLinearGradient(w.x,w.y-E,w.x,w.y+E);break;case"to-top":i=t.createLinearGradient(w.x,w.y+E,w.x,w.y-E);break;case"to-left":i=t.createLinearGradient(w.x+k,w.y,w.x-k,w.y);break;case"to-right":i=t.createLinearGradient(w.x-k,w.y,w.x+k,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-k,w.y-E,w.x+k,w.y+E);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-k,w.y+E,w.x+k,w.y-E);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+k,w.y-E,w.x-k,w.y+E);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+k,w.y+E,w.x-k,w.y-E);break}}if(!i)return null;for(var S=u.length===l.length,T=l.length,N=0;N<T;N++)i.addColorStop(S?u[N]:N/(T-1),"rgba("+l[N][0]+","+l[N][1]+","+l[N][2]+","+a+")");return i},Xt.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},Xt.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}},Xt.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},Xt.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},Xt.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}},Xt.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=l);var u=a*o,c=i*o,d;if(!(u===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var f=r.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)d=r.canvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)d=r.bufferCanvases[h],d.width=u,d.height=c,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,o<=1&&(d=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=u*e.textureMult,d.height=c*e.textureMult),e.canvasWidth=u,e.canvasHeight=c}},Xt.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},Xt.render=function(t){t=t||Q0();var e=t.forcedContext,r=t.drawAllLayers,n=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,o=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=o.cy,c=o.data,d=c.canvasNeedsRedraw,f=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),h=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,v=o.motionBlurPxRatio,p=u.hasCompoundNodes(),g=o.hoverData.draggingEles,y=!!(o.hoverData.selecting||o.touchData.selecting);h=h&&!e&&o.motionBlurEnabled&&!y;var m=h;e||(o.prevPxRatio!==l&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=l),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),h&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(m=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!f&&(d[o.NODE]=!0,d[o.SELECT_BOX]=!0);var b=u.style(),w=u.zoom(),C=a!==void 0?a:w,x=u.pan(),k={x:x.x,y:x.y},E={zoom:w,pan:{x:x.x,y:x.y}},_=o.prevViewport,S=_===void 0||E.zoom!==_.zoom||E.pan.x!==_.pan.x||E.pan.y!==_.pan.y;!S&&!(g&&!p)&&(o.motionBlurPxRatio=1),i&&(k=i),C*=l,k.x*=l,k.y*=l;var T=o.getCachedZSortedEles();function N(ae,ne,ue,ie,fe){var pe=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",o.colorFillStyle(ae,255,255,255,o.motionBlurTransparency),ae.fillRect(ne,ue,ie,fe),ae.globalCompositeOperation=pe}function B(ae,ne){var ue,ie,fe,pe;!o.clearingMotionBlur&&(ae===c.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||ae===c.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(ue={x:x.x*v,y:x.y*v},ie=w*v,fe=o.canvasWidth*v,pe=o.canvasHeight*v):(ue=k,ie=C,fe=o.canvasWidth,pe=o.canvasHeight),ae.setTransform(1,0,0,1,0,0),ne==="motionBlur"?N(ae,0,0,fe,pe):!e&&(ne===void 0||ne)&&ae.clearRect(0,0,fe,pe),r||(ae.translate(ue.x,ue.y),ae.scale(ie,ie)),i&&ae.translate(i.x,i.y),a&&ae.scale(a,a)}if(f||(o.textureDrawLastFrame=!1),f){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=u.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var A=o.data.bufferContexts[o.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:l*o.textureMult});var E=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}d[o.DRAG]=!1,d[o.NODE]=!1;var D=c.contexts[o.NODE],R=o.textureCache.texture,E=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?N(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,O[0],O[1],O[2],M),D.fillRect(0,0,E.width,E.height);var w=u.zoom();B(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),D.drawImage(R,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else o.textureOnViewport&&!e&&(o.textureCache=null);var P=u.extent(),z=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),W=o.hideEdgesOnViewport&&z,H=[];if(H[o.NODE]=!d[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,H[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),H[o.DRAG]=!d[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,H[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),d[o.NODE]||r||n||H[o.NODE]){var G=h&&!H[o.NODE]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:c.contexts[o.NODE]),X=h&&!G?"motionBlur":void 0;B(D,X),W?o.drawCachedNodes(D,T.nondrag,l,P):o.drawLayeredElements(D,T.nondrag,l,P),o.debug&&o.drawDebugPoints(D,T.nondrag),!r&&!h&&(d[o.NODE]=!1)}if(!n&&(d[o.DRAG]||r||H[o.DRAG])){var G=h&&!H[o.DRAG]&&v!==1,D=e||(G?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:c.contexts[o.DRAG]);B(D,h&&!G?"motionBlur":void 0),W?o.drawCachedNodes(D,T.drag,l,P):o.drawCachedElements(D,T.drag,l,P),o.debug&&o.drawDebugPoints(D,T.drag),!r&&!h&&(d[o.DRAG]=!1)}if(o.showFps||!n&&d[o.SELECT_BOX]&&!r){var D=e||c.contexts[o.SELECT_BOX];if(B(D),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var w=o.cy.zoom(),F=b.core("selection-box-border-width").value/w;D.lineWidth=F,D.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",D.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),F>0&&(D.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",D.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(c.bgActivePosistion&&!o.hoverData.selecting){var w=o.cy.zoom(),V=c.bgActivePosistion;D.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",D.beginPath(),D.arc(V.x,V.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),D.fill()}var q=o.lastRedrawTime;if(o.showFps&&q){q=Math.round(q);var $=Math.round(1e3/q);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+q+" ms = "+$+" fps",0,20);var K=60;D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min($/K,1),20)}r||(d[o.SELECT_BOX]=!1)}if(h&&v!==1){var L=c.contexts[o.NODE],j=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=c.contexts[o.DRAG],se=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],ce=function(ne,ue,ie){ne.setTransform(1,0,0,1,0,0),ie||!m?ne.clearRect(0,0,o.canvasWidth,o.canvasHeight):N(ne,0,0,o.canvasWidth,o.canvasHeight);var fe=v;ne.drawImage(ue,0,0,o.canvasWidth*fe,o.canvasHeight*fe,0,0,o.canvasWidth,o.canvasHeight)};(d[o.NODE]||H[o.NODE])&&(ce(L,j,H[o.NODE]),d[o.NODE]=!1),(d[o.DRAG]||H[o.DRAG])&&(ce(Y,se,H[o.DRAG]),d[o.DRAG]=!1)}o.prevViewport=E,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!f,o.mbFrames=0,d[o.NODE]=!0,d[o.DRAG]=!0,o.redraw()},r4)),e||u.emit("render")};var Bn={};Bn.drawPolygonPath=function(t,e,r,n,a,i){var o=n/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+l*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+l*i[u*2+1]);t.closePath()},Bn.drawRoundPolygonPath=function(t,e,r,n,a,i,o){o.forEach(function(l){return G1(t,l)}),t.closePath()},Bn.drawRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,u=i==="auto"?ra(n,a):Math.min(i,l,o);t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.arcTo(e+o,r-l,e+o,r,u),t.arcTo(e+o,r+l,e,r+l,u),t.arcTo(e-o,r+l,e-o,r,u),t.arcTo(e-o,r-l,e,r-l,u),t.lineTo(e,r-l),t.closePath()},Bn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var o=n/2,l=a/2,u=i==="auto"?ra(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-l),t.lineTo(e+o,r-l),t.lineTo(e+o,r),t.arcTo(e+o,r+l,e,r+l,u),t.arcTo(e-o,r+l,e-o,r,u),t.lineTo(e-o,r-l),t.lineTo(e,r-l),t.closePath()},Bn.drawCutRectanglePath=function(t,e,r,n,a,i,o){var l=n/2,u=a/2,c=o==="auto"?jc():o;t.beginPath&&t.beginPath(),t.moveTo(e-l+c,r-u),t.lineTo(e+l-c,r-u),t.lineTo(e+l,r-u+c),t.lineTo(e+l,r+u-c),t.lineTo(e+l-c,r+u),t.lineTo(e-l+c,r+u),t.lineTo(e-l,r+u-c),t.lineTo(e-l,r-u+c),t.closePath()},Bn.drawBarrelPath=function(t,e,r,n,a){var i=n/2,o=a/2,l=e-i,u=e+i,c=r-o,d=r+o,f=Yc(n,a),h=f.widthOffset,v=f.heightOffset,p=f.ctrlPtOffsetPct*h;t.beginPath&&t.beginPath(),t.moveTo(l,c+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+p,d,l+h,d),t.lineTo(u-h,d),t.quadraticCurveTo(u-p,d,u,d-v),t.lineTo(u,c+v),t.quadraticCurveTo(u-p,c,u-h,c),t.lineTo(l+h,c),t.quadraticCurveTo(l+p,c,l,c+v),t.closePath()};for(var fw=Math.sin(0),hw=Math.cos(0),Bu={},Du={},pw=Math.PI/40,ci=0*Math.PI;ci<2*Math.PI;ci+=pw)Bu[ci]=Math.sin(ci),Du[ci]=Math.cos(ci);Bn.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,o,l=n/2,u=a/2,c=0*Math.PI;c<2*Math.PI;c+=pw)i=e-l*Bu[c]*fw+l*Du[c]*hw,o=r+u*Du[c]*fw+u*Bu[c]*hw,c===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Co={};Co.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Co.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],o=t.full?Math.ceil(n.h):a[3],l=de(t.maxWidth)||de(t.maxHeight),u=this.getPixelRatio(),c=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,c=t.scale;else if(l){var d=1/0,f=1/0;de(t.maxWidth)&&(d=c*t.maxWidth/i),de(t.maxHeight)&&(f=c*t.maxHeight/o),c=Math.min(d,f),i*=c,o*=c}l||(i*=u,o*=u,c*=u);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var v=h.getContext("2d");if(i>0&&o>0){v.clearRect(0,0,i,o),v.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)v.translate(-n.x1*c,-n.y1*c),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(n.x1*c,n.y1*c);else{var g=e.pan(),y={x:g.x*c,y:g.y*c};c*=e.zoom(),v.translate(y.x,y.y),v.scale(c,c),this.drawElements(v,p),v.scale(1/c,1/c),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,o),v.fill())}return h};function n4(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function vw(t){var e=t.indexOf(",");return t.substr(e+1)}function gw(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Ua(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return n4(vw(n()),r);case"base64":return vw(n());case"base64uri":default:return n()}}Co.png=function(t){return gw(t,this.bufferCanvasImage(t),"image/png")},Co.jpg=function(t){return gw(t,this.bufferCanvasImage(t),"image/jpeg")};var mw={};mw.nodeShapeImpl=function(t,e,r,n,a,i,o,l){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,o,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,o,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,l);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var a4=yw,Me=yw.prototype;Me.CANVAS_LAYERS=3,Me.SELECT_BOX=0,Me.DRAG=1,Me.NODE=2,Me.BUFFER_COUNT=3,Me.TEXTURE_BUFFER=0,Me.MOTIONBLUR_BUFFER_NODE=1,Me.MOTIONBLUR_BUFFER_DRAG=2;function yw(t){var e=this,r=e.cy.window(),n=r.document;e.data={canvases:new Array(Me.CANVAS_LAYERS),contexts:new Array(Me.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Me.CANVAS_LAYERS),bufferCanvases:new Array(Me.BUFFER_COUNT),bufferContexts:new Array(Me.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};GM()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var c=0;c<Me.CANVAS_LAYERS;c++){var d=e.data.canvases[c]=n.createElement("canvas");e.data.contexts[c]=d.getContext("2d"),Object.keys(u).forEach(function(K){d.style[K]=u[K]}),d.style.position="absolute",d.setAttribute("data-id","layer"+c),d.style.zIndex=String(Me.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Me.NODE].setAttribute("data-id","layer"+Me.NODE+"-node"),e.data.canvases[Me.SELECT_BOX].setAttribute("data-id","layer"+Me.SELECT_BOX+"-selectbox"),e.data.canvases[Me.DRAG].setAttribute("data-id","layer"+Me.DRAG+"-drag");for(var c=0;c<Me.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=n.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var f=Gt(),h=function(L){return{x:(L.x1+L.x2)/2,y:(L.y1+L.y2)/2}},v=function(L){return{x:-L.w/2,y:-L.h/2}},p=function(L){var j=L[0]._private,Y=j.oldBackgroundTimestamp===j.backgroundTimestamp;return!Y},g=function(L){return L[0]._private.nodeKey},y=function(L){return L[0]._private.labelStyleKey},m=function(L){return L[0]._private.sourceLabelStyleKey},b=function(L){return L[0]._private.targetLabelStyleKey},w=function(L,j,Y,se,ce){return e.drawElement(L,j,Y,!1,!1,ce)},C=function(L,j,Y,se,ce){return e.drawElementText(L,j,Y,se,"main",ce)},x=function(L,j,Y,se,ce){return e.drawElementText(L,j,Y,se,"source",ce)},k=function(L,j,Y,se,ce){return e.drawElementText(L,j,Y,se,"target",ce)},E=function(L){return L.boundingBox(),L[0]._private.bodyBounds},_=function(L){return L.boundingBox(),L[0]._private.labelBounds.main||f},S=function(L){return L.boundingBox(),L[0]._private.labelBounds.source||f},T=function(L){return L.boundingBox(),L[0]._private.labelBounds.target||f},N=function(L,j){return j},B=function(L){return h(E(L))},A=function(L,j,Y){var se=L?L+"-":"";return{x:j.x+Y.pstyle(se+"text-margin-x").pfValue,y:j.y+Y.pstyle(se+"text-margin-y").pfValue}},D=function(L,j,Y){var se=L[0]._private.rscratch;return{x:se[j],y:se[Y]}},R=function(L){return A("",D(L,"labelX","labelY"),L)},O=function(L){return A("source",D(L,"sourceLabelX","sourceLabelY"),L)},M=function(L){return A("target",D(L,"targetLabelX","targetLabelY"),L)},P=function(L){return v(E(L))},z=function(L){return v(S(L))},W=function(L){return v(T(L))},H=function(L){var j=_(L),Y=v(_(L));if(L.isNode()){switch(L.pstyle("text-halign").value){case"left":Y.x=-j.w;break;case"right":Y.x=0;break}switch(L.pstyle("text-valign").value){case"top":Y.y=-j.h;break;case"bottom":Y.y=0;break}}return Y},G=e.data.eleTxrCache=new bo(e,{getKey:g,doesEleInvalidateKey:p,drawElement:w,getBoundingBox:E,getRotationPoint:B,getRotationOffset:P,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),X=e.data.lblTxrCache=new bo(e,{getKey:y,drawElement:C,getBoundingBox:_,getRotationPoint:R,getRotationOffset:H,isVisible:N}),F=e.data.slbTxrCache=new bo(e,{getKey:m,drawElement:x,getBoundingBox:S,getRotationPoint:O,getRotationOffset:z,isVisible:N}),V=e.data.tlbTxrCache=new bo(e,{getKey:b,drawElement:k,getBoundingBox:T,getRotationPoint:M,getRotationOffset:W,isVisible:N}),q=e.data.lyrTxrCache=new iw(e);e.onUpdateEleCalcs(function(L,j){G.invalidateElements(j),X.invalidateElements(j),F.invalidateElements(j),V.invalidateElements(j),q.invalidateElements(j);for(var Y=0;Y<j.length;Y++){var se=j[Y]._private;se.oldBackgroundTimestamp=se.backgroundTimestamp}});var $=function(L){for(var j=0;j<L.length;j++)q.enqueueElementRefinement(L[j].ele)};G.onDequeue($),X.onDequeue($),F.onDequeue($),V.onDequeue($)}Me.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var i4=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return i4&&this.pathsEnabled},Me.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Me.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Me.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":ht(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r},[sw,Pr,tn,Nu,ua,li,Xt,Bn,Co,mw].forEach(function(t){Te(Me,t)});var o4=[{name:"null",impl:L1},{name:"base",impl:tw},{name:"canvas",impl:a4}],s4=[{type:"layout",extensions:h3},{type:"renderer",extensions:o4}],bw={},ww={};function Cw(t,e,r){var n=r,a=function(_){$e("Can not register `"+e+"` for `"+t+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(go.prototype[e])return a(e);go.prototype[e]=r}else if(t==="collection"){if(Tt.prototype[e])return a(e);Tt.prototype[e]=r}else if(t==="layout"){for(var i=function(_){this.options=_,r.call(this,_),Pe(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),l=[],u=0;u<l.length;u++){var c=l[u];o[c]=o[c]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var d=r.prototype.stop;o.stop=function(){var E=this.options;if(E&&E.animate){var _=this.animations;if(_)for(var S=0;S<_.length;S++)_[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(_){return _._private.cy},h={addEventFields:function(_,S){S.layout=_,S.cy=f(_),S.target=_},bubble:function(){return!0},parent:function(_){return f(_)}};Te(o,{createEmitter:function(){return this._private.emitter=new Vs(h,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ve.eventAliasesOn(o),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Ew("renderer","base"),p=v.prototype,g=r,y=r.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in p){var C=p[w],x=y[w]!=null;if(x)return a(w);b[w]=C}for(var k in y)b[k]=y[k];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Qe("Renderer does not implement `renderer."+E+"()` on its prototype")}}),n=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Qe(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return M0({map:bw,keys:[t,e],value:n})}function Ew(t,e){return F0({map:bw,keys:[t,e]})}function l4(t,e,r,n,a){return M0({map:ww,keys:[t,e,r,n],value:a})}function c4(t,e,r,n){return F0({map:ww,keys:[t,e,r,n]})}var Au=function(){if(arguments.length===2)return Ew.apply(null,arguments);if(arguments.length===3)return Cw.apply(null,arguments);if(arguments.length===4)return c4.apply(null,arguments);if(arguments.length===5)return l4.apply(null,arguments);Qe("Invalid extension access syntax")};go.prototype.extension=Au,s4.forEach(function(t){t.extensions.forEach(function(e){Cw(t.type,e.name,e.impl)})});var xw=function t(){if(!(this instanceof t))return new t;this.length=0},da=xw.prototype;da.instanceString=function(){return"stylesheet"},da.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},da.css=function(t,e){var r=this.length-1;if(Ee(t))this[r].properties.push({name:t,value:e});else if(Pe(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],l=n[o];if(l!=null){var u=Ot.properties[o]||Ot.properties[ps(o)];if(u!=null){var c=u.name,d=l;this[r].properties.push({name:c,value:d})}}}return this},da.style=da.css,da.generateStyle=function(t){var e=new Ot(t);return this.appendToStyle(e)},da.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var o=a[i];t.css(o.name,o.value)}}return t};var u4="3.30.2",Dn=function(e){if(e===void 0&&(e={}),Pe(e))return new go(e);if(Ee(e))return Au.apply(Au,arguments)};Dn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Dn),t.apply(null,e),this},Dn.warnings=function(t){return X0(t)},Dn.version=u4,Dn.stylesheet=Dn.Stylesheet=xw;var kw={exports:{}};function Ou(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pu,Sw;function d4(){if(Sw)return Pu;Sw=1;function t(){this.__data__=[],this.size=0}return Pu=t,Pu}var Ru,_w;function ui(){if(_w)return Ru;_w=1;function t(e,r){return e===r||e!==e&&r!==r}return Ru=t,Ru}var Lu,Tw;function cl(){if(Tw)return Lu;Tw=1;var t=ui();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return Lu=e,Lu}var Mu,Nw;function f4(){if(Nw)return Mu;Nw=1;var t=cl(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,o=t(i,a);if(o<0)return!1;var l=i.length-1;return o==l?i.pop():r.call(i,o,1),--this.size,!0}return Mu=n,Mu}var Fu,Iw;function h4(){if(Iw)return Fu;Iw=1;var t=cl();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return Fu=e,Fu}var $u,Bw;function p4(){if(Bw)return $u;Bw=1;var t=cl();function e(r){return t(this.__data__,r)>-1}return $u=e,$u}var Vu,Dw;function v4(){if(Dw)return Vu;Dw=1;var t=cl();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Vu=e,Vu}var qu,Aw;function ul(){if(Aw)return qu;Aw=1;var t=d4(),e=f4(),r=h4(),n=p4(),a=v4();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var c=o[l];this.set(c[0],c[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,qu=i,qu}var zu,Ow;function g4(){if(Ow)return zu;Ow=1;var t=ul();function e(){this.__data__=new t,this.size=0}return zu=e,zu}var Hu,Pw;function m4(){if(Pw)return Hu;Pw=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Hu=t,Hu}var Ku,Rw;function y4(){if(Rw)return Ku;Rw=1;function t(e){return this.__data__.get(e)}return Ku=t,Ku}var Gu,Lw;function b4(){if(Lw)return Gu;Lw=1;function t(e){return this.__data__.has(e)}return Gu=t,Gu}var Uu,Mw;function Fw(){if(Mw)return Uu;Mw=1;var t=typeof Li=="object"&&Li&&Li.Object===Object&&Li;return Uu=t,Uu}var Wu,$w;function br(){if($w)return Wu;$w=1;var t=Fw(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Wu=r,Wu}var ju,Vw;function di(){if(Vw)return ju;Vw=1;var t=br(),e=t.Symbol;return ju=e,ju}var Yu,qw;function w4(){if(qw)return Yu;qw=1;var t=di(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(o){var l=r.call(o,a),u=o[a];try{o[a]=void 0;var c=!0}catch{}var d=n.call(o);return c&&(l?o[a]=u:delete o[a]),d}return Yu=i,Yu}var Zu,zw;function C4(){if(zw)return Zu;zw=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Zu=r,Zu}var Xu,Hw;function fa(){if(Hw)return Xu;Hw=1;var t=di(),e=w4(),r=C4(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?a:n:i&&i in Object(l)?e(l):r(l)}return Xu=o,Xu}var Ju,Kw;function or(){if(Kw)return Ju;Kw=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Ju=t,Ju}var Qu,Gw;function Eo(){if(Gw)return Qu;Gw=1;var t=fa(),e=or(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!e(l))return!1;var u=t(l);return u==n||u==a||u==r||u==i}return Qu=o,Qu}var ed,Uw;function E4(){if(Uw)return ed;Uw=1;var t=br(),e=t["__core-js_shared__"];return ed=e,ed}var td,Ww;function x4(){if(Ww)return td;Ww=1;var t=E4(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return td=r,td}var rd,jw;function Yw(){if(jw)return rd;jw=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return rd=r,rd}var nd,Zw;function k4(){if(Zw)return nd;Zw=1;var t=Eo(),e=x4(),r=or(),n=Yw(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,u=o.toString,c=l.hasOwnProperty,d=RegExp("^"+u.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||e(h))return!1;var v=t(h)?d:i;return v.test(n(h))}return nd=f,nd}var ad,Xw;function S4(){if(Xw)return ad;Xw=1;function t(e,r){return e==null?void 0:e[r]}return ad=t,ad}var id,Jw;function ha(){if(Jw)return id;Jw=1;var t=k4(),e=S4();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return id=r,id}var od,Qw;function sd(){if(Qw)return od;Qw=1;var t=ha(),e=br(),r=t(e,"Map");return od=r,od}var ld,eC;function dl(){if(eC)return ld;eC=1;var t=ha(),e=t(Object,"create");return ld=e,ld}var cd,tC;function _4(){if(tC)return cd;tC=1;var t=dl();function e(){this.__data__=t?t(null):{},this.size=0}return cd=e,cd}var ud,rC;function T4(){if(rC)return ud;rC=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return ud=t,ud}var dd,nC;function N4(){if(nC)return dd;nC=1;var t=dl(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(t){var l=o[i];return l===e?void 0:l}return n.call(o,i)?o[i]:void 0}return dd=a,dd}var fd,aC;function I4(){if(aC)return fd;aC=1;var t=dl(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return fd=n,fd}var hd,iC;function B4(){if(iC)return hd;iC=1;var t=dl(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return hd=r,hd}var pd,oC;function D4(){if(oC)return pd;oC=1;var t=_4(),e=T4(),r=N4(),n=I4(),a=B4();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var c=o[l];this.set(c[0],c[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,pd=i,pd}var vd,sC;function A4(){if(sC)return vd;sC=1;var t=D4(),e=ul(),r=sd();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return vd=n,vd}var gd,lC;function O4(){if(lC)return gd;lC=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return gd=t,gd}var md,cC;function fl(){if(cC)return md;cC=1;var t=O4();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return md=e,md}var yd,uC;function P4(){if(uC)return yd;uC=1;var t=fl();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return yd=e,yd}var bd,dC;function R4(){if(dC)return bd;dC=1;var t=fl();function e(r){return t(this,r).get(r)}return bd=e,bd}var wd,fC;function L4(){if(fC)return wd;fC=1;var t=fl();function e(r){return t(this,r).has(r)}return wd=e,wd}var Cd,hC;function M4(){if(hC)return Cd;hC=1;var t=fl();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return Cd=e,Cd}var Ed,pC;function xd(){if(pC)return Ed;pC=1;var t=A4(),e=P4(),r=R4(),n=L4(),a=M4();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var c=o[l];this.set(c[0],c[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,Ed=i,Ed}var kd,vC;function F4(){if(vC)return kd;vC=1;var t=ul(),e=sd(),r=xd(),n=200;function a(i,o){var l=this.__data__;if(l instanceof t){var u=l.__data__;if(!e||u.length<n-1)return u.push([i,o]),this.size=++l.size,this;l=this.__data__=new r(u)}return l.set(i,o),this.size=l.size,this}return kd=a,kd}var Sd,gC;function hl(){if(gC)return Sd;gC=1;var t=ul(),e=g4(),r=m4(),n=y4(),a=b4(),i=F4();function o(l){var u=this.__data__=new t(l);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Sd=o,Sd}var _d,mC;function Td(){if(mC)return _d;mC=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a&&r(e[n],n,e)!==!1;);return e}return _d=t,_d}var Nd,yC;function bC(){if(yC)return Nd;yC=1;var t=ha(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Nd=e,Nd}var Id,wC;function pl(){if(wC)return Id;wC=1;var t=bC();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Id=e,Id}var Bd,CC;function vl(){if(CC)return Bd;CC=1;var t=pl(),e=ui(),r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l){var u=i[o];(!(n.call(i,o)&&e(u,l))||l===void 0&&!(o in i))&&t(i,o,l)}return Bd=a,Bd}var Dd,EC;function xo(){if(EC)return Dd;EC=1;var t=vl(),e=pl();function r(n,a,i,o){var l=!i;i||(i={});for(var u=-1,c=a.length;++u<c;){var d=a[u],f=o?o(i[d],n[d],d,i,n):void 0;f===void 0&&(f=n[d]),l?e(i,d,f):t(i,d,f)}return i}return Dd=r,Dd}var Ad,xC;function $4(){if(xC)return Ad;xC=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return Ad=t,Ad}var Od,kC;function Rr(){if(kC)return Od;kC=1;function t(e){return e!=null&&typeof e=="object"}return Od=t,Od}var Pd,SC;function V4(){if(SC)return Pd;SC=1;var t=fa(),e=Rr(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return Pd=n,Pd}var Rd,_C;function ko(){if(_C)return Rd;_C=1;var t=V4(),e=Rr(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t(function(){return arguments}())?t:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return Rd=i,Rd}var Ld,TC;function ot(){if(TC)return Ld;TC=1;var t=Array.isArray;return Ld=t,Ld}var So={exports:{}},Md,NC;function q4(){if(NC)return Md;NC=1;function t(){return!1}return Md=t,Md}So.exports;var IC;function fi(){return IC||(IC=1,function(t,e){var r=br(),n=q4(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===a,l=o?r.Buffer:void 0,u=l?l.isBuffer:void 0,c=u||n;t.exports=c}(So,So.exports)),So.exports}var Fd,BC;function gl(){if(BC)return Fd;BC=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Fd=r,Fd}var $d,DC;function Vd(){if(DC)return $d;DC=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return $d=e,$d}var qd,AC;function z4(){if(AC)return qd;AC=1;var t=fa(),e=Vd(),r=Rr(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",u="[object Function]",c="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",v="[object Set]",p="[object String]",g="[object WeakMap]",y="[object ArrayBuffer]",m="[object DataView]",b="[object Float32Array]",w="[object Float64Array]",C="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",_="[object Uint8ClampedArray]",S="[object Uint16Array]",T="[object Uint32Array]",N={};N[b]=N[w]=N[C]=N[x]=N[k]=N[E]=N[_]=N[S]=N[T]=!0,N[n]=N[a]=N[y]=N[i]=N[m]=N[o]=N[l]=N[u]=N[c]=N[d]=N[f]=N[h]=N[v]=N[p]=N[g]=!1;function B(A){return r(A)&&e(A.length)&&!!N[t(A)]}return qd=B,qd}var zd,OC;function ml(){if(OC)return zd;OC=1;function t(e){return function(r){return e(r)}}return zd=t,zd}var _o={exports:{}};_o.exports;var PC;function Hd(){return PC||(PC=1,function(t,e){var r=Fw(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var u=a&&a.require&&a.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();t.exports=l}(_o,_o.exports)),_o.exports}var Kd,RC;function To(){if(RC)return Kd;RC=1;var t=z4(),e=ml(),r=Hd(),n=r&&r.isTypedArray,a=n?e(n):t;return Kd=a,Kd}var Gd,LC;function MC(){if(LC)return Gd;LC=1;var t=$4(),e=ko(),r=ot(),n=fi(),a=gl(),i=To(),o=Object.prototype,l=o.hasOwnProperty;function u(c,d){var f=r(c),h=!f&&e(c),v=!f&&!h&&n(c),p=!f&&!h&&!v&&i(c),g=f||h||v||p,y=g?t(c.length,String):[],m=y.length;for(var b in c)(d||l.call(c,b))&&!(g&&(b=="length"||v&&(b=="offset"||b=="parent")||p&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||a(b,m)))&&y.push(b);return y}return Gd=u,Gd}var Ud,FC;function yl(){if(FC)return Ud;FC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Ud=e,Ud}var Wd,$C;function VC(){if($C)return Wd;$C=1;function t(e,r){return function(n){return e(r(n))}}return Wd=t,Wd}var jd,qC;function H4(){if(qC)return jd;qC=1;var t=VC(),e=t(Object.keys,Object);return jd=e,jd}var Yd,zC;function Zd(){if(zC)return Yd;zC=1;var t=yl(),e=H4(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var o=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&o.push(l);return o}return Yd=a,Yd}var Xd,HC;function rn(){if(HC)return Xd;HC=1;var t=Eo(),e=Vd();function r(n){return n!=null&&e(n.length)&&!t(n)}return Xd=r,Xd}var Jd,KC;function An(){if(KC)return Jd;KC=1;var t=MC(),e=Zd(),r=rn();function n(a){return r(a)?t(a):e(a)}return Jd=n,Jd}var Qd,GC;function K4(){if(GC)return Qd;GC=1;var t=xo(),e=An();function r(n,a){return n&&t(a,e(a),n)}return Qd=r,Qd}var ef,UC;function G4(){if(UC)return ef;UC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return ef=t,ef}var tf,WC;function U4(){if(WC)return tf;WC=1;var t=or(),e=yl(),r=G4(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!t(o))return r(o);var l=e(o),u=[];for(var c in o)c=="constructor"&&(l||!a.call(o,c))||u.push(c);return u}return tf=i,tf}var rf,jC;function pa(){if(jC)return rf;jC=1;var t=MC(),e=U4(),r=rn();function n(a){return r(a)?t(a,!0):e(a)}return rf=n,rf}var nf,YC;function W4(){if(YC)return nf;YC=1;var t=xo(),e=pa();function r(n,a){return n&&t(a,e(a),n)}return nf=r,nf}var No={exports:{}};No.exports;var ZC;function XC(){return ZC||(ZC=1,function(t,e){var r=br(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;function u(c,d){if(d)return c.slice();var f=c.length,h=l?l(f):new c.constructor(f);return c.copy(h),h}t.exports=u}(No,No.exports)),No.exports}var af,JC;function QC(){if(JC)return af;JC=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++n<a;)r[n]=e[n];return r}return af=t,af}var of,eE;function tE(){if(eE)return of;eE=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var l=e[n];r(l,n,e)&&(o[i++]=l)}return o}return of=t,of}var sf,rE;function nE(){if(rE)return sf;rE=1;function t(){return[]}return sf=t,sf}var lf,aE;function cf(){if(aE)return lf;aE=1;var t=tE(),e=nE(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),t(a(o),function(l){return n.call(o,l)}))}:e;return lf=i,lf}var uf,iE;function j4(){if(iE)return uf;iE=1;var t=xo(),e=cf();function r(n,a){return t(n,e(n),a)}return uf=r,uf}var df,oE;function ff(){if(oE)return df;oE=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return df=t,df}var hf,sE;function bl(){if(sE)return hf;sE=1;var t=VC(),e=t(Object.getPrototypeOf,Object);return hf=e,hf}var pf,lE;function cE(){if(lE)return pf;lE=1;var t=ff(),e=bl(),r=cf(),n=nE(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var l=[];o;)t(l,r(o)),o=e(o);return l}:n;return pf=i,pf}var vf,uE;function Y4(){if(uE)return vf;uE=1;var t=xo(),e=cE();function r(n,a){return t(n,e(n),a)}return vf=r,vf}var gf,dE;function fE(){if(dE)return gf;dE=1;var t=ff(),e=ot();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return gf=r,gf}var mf,hE;function pE(){if(hE)return mf;hE=1;var t=fE(),e=cf(),r=An();function n(a){return t(a,r,e)}return mf=n,mf}var yf,vE;function Z4(){if(vE)return yf;vE=1;var t=fE(),e=cE(),r=pa();function n(a){return t(a,r,e)}return yf=n,yf}var bf,gE;function X4(){if(gE)return bf;gE=1;var t=ha(),e=br(),r=t(e,"DataView");return bf=r,bf}var wf,mE;function J4(){if(mE)return wf;mE=1;var t=ha(),e=br(),r=t(e,"Promise");return wf=r,wf}var Cf,yE;function bE(){if(yE)return Cf;yE=1;var t=ha(),e=br(),r=t(e,"Set");return Cf=r,Cf}var Ef,wE;function Q4(){if(wE)return Ef;wE=1;var t=ha(),e=br(),r=t(e,"WeakMap");return Ef=r,Ef}var xf,CE;function hi(){if(CE)return xf;CE=1;var t=X4(),e=sd(),r=J4(),n=bE(),a=Q4(),i=fa(),o=Yw(),l="[object Map]",u="[object Object]",c="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",v=o(t),p=o(e),g=o(r),y=o(n),m=o(a),b=i;return(t&&b(new t(new ArrayBuffer(1)))!=h||e&&b(new e)!=l||r&&b(r.resolve())!=c||n&&b(new n)!=d||a&&b(new a)!=f)&&(b=function(w){var C=i(w),x=C==u?w.constructor:void 0,k=x?o(x):"";if(k)switch(k){case v:return h;case p:return l;case g:return c;case y:return d;case m:return f}return C}),xf=b,xf}var kf,EE;function e8(){if(EE)return kf;EE=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return kf=r,kf}var Sf,xE;function kE(){if(xE)return Sf;xE=1;var t=br(),e=t.Uint8Array;return Sf=e,Sf}var _f,SE;function Tf(){if(SE)return _f;SE=1;var t=kE();function e(r){var n=new r.constructor(r.byteLength);return new t(n).set(new t(r)),n}return _f=e,_f}var Nf,_E;function t8(){if(_E)return Nf;_E=1;var t=Tf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return Nf=e,Nf}var If,TE;function r8(){if(TE)return If;TE=1;var t=/\w*$/;function e(r){var n=new r.constructor(r.source,t.exec(r));return n.lastIndex=r.lastIndex,n}return If=e,If}var Bf,NE;function n8(){if(NE)return Bf;NE=1;var t=di(),e=t?t.prototype:void 0,r=e?e.valueOf:void 0;function n(a){return r?Object(r.call(a)):{}}return Bf=n,Bf}var Df,IE;function BE(){if(IE)return Df;IE=1;var t=Tf();function e(r,n){var a=n?t(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return Df=e,Df}var Af,DE;function a8(){if(DE)return Af;DE=1;var t=Tf(),e=t8(),r=r8(),n=n8(),a=BE(),i="[object Boolean]",o="[object Date]",l="[object Map]",u="[object Number]",c="[object RegExp]",d="[object Set]",f="[object String]",h="[object Symbol]",v="[object ArrayBuffer]",p="[object DataView]",g="[object Float32Array]",y="[object Float64Array]",m="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",C="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",E="[object Uint32Array]";function _(S,T,N){var B=S.constructor;switch(T){case v:return t(S);case i:case o:return new B(+S);case p:return e(S,N);case g:case y:case m:case b:case w:case C:case x:case k:case E:return a(S,N);case l:return new B;case u:case f:return new B(S);case c:return r(S);case d:return new B;case h:return n(S)}}return Af=_,Af}var Of,AE;function OE(){if(AE)return Of;AE=1;var t=or(),e=Object.create,r=function(){function n(){}return function(a){if(!t(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}}();return Of=r,Of}var Pf,PE;function RE(){if(PE)return Pf;PE=1;var t=OE(),e=bl(),r=yl();function n(a){return typeof a.constructor=="function"&&!r(a)?t(e(a)):{}}return Pf=n,Pf}var Rf,LE;function i8(){if(LE)return Rf;LE=1;var t=hi(),e=Rr(),r="[object Map]";function n(a){return e(a)&&t(a)==r}return Rf=n,Rf}var Lf,ME;function o8(){if(ME)return Lf;ME=1;var t=i8(),e=ml(),r=Hd(),n=r&&r.isMap,a=n?e(n):t;return Lf=a,Lf}var Mf,FE;function s8(){if(FE)return Mf;FE=1;var t=hi(),e=Rr(),r="[object Set]";function n(a){return e(a)&&t(a)==r}return Mf=n,Mf}var Ff,$E;function l8(){if($E)return Ff;$E=1;var t=s8(),e=ml(),r=Hd(),n=r&&r.isSet,a=n?e(n):t;return Ff=a,Ff}var $f,VE;function qE(){if(VE)return $f;VE=1;var t=hl(),e=Td(),r=vl(),n=K4(),a=W4(),i=XC(),o=QC(),l=j4(),u=Y4(),c=pE(),d=Z4(),f=hi(),h=e8(),v=a8(),p=RE(),g=ot(),y=fi(),m=o8(),b=or(),w=l8(),C=An(),x=pa(),k=1,E=2,_=4,S="[object Arguments]",T="[object Array]",N="[object Boolean]",B="[object Date]",A="[object Error]",D="[object Function]",R="[object GeneratorFunction]",O="[object Map]",M="[object Number]",P="[object Object]",z="[object RegExp]",W="[object Set]",H="[object String]",G="[object Symbol]",X="[object WeakMap]",F="[object ArrayBuffer]",V="[object DataView]",q="[object Float32Array]",$="[object Float64Array]",K="[object Int8Array]",L="[object Int16Array]",j="[object Int32Array]",Y="[object Uint8Array]",se="[object Uint8ClampedArray]",ce="[object Uint16Array]",ae="[object Uint32Array]",ne={};ne[S]=ne[T]=ne[F]=ne[V]=ne[N]=ne[B]=ne[q]=ne[$]=ne[K]=ne[L]=ne[j]=ne[O]=ne[M]=ne[P]=ne[z]=ne[W]=ne[H]=ne[G]=ne[Y]=ne[se]=ne[ce]=ne[ae]=!0,ne[A]=ne[D]=ne[X]=!1;function ue(ie,fe,pe,Ae,Ie,we){var ke,re=fe&k,I=fe&E,U=fe&_;if(pe&&(ke=Ie?pe(ie,Ae,Ie,we):pe(ie)),ke!==void 0)return ke;if(!b(ie))return ie;var te=g(ie);if(te){if(ke=h(ie),!re)return o(ie,ke)}else{var Z=f(ie),J=Z==D||Z==R;if(y(ie))return i(ie,re);if(Z==P||Z==S||J&&!Ie){if(ke=I||J?{}:p(ie),!re)return I?u(ie,a(ke,ie)):l(ie,n(ke,ie))}else{if(!ne[Z])return Ie?ie:{};ke=v(ie,Z,re)}}we||(we=new t);var le=we.get(ie);if(le)return le;we.set(ie,ke),w(ie)?ie.forEach(function(me){ke.add(ue(me,fe,pe,me,ie,we))}):m(ie)&&ie.forEach(function(me,be){ke.set(be,ue(me,fe,pe,be,ie,we))});var ee=U?I?d:c:I?x:C,oe=te?void 0:ee(ie);return e(oe||ie,function(me,be){oe&&(be=me,me=ie[be]),r(ke,be,ue(me,fe,pe,be,ie,we))}),ke}return $f=ue,$f}var Vf,zE;function c8(){if(zE)return Vf;zE=1;var t=qE(),e=4;function r(n){return t(n,e)}return Vf=r,Vf}var qf,HE;function zf(){if(HE)return qf;HE=1;function t(e){return function(){return e}}return qf=t,qf}var Hf,KE;function u8(){if(KE)return Hf;KE=1;function t(e){return function(r,n,a){for(var i=-1,o=Object(r),l=a(r),u=l.length;u--;){var c=l[e?u:++i];if(n(o[c],c,o)===!1)break}return r}}return Hf=t,Hf}var Kf,GE;function Gf(){if(GE)return Kf;GE=1;var t=u8(),e=t();return Kf=e,Kf}var Uf,UE;function Wf(){if(UE)return Uf;UE=1;var t=Gf(),e=An();function r(n,a){return n&&t(n,a,e)}return Uf=r,Uf}var jf,WE;function d8(){if(WE)return jf;WE=1;var t=rn();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var o=a.length,l=n?o:-1,u=Object(a);(n?l--:++l<o)&&i(u[l],l,u)!==!1;);return a}}return jf=e,jf}var Yf,jE;function wl(){if(jE)return Yf;jE=1;var t=Wf(),e=d8(),r=e(t);return Yf=r,Yf}var Zf,YE;function va(){if(YE)return Zf;YE=1;function t(e){return e}return Zf=t,Zf}var Xf,ZE;function XE(){if(ZE)return Xf;ZE=1;var t=va();function e(r){return typeof r=="function"?r:t}return Xf=e,Xf}var Jf,JE;function QE(){if(JE)return Jf;JE=1;var t=Td(),e=wl(),r=XE(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o))}return Jf=a,Jf}var Qf,ex;function tx(){return ex||(ex=1,Qf=QE()),Qf}var eh,rx;function f8(){if(rx)return eh;rx=1;var t=wl();function e(r,n){var a=[];return t(r,function(i,o,l){n(i,o,l)&&a.push(i)}),a}return eh=e,eh}var th,nx;function h8(){if(nx)return th;nx=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return th=e,th}var rh,ax;function p8(){if(ax)return rh;ax=1;function t(e){return this.__data__.has(e)}return rh=t,rh}var nh,ix;function ox(){if(ix)return nh;ix=1;var t=xd(),e=h8(),r=p8();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new t;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,nh=n,nh}var ah,sx;function v8(){if(sx)return ah;sx=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return ah=t,ah}var ih,lx;function cx(){if(lx)return ih;lx=1;function t(e,r){return e.has(r)}return ih=t,ih}var oh,ux;function dx(){if(ux)return oh;ux=1;var t=ox(),e=v8(),r=cx(),n=1,a=2;function i(o,l,u,c,d,f){var h=u&n,v=o.length,p=l.length;if(v!=p&&!(h&&p>v))return!1;var g=f.get(o),y=f.get(l);if(g&&y)return g==l&&y==o;var m=-1,b=!0,w=u&a?new t:void 0;for(f.set(o,l),f.set(l,o);++m<v;){var C=o[m],x=l[m];if(c)var k=h?c(x,C,m,l,o,f):c(C,x,m,o,l,f);if(k!==void 0){if(k)continue;b=!1;break}if(w){if(!e(l,function(E,_){if(!r(w,_)&&(C===E||d(C,E,u,c,f)))return w.push(_)})){b=!1;break}}else if(!(C===x||d(C,x,u,c,f))){b=!1;break}}return f.delete(o),f.delete(l),b}return oh=i,oh}var sh,fx;function g8(){if(fx)return sh;fx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return sh=t,sh}var lh,hx;function ch(){if(hx)return lh;hx=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return lh=t,lh}var uh,px;function m8(){if(px)return uh;px=1;var t=di(),e=kE(),r=ui(),n=dx(),a=g8(),i=ch(),o=1,l=2,u="[object Boolean]",c="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",v="[object RegExp]",p="[object Set]",g="[object String]",y="[object Symbol]",m="[object ArrayBuffer]",b="[object DataView]",w=t?t.prototype:void 0,C=w?w.valueOf:void 0;function x(k,E,_,S,T,N,B){switch(_){case b:if(k.byteLength!=E.byteLength||k.byteOffset!=E.byteOffset)return!1;k=k.buffer,E=E.buffer;case m:return!(k.byteLength!=E.byteLength||!N(new e(k),new e(E)));case u:case c:case h:return r(+k,+E);case d:return k.name==E.name&&k.message==E.message;case v:case g:return k==E+"";case f:var A=a;case p:var D=S&o;if(A||(A=i),k.size!=E.size&&!D)return!1;var R=B.get(k);if(R)return R==E;S|=l,B.set(k,E);var O=n(A(k),A(E),S,T,N,B);return B.delete(k),O;case y:if(C)return C.call(k)==C.call(E)}return!1}return uh=x,uh}var dh,vx;function y8(){if(vx)return dh;vx=1;var t=pE(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l,u,c,d){var f=l&e,h=t(i),v=h.length,p=t(o),g=p.length;if(v!=g&&!f)return!1;for(var y=v;y--;){var m=h[y];if(!(f?m in o:n.call(o,m)))return!1}var b=d.get(i),w=d.get(o);if(b&&w)return b==o&&w==i;var C=!0;d.set(i,o),d.set(o,i);for(var x=f;++y<v;){m=h[y];var k=i[m],E=o[m];if(u)var _=f?u(E,k,m,o,i,d):u(k,E,m,i,o,d);if(!(_===void 0?k===E||c(k,E,l,u,d):_)){C=!1;break}x||(x=m=="constructor")}if(C&&!x){var S=i.constructor,T=o.constructor;S!=T&&"constructor"in i&&"constructor"in o&&!(typeof S=="function"&&S instanceof S&&typeof T=="function"&&T instanceof T)&&(C=!1)}return d.delete(i),d.delete(o),C}return dh=a,dh}var fh,gx;function b8(){if(gx)return fh;gx=1;var t=hl(),e=dx(),r=m8(),n=y8(),a=hi(),i=ot(),o=fi(),l=To(),u=1,c="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,v=h.hasOwnProperty;function p(g,y,m,b,w,C){var x=i(g),k=i(y),E=x?d:a(g),_=k?d:a(y);E=E==c?f:E,_=_==c?f:_;var S=E==f,T=_==f,N=E==_;if(N&&o(g)){if(!o(y))return!1;x=!0,S=!1}if(N&&!S)return C||(C=new t),x||l(g)?e(g,y,m,b,w,C):r(g,y,E,m,b,w,C);if(!(m&u)){var B=S&&v.call(g,"__wrapped__"),A=T&&v.call(y,"__wrapped__");if(B||A){var D=B?g.value():g,R=A?y.value():y;return C||(C=new t),w(D,R,m,b,C)}}return N?(C||(C=new t),n(g,y,m,b,w,C)):!1}return fh=p,fh}var hh,mx;function yx(){if(mx)return hh;mx=1;var t=b8(),e=Rr();function r(n,a,i,o,l){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,o,r,l)}return hh=r,hh}var ph,bx;function w8(){if(bx)return ph;bx=1;var t=hl(),e=yx(),r=1,n=2;function a(i,o,l,u){var c=l.length,d=c,f=!u;if(i==null)return!d;for(i=Object(i);c--;){var h=l[c];if(f&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++c<d;){h=l[c];var v=h[0],p=i[v],g=h[1];if(f&&h[2]){if(p===void 0&&!(v in i))return!1}else{var y=new t;if(u)var m=u(p,g,v,i,o,y);if(!(m===void 0?e(g,p,r|n,u,y):m))return!1}}return!0}return ph=a,ph}var vh,wx;function Cx(){if(wx)return vh;wx=1;var t=or();function e(r){return r===r&&!t(r)}return vh=e,vh}var gh,Ex;function C8(){if(Ex)return gh;Ex=1;var t=Cx(),e=An();function r(n){for(var a=e(n),i=a.length;i--;){var o=a[i],l=n[o];a[i]=[o,l,t(l)]}return a}return gh=r,gh}var mh,xx;function kx(){if(xx)return mh;xx=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return mh=t,mh}var yh,Sx;function E8(){if(Sx)return yh;Sx=1;var t=w8(),e=C8(),r=kx();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===a||t(o,a,i)}}return yh=n,yh}var bh,_x;function pi(){if(_x)return bh;_x=1;var t=fa(),e=Rr(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return bh=n,bh}var wh,Tx;function Ch(){if(Tx)return wh;Tx=1;var t=ot(),e=pi(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(t(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return wh=a,wh}var Eh,Nx;function x8(){if(Nx)return Eh;Nx=1;var t=xd(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,l=a?a.apply(this,o):o[0],u=i.cache;if(u.has(l))return u.get(l);var c=n.apply(this,o);return i.cache=u.set(l,c)||u,c};return i.cache=new(r.Cache||t),i}return r.Cache=t,Eh=r,Eh}var xh,Ix;function k8(){if(Ix)return xh;Ix=1;var t=x8(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return xh=r,xh}var kh,Bx;function S8(){if(Bx)return kh;Bx=1;var t=k8(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,l,u,c){i.push(u?c.replace(r,"$1"):l||o)}),i});return kh=n,kh}var Sh,Dx;function Cl(){if(Dx)return Sh;Dx=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Sh=t,Sh}var _h,Ax;function _8(){if(Ax)return _h;Ax=1;var t=di(),e=Cl(),r=ot(),n=pi(),a=1/0,i=t?t.prototype:void 0,o=i?i.toString:void 0;function l(u){if(typeof u=="string")return u;if(r(u))return e(u,l)+"";if(n(u))return o?o.call(u):"";var c=u+"";return c=="0"&&1/u==-a?"-0":c}return _h=l,_h}var Th,Ox;function Px(){if(Ox)return Th;Ox=1;var t=_8();function e(r){return r==null?"":t(r)}return Th=e,Th}var Nh,Rx;function El(){if(Rx)return Nh;Rx=1;var t=ot(),e=Ch(),r=S8(),n=Px();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Nh=a,Nh}var Ih,Lx;function Io(){if(Lx)return Ih;Lx=1;var t=pi(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var a=n+"";return a=="0"&&1/n==-e?"-0":a}return Ih=r,Ih}var Bh,Mx;function xl(){if(Mx)return Bh;Mx=1;var t=El(),e=Io();function r(n,a){a=t(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Bh=r,Bh}var Dh,Fx;function T8(){if(Fx)return Dh;Fx=1;var t=xl();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Dh=e,Dh}var Ah,$x;function N8(){if($x)return Ah;$x=1;function t(e,r){return e!=null&&r in Object(e)}return Ah=t,Ah}var Oh,Vx;function qx(){if(Vx)return Oh;Vx=1;var t=El(),e=ko(),r=ot(),n=gl(),a=Vd(),i=Io();function o(l,u,c){u=t(u,l);for(var d=-1,f=u.length,h=!1;++d<f;){var v=i(u[d]);if(!(h=l!=null&&c(l,v)))break;l=l[v]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&a(f)&&n(v,f)&&(r(l)||e(l)))}return Oh=o,Oh}var Ph,zx;function Hx(){if(zx)return Ph;zx=1;var t=N8(),e=qx();function r(n,a){return n!=null&&e(n,a,t)}return Ph=r,Ph}var Rh,Kx;function I8(){if(Kx)return Rh;Kx=1;var t=yx(),e=T8(),r=Hx(),n=Ch(),a=Cx(),i=kx(),o=Io(),l=1,u=2;function c(d,f){return n(d)&&a(f)?i(o(d),f):function(h){var v=e(h,d);return v===void 0&&v===f?r(h,d):t(f,v,l|u)}}return Rh=c,Rh}var Lh,Gx;function Ux(){if(Gx)return Lh;Gx=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Lh=t,Lh}var Mh,Wx;function B8(){if(Wx)return Mh;Wx=1;var t=xl();function e(r){return function(n){return t(n,r)}}return Mh=e,Mh}var Fh,jx;function D8(){if(jx)return Fh;jx=1;var t=Ux(),e=B8(),r=Ch(),n=Io();function a(i){return r(i)?t(n(i)):e(i)}return Fh=a,Fh}var $h,Yx;function nn(){if(Yx)return $h;Yx=1;var t=E8(),e=I8(),r=va(),n=ot(),a=D8();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):a(o)}return $h=i,$h}var Vh,Zx;function Xx(){if(Zx)return Vh;Zx=1;var t=tE(),e=f8(),r=nn(),n=ot();function a(i,o){var l=n(i)?t:e;return l(i,r(o,3))}return Vh=a,Vh}var qh,Jx;function A8(){if(Jx)return qh;Jx=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,a){return n!=null&&e.call(n,a)}return qh=r,qh}var zh,Qx;function ek(){if(Qx)return zh;Qx=1;var t=A8(),e=qx();function r(n,a){return n!=null&&e(n,a,t)}return zh=r,zh}var Hh,tk;function O8(){if(tk)return Hh;tk=1;var t=Zd(),e=hi(),r=ko(),n=ot(),a=rn(),i=fi(),o=yl(),l=To(),u="[object Map]",c="[object Set]",d=Object.prototype,f=d.hasOwnProperty;function h(v){if(v==null)return!0;if(a(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||i(v)||l(v)||r(v)))return!v.length;var p=e(v);if(p==u||p==c)return!v.size;if(o(v))return!t(v).length;for(var g in v)if(f.call(v,g))return!1;return!0}return Hh=h,Hh}var Kh,rk;function nk(){if(rk)return Kh;rk=1;function t(e){return e===void 0}return Kh=t,Kh}var Gh,ak;function ik(){if(ak)return Gh;ak=1;var t=wl(),e=rn();function r(n,a){var i=-1,o=e(n)?Array(n.length):[];return t(n,function(l,u,c){o[++i]=a(l,u,c)}),o}return Gh=r,Gh}var Uh,ok;function sk(){if(ok)return Uh;ok=1;var t=Cl(),e=nn(),r=ik(),n=ot();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return Uh=a,Uh}var Wh,lk;function P8(){if(lk)return Wh;lk=1;function t(e,r,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=r(n,e[i],i,e);return n}return Wh=t,Wh}var jh,ck;function R8(){if(ck)return jh;ck=1;function t(e,r,n,a,i){return i(e,function(o,l,u){n=a?(a=!1,o):r(n,o,l,u)}),n}return jh=t,jh}var Yh,uk;function dk(){if(uk)return Yh;uk=1;var t=P8(),e=wl(),r=nn(),n=R8(),a=ot();function i(o,l,u){var c=a(o)?t:n,d=arguments.length<3;return c(o,r(l,4),u,d,e)}return Yh=i,Yh}var Zh,fk;function L8(){if(fk)return Zh;fk=1;var t=fa(),e=ot(),r=Rr(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return Zh=a,Zh}var Xh,hk;function M8(){if(hk)return Xh;hk=1;var t=Ux(),e=t("length");return Xh=e,Xh}var Jh,pk;function F8(){if(pk)return Jh;pk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+a+i+"]");function u(c){return l.test(c)}return Jh=u,Jh}var Qh,vk;function $8(){if(vk)return Qh;vk=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="["+t+"]",l="["+a+"]",u="\\ud83c[\\udffb-\\udfff]",c="(?:"+l+"|"+u+")",d="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",p=c+"?",g="["+i+"]?",y="(?:"+v+"(?:"+[d,f,h].join("|")+")"+g+p+")*",m=g+p+y,b="(?:"+[d+l+"?",l,f,h,o].join("|")+")",w=RegExp(u+"(?="+u+")|"+b+m,"g");function C(x){for(var k=w.lastIndex=0;w.test(x);)++k;return k}return Qh=C,Qh}var ep,gk;function V8(){if(gk)return ep;gk=1;var t=M8(),e=F8(),r=$8();function n(a){return e(a)?r(a):t(a)}return ep=n,ep}var tp,mk;function q8(){if(mk)return tp;mk=1;var t=Zd(),e=hi(),r=rn(),n=L8(),a=V8(),i="[object Map]",o="[object Set]";function l(u){if(u==null)return 0;if(r(u))return n(u)?a(u):u.length;var c=e(u);return c==i||c==o?u.size:t(u).length}return tp=l,tp}var rp,yk;function z8(){if(yk)return rp;yk=1;var t=Td(),e=OE(),r=Wf(),n=nn(),a=bl(),i=ot(),o=fi(),l=Eo(),u=or(),c=To();function d(f,h,v){var p=i(f),g=p||o(f)||c(f);if(h=n(h,4),v==null){var y=f&&f.constructor;g?v=p?new y:[]:u(f)?v=l(y)?e(a(f)):{}:v={}}return(g?t:r)(f,function(m,b,w){return h(v,m,b,w)}),v}return rp=d,rp}var np,bk;function H8(){if(bk)return np;bk=1;var t=di(),e=ko(),r=ot(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return np=a,np}var ap,wk;function ip(){if(wk)return ap;wk=1;var t=ff(),e=H8();function r(n,a,i,o,l){var u=-1,c=n.length;for(i||(i=e),l||(l=[]);++u<c;){var d=n[u];a>0&&i(d)?a>1?r(d,a-1,i,o,l):t(l,d):o||(l[l.length]=d)}return l}return ap=r,ap}var op,Ck;function K8(){if(Ck)return op;Ck=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return op=t,op}var sp,Ek;function xk(){if(Ek)return sp;Ek=1;var t=K8(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,l=-1,u=e(o.length-a,0),c=Array(u);++l<u;)c[l]=o[a+l];l=-1;for(var d=Array(a+1);++l<a;)d[l]=o[l];return d[a]=i(c),t(n,this,d)}}return sp=r,sp}var lp,kk;function G8(){if(kk)return lp;kk=1;var t=zf(),e=bC(),r=va(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return lp=n,lp}var cp,Sk;function U8(){if(Sk)return cp;Sk=1;var t=800,e=16,r=Date.now;function n(a){var i=0,o=0;return function(){var l=r(),u=e-(l-o);if(o=l,u>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return cp=n,cp}var up,_k;function Tk(){if(_k)return up;_k=1;var t=G8(),e=U8(),r=e(t);return up=r,up}var dp,Nk;function kl(){if(Nk)return dp;Nk=1;var t=va(),e=xk(),r=Tk();function n(a,i){return r(e(a,i,t),a+"")}return dp=n,dp}var fp,Ik;function Bk(){if(Ik)return fp;Ik=1;function t(e,r,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return fp=t,fp}var hp,Dk;function W8(){if(Dk)return hp;Dk=1;function t(e){return e!==e}return hp=t,hp}var pp,Ak;function j8(){if(Ak)return pp;Ak=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return pp=t,pp}var vp,Ok;function Y8(){if(Ok)return vp;Ok=1;var t=Bk(),e=W8(),r=j8();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return vp=n,vp}var gp,Pk;function Z8(){if(Pk)return gp;Pk=1;var t=Y8();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return gp=e,gp}var mp,Rk;function X8(){if(Rk)return mp;Rk=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return mp=t,mp}var yp,Lk;function J8(){if(Lk)return yp;Lk=1;function t(){}return yp=t,yp}var bp,Mk;function Q8(){if(Mk)return bp;Mk=1;var t=bE(),e=J8(),r=ch(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return bp=a,bp}var wp,Fk;function e6(){if(Fk)return wp;Fk=1;var t=ox(),e=Z8(),r=X8(),n=cx(),a=Q8(),i=ch(),o=200;function l(u,c,d){var f=-1,h=e,v=u.length,p=!0,g=[],y=g;if(d)p=!1,h=r;else if(v>=o){var m=c?null:a(u);if(m)return i(m);p=!1,h=n,y=new t}else y=c?[]:g;e:for(;++f<v;){var b=u[f],w=c?c(b):b;if(b=d||b!==0?b:0,p&&w===w){for(var C=y.length;C--;)if(y[C]===w)continue e;c&&y.push(w),g.push(b)}else h(y,w,d)||(y!==g&&y.push(w),g.push(b))}return g}return wp=l,wp}var Cp,$k;function Vk(){if($k)return Cp;$k=1;var t=rn(),e=Rr();function r(n){return e(n)&&t(n)}return Cp=r,Cp}var Ep,qk;function t6(){if(qk)return Ep;qk=1;var t=ip(),e=kl(),r=e6(),n=Vk(),a=e(function(i){return r(t(i,1,n,!0))});return Ep=a,Ep}var xp,zk;function r6(){if(zk)return xp;zk=1;var t=Cl();function e(r,n){return t(n,function(a){return r[a]})}return xp=e,xp}var kp,Hk;function Kk(){if(Hk)return kp;Hk=1;var t=r6(),e=An();function r(n){return n==null?[]:t(n,e(n))}return kp=r,kp}var Sp,Gk;function sr(){if(Gk)return Sp;Gk=1;var t;if(typeof Ou=="function")try{t={clone:c8(),constant:zf(),each:tx(),filter:Xx(),has:ek(),isArray:ot(),isEmpty:O8(),isFunction:Eo(),isUndefined:nk(),keys:An(),map:sk(),reduce:dk(),size:q8(),transform:z8(),union:t6(),values:Kk()}}catch{}return t||(t=window._),Sp=t,Sp}var _p,Uk;function Tp(){if(Uk)return _p;Uk=1;var t=sr();_p=a;var e="\0",r="\0",n="";function a(d){this._isDirected=t.has(d,"directed")?d.directed:!0,this._isMultigraph=t.has(d,"multigraph")?d.multigraph:!1,this._isCompound=t.has(d,"compound")?d.compound:!1,this._label=void 0,this._defaultNodeLabelFn=t.constant(void 0),this._defaultEdgeLabelFn=t.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(d){return this._label=d,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultNodeLabelFn=d,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return t.keys(this._nodes)},a.prototype.sources=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._in[f])})},a.prototype.sinks=function(){var d=this;return t.filter(this.nodes(),function(f){return t.isEmpty(d._out[f])})},a.prototype.setNodes=function(d,f){var h=arguments,v=this;return t.each(d,function(p){h.length>1?v.setNode(p,f):v.setNode(p)}),this},a.prototype.setNode=function(d,f){return t.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=f),this):(this._nodes[d]=arguments.length>1?f:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return t.has(this._nodes,d)},a.prototype.removeNode=function(d){var f=this;if(t.has(this._nodes,d)){var h=function(v){f.removeEdge(f._edgeObjs[v])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],t.each(this.children(d),function(v){f.setParent(v)}),delete this._children[d]),t.each(t.keys(this._in[d]),h),delete this._in[d],delete this._preds[d],t.each(t.keys(this._out[d]),h),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,f){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(f))f=r;else{f+="";for(var h=f;!t.isUndefined(h);h=this.parent(h))if(h===d)throw new Error("Setting "+f+" as parent of "+d+" would create a cycle");this.setNode(f)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=f,this._children[f][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var f=this._parent[d];if(f!==r)return f}},a.prototype.children=function(d){if(t.isUndefined(d)&&(d=r),this._isCompound){var f=this._children[d];if(f)return t.keys(f)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var f=this._preds[d];if(f)return t.keys(f)},a.prototype.successors=function(d){var f=this._sucs[d];if(f)return t.keys(f)},a.prototype.neighbors=function(d){var f=this.predecessors(d);if(f)return t.union(f,this.successors(d))},a.prototype.isLeaf=function(d){var f;return this.isDirected()?f=this.successors(d):f=this.neighbors(d),f.length===0},a.prototype.filterNodes=function(d){var f=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});f.setGraph(this.graph());var h=this;t.each(this._nodes,function(g,y){d(y)&&f.setNode(y,g)}),t.each(this._edgeObjs,function(g){f.hasNode(g.v)&&f.hasNode(g.w)&&f.setEdge(g,h.edge(g))});var v={};function p(g){var y=h.parent(g);return y===void 0||f.hasNode(y)?(v[g]=y,y):y in v?v[y]:p(y)}return this._isCompound&&t.each(f.nodes(),function(g){f.setParent(g,p(g))}),f},a.prototype.setDefaultEdgeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(d,f){var h=this,v=arguments;return t.reduce(d,function(p,g){return v.length>1?h.setEdge(p,g,f):h.setEdge(p,g),g}),this},a.prototype.setEdge=function(){var d,f,h,v,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(d=g.v,f=g.w,h=g.name,arguments.length===2&&(v=arguments[1],p=!0)):(d=g,f=arguments[1],h=arguments[3],arguments.length>2&&(v=arguments[2],p=!0)),d=""+d,f=""+f,t.isUndefined(h)||(h=""+h);var y=l(this._isDirected,d,f,h);if(t.has(this._edgeLabels,y))return p&&(this._edgeLabels[y]=v),this;if(!t.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(f),this._edgeLabels[y]=p?v:this._defaultEdgeLabelFn(d,f,h);var m=u(this._isDirected,d,f,h);return d=m.v,f=m.w,Object.freeze(m),this._edgeObjs[y]=m,i(this._preds[f],d),i(this._sucs[d],f),this._in[f][y]=m,this._out[d][y]=m,this._edgeCount++,this},a.prototype.edge=function(d,f,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return this._edgeLabels[v]},a.prototype.hasEdge=function(d,f,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,f,h);return t.has(this._edgeLabels,v)},a.prototype.removeEdge=function(d,f,h){var v=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,f,h),p=this._edgeObjs[v];return p&&(d=p.v,f=p.w,delete this._edgeLabels[v],delete this._edgeObjs[v],o(this._preds[f],d),o(this._sucs[d],f),delete this._in[f][v],delete this._out[d][v],this._edgeCount--),this},a.prototype.inEdges=function(d,f){var h=this._in[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.v===f}):v}},a.prototype.outEdges=function(d,f){var h=this._out[d];if(h){var v=t.values(h);return f?t.filter(v,function(p){return p.w===f}):v}},a.prototype.nodeEdges=function(d,f){var h=this.inEdges(d,f);if(h)return h.concat(this.outEdges(d,f))};function i(d,f){d[f]?d[f]++:d[f]=1}function o(d,f){--d[f]||delete d[f]}function l(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}return p+n+g+n+(t.isUndefined(v)?e:v)}function u(d,f,h,v){var p=""+f,g=""+h;if(!d&&p>g){var y=p;p=g,g=y}var m={v:p,w:g};return v&&(m.name=v),m}function c(d,f){return l(d,f.v,f.w,f.name)}return _p}var Np,Wk;function n6(){return Wk||(Wk=1,Np="2.1.8"),Np}var Ip,jk;function a6(){return jk||(jk=1,Ip={Graph:Tp(),version:n6()}),Ip}var Bp,Yk;function i6(){if(Yk)return Bp;Yk=1;var t=sr(),e=Tp();Bp={write:r,read:i};function r(o){var l={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return t.isUndefined(o.graph())||(l.value=t.clone(o.graph())),l}function n(o){return t.map(o.nodes(),function(l){var u=o.node(l),c=o.parent(l),d={v:l};return t.isUndefined(u)||(d.value=u),t.isUndefined(c)||(d.parent=c),d})}function a(o){return t.map(o.edges(),function(l){var u=o.edge(l),c={v:l.v,w:l.w};return t.isUndefined(l.name)||(c.name=l.name),t.isUndefined(u)||(c.value=u),c})}function i(o){var l=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(u){l.setNode(u.v,u.value),u.parent&&l.setParent(u.v,u.parent)}),t.each(o.edges,function(u){l.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),l}return Bp}var Dp,Zk;function o6(){if(Zk)return Dp;Zk=1;var t=sr();Dp=e;function e(r){var n={},a=[],i;function o(l){t.has(n,l)||(n[l]=!0,i.push(l),t.each(r.successors(l),o),t.each(r.predecessors(l),o))}return t.each(r.nodes(),function(l){i=[],o(l),i.length&&a.push(i)}),a}return Dp}var Ap,Xk;function Jk(){if(Xk)return Ap;Xk=1;var t=sr();Ap=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var i=this._arr,o=i.length;return a[r]=o,i.push({key:r,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,i=a+1,o=r;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==r&&(this._swap(r,o),this._heapify(o)))},e.prototype._decrease=function(r){for(var n=this._arr,a=n[r].priority,i;r!==0&&(i=r>>1,!(n[i].priority<a));)this._swap(r,i),r=i},e.prototype._swap=function(r,n){var a=this._arr,i=this._keyIndices,o=a[r],l=a[n];a[r]=l,a[n]=o,i[l.key]=r,i[o.key]=n},Ap}var Op,Qk;function eS(){if(Qk)return Op;Qk=1;var t=sr(),e=Jk();Op=n;var r=t.constant(1);function n(i,o,l,u){return a(i,String(o),l||r,u||function(c){return i.outEdges(c)})}function a(i,o,l,u){var c={},d=new e,f,h,v=function(p){var g=p.v!==f?p.v:p.w,y=c[g],m=l(p),b=h.distance+m;if(m<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+m);b<y.distance&&(y.distance=b,y.predecessor=f,d.decrease(g,b))};for(i.nodes().forEach(function(p){var g=p===o?0:Number.POSITIVE_INFINITY;c[p]={distance:g},d.add(p,g)});d.size()>0&&(f=d.removeMin(),h=c[f],h.distance!==Number.POSITIVE_INFINITY);)u(f).forEach(v);return c}return Op}var Pp,tS;function s6(){if(tS)return Pp;tS=1;var t=eS(),e=sr();Pp=r;function r(n,a,i){return e.transform(n.nodes(),function(o,l){o[l]=t(n,l,a,i)},{})}return Pp}var Rp,rS;function nS(){if(rS)return Rp;rS=1;var t=sr();Rp=e;function e(r){var n=0,a=[],i={},o=[];function l(u){var c=i[u]={onStack:!0,lowlink:n,index:n++};if(a.push(u),r.successors(u).forEach(function(h){t.has(i,h)?i[h].onStack&&(c.lowlink=Math.min(c.lowlink,i[h].index)):(l(h),c.lowlink=Math.min(c.lowlink,i[h].lowlink))}),c.lowlink===c.index){var d=[],f;do f=a.pop(),i[f].onStack=!1,d.push(f);while(u!==f);o.push(d)}}return r.nodes().forEach(function(u){t.has(i,u)||l(u)}),o}return Rp}var Lp,aS;function l6(){if(aS)return Lp;aS=1;var t=sr(),e=nS();Lp=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Lp}var Mp,iS;function c6(){if(iS)return Mp;iS=1;var t=sr();Mp=r;var e=t.constant(1);function r(a,i,o){return n(a,i||e,o||function(l){return a.outEdges(l)})}function n(a,i,o){var l={},u=a.nodes();return u.forEach(function(c){l[c]={},l[c][c]={distance:0},u.forEach(function(d){c!==d&&(l[c][d]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(d){var f=d.v===c?d.w:d.v,h=i(d);l[c][f]={distance:h,predecessor:c}})}),u.forEach(function(c){var d=l[c];u.forEach(function(f){var h=l[f];u.forEach(function(v){var p=h[c],g=d[v],y=h[v],m=p.distance+g.distance;m<y.distance&&(y.distance=m,y.predecessor=g.predecessor)})})}),l}return Mp}var Fp,oS;function sS(){if(oS)return Fp;oS=1;var t=sr();Fp=e,e.CycleException=r;function e(n){var a={},i={},o=[];function l(u){if(t.has(i,u))throw new r;t.has(a,u)||(i[u]=!0,a[u]=!0,t.each(n.predecessors(u),l),delete i[u],o.push(u))}if(t.each(n.sinks(),l),t.size(a)!==n.nodeCount())throw new r;return o}function r(){}return r.prototype=new Error,Fp}var $p,lS;function u6(){if(lS)return $p;lS=1;var t=sS();$p=e;function e(r){try{t(r)}catch(n){if(n instanceof t.CycleException)return!1;throw n}return!0}return $p}var Vp,cS;function uS(){if(cS)return Vp;cS=1;var t=sr();Vp=e;function e(n,a,i){t.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),l=[],u={};return t.each(a,function(c){if(!n.hasNode(c))throw new Error("Graph does not have node: "+c);r(n,c,i==="post",u,o,l)}),l}function r(n,a,i,o,l,u){t.has(o,a)||(o[a]=!0,i||u.push(a),t.each(l(a),function(c){r(n,c,i,o,l,u)}),i&&u.push(a))}return Vp}var qp,dS;function d6(){if(dS)return qp;dS=1;var t=uS();qp=e;function e(r,n){return t(r,n,"post")}return qp}var zp,fS;function f6(){if(fS)return zp;fS=1;var t=uS();zp=e;function e(r,n){return t(r,n,"pre")}return zp}var Hp,hS;function h6(){if(hS)return Hp;hS=1;var t=sr(),e=Tp(),r=Jk();Hp=n;function n(a,i){var o=new e,l={},u=new r,c;function d(h){var v=h.v===c?h.w:h.v,p=u.priority(v);if(p!==void 0){var g=i(h);g<p&&(l[v]=c,u.decrease(v,g))}}if(a.nodeCount()===0)return o;t.each(a.nodes(),function(h){u.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),u.decrease(a.nodes()[0],0);for(var f=!1;u.size()>0;){if(c=u.removeMin(),t.has(l,c))o.setEdge(c,l[c]);else{if(f)throw new Error("Input graph is not connected: "+a);f=!0}a.nodeEdges(c).forEach(d)}return o}return Hp}var Kp,pS;function p6(){return pS||(pS=1,Kp={components:o6(),dijkstra:eS(),dijkstraAll:s6(),findCycles:l6(),floydWarshall:c6(),isAcyclic:u6(),postorder:d6(),preorder:f6(),prim:h6(),tarjan:nS(),topsort:sS()}),Kp}var Gp,vS;function v6(){if(vS)return Gp;vS=1;var t=a6();return Gp={Graph:t.Graph,json:i6(),alg:p6(),version:t.version},Gp}var Up,gS;function wr(){if(gS)return Up;gS=1;var t;if(typeof Ou=="function")try{t=v6()}catch{}return t||(t=window.graphlib),Up=t,Up}var Wp,mS;function g6(){if(mS)return Wp;mS=1;var t=qE(),e=1,r=4;function n(a){return t(a,e|r)}return Wp=n,Wp}var jp,yS;function Sl(){if(yS)return jp;yS=1;var t=ui(),e=rn(),r=gl(),n=or();function a(i,o,l){if(!n(l))return!1;var u=typeof o;return(u=="number"?e(l)&&r(o,l.length):u=="string"&&o in l)?t(l[o],i):!1}return jp=a,jp}var Yp,bS;function m6(){if(bS)return Yp;bS=1;var t=kl(),e=ui(),r=Sl(),n=pa(),a=Object.prototype,i=a.hasOwnProperty,o=t(function(l,u){l=Object(l);var c=-1,d=u.length,f=d>2?u[2]:void 0;for(f&&r(u[0],u[1],f)&&(d=1);++c<d;)for(var h=u[c],v=n(h),p=-1,g=v.length;++p<g;){var y=v[p],m=l[y];(m===void 0||e(m,a[y])&&!i.call(l,y))&&(l[y]=h[y])}return l});return Yp=o,Yp}var Zp,wS;function y6(){if(wS)return Zp;wS=1;var t=nn(),e=rn(),r=An();function n(a){return function(i,o,l){var u=Object(i);if(!e(i)){var c=t(o,3);i=r(i),o=function(f){return c(u[f],f,u)}}var d=a(i,o,l);return d>-1?u[c?i[d]:d]:void 0}}return Zp=n,Zp}var Xp,CS;function b6(){if(CS)return Xp;CS=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Xp=e,Xp}var Jp,ES;function w6(){if(ES)return Jp;ES=1;var t=b6(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Jp=r,Jp}var Qp,xS;function C6(){if(xS)return Qp;xS=1;var t=w6(),e=or(),r=pi(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function u(c){if(typeof c=="number")return c;if(r(c))return n;if(e(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=e(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=t(c);var f=i.test(c);return f||o.test(c)?l(c.slice(2),f?2:8):a.test(c)?n:+c}return Qp=u,Qp}var ev,kS;function SS(){if(kS)return ev;kS=1;var t=C6(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return ev=n,ev}var tv,_S;function E6(){if(_S)return tv;_S=1;var t=SS();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return tv=e,tv}var rv,TS;function x6(){if(TS)return rv;TS=1;var t=Bk(),e=nn(),r=E6(),n=Math.max;function a(i,o,l){var u=i==null?0:i.length;if(!u)return-1;var c=l==null?0:r(l);return c<0&&(c=n(u+c,0)),t(i,e(o,3),c)}return rv=a,rv}var nv,NS;function k6(){if(NS)return nv;NS=1;var t=y6(),e=x6(),r=t(e);return nv=r,nv}var av,IS;function BS(){if(IS)return av;IS=1;var t=ip();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return av=e,av}var iv,DS;function S6(){if(DS)return iv;DS=1;var t=Gf(),e=XE(),r=pa();function n(a,i){return a==null?a:t(a,e(i),r)}return iv=n,iv}var ov,AS;function _6(){if(AS)return ov;AS=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return ov=t,ov}var sv,OS;function T6(){if(OS)return sv;OS=1;var t=pl(),e=Wf(),r=nn();function n(a,i){var o={};return i=r(i,3),e(a,function(l,u,c){t(o,u,i(l,u,c))}),o}return sv=n,sv}var lv,PS;function cv(){if(PS)return lv;PS=1;var t=pi();function e(r,n,a){for(var i=-1,o=r.length;++i<o;){var l=r[i],u=n(l);if(u!=null&&(c===void 0?u===u&&!t(u):a(u,c)))var c=u,d=l}return d}return lv=e,lv}var uv,RS;function N6(){if(RS)return uv;RS=1;function t(e,r){return e>r}return uv=t,uv}var dv,LS;function I6(){if(LS)return dv;LS=1;var t=cv(),e=N6(),r=va();function n(a){return a&&a.length?t(a,r,e):void 0}return dv=n,dv}var fv,MS;function FS(){if(MS)return fv;MS=1;var t=pl(),e=ui();function r(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&t(n,a,i)}return fv=r,fv}var hv,$S;function B6(){if($S)return hv;$S=1;var t=fa(),e=bl(),r=Rr(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,l=i.hasOwnProperty,u=o.call(Object);function c(d){if(!r(d)||t(d)!=n)return!1;var f=e(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==u}return hv=c,hv}var pv,VS;function qS(){if(VS)return pv;VS=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return pv=t,pv}var vv,zS;function D6(){if(zS)return vv;zS=1;var t=xo(),e=pa();function r(n){return t(n,e(n))}return vv=r,vv}var gv,HS;function A6(){if(HS)return gv;HS=1;var t=FS(),e=XC(),r=BE(),n=QC(),a=RE(),i=ko(),o=ot(),l=Vk(),u=fi(),c=Eo(),d=or(),f=B6(),h=To(),v=qS(),p=D6();function g(y,m,b,w,C,x,k){var E=v(y,b),_=v(m,b),S=k.get(_);if(S){t(y,b,S);return}var T=x?x(E,_,b+"",y,m,k):void 0,N=T===void 0;if(N){var B=o(_),A=!B&&u(_),D=!B&&!A&&h(_);T=_,B||A||D?o(E)?T=E:l(E)?T=n(E):A?(N=!1,T=e(_,!0)):D?(N=!1,T=r(_,!0)):T=[]:f(_)||i(_)?(T=E,i(E)?T=p(E):(!d(E)||c(E))&&(T=a(_))):N=!1}N&&(k.set(_,T),C(T,_,w,x,k),k.delete(_)),t(y,b,T)}return gv=g,gv}var mv,KS;function O6(){if(KS)return mv;KS=1;var t=hl(),e=FS(),r=Gf(),n=A6(),a=or(),i=pa(),o=qS();function l(u,c,d,f,h){u!==c&&r(c,function(v,p){if(h||(h=new t),a(v))n(u,c,p,d,l,f,h);else{var g=f?f(o(u,p),v,p+"",u,c,h):void 0;g===void 0&&(g=v),e(u,p,g)}},i)}return mv=l,mv}var yv,GS;function P6(){if(GS)return yv;GS=1;var t=kl(),e=Sl();function r(n){return t(function(a,i){var o=-1,l=i.length,u=l>1?i[l-1]:void 0,c=l>2?i[2]:void 0;for(u=n.length>3&&typeof u=="function"?(l--,u):void 0,c&&e(i[0],i[1],c)&&(u=l<3?void 0:u,l=1),a=Object(a);++o<l;){var d=i[o];d&&n(a,d,o,u)}return a})}return yv=r,yv}var bv,US;function R6(){if(US)return bv;US=1;var t=O6(),e=P6(),r=e(function(n,a,i){t(n,a,i)});return bv=r,bv}var wv,WS;function jS(){if(WS)return wv;WS=1;function t(e,r){return e<r}return wv=t,wv}var Cv,YS;function L6(){if(YS)return Cv;YS=1;var t=cv(),e=jS(),r=va();function n(a){return a&&a.length?t(a,r,e):void 0}return Cv=n,Cv}var Ev,ZS;function M6(){if(ZS)return Ev;ZS=1;var t=cv(),e=nn(),r=jS();function n(a,i){return a&&a.length?t(a,e(i,2),r):void 0}return Ev=n,Ev}var xv,XS;function F6(){if(XS)return xv;XS=1;var t=br(),e=function(){return t.Date.now()};return xv=e,xv}var kv,JS;function $6(){if(JS)return kv;JS=1;var t=vl(),e=El(),r=gl(),n=or(),a=Io();function i(o,l,u,c){if(!n(o))return o;l=e(l,o);for(var d=-1,f=l.length,h=f-1,v=o;v!=null&&++d<f;){var p=a(l[d]),g=u;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(d!=h){var y=v[p];g=c?c(y,p,v):void 0,g===void 0&&(g=n(y)?y:r(l[d+1])?[]:{})}t(v,p,g),v=v[p]}return o}return kv=i,kv}var Sv,QS;function V6(){if(QS)return Sv;QS=1;var t=xl(),e=$6(),r=El();function n(a,i,o){for(var l=-1,u=i.length,c={};++l<u;){var d=i[l],f=t(a,d);o(f,d)&&e(c,r(d,a),f)}return c}return Sv=n,Sv}var _v,e2;function q6(){if(e2)return _v;e2=1;var t=V6(),e=Hx();function r(n,a){return t(n,a,function(i,o){return e(n,o)})}return _v=r,_v}var Tv,t2;function z6(){if(t2)return Tv;t2=1;var t=BS(),e=xk(),r=Tk();function n(a){return r(e(a,void 0,t),a+"")}return Tv=n,Tv}var Nv,r2;function H6(){if(r2)return Nv;r2=1;var t=q6(),e=z6(),r=e(function(n,a){return n==null?{}:t(n,a)});return Nv=r,Nv}var Iv,n2;function K6(){if(n2)return Iv;n2=1;var t=Math.ceil,e=Math.max;function r(n,a,i,o){for(var l=-1,u=e(t((a-n)/(i||1)),0),c=Array(u);u--;)c[o?u:++l]=n,n+=i;return c}return Iv=r,Iv}var Bv,a2;function G6(){if(a2)return Bv;a2=1;var t=K6(),e=Sl(),r=SS();function n(a){return function(i,o,l){return l&&typeof l!="number"&&e(i,o,l)&&(o=l=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),l=l===void 0?i<o?1:-1:r(l),t(i,o,l,a)}}return Bv=n,Bv}var Dv,i2;function U6(){if(i2)return Dv;i2=1;var t=G6(),e=t();return Dv=e,Dv}var Av,o2;function W6(){if(o2)return Av;o2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Av=t,Av}var Ov,s2;function j6(){if(s2)return Ov;s2=1;var t=pi();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,o=r===r,l=t(r),u=n!==void 0,c=n===null,d=n===n,f=t(n);if(!c&&!f&&!l&&r>n||l&&u&&d&&!c&&!f||i&&u&&d||!a&&d||!o)return 1;if(!i&&!l&&!f&&r<n||f&&a&&o&&!i&&!l||c&&a&&o||!u&&o||!d)return-1}return 0}return Ov=e,Ov}var Pv,l2;function Y6(){if(l2)return Pv;l2=1;var t=j6();function e(r,n,a){for(var i=-1,o=r.criteria,l=n.criteria,u=o.length,c=a.length;++i<u;){var d=t(o[i],l[i]);if(d){if(i>=c)return d;var f=a[i];return d*(f=="desc"?-1:1)}}return r.index-n.index}return Pv=e,Pv}var Rv,c2;function Z6(){if(c2)return Rv;c2=1;var t=Cl(),e=xl(),r=nn(),n=ik(),a=W6(),i=ml(),o=Y6(),l=va(),u=ot();function c(d,f,h){f.length?f=t(f,function(g){return u(g)?function(y){return e(y,g.length===1?g[0]:g)}:g}):f=[l];var v=-1;f=t(f,i(r));var p=n(d,function(g,y,m){var b=t(f,function(w){return w(g)});return{criteria:b,index:++v,value:g}});return a(p,function(g,y){return o(g,y,h)})}return Rv=c,Rv}var Lv,u2;function X6(){if(u2)return Lv;u2=1;var t=ip(),e=Z6(),r=kl(),n=Sl(),a=r(function(i,o){if(i==null)return[];var l=o.length;return l>1&&n(i,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return Lv=a,Lv}var Mv,d2;function J6(){if(d2)return Mv;d2=1;var t=Px(),e=0;function r(n){var a=++e;return t(n)+a}return Mv=r,Mv}var Fv,f2;function Q6(){if(f2)return Fv;f2=1;function t(e,r,n){for(var a=-1,i=e.length,o=r.length,l={};++a<i;){var u=a<o?r[a]:void 0;n(l,e[a],u)}return l}return Fv=t,Fv}var $v,h2;function e9(){if(h2)return $v;h2=1;var t=vl(),e=Q6();function r(n,a){return e(n||[],a||[],t)}return $v=r,$v}var Vv,p2;function Ze(){if(p2)return Vv;p2=1;var t;if(typeof Ou=="function")try{t={cloneDeep:g6(),constant:zf(),defaults:m6(),each:tx(),filter:Xx(),find:k6(),flatten:BS(),forEach:QE(),forIn:S6(),has:ek(),isUndefined:nk(),last:_6(),map:sk(),mapValues:T6(),max:I6(),merge:R6(),min:L6(),minBy:M6(),now:F6(),pick:H6(),range:U6(),reduce:dk(),sortBy:X6(),uniqueId:J6(),values:Kk(),zipObject:e9()}}catch{}return t||(t=window._),Vv=t,Vv}var qv,v2;function t9(){if(v2)return qv;v2=1,qv=t;function t(){var n={};n._next=n._prev=n,this._sentinel=n}t.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},t.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},t.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,r)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,a){if(n!=="_next"&&n!=="_prev")return a}return qv}var zv,g2;function r9(){if(g2)return zv;g2=1;var t=Ze(),e=wr().Graph,r=t9();zv=a;var n=t.constant(1);function a(c,d){if(c.nodeCount()<=1)return[];var f=l(c,d||n),h=i(f.graph,f.buckets,f.zeroIdx);return t.flatten(t.map(h,function(v){return c.outEdges(v.v,v.w)}),!0)}function i(c,d,f){for(var h=[],v=d[d.length-1],p=d[0],g;c.nodeCount();){for(;g=p.dequeue();)o(c,d,f,g);for(;g=v.dequeue();)o(c,d,f,g);if(c.nodeCount()){for(var y=d.length-2;y>0;--y)if(g=d[y].dequeue(),g){h=h.concat(o(c,d,f,g,!0));break}}}return h}function o(c,d,f,h,v){var p=v?[]:void 0;return t.forEach(c.inEdges(h.v),function(g){var y=c.edge(g),m=c.node(g.v);v&&p.push({v:g.v,w:g.w}),m.out-=y,u(d,f,m)}),t.forEach(c.outEdges(h.v),function(g){var y=c.edge(g),m=g.w,b=c.node(m);b.in-=y,u(d,f,b)}),c.removeNode(h.v),p}function l(c,d){var f=new e,h=0,v=0;t.forEach(c.nodes(),function(y){f.setNode(y,{v:y,in:0,out:0})}),t.forEach(c.edges(),function(y){var m=f.edge(y.v,y.w)||0,b=d(y),w=m+b;f.setEdge(y.v,y.w,w),v=Math.max(v,f.node(y.v).out+=b),h=Math.max(h,f.node(y.w).in+=b)});var p=t.range(v+h+3).map(function(){return new r}),g=h+1;return t.forEach(f.nodes(),function(y){u(p,g,f.node(y))}),{graph:f,buckets:p,zeroIdx:g}}function u(c,d,f){f.out?f.in?c[f.out-f.in+d].enqueue(f):c[c.length-1].enqueue(f):c[0].enqueue(f)}return zv}var Hv,m2;function n9(){if(m2)return Hv;m2=1;var t=Ze(),e=r9();Hv={run:r,undo:a};function r(i){var o=i.graph().acyclicer==="greedy"?e(i,l(i)):n(i);t.forEach(o,function(u){var c=i.edge(u);i.removeEdge(u),c.forwardName=u.name,c.reversed=!0,i.setEdge(u.w,u.v,c,t.uniqueId("rev"))});function l(u){return function(c){return u.edge(c).weight}}}function n(i){var o=[],l={},u={};function c(d){t.has(u,d)||(u[d]=!0,l[d]=!0,t.forEach(i.outEdges(d),function(f){t.has(l,f.w)?o.push(f):c(f.w)}),delete l[d])}return t.forEach(i.nodes(),c),o}function a(i){t.forEach(i.edges(),function(o){var l=i.edge(o);if(l.reversed){i.removeEdge(o);var u=l.forwardName;delete l.reversed,delete l.forwardName,i.setEdge(o.w,o.v,l,u)}})}return Hv}var Kv,y2;function Wt(){if(y2)return Kv;y2=1;var t=Ze(),e=wr().Graph;Kv={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:l,buildLayerMatrix:u,normalizeRanks:c,removeEmptyRanks:d,addBorderNode:f,maxRank:h,partition:v,time:p,notime:g};function r(y,m,b,w){var C;do C=t.uniqueId(w);while(y.hasNode(C));return b.dummy=m,y.setNode(C,b),C}function n(y){var m=new e().setGraph(y.graph());return t.forEach(y.nodes(),function(b){m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){var w=m.edge(b.v,b.w)||{weight:0,minlen:1},C=y.edge(b);m.setEdge(b.v,b.w,{weight:w.weight+C.weight,minlen:Math.max(w.minlen,C.minlen)})}),m}function a(y){var m=new e({multigraph:y.isMultigraph()}).setGraph(y.graph());return t.forEach(y.nodes(),function(b){y.children(b).length||m.setNode(b,y.node(b))}),t.forEach(y.edges(),function(b){m.setEdge(b,y.edge(b))}),m}function i(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.outEdges(b),function(C){w[C.w]=(w[C.w]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function o(y){var m=t.map(y.nodes(),function(b){var w={};return t.forEach(y.inEdges(b),function(C){w[C.v]=(w[C.v]||0)+y.edge(C).weight}),w});return t.zipObject(y.nodes(),m)}function l(y,m){var b=y.x,w=y.y,C=m.x-b,x=m.y-w,k=y.width/2,E=y.height/2;if(!C&&!x)throw new Error("Not possible to find intersection inside of the rectangle");var _,S;return Math.abs(x)*k>Math.abs(C)*E?(x<0&&(E=-E),_=E*C/x,S=E):(C<0&&(k=-k),_=k,S=k*x/C),{x:b+_,y:w+S}}function u(y){var m=t.map(t.range(h(y)+1),function(){return[]});return t.forEach(y.nodes(),function(b){var w=y.node(b),C=w.rank;t.isUndefined(C)||(m[C][w.order]=b)}),m}function c(y){var m=t.min(t.map(y.nodes(),function(b){return y.node(b).rank}));t.forEach(y.nodes(),function(b){var w=y.node(b);t.has(w,"rank")&&(w.rank-=m)})}function d(y){var m=t.min(t.map(y.nodes(),function(x){return y.node(x).rank})),b=[];t.forEach(y.nodes(),function(x){var k=y.node(x).rank-m;b[k]||(b[k]=[]),b[k].push(x)});var w=0,C=y.graph().nodeRankFactor;t.forEach(b,function(x,k){t.isUndefined(x)&&k%C!==0?--w:w&&t.forEach(x,function(E){y.node(E).rank+=w})})}function f(y,m,b,w){var C={width:0,height:0};return arguments.length>=4&&(C.rank=b,C.order=w),r(y,"border",C,m)}function h(y){return t.max(t.map(y.nodes(),function(m){var b=y.node(m).rank;if(!t.isUndefined(b))return b}))}function v(y,m){var b={lhs:[],rhs:[]};return t.forEach(y,function(w){m(w)?b.lhs.push(w):b.rhs.push(w)}),b}function p(y,m){var b=t.now();try{return m()}finally{console.log(y+" time: "+(t.now()-b)+"ms")}}function g(y,m){return m()}return Kv}var Gv,b2;function a9(){if(b2)return Gv;b2=1;var t=Ze(),e=Wt();Gv={run:r,undo:a};function r(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var l=o.v,u=i.node(l).rank,c=o.w,d=i.node(c).rank,f=o.name,h=i.edge(o),v=h.labelRank;if(d!==u+1){i.removeEdge(o);var p,g,y;for(y=0,++u;u<d;++y,++u)h.points=[],g={width:0,height:0,edgeLabel:h,edgeObj:o,rank:u},p=e.addDummyNode(i,"edge",g,"_d"),u===v&&(g.width=h.width,g.height=h.height,g.dummy="edge-label",g.labelpos=h.labelpos),i.setEdge(l,p,{weight:h.weight},f),y===0&&i.graph().dummyChains.push(p),l=p;i.setEdge(l,c,{weight:h.weight},f)}}function a(i){t.forEach(i.graph().dummyChains,function(o){var l=i.node(o),u=l.edgeLabel,c;for(i.setEdge(l.edgeObj,u);l.dummy;)c=i.successors(o)[0],i.removeNode(o),u.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(u.x=l.x,u.y=l.y,u.width=l.width,u.height=l.height),o=c,l=i.node(o)})}return Gv}var Uv,w2;function _l(){if(w2)return Uv;w2=1;var t=Ze();Uv={longestPath:e,slack:r};function e(n){var a={};function i(o){var l=n.node(o);if(t.has(a,o))return l.rank;a[o]=!0;var u=t.min(t.map(n.outEdges(o),function(c){return i(c.w)-n.edge(c).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),l.rank=u}t.forEach(n.sources(),i)}function r(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Uv}var Wv,C2;function E2(){if(C2)return Wv;C2=1;var t=Ze(),e=wr().Graph,r=_l().slack;Wv=n;function n(l){var u=new e({directed:!1}),c=l.nodes()[0],d=l.nodeCount();u.setNode(c,{});for(var f,h;a(u,l)<d;)f=i(u,l),h=u.hasNode(f.v)?r(l,f):-r(l,f),o(u,l,h);return u}function a(l,u){function c(d){t.forEach(u.nodeEdges(d),function(f){var h=f.v,v=d===h?f.w:h;!l.hasNode(v)&&!r(u,f)&&(l.setNode(v,{}),l.setEdge(d,v,{}),c(v))})}return t.forEach(l.nodes(),c),l.nodeCount()}function i(l,u){return t.minBy(u.edges(),function(c){if(l.hasNode(c.v)!==l.hasNode(c.w))return r(u,c)})}function o(l,u,c){t.forEach(l.nodes(),function(d){u.node(d).rank+=c})}return Wv}var jv,x2;function i9(){if(x2)return jv;x2=1;var t=Ze(),e=E2(),r=_l().slack,n=_l().longestPath,a=wr().alg.preorder,i=wr().alg.postorder,o=Wt().simplify;jv=l,l.initLowLimValues=f,l.initCutValues=u,l.calcCutValue=d,l.leaveEdge=v,l.enterEdge=p,l.exchangeEdges=g;function l(w){w=o(w),n(w);var C=e(w);f(C),u(C,w);for(var x,k;x=v(C);)k=p(C,w,x),g(C,w,x,k)}function u(w,C){var x=i(w,w.nodes());x=x.slice(0,x.length-1),t.forEach(x,function(k){c(w,C,k)})}function c(w,C,x){var k=w.node(x),E=k.parent;w.edge(x,E).cutvalue=d(w,C,x)}function d(w,C,x){var k=w.node(x),E=k.parent,_=!0,S=C.edge(x,E),T=0;return S||(_=!1,S=C.edge(E,x)),T=S.weight,t.forEach(C.nodeEdges(x),function(N){var B=N.v===x,A=B?N.w:N.v;if(A!==E){var D=B===_,R=C.edge(N).weight;if(T+=D?R:-R,m(w,x,A)){var O=w.edge(x,A).cutvalue;T+=D?-O:O}}}),T}function f(w,C){arguments.length<2&&(C=w.nodes()[0]),h(w,{},1,C)}function h(w,C,x,k,E){var _=x,S=w.node(k);return C[k]=!0,t.forEach(w.neighbors(k),function(T){t.has(C,T)||(x=h(w,C,x,T,k))}),S.low=_,S.lim=x++,E?S.parent=E:delete S.parent,x}function v(w){return t.find(w.edges(),function(C){return w.edge(C).cutvalue<0})}function p(w,C,x){var k=x.v,E=x.w;C.hasEdge(k,E)||(k=x.w,E=x.v);var _=w.node(k),S=w.node(E),T=_,N=!1;_.lim>S.lim&&(T=S,N=!0);var B=t.filter(C.edges(),function(A){return N===b(w,w.node(A.v),T)&&N!==b(w,w.node(A.w),T)});return t.minBy(B,function(A){return r(C,A)})}function g(w,C,x,k){var E=x.v,_=x.w;w.removeEdge(E,_),w.setEdge(k.v,k.w,{}),f(w),u(w,C),y(w,C)}function y(w,C){var x=t.find(w.nodes(),function(E){return!C.node(E).parent}),k=a(w,x);k=k.slice(1),t.forEach(k,function(E){var _=w.node(E).parent,S=C.edge(E,_),T=!1;S||(S=C.edge(_,E),T=!0),C.node(E).rank=C.node(_).rank+(T?S.minlen:-S.minlen)})}function m(w,C,x){return w.hasEdge(C,x)}function b(w,C,x){return x.low<=C.lim&&C.lim<=x.lim}return jv}var Yv,k2;function o9(){if(k2)return Yv;k2=1;var t=_l(),e=t.longestPath,r=E2(),n=i9();Yv=a;function a(u){switch(u.graph().ranker){case"network-simplex":l(u);break;case"tight-tree":o(u);break;case"longest-path":i(u);break;default:l(u)}}var i=e;function o(u){e(u),r(u)}function l(u){n(u)}return Yv}var Zv,S2;function s9(){if(S2)return Zv;S2=1;var t=Ze();Zv=e;function e(a){var i=n(a);t.forEach(a.graph().dummyChains,function(o){for(var l=a.node(o),u=l.edgeObj,c=r(a,i,u.v,u.w),d=c.path,f=c.lca,h=0,v=d[h],p=!0;o!==u.w;){if(l=a.node(o),p){for(;(v=d[h])!==f&&a.node(v).maxRank<l.rank;)h++;v===f&&(p=!1)}if(!p){for(;h<d.length-1&&a.node(v=d[h+1]).minRank<=l.rank;)h++;v=d[h]}a.setParent(o,v),o=a.successors(o)[0]}})}function r(a,i,o,l){var u=[],c=[],d=Math.min(i[o].low,i[l].low),f=Math.max(i[o].lim,i[l].lim),h,v;h=o;do h=a.parent(h),u.push(h);while(h&&(i[h].low>d||f>i[h].lim));for(v=h,h=l;(h=a.parent(h))!==v;)c.push(h);return{path:u.concat(c.reverse()),lca:v}}function n(a){var i={},o=0;function l(u){var c=o;t.forEach(a.children(u),l),i[u]={low:c,lim:o++}}return t.forEach(a.children(),l),i}return Zv}var Xv,_2;function l9(){if(_2)return Xv;_2=1;var t=Ze(),e=Wt();Xv={run:r,cleanup:o};function r(l){var u=e.addDummyNode(l,"root",{},"_root"),c=a(l),d=t.max(t.values(c))-1,f=2*d+1;l.graph().nestingRoot=u,t.forEach(l.edges(),function(v){l.edge(v).minlen*=f});var h=i(l)+1;t.forEach(l.children(),function(v){n(l,u,f,h,d,c,v)}),l.graph().nodeRankFactor=f}function n(l,u,c,d,f,h,v){var p=l.children(v);if(!p.length){v!==u&&l.setEdge(u,v,{weight:0,minlen:c});return}var g=e.addBorderNode(l,"_bt"),y=e.addBorderNode(l,"_bb"),m=l.node(v);l.setParent(g,v),m.borderTop=g,l.setParent(y,v),m.borderBottom=y,t.forEach(p,function(b){n(l,u,c,d,f,h,b);var w=l.node(b),C=w.borderTop?w.borderTop:b,x=w.borderBottom?w.borderBottom:b,k=w.borderTop?d:2*d,E=C!==x?1:f-h[v]+1;l.setEdge(g,C,{weight:k,minlen:E,nestingEdge:!0}),l.setEdge(x,y,{weight:k,minlen:E,nestingEdge:!0})}),l.parent(v)||l.setEdge(u,g,{weight:0,minlen:f+h[v]})}function a(l){var u={};function c(d,f){var h=l.children(d);h&&h.length&&t.forEach(h,function(v){c(v,f+1)}),u[d]=f}return t.forEach(l.children(),function(d){c(d,1)}),u}function i(l){return t.reduce(l.edges(),function(u,c){return u+l.edge(c).weight},0)}function o(l){var u=l.graph();l.removeNode(u.nestingRoot),delete u.nestingRoot,t.forEach(l.edges(),function(c){var d=l.edge(c);d.nestingEdge&&l.removeEdge(c)})}return Xv}var Jv,T2;function c9(){if(T2)return Jv;T2=1;var t=Ze(),e=Wt();Jv=r;function r(a){function i(o){var l=a.children(o),u=a.node(o);if(l.length&&t.forEach(l,i),t.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var c=u.minRank,d=u.maxRank+1;c<d;++c)n(a,"borderLeft","_bl",o,u,c),n(a,"borderRight","_br",o,u,c)}}t.forEach(a.children(),i)}function n(a,i,o,l,u,c){var d={width:0,height:0,rank:c,borderType:i},f=u[i][c-1],h=e.addDummyNode(a,"border",d,o);u[i][c]=h,a.setParent(h,l),f&&a.setEdge(f,h,{weight:1})}return Jv}var Qv,N2;function u9(){if(N2)return Qv;N2=1;var t=Ze();Qv={adjust:e,undo:r};function e(c){var d=c.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&n(c)}function r(c){var d=c.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&i(c),(d==="lr"||d==="rl")&&(l(c),n(c))}function n(c){t.forEach(c.nodes(),function(d){a(c.node(d))}),t.forEach(c.edges(),function(d){a(c.edge(d))})}function a(c){var d=c.width;c.width=c.height,c.height=d}function i(c){t.forEach(c.nodes(),function(d){o(c.node(d))}),t.forEach(c.edges(),function(d){var f=c.edge(d);t.forEach(f.points,o),t.has(f,"y")&&o(f)})}function o(c){c.y=-c.y}function l(c){t.forEach(c.nodes(),function(d){u(c.node(d))}),t.forEach(c.edges(),function(d){var f=c.edge(d);t.forEach(f.points,u),t.has(f,"x")&&u(f)})}function u(c){var d=c.x;c.x=c.y,c.y=d}return Qv}var eg,I2;function d9(){if(I2)return eg;I2=1;var t=Ze();eg=e;function e(r){var n={},a=t.filter(r.nodes(),function(c){return!r.children(c).length}),i=t.max(t.map(a,function(c){return r.node(c).rank})),o=t.map(t.range(i+1),function(){return[]});function l(c){if(!t.has(n,c)){n[c]=!0;var d=r.node(c);o[d.rank].push(c),t.forEach(r.successors(c),l)}}var u=t.sortBy(a,function(c){return r.node(c).rank});return t.forEach(u,l),o}return eg}var tg,B2;function f9(){if(B2)return tg;B2=1;var t=Ze();tg=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=r(n,a[o-1],a[o]);return i}function r(n,a,i){for(var o=t.zipObject(i,t.map(i,function(h,v){return v})),l=t.flatten(t.map(a,function(h){return t.sortBy(t.map(n.outEdges(h),function(v){return{pos:o[v.w],weight:n.edge(v).weight}}),"pos")}),!0),u=1;u<i.length;)u<<=1;var c=2*u-1;u-=1;var d=t.map(new Array(c),function(){return 0}),f=0;return t.forEach(l.forEach(function(h){var v=h.pos+u;d[v]+=h.weight;for(var p=0;v>0;)v%2&&(p+=d[v+1]),v=v-1>>1,d[v]+=h.weight;f+=h.weight*p})),f}return tg}var rg,D2;function h9(){if(D2)return rg;D2=1;var t=Ze();rg=e;function e(r,n){return t.map(n,function(a){var i=r.inEdges(a);if(i.length){var o=t.reduce(i,function(l,u){var c=r.edge(u),d=r.node(u.v);return{sum:l.sum+c.weight*d.order,weight:l.weight+c.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return rg}var ng,A2;function p9(){if(A2)return ng;A2=1;var t=Ze();ng=e;function e(a,i){var o={};t.forEach(a,function(u,c){var d=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:c};t.isUndefined(u.barycenter)||(d.barycenter=u.barycenter,d.weight=u.weight)}),t.forEach(i.edges(),function(u){var c=o[u.v],d=o[u.w];!t.isUndefined(c)&&!t.isUndefined(d)&&(d.indegree++,c.out.push(o[u.w]))});var l=t.filter(o,function(u){return!u.indegree});return r(l)}function r(a){var i=[];function o(c){return function(d){d.merged||(t.isUndefined(d.barycenter)||t.isUndefined(c.barycenter)||d.barycenter>=c.barycenter)&&n(c,d)}}function l(c){return function(d){d.in.push(c),--d.indegree===0&&a.push(d)}}for(;a.length;){var u=a.pop();i.push(u),t.forEach(u.in.reverse(),o(u)),t.forEach(u.out,l(u))}return t.map(t.filter(i,function(c){return!c.merged}),function(c){return t.pick(c,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,l=0;a.weight&&(o+=a.barycenter*a.weight,l+=a.weight),i.weight&&(o+=i.barycenter*i.weight,l+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/l,a.weight=l,a.i=Math.min(i.i,a.i),i.merged=!0}return ng}var ag,O2;function v9(){if(O2)return ag;O2=1;var t=Ze(),e=Wt();ag=r;function r(i,o){var l=e.partition(i,function(g){return t.has(g,"barycenter")}),u=l.lhs,c=t.sortBy(l.rhs,function(g){return-g.i}),d=[],f=0,h=0,v=0;u.sort(a(!!o)),v=n(d,c,v),t.forEach(u,function(g){v+=g.vs.length,d.push(g.vs),f+=g.barycenter*g.weight,h+=g.weight,v=n(d,c,v)});var p={vs:t.flatten(d,!0)};return h&&(p.barycenter=f/h,p.weight=h),p}function n(i,o,l){for(var u;o.length&&(u=t.last(o)).i<=l;)o.pop(),i.push(u.vs),l++;return l}function a(i){return function(o,l){return o.barycenter<l.barycenter?-1:o.barycenter>l.barycenter?1:i?l.i-o.i:o.i-l.i}}return ag}var ig,P2;function g9(){if(P2)return ig;P2=1;var t=Ze(),e=h9(),r=p9(),n=v9();ig=a;function a(l,u,c,d){var f=l.children(u),h=l.node(u),v=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,g={};v&&(f=t.filter(f,function(x){return x!==v&&x!==p}));var y=e(l,f);t.forEach(y,function(x){if(l.children(x.v).length){var k=a(l,x.v,c,d);g[x.v]=k,t.has(k,"barycenter")&&o(x,k)}});var m=r(y,c);i(m,g);var b=n(m,d);if(v&&(b.vs=t.flatten([v,b.vs,p],!0),l.predecessors(v).length)){var w=l.node(l.predecessors(v)[0]),C=l.node(l.predecessors(p)[0]);t.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+w.order+C.order)/(b.weight+2),b.weight+=2}return b}function i(l,u){t.forEach(l,function(c){c.vs=t.flatten(c.vs.map(function(d){return u[d]?u[d].vs:d}),!0)})}function o(l,u){t.isUndefined(l.barycenter)?(l.barycenter=u.barycenter,l.weight=u.weight):(l.barycenter=(l.barycenter*l.weight+u.barycenter*u.weight)/(l.weight+u.weight),l.weight+=u.weight)}return ig}var og,R2;function m9(){if(R2)return og;R2=1;var t=Ze(),e=wr().Graph;og=r;function r(a,i,o){var l=n(a),u=new e({compound:!0}).setGraph({root:l}).setDefaultNodeLabel(function(c){return a.node(c)});return t.forEach(a.nodes(),function(c){var d=a.node(c),f=a.parent(c);(d.rank===i||d.minRank<=i&&i<=d.maxRank)&&(u.setNode(c),u.setParent(c,f||l),t.forEach(a[o](c),function(h){var v=h.v===c?h.w:h.v,p=u.edge(v,c),g=t.isUndefined(p)?0:p.weight;u.setEdge(v,c,{weight:a.edge(h).weight+g})}),t.has(d,"minRank")&&u.setNode(c,{borderLeft:d.borderLeft[i],borderRight:d.borderRight[i]}))}),u}function n(a){for(var i;a.hasNode(i=t.uniqueId("_root")););return i}return og}var sg,L2;function y9(){if(L2)return sg;L2=1;var t=Ze();sg=e;function e(r,n,a){var i={},o;t.forEach(a,function(l){for(var u=r.parent(l),c,d;u;){if(c=r.parent(u),c?(d=i[c],i[c]=u):(d=o,o=u),d&&d!==u){n.setEdge(d,u);return}u=c}})}return sg}var lg,M2;function b9(){if(M2)return lg;M2=1;var t=Ze(),e=d9(),r=f9(),n=g9(),a=m9(),i=y9(),o=wr().Graph,l=Wt();lg=u;function u(h){var v=l.maxRank(h),p=c(h,t.range(1,v+1),"inEdges"),g=c(h,t.range(v-1,-1,-1),"outEdges"),y=e(h);f(h,y);for(var m=Number.POSITIVE_INFINITY,b,w=0,C=0;C<4;++w,++C){d(w%2?p:g,w%4>=2),y=l.buildLayerMatrix(h);var x=r(h,y);x<m&&(C=0,b=t.cloneDeep(y),m=x)}f(h,b)}function c(h,v,p){return t.map(v,function(g){return a(h,g,p)})}function d(h,v){var p=new o;t.forEach(h,function(g){var y=g.graph().root,m=n(g,y,p,v);t.forEach(m.vs,function(b,w){g.node(b).order=w}),i(g,p,m.vs)})}function f(h,v){t.forEach(v,function(p){t.forEach(p,function(g,y){h.node(g).order=y})})}return lg}var cg,F2;function w9(){if(F2)return cg;F2=1;var t=Ze(),e=wr().Graph,r=Wt();cg={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:l,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:f,balance:v};function n(m,b){var w={};function C(x,k){var E=0,_=0,S=x.length,T=t.last(k);return t.forEach(k,function(N,B){var A=i(m,N),D=A?m.node(A).order:S;(A||N===T)&&(t.forEach(k.slice(_,B+1),function(R){t.forEach(m.predecessors(R),function(O){var M=m.node(O),P=M.order;(P<E||D<P)&&!(M.dummy&&m.node(R).dummy)&&o(w,O,R)})}),_=B+1,E=D)}),k}return t.reduce(b,C),w}function a(m,b){var w={};function C(k,E,_,S,T){var N;t.forEach(t.range(E,_),function(B){N=k[B],m.node(N).dummy&&t.forEach(m.predecessors(N),function(A){var D=m.node(A);D.dummy&&(D.order<S||D.order>T)&&o(w,A,N)})})}function x(k,E){var _=-1,S,T=0;return t.forEach(E,function(N,B){if(m.node(N).dummy==="border"){var A=m.predecessors(N);A.length&&(S=m.node(A[0]).order,C(E,T,B,_,S),T=B,_=S)}C(E,T,E.length,S,k.length)}),E}return t.reduce(b,x),w}function i(m,b){if(m.node(b).dummy)return t.find(m.predecessors(b),function(w){return m.node(w).dummy})}function o(m,b,w){if(b>w){var C=b;b=w,w=C}var x=m[b];x||(m[b]=x={}),x[w]=!0}function l(m,b,w){if(b>w){var C=b;b=w,w=C}return t.has(m[b],w)}function u(m,b,w,C){var x={},k={},E={};return t.forEach(b,function(_){t.forEach(_,function(S,T){x[S]=S,k[S]=S,E[S]=T})}),t.forEach(b,function(_){var S=-1;t.forEach(_,function(T){var N=C(T);if(N.length){N=t.sortBy(N,function(O){return E[O]});for(var B=(N.length-1)/2,A=Math.floor(B),D=Math.ceil(B);A<=D;++A){var R=N[A];k[T]===T&&S<E[R]&&!l(w,T,R)&&(k[R]=T,k[T]=x[T]=x[R],S=E[R])}}})}),{root:x,align:k}}function c(m,b,w,C,x){var k={},E=d(m,b,w,x),_=x?"borderLeft":"borderRight";function S(B,A){for(var D=E.nodes(),R=D.pop(),O={};R;)O[R]?B(R):(O[R]=!0,D.push(R),D=D.concat(A(R))),R=D.pop()}function T(B){k[B]=E.inEdges(B).reduce(function(A,D){return Math.max(A,k[D.v]+E.edge(D))},0)}function N(B){var A=E.outEdges(B).reduce(function(R,O){return Math.min(R,k[O.w]-E.edge(O))},Number.POSITIVE_INFINITY),D=m.node(B);A!==Number.POSITIVE_INFINITY&&D.borderType!==_&&(k[B]=Math.max(k[B],A))}return S(T,E.predecessors.bind(E)),S(N,E.successors.bind(E)),t.forEach(C,function(B){k[B]=k[w[B]]}),k}function d(m,b,w,C){var x=new e,k=m.graph(),E=g(k.nodesep,k.edgesep,C);return t.forEach(b,function(_){var S;t.forEach(_,function(T){var N=w[T];if(x.setNode(N),S){var B=w[S],A=x.edge(B,N);x.setEdge(B,N,Math.max(E(m,T,S),A||0))}S=T})}),x}function f(m,b){return t.minBy(t.values(b),function(w){var C=Number.NEGATIVE_INFINITY,x=Number.POSITIVE_INFINITY;return t.forIn(w,function(k,E){var _=y(m,E)/2;C=Math.max(k+_,C),x=Math.min(k-_,x)}),C-x})}function h(m,b){var w=t.values(b),C=t.min(w),x=t.max(w);t.forEach(["u","d"],function(k){t.forEach(["l","r"],function(E){var _=k+E,S=m[_],T;if(S!==b){var N=t.values(S);T=E==="l"?C-t.min(N):x-t.max(N),T&&(m[_]=t.mapValues(S,function(B){return B+T}))}})})}function v(m,b){return t.mapValues(m.ul,function(w,C){if(b)return m[b.toLowerCase()][C];var x=t.sortBy(t.map(m,C));return(x[1]+x[2])/2})}function p(m){var b=r.buildLayerMatrix(m),w=t.merge(n(m,b),a(m,b)),C={},x;t.forEach(["u","d"],function(E){x=E==="u"?b:t.values(b).reverse(),t.forEach(["l","r"],function(_){_==="r"&&(x=t.map(x,function(B){return t.values(B).reverse()}));var S=(E==="u"?m.predecessors:m.successors).bind(m),T=u(m,x,w,S),N=c(m,x,T.root,T.align,_==="r");_==="r"&&(N=t.mapValues(N,function(B){return-B})),C[E+_]=N})});var k=f(m,C);return h(C,k),v(C,m.graph().align)}function g(m,b,w){return function(C,x,k){var E=C.node(x),_=C.node(k),S=0,T;if(S+=E.width/2,t.has(E,"labelpos"))switch(E.labelpos.toLowerCase()){case"l":T=-E.width/2;break;case"r":T=E.width/2;break}if(T&&(S+=w?T:-T),T=0,S+=(E.dummy?b:m)/2,S+=(_.dummy?b:m)/2,S+=_.width/2,t.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":T=_.width/2;break;case"r":T=-_.width/2;break}return T&&(S+=w?T:-T),T=0,S}}function y(m,b){return m.node(b).width}return cg}var ug,$2;function C9(){if($2)return ug;$2=1;var t=Ze(),e=Wt(),r=w9().positionX;ug=n;function n(i){i=e.asNonCompoundGraph(i),a(i),t.forEach(r(i),function(o,l){i.node(l).x=o})}function a(i){var o=e.buildLayerMatrix(i),l=i.graph().ranksep,u=0;t.forEach(o,function(c){var d=t.max(t.map(c,function(f){return i.node(f).height}));t.forEach(c,function(f){i.node(f).y=u+d/2}),u+=d+l})}return ug}var dg,V2;function E9(){if(V2)return dg;V2=1;var t=Ze(),e=n9(),r=a9(),n=o9(),a=Wt().normalizeRanks,i=s9(),o=Wt().removeEmptyRanks,l=l9(),u=c9(),c=u9(),d=b9(),f=C9(),h=Wt(),v=wr().Graph;dg=p;function p(F,V){var q=V&&V.debugTiming?h.time:h.notime;q("layout",function(){var $=q(" buildLayoutGraph",function(){return S(F)});q(" runLayout",function(){g($,q)}),q(" updateInputGraph",function(){y(F,$)})})}function g(F,V){V(" makeSpaceForEdgeLabels",function(){T(F)}),V(" removeSelfEdges",function(){z(F)}),V(" acyclic",function(){e.run(F)}),V(" nestingGraph.run",function(){l.run(F)}),V(" rank",function(){n(h.asNonCompoundGraph(F))}),V(" injectEdgeLabelProxies",function(){N(F)}),V(" removeEmptyRanks",function(){o(F)}),V(" nestingGraph.cleanup",function(){l.cleanup(F)}),V(" normalizeRanks",function(){a(F)}),V(" assignRankMinMax",function(){B(F)}),V(" removeEdgeLabelProxies",function(){A(F)}),V(" normalize.run",function(){r.run(F)}),V(" parentDummyChains",function(){i(F)}),V(" addBorderSegments",function(){u(F)}),V(" order",function(){d(F)}),V(" insertSelfEdges",function(){W(F)}),V(" adjustCoordinateSystem",function(){c.adjust(F)}),V(" position",function(){f(F)}),V(" positionSelfEdges",function(){H(F)}),V(" removeBorderNodes",function(){P(F)}),V(" normalize.undo",function(){r.undo(F)}),V(" fixupEdgeLabelCoords",function(){O(F)}),V(" undoCoordinateSystem",function(){c.undo(F)}),V(" translateGraph",function(){D(F)}),V(" assignNodeIntersects",function(){R(F)}),V(" reversePoints",function(){M(F)}),V(" acyclic.undo",function(){e.undo(F)})}function y(F,V){t.forEach(F.nodes(),function(q){var $=F.node(q),K=V.node(q);$&&($.x=K.x,$.y=K.y,V.children(q).length&&($.width=K.width,$.height=K.height))}),t.forEach(F.edges(),function(q){var $=F.edge(q),K=V.edge(q);$.points=K.points,t.has(K,"x")&&($.x=K.x,$.y=K.y)}),F.graph().width=V.graph().width,F.graph().height=V.graph().height}var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],C=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function S(F){var V=new v({multigraph:!0,compound:!0}),q=X(F.graph());return V.setGraph(t.merge({},b,G(q,m),t.pick(q,w))),t.forEach(F.nodes(),function($){var K=X(F.node($));V.setNode($,t.defaults(G(K,C),x)),V.setParent($,F.parent($))}),t.forEach(F.edges(),function($){var K=X(F.edge($));V.setEdge($,t.merge({},E,G(K,k),t.pick(K,_)))}),V}function T(F){var V=F.graph();V.ranksep/=2,t.forEach(F.edges(),function(q){var $=F.edge(q);$.minlen*=2,$.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?$.width+=$.labeloffset:$.height+=$.labeloffset)})}function N(F){t.forEach(F.edges(),function(V){var q=F.edge(V);if(q.width&&q.height){var $=F.node(V.v),K=F.node(V.w),L={rank:(K.rank-$.rank)/2+$.rank,e:V};h.addDummyNode(F,"edge-proxy",L,"_ep")}})}function B(F){var V=0;t.forEach(F.nodes(),function(q){var $=F.node(q);$.borderTop&&($.minRank=F.node($.borderTop).rank,$.maxRank=F.node($.borderBottom).rank,V=t.max(V,$.maxRank))}),F.graph().maxRank=V}function A(F){t.forEach(F.nodes(),function(V){var q=F.node(V);q.dummy==="edge-proxy"&&(F.edge(q.e).labelRank=q.rank,F.removeNode(V))})}function D(F){var V=Number.POSITIVE_INFINITY,q=0,$=Number.POSITIVE_INFINITY,K=0,L=F.graph(),j=L.marginx||0,Y=L.marginy||0;function se(ce){var ae=ce.x,ne=ce.y,ue=ce.width,ie=ce.height;V=Math.min(V,ae-ue/2),q=Math.max(q,ae+ue/2),$=Math.min($,ne-ie/2),K=Math.max(K,ne+ie/2)}t.forEach(F.nodes(),function(ce){se(F.node(ce))}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.has(ae,"x")&&se(ae)}),V-=j,$-=Y,t.forEach(F.nodes(),function(ce){var ae=F.node(ce);ae.x-=V,ae.y-=$}),t.forEach(F.edges(),function(ce){var ae=F.edge(ce);t.forEach(ae.points,function(ne){ne.x-=V,ne.y-=$}),t.has(ae,"x")&&(ae.x-=V),t.has(ae,"y")&&(ae.y-=$)}),L.width=q-V+j,L.height=K-$+Y}function R(F){t.forEach(F.edges(),function(V){var q=F.edge(V),$=F.node(V.v),K=F.node(V.w),L,j;q.points?(L=q.points[0],j=q.points[q.points.length-1]):(q.points=[],L=K,j=$),q.points.unshift(h.intersectRect($,L)),q.points.push(h.intersectRect(K,j))})}function O(F){t.forEach(F.edges(),function(V){var q=F.edge(V);if(t.has(q,"x"))switch((q.labelpos==="l"||q.labelpos==="r")&&(q.width-=q.labeloffset),q.labelpos){case"l":q.x-=q.width/2+q.labeloffset;break;case"r":q.x+=q.width/2+q.labeloffset;break}})}function M(F){t.forEach(F.edges(),function(V){var q=F.edge(V);q.reversed&&q.points.reverse()})}function P(F){t.forEach(F.nodes(),function(V){if(F.children(V).length){var q=F.node(V),$=F.node(q.borderTop),K=F.node(q.borderBottom),L=F.node(t.last(q.borderLeft)),j=F.node(t.last(q.borderRight));q.width=Math.abs(j.x-L.x),q.height=Math.abs(K.y-$.y),q.x=L.x+q.width/2,q.y=$.y+q.height/2}}),t.forEach(F.nodes(),function(V){F.node(V).dummy==="border"&&F.removeNode(V)})}function z(F){t.forEach(F.edges(),function(V){if(V.v===V.w){var q=F.node(V.v);q.selfEdges||(q.selfEdges=[]),q.selfEdges.push({e:V,label:F.edge(V)}),F.removeEdge(V)}})}function W(F){var V=h.buildLayerMatrix(F);t.forEach(V,function(q){var $=0;t.forEach(q,function(K,L){var j=F.node(K);j.order=L+$,t.forEach(j.selfEdges,function(Y){h.addDummyNode(F,"selfedge",{width:Y.label.width,height:Y.label.height,rank:j.rank,order:L+ ++$,e:Y.e,label:Y.label},"_se")}),delete j.selfEdges})})}function H(F){t.forEach(F.nodes(),function(V){var q=F.node(V);if(q.dummy==="selfedge"){var $=F.node(q.e.v),K=$.x+$.width/2,L=$.y,j=q.x-K,Y=$.height/2;F.setEdge(q.e,q.label),F.removeNode(V),q.label.points=[{x:K+2*j/3,y:L-Y},{x:K+5*j/6,y:L-Y},{x:K+j,y:L},{x:K+5*j/6,y:L+Y},{x:K+2*j/3,y:L+Y}],q.label.x=q.x,q.label.y=q.y}})}function G(F,V){return t.mapValues(t.pick(F,V),Number)}function X(F){var V={};return t.forEach(F,function(q,$){V[$.toLowerCase()]=q}),V}return dg}var fg,q2;function x9(){if(q2)return fg;q2=1;var t=Ze(),e=Wt(),r=wr().Graph;fg={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new r({compound:!0,multigraph:!0}).setGraph({});return t.forEach(a.nodes(),function(l){o.setNode(l,{label:l}),o.setParent(l,"layer"+a.node(l).rank)}),t.forEach(a.edges(),function(l){o.setEdge(l.v,l.w,{},l.name)}),t.forEach(i,function(l,u){var c="layer"+u;o.setNode(c,{rank:"same"}),t.reduce(l,function(d,f){return o.setEdge(d,f,{style:"invis"}),f})}),o}return fg}var hg,z2;function k9(){return z2||(z2=1,hg="0.8.5"),hg}var pg,H2;function S9(){return H2||(H2=1,pg={graphlib:wr(),layout:E9(),debug:x9(),util:{time:Wt().time,notime:Wt().notime},version:k9()}),pg}(function(t,e){(function(n,a){t.exports=a(S9())})(Li,function(r){return function(n){var a={};function i(o){if(a[o])return a[o].exports;var l=a[o]={i:o,l:!1,exports:{}};return n[o].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=a,i.d=function(o,l,u){i.o(o,l)||Object.defineProperty(o,l,{enumerable:!0,get:u})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,l){if(l&1&&(o=i(o)),l&8||l&4&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(i.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),l&2&&typeof o!="string")for(var c in o)i.d(u,c,(function(d){return o[d]}).bind(null,c));return u},i.n=function(o){var l=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(l,"a",l),l},i.o=function(o,l){return Object.prototype.hasOwnProperty.call(o,l)},i.p="",i(i.s=0)}([function(n,a,i){var o=i(1),l=function(c){c&&c("layout","dagre",o)};typeof cytoscape<"u"&&l(cytoscape),n.exports=l},function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var l=function(v){return typeof v=="function"},u=i(2),c=i(3),d=i(4);function f(h){this.options=c({},u,h)}f.prototype.run=function(){var h=this.options,v=this,p=h.cy,g=h.eles,y=function(H,G){return l(G)?G.apply(H,[H]):G},m=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};m.x2===void 0&&(m.x2=m.x1+m.w),m.w===void 0&&(m.w=m.x2-m.x1),m.y2===void 0&&(m.y2=m.y1+m.h),m.h===void 0&&(m.h=m.y2-m.y1);var b=new d.graphlib.Graph({multigraph:!0,compound:!0}),w={},C=function(H,G){G!=null&&(w[H]=G)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),b.setGraph(w),b.setDefaultEdgeLabel(function(){return{}}),b.setDefaultNodeLabel(function(){return{}});var x=g.nodes();l(h.sort)&&(x=x.sort(h.sort));for(var k=0;k<x.length;k++){var E=x[k],_=E.layoutDimensions(h);b.setNode(E.id(),{width:_.w,height:_.h,name:E.id()})}for(var S=0;S<x.length;S++){var T=x[S];T.isChild()&&b.setParent(T.id(),T.parent().id())}var N=g.edges().stdFilter(function(W){return!W.source().isParent()&&!W.target().isParent()});l(h.sort)&&(N=N.sort(h.sort));for(var B=0;B<N.length;B++){var A=N[B];b.setEdge(A.source().id(),A.target().id(),{minlen:y(A,h.minLen),weight:y(A,h.edgeWeight),name:A.id()},A.id())}d.layout(b);for(var D=b.nodes(),R=0;R<D.length;R++){var O=D[R],M=b.node(O);p.getElementById(O).scratch().dagre=M}var P;h.boundingBox?(P={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},x.forEach(function(W){var H=W.scratch().dagre;P.x1=Math.min(P.x1,H.x),P.x2=Math.max(P.x2,H.x),P.y1=Math.min(P.y1,H.y),P.y2=Math.max(P.y2,H.y)}),P.w=P.x2-P.x1,P.h=P.y2-P.y1):P=m;var z=function(H){if(h.boundingBox){var G=P.w===0?0:(H.x-P.x1)/P.w,X=P.h===0?0:(H.y-P.y1)/P.h;return{x:m.x1+G*m.w,y:m.y1+X*m.h}}else return H};return x.layoutPositions(v,h,function(W){W=o(W)==="object"?W:this;var H=W.scratch().dagre;return z({x:H.x,y:H.y})}),this},n.exports=f},function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(l){return 1},edgeWeight:function(l){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(l,u){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(l,u){return u},ready:function(){},sort:void 0,stop:function(){}};n.exports=i},function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];return l.forEach(function(c){Object.keys(c).forEach(function(d){return i[d]=c[d]})}),i}},function(n,a){n.exports=r}])})})(kw);var _9=kw.exports;const T9=VP(_9);Dn.use(T9);const K2=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1},N9=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},I9=function(t,e,r){let n=t.connectivity.flat(),a=N9(n),i=[],o=!1;return a.forEach(l=>{o=!1,K2(e,l)&&(o=!0),K2(r,l)&&(o=!0),o||i.push(l)}),i};let B9=class extends EventTarget{constructor(r,n){super();ur(this,"cyg",null);ur(this,"nodes",[]);ur(this,"edges",[]);ur(this,"axons",[]);ur(this,"dendrites",[]);ur(this,"somas",[]);ur(this,"labelCache",new Map);ur(this,"graphCanvas",null);ur(this,"hasPhenotypes",!1);this.labelCache=r,this.graphCanvas=n}async addConnectivity(r){var n;if(r&&r["node-phenotypes"]){const a=["ilxtr:hasSomaLocatedIn"],i=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],o=[],l=[];a.forEach(c=>{o.push(...r["node-phenotypes"][c])}),i.forEach(c=>{l.push(...r["node-phenotypes"][c])});const u=I9(r,o,l);this.dendrites=o.map(c=>JSON.stringify(c)),this.axons=l.map(c=>JSON.stringify(c)),u!=null&&u.length&&(this.somas=u.map(c=>JSON.stringify(c))),this.hasPhenotypes=!0}else this.axons=r.axons.map(a=>JSON.stringify(a)),this.dendrites=r.dendrites.map(a=>JSON.stringify(a)),(n=r.somas)!=null&&n.length&&(this.somas=r.somas.map(a=>JSON.stringify(a))),this.hasPhenotypes=!1;if(r.connectivity.length)for(const a of r.connectivity){const i=await this.graphNode(a[0]),o=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(o),this.edges.push({id:`${i.id}_${o.id}`,source:i.id,target:o.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(r){this.cyg=new P9(this,r),this.cyg.on("tap-node",n=>{const a=new CustomEvent("tap-node",{detail:n.detail});this.dispatchEvent(a)})}selectConnectivity(r){var n;if((n=this.cyg)!=null&&n.cy){let a="";this.cyg.cy.elements().forEach(i=>{const o=i.data("label"),l=vg(o);O9(r,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var r;(r=this.cyg)!=null&&r.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.reset()}zoom(r){var n;if((n=this.cyg)!=null&&n.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),o=this.cyg.cy.height(),l={x:i/2,y:o/2};this.cyg.cy.zoom({level:a+r,renderedPosition:l})}}enableZoom(r){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.userZoomingEnabled(r)}get elements(){return[...this.nodes.map(r=>({data:r})),...this.edges.map(r=>({data:r}))]}get roots(){return this.hasPhenotypes?[...this.dendrites]:[...this.dendrites,...this.somas]}async graphNode(r){const n=JSON.stringify(r),a=[r[0],...r[1]],i=[];for(const l of a){const u=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(u)}a.push(...i);const o={id:n,label:a.join(`
45
+ `)};return this.hasPhenotypes?this.axons.includes(n)?o.axon=!0:this.dendrites.includes(n)?o.dendrite=!0:o.somas=!0:this.axons.includes(n)?this.dendrites.includes(n)||this.somas.includes(n)?o.somas=!0:o.axon=!0:(this.dendrites.includes(n)||this.somas.includes(n))&&(o.dendrite=!0),o}on(r,n){this.addEventListener(r,n)}};const D9=[{selector:"node",style:{label:function(t){return A9(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function A9(t){const e=t.split(`
46
+ `),r=e.length/2,n=e.slice(r);return G2(n.join(`
47
+ `))}function G2(t){return t.split(`
48
48
  `).map(e=>e&&e[0]>="a"&&e[0]<="z"?e.charAt(0).toUpperCase()+e.slice(1):e).join(`
49
- `)}function pg(t){const e=t?t.split(`
50
- `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function B9(t,e){t.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0),e.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0);for(let r=0;r<t.length;r++)if(JSON.stringify(t[r])!==JSON.stringify(e[r]))return!1;return!0}class D9 extends EventTarget{constructor(r,n){var a;super();cr(this,"cy");cr(this,"tooltip");this.cy=Bn({container:n,elements:r.elements,layout:{name:"dagre",nodeSep:150,edgeSep:50,rankSep:100,rankDir:"TB",roots:r.roots.length?r.roots:void 0},style:N9,minZoom:.1,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(a=n==null?void 0:n.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(r){var n;r+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${r-this.tooltip.offsetWidth}px`)}overNode(r){const a=r.target.data(),{label:i}=a,l=pg(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=H2(l.join(`
51
- `)),this.tooltip.style.left=`${r.renderedPosition.x}px`,this.tooltip.style.top=`${r.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(r.renderedPosition.x),this.tapNode(r,!0)}moveNode(r){const n=r.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(r){this.tooltip.hidden=!0,this.tapNode(r,!1)}tapNode(r,n){const a=r.target,i=a.data();let{label:o}=i;n?a.addClass("active"):(a.removeClass("active"),o="",setTimeout(()=>{a.unselect()}));const l=pg(o),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(r,n){this.addEventListener(r,n)}}const P9=1.3,O9=24*60*60*1e3,A9="Reset position",K2="Lock zoom",R9="Unlock zoom",L9="Zoom in",F9="Zoom out",G2=.25,M9="#8300bf",$9={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]},connectivityFromMap:{type:Object,default:()=>null},connectivityError:{type:Object,default:()=>{}}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:A9,zoomLockLabel:K2,zoomInLabel:L9,zoomOutLabel:F9,iconColor:M9,zoomEnabled:!1,connectivityGraphContainer:null}},watch:{connectivityFromMap:function(t,e){t!=e&&(this.showSpinner(),this.start())}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.start()},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,r=this.isValidKnowledgeSource();(e.getTime()>t||!r)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+O9;sessionStorage.setItem("connectivity-graph-expiry",e)},start:function(){this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?(this.loadingError=t.error,this.hideSpinner()):(this.loadingError="Loading error!",this.hideSpinner())}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<P9?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),!this.connectivityFromMap&&!this.isSCKANVersionAvailable()?{error:`No data available for SCKAN version ${this.selectedSource}.`}:(await this.setPathList(this.selectedSource),{success:!0}))},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new T9(this.labelCache,e);const r=this.knowledgeByPath.get(t);this.connectivityFromMap&&(r.axons=this.connectivityFromMap.axons,r.connectivity=this.connectivityFromMap.connectivity,r.dendrites=this.connectivityFromMap.dendrites,r.somas=this.connectivityFromMap.somas),await this.connectivityGraph.addConnectivity(r),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const a=n.detail;this.$emit("tap-node",a)}),this.hideSpinner()},query:async function(t,e){const r=`${this.mapServer}knowledge/query/`,n={sql:t,params:e};try{const a=await fetch(r,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok)throw new Error(`Cannot access ${r}`);return await a.json()}catch{return{values:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),r=(t?t.sources||[]:[]).filter(n=>n);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(r)),this.updateCacheExpiry(),r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
49
+ `)}function vg(t){const e=t?t.split(`
50
+ `):[],r=[];for(let n=0;n<e.length/2;n++)r.push({id:e[n],label:e[n+e.length/2]});return r}function O9(t,e){t.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0),e.sort((r,n)=>r.id<n.id?-1:r.id>n.id?1:0);for(let r=0;r<t.length;r++)if(JSON.stringify(t[r])!==JSON.stringify(e[r]))return!1;return!0}class P9 extends EventTarget{constructor(r,n){var a;super();ur(this,"cy");ur(this,"tooltip");this.cy=Dn({container:n,elements:r.elements,layout:{name:"dagre",nodeSep:150,edgeSep:50,rankSep:100,rankDir:"TB",roots:r.roots.length?r.roots:void 0},style:D9,minZoom:.1,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(a=n==null?void 0:n.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(r){var n;r+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${r-this.tooltip.offsetWidth}px`)}overNode(r){const a=r.target.data(),{label:i}=a,l=vg(i).map(u=>u.label+" ("+u.id+")");this.tooltip.innerText=G2(l.join(`
51
+ `)),this.tooltip.style.left=`${r.renderedPosition.x}px`,this.tooltip.style.top=`${r.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(r.renderedPosition.x),this.tapNode(r,!0)}moveNode(r){const n=r.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(r){this.tooltip.hidden=!0,this.tapNode(r,!1)}tapNode(r,n){const a=r.target,i=a.data();let{label:o}=i;n?a.addClass("active"):(a.removeClass("active"),o="",setTimeout(()=>{a.unselect()}));const l=vg(o),u=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(u)}on(r,n){this.addEventListener(r,n)}}const R9=1.3,L9=24*60*60*1e3,M9="Reset position",U2="Lock zoom",F9="Unlock zoom",$9="Zoom in",V9="Zoom out",W2=.25,q9="#8300bf",z9={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]},connectivityFromMap:{type:Object,default:()=>null},connectivityError:{type:Object,default:()=>{}}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:M9,zoomLockLabel:U2,zoomInLabel:$9,zoomOutLabel:V9,iconColor:q9,zoomEnabled:!1,connectivityGraphContainer:null}},watch:{connectivityFromMap:function(t,e){t!=e&&(this.showSpinner(),this.start())}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.start()},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),r=sessionStorage.getItem("connectivity-graph-pathlist"),n=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),r&&(this.pathList=JSON.parse(r)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}n&&(this.schemaVersion=n)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,r=this.isValidKnowledgeSource();(e.getTime()>t||!r)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+L9;sessionStorage.setItem("connectivity-graph-expiry",e)},start:function(){this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?(this.loadingError=t.error,this.hideSpinner()):(this.loadingError="Loading error!",this.hideSpinner())}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<R9?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),!this.connectivityFromMap&&!this.isSCKANVersionAvailable()?{error:`No data available for SCKAN version ${this.selectedSource}.`}:(await this.setPathList(this.selectedSource),{success:!0}))},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityFromMap&&(this.cacheLabels(this.connectivityFromMap),await this.getCachedTermLabels()),this.connectivityGraph=new B9(this.labelCache,e);const r=this.knowledgeByPath.get(t);this.connectivityFromMap&&(r.axons=this.connectivityFromMap.axons,r.connectivity=this.connectivityFromMap.connectivity,r.dendrites=this.connectivityFromMap.dendrites,r.somas=this.connectivityFromMap.somas),await this.connectivityGraph.addConnectivity(r),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const a=n.detail;this.$emit("tap-node",a)}),this.hideSpinner()},query:async function(t,e){const r=`${this.mapServer}knowledge/query/`,n={sql:t,params:e};try{const a=await fetch(r,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok)throw new Error(`Cannot access ${r}`);return await a.json()}catch{return{values:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),r=(t?t.sources||[]:[]).filter(n=>n);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(r)),this.updateCacheExpiry(),r},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
52
52
  where entity like 'ilxtr:%' and source=?
53
53
  order by entity`,[t]);return e?e.values:[]},setPathList:async function(t){this.pathList.length||(this.pathList=await this.loadPathData(t),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[e,r]of this.pathList){const n=JSON.parse(r);"connectivity"in n&&(this.knowledgeByPath.set(e,n),this.cacheLabels(n))}return this.labelCache.size||await this.getCachedTermLabels(),""},getSchemaVersion:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/schema-version`);return t&&+t.version||0},getJsonData:async function(t){try{const e=await fetch(t,{method:"GET",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"}});return e.ok||console.error(`Cannot access ${t}`),await e.json()}catch{return null}},getCachedTermLabels:async function(){if(this.labelledTerms.size){const t=await this.query(`select entity, knowledge from knowledge
54
54
  where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
55
- order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[n,a]of t.values)if(n!==e){const i=JSON.parse(a);this.labelCache.set(n,i.label||n),e=n}const r=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(r)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(G2)},zoomOut:function(){this.connectivityGraph.zoom(-G2)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?R9:K2,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},V9={class:"connectivity-graph",ref:"connectivityGraphRef"},q9={ref:"graphCanvas",class:"graph-canvas"},z9={class:"control-panel control-panel-tools"},H9={class:"visually-hidden"},K9={class:"visually-hidden"},G9={class:"visually-hidden"},U9={class:"visually-hidden"},j9=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>',1),W9={class:"connectivity-graph-error"},Y9={key:0,class:"loading-error"};function Z9(t,e,r,n,a,i){const o=Ne.Aim,l=it,c=Ht,u=Pa,d=Ne.Lock,f=Ne.Unlock,h=Ne.ZoomIn,v=Ne.ZoomOut,p=Pu;return s.withDirectives((s.openBlock(),s.createElementBlock("div",V9,[s.createElementVNode("div",q9,null,512),s.createElementVNode("div",z9,[s.createElementVNode("div",{class:s.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[s.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1}),s.createElementVNode("span",H9,s.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[t.zoomEnabled?(s.openBlock(),s.createBlock(d,{key:0})):(s.openBlock(),s.createBlock(f,{key:1}))]),_:1}),s.createElementVNode("span",K9,s.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(h)]),_:1}),s.createElementVNode("span",G9,s.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(v)]),_:1}),s.createElementVNode("span",U9,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),j9,s.withDirectives(s.createElementVNode("div",W9,[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)],512),[[s.vShow,r.connectivityError.errorConnectivities]]),t.loadingError?(s.openBlock(),s.createElementBlock("div",Y9,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const X9=Yt($9,[["render",Z9],["__scopeId","data-v-95331209"]]),U2=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),J9=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),Q9=t=>new Promise(e=>setTimeout(e,t)),eH={name:"ConnectivityList",components:{Button:Ht,Container:Su,Icon:it,ElIconWarning:Ne.Warning,ElIconSearch:Ne.Search},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>{}}},data:function(){return{alertTop:0,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[]}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return U2(t)},onConnectivityHovered:function(t,e){this.$emit("connectivity-hovered",t),e&&(this.alertTop=e.srcElement.offsetParent.offsetTop+e.srcElement.offsetTop)},onConnectivityClicked:function(t){const e=this.connectivityError.errorConnectivities,r=e?t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`,"gi"),"").trim():t;this.$emit("connectivity-clicked",r)},shouldShowMagnifyGlass:function(t){const e=this.connectivityError.errorConnectivities;return(e==null?void 0:e.toLowerCase())!==t.toLowerCase()},shouldShowExploreButton:function(t){if(!this.facetList.length)return!0;for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},Pn=t=>(s.pushScopeId("data-v-81bbd5ff"),t=t(),s.popScopeId(),t),tH={ref:"connectivityList",class:"connectivity-list"},rH={key:0,class:"block"},nH={class:"attribute-title-container"},aH=Pn(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),iH={style:{"word-break":"keep-all"}},oH=Pn(()=>s.createElementVNode("i",null,"Origin",-1)),sH=["origin-item-label","onMouseenter"],lH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),uH={key:1,class:"block"},cH=Pn(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),dH=["component-item-label","onMouseenter"],fH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),hH={key:2,class:"block"},pH={class:"attribute-title-container"},vH=Pn(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),gH=Pn(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),mH=["destination-item-label","onMouseenter"],yH=Pn(()=>s.createElementVNode("span",null,"Search connectivity",-1)),bH={class:"block"};function wH(t,e,r,n,a,i){const o=Ra,l=Ne.Warning,c=it,u=Ne.Search,d=Ht;return s.openBlock(),s.createElementBlock("div",tH,[s.createVNode(o,{width:"250","show-arrow":!1,trigger:"manual",teleported:!1,placement:"left-start",visible:!!r.connectivityError.errorConnectivities,"popper-class":"connectivity-error-container"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"connectivity-alert",style:s.normalizeStyle({top:t.alertTop+"px"})},null,4)]),default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)]),_:1},8,["visible"]),s.createTextVNode(" "+s.toDisplayString(r.entry.paths)+" ",1),r.origins&&r.origins.length>0?(s.openBlock(),s.createElementBlock("div",rH,[s.createElementVNode("div",nH,[aH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",iH,[oH,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.origins,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[0]||(e[0]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[lH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,sH))),128)),s.withDirectives(s.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,r.originsWithDatasets&&r.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.originsWithDatasets)]])])):s.createCommentVNode("",!0),r.components&&r.components.length>0?(s.openBlock(),s.createElementBlock("div",uH,[cH,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.components,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[1]||(e[1]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[fH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,dH))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",hH,[s.createElementVNode("div",pH,[vH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[gH]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.destinations,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[2]||(e[2]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(c,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(u)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[yH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,mH))),128)),s.withDirectives(s.createVNode(d,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,r.destinationsWithDatasets&&r.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.destinationsWithDatasets)]])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",bH,[s.createVNode(d,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[s.vShow,r.componentsWithDatasets&&r.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.componentsWithDatasets)]])],512)}const vg=Yt(eH,[["render",wH],["__scopeId","data-v-81bbd5ff"]]),CH=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},EH={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return CH(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},gg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),xH={class:"dialog-container"},kH=gg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),SH=gg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),_H=gg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),TH={class:"connection-label"};function NH(t,e,r,n,a,i){const o=Ht,l=is,c=Fi,u=Ra,d=zA;return s.openBlock(),s.createElementBlock("div",xH,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[r.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[kH,s.createVNode(o,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(o,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[SH,s.createVNode(o,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),r.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[_H,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.connectionEntry,(f,h)=>(s.openBlock(),s.createBlock(l,{key:h},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:s.withCtx(()=>[s.createVNode(u,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",TH,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const IH=Yt(EH,[["render",NH],["__scopeId","data-v-1ddab772"]]),j2=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},BH=["xlink:href"],DH={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[s.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,BH)],2))}},PH=j2(DH,[["__scopeId","data-v-e172d5ff"]]),W2=`<?xml version="1.0" encoding="UTF-8"?>
55
+ order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[n,a]of t.values)if(n!==e){const i=JSON.parse(a);this.labelCache.set(n,i.label||n),e=n}const r=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(r)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(W2)},zoomOut:function(){this.connectivityGraph.zoom(-W2)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?F9:U2,this.connectivityGraph.enableZoom(!this.zoomEnabled)}}},H9={class:"connectivity-graph",ref:"connectivityGraphRef"},K9={ref:"graphCanvas",class:"graph-canvas"},G9={class:"control-panel control-panel-tools"},U9={class:"visually-hidden"},W9={class:"visually-hidden"},j9={class:"visually-hidden"},Y9={class:"visually-hidden"},Z9=s.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>',1),X9={class:"connectivity-graph-error"},J9={key:0,class:"loading-error"};function Q9(t,e,r,n,a,i){const o=xe.Aim,l=Xe,u=Bt,c=Oa,d=xe.Lock,f=xe.Unlock,h=xe.ZoomIn,v=xe.ZoomOut,p=Oc;return s.withDirectives((s.openBlock(),s.createElementBlock("div",H9,[s.createElementVNode("div",K9,null,512),s.createElementVNode("div",G9,[s.createElementVNode("div",{class:s.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[s.createVNode(c,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(u,{class:"control-button",size:"small",onClick:i.reset},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(o)]),_:1}),s.createElementVNode("span",U9,s.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(c,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(u,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[t.zoomEnabled?(s.openBlock(),s.createBlock(d,{key:0})):(s.openBlock(),s.createBlock(f,{key:1}))]),_:1}),s.createElementVNode("span",W9,s.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(c,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomIn},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(h)]),_:1}),s.createElementVNode("span",j9,s.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),s.createVNode(c,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:s.withCtx(()=>[s.createVNode(u,{class:"control-button",size:"small",onClick:i.zoomOut},{default:s.withCtx(()=>[s.createVNode(l,{color:"white"},{default:s.withCtx(()=>[s.createVNode(v)]),_:1}),s.createElementVNode("span",Y9,s.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),Z9,s.withDirectives(s.createElementVNode("div",X9,[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)],512),[[s.vShow,r.connectivityError.errorConnectivities]]),t.loadingError?(s.openBlock(),s.createElementBlock("div",J9,s.toDisplayString(t.loadingError),1)):s.createCommentVNode("",!0)])),[[p,t.loading]])}const eH=qt(z9,[["render",Q9],["__scopeId","data-v-95331209"]]),gg=t=>t&&t.charAt(0).toUpperCase()+t.slice(1),tH=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),rH=t=>new Promise(e=>setTimeout(e,t)),nH=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},aH={name:"ConnectivityList",components:{Button:Bt,Container:ls,Icon:Xe,ElIconWarning:xe.Warning,ElIconSearch:xe.Search},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>{}}},data:function(){return{alertTop:0,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[]}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory}},methods:{capitalise:function(t){return gg(t)},onConnectivityHovered:function(t,e){this.$emit("connectivity-hovered",t),e&&(this.alertTop=e.srcElement.offsetParent.offsetTop+e.srcElement.offsetTop)},onConnectivityClicked:function(t){const e=this.connectivityError.errorConnectivities,r=e?t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`,"gi"),"").trim():t;this.$emit("connectivity-clicked",r)},shouldShowMagnifyGlass:function(t){const e=this.connectivityError.errorConnectivities;return(e==null?void 0:e.toLowerCase())!==t.toLowerCase()},shouldShowExploreButton:function(t){if(!this.facetList.length)return!0;for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},On=t=>(s.pushScopeId("data-v-68dab9dd"),t=t(),s.popScopeId(),t),iH={ref:"connectivityList",class:"connectivity-list"},oH={key:0,class:"block"},sH={class:"attribute-title-container"},lH=On(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),cH={style:{"word-break":"keep-all"}},uH=On(()=>s.createElementVNode("i",null,"Origin",-1)),dH=["origin-item-label","onMouseenter"],fH=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),hH={key:1,class:"block"},pH=On(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),vH=["component-item-label","onMouseenter"],gH=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),mH={key:2,class:"block"},yH={class:"attribute-title-container"},bH=On(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),wH=On(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),CH=["destination-item-label","onMouseenter"],EH=On(()=>s.createElementVNode("span",null,"Search connectivity",-1)),xH={class:"block"};function kH(t,e,r,n,a,i){const o=mn,l=xe.Warning,u=Xe,c=xe.Search,d=Bt;return s.openBlock(),s.createElementBlock("div",iH,[s.createVNode(o,{width:"250","show-arrow":!1,trigger:"manual",teleported:!1,placement:"left-start",visible:!!r.connectivityError.errorConnectivities,"popper-class":"connectivity-error-container"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"connectivity-alert",style:s.normalizeStyle({top:t.alertTop+"px"})},null,4)]),default:s.withCtx(()=>[s.createElementVNode("strong",null,s.toDisplayString(r.connectivityError.errorConnectivities),1),s.createTextVNode(" "+s.toDisplayString(r.connectivityError.errorMessage),1)]),_:1},8,["visible"]),s.createTextVNode(" "+s.toDisplayString(r.entry.paths)+" ",1),r.origins&&r.origins.length>0?(s.openBlock(),s.createElementBlock("div",oH,[s.createElementVNode("div",sH,[lH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",cH,[uH,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.origins,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[0]||(e[0]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(u,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(c)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[fH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,dH))),128)),s.withDirectives(s.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,r.originsWithDatasets&&r.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.originsWithDatasets)]])])):s.createCommentVNode("",!0),r.components&&r.components.length>0?(s.openBlock(),s.createElementBlock("div",hH,[pH,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.components,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[1]||(e[1]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(u,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(c)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[gH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,vH))),128))])):s.createCommentVNode("",!0),r.destinations&&r.destinations.length>0?(s.openBlock(),s.createElementBlock("div",mH,[s.createElementVNode("div",yH,[bH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[wH]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.destinations,(f,h)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f,onMouseenter:v=>i.onConnectivityHovered(f,v),onMouseleave:e[2]||(e[2]=v=>i.onConnectivityHovered())},[s.createVNode(o,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.withDirectives(s.createVNode(u,{class:"magnify-glass",onClick:v=>i.onConnectivityClicked(f)},{default:s.withCtx(()=>[s.createVNode(c)]),_:2},1032,["onClick"]),[[s.vShow,i.shouldShowMagnifyGlass(f)]])]),default:s.withCtx(()=>[EH]),_:2},1024),s.createElementVNode("span",null,s.toDisplayString(i.capitalise(f)),1)],40,CH))),128)),s.withDirectives(s.createVNode(d,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,r.destinationsWithDatasets&&r.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.destinationsWithDatasets)]])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",xH,[s.createVNode(d,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[s.vShow,r.componentsWithDatasets&&r.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.componentsWithDatasets)]])],512)}const mg=qt(aH,[["render",kH],["__scopeId","data-v-68dab9dd"]]),SH={name:"ReconciliationTable",components:{ElIconSearch:xe.Search},props:{groups:{type:Array,default:()=>[]},tableKey:{type:String,default:"reconciliation"},connectivityListContainer:{type:HTMLElement,default:null}},emits:["row-hovered","connectivity-clicked"],data(){return{hoveredGroupIndex:null}},methods:{capitalise:function(t){return gg(t)},isDirectMatch:function(t,e){return t.items.length!==1||!e.sckanId||!e.mapId?!1:this.isMatch(e)},isMatch:function(t){return JSON.stringify(t.sckanId)===JSON.stringify(t.mapId)},onTargetHover(t,e,r){this.hoveredGroupIndex=t,this.$emit("row-hovered",e,r,!0)},onSourceHover(t,e,r){this.hoveredGroupIndex=t,this.$emit("row-hovered",e,r,!1)},onSourceLeave(t){this.hoveredGroupIndex=null,this.$emit("row-hovered")}}},j2=t=>(s.pushScopeId("data-v-4e0eed22"),t=t(),s.popScopeId(),t),_H={class:"reconciliation-table"},TH={class:"reconciliation-table-inner"},NH=["onMouseenter"],IH={class:"target-content"},BH={class:"term-label"},DH=j2(()=>s.createElementVNode("span",null,"Search connectivity",-1)),AH=["onMouseenter","onMouseleave"],OH={class:"term-label"},PH=["rowspan","onMouseenter","onMouseleave"],RH={class:"target-content"},LH={class:"term-label"},MH=j2(()=>s.createElementVNode("span",null,"Search connectivity",-1));function FH(t,e,r,n,a,i){const o=xe.Search,l=Xe,u=mn;return s.openBlock(),s.createElementBlock("div",_H,[s.createElementVNode("table",TH,[s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.groups,(c,d)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:`${r.tableKey}-group-${d}`},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.items,(f,h)=>(s.openBlock(),s.createElementBlock("tr",{key:`${r.tableKey}-${d}-${h}`,class:s.normalizeClass(["table-row",{"group-last":h===c.items.length-1}])},[i.isDirectMatch(c,f)?(s.openBlock(),s.createElementBlock("td",{key:0,class:"table-cell direct-match-cell",colspan:"2",onMouseenter:v=>t.$emit("row-hovered",f,v),onMouseleave:e[0]||(e[0]=v=>t.$emit("row-hovered"))},[s.createElementVNode("div",IH,[s.createElementVNode("span",BH,s.toDisplayString(i.capitalise(f.sckanLabel)),1),s.createVNode(u,{width:"150",trigger:"hover",teleported:!0,"append-to":r.connectivityListContainer,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"status-search-icon",onClick:v=>t.$emit("connectivity-clicked",f.mapLabel)},{default:s.withCtx(()=>[s.createVNode(o)]),_:2},1032,["onClick"])]),default:s.withCtx(()=>[DH]),_:2},1032,["append-to"])])],40,NH)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("td",{class:s.normalizeClass(["table-cell source-column",{mapped:this.isMatch(f),"highlighted-by-target":a.hoveredGroupIndex===d&&(!c.items[0].mapId||c.items[0].mapId.length===0)}]),onMouseenter:v=>i.onSourceHover(d,f,v),onMouseleave:v=>i.onSourceLeave(f)},[s.createElementVNode("span",OH,s.toDisplayString(i.capitalise(f.sckanLabel)),1)],42,AH),h===0?(s.openBlock(),s.createElementBlock("td",{key:0,class:s.normalizeClass(["table-cell target-column",{"grouped-cell":c.items.length>1,unavailable:!f.mapId||f.mapId.length===0,highlighted:a.hoveredGroupIndex===d}]),rowspan:c.items.length,onMouseenter:v=>i.onTargetHover(d,f,v),onMouseleave:v=>i.onSourceLeave(f)},[s.createElementVNode("div",RH,[f.mapId&&f.mapId.length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("span",LH,s.toDisplayString(i.capitalise(f.mapLabel)),1),s.createVNode(u,{width:"150",trigger:"hover",teleported:!0,"append-to":r.connectivityListContainer,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"status-search-icon",onClick:v=>t.$emit("connectivity-clicked",f.mapLabel)},{default:s.withCtx(()=>[s.createVNode(o)]),_:2},1032,["onClick"])]),default:s.withCtx(()=>[MH]),_:2},1032,["append-to"])],64)):s.createCommentVNode("",!0)])],42,PH)):s.createCommentVNode("",!0)],64))],2))),128))],64))),128))])])])}const Y2=qt(SH,[["render",FH],["__scopeId","data-v-4e0eed22"]]),$H={name:"ConnectivityReconciliationList",components:{Button:Bt,Container:ls,Icon:Xe,ElIconWarning:xe.Warning,ReconciliationTable:Y2},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],destinationsCombinations:[],originsCombinations:[],componentsCombinations:[],resource:void 0,featuresAlert:void 0})},origins:{type:Array,default:()=>[]},components:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},originsWithDatasets:{type:Array,default:()=>[]},componentsWithDatasets:{type:Array,default:()=>[]},destinationsWithDatasets:{type:Array,default:()=>[]},componentsCombinations:{type:Array,default:()=>[]},originsCombinations:{type:Array,default:()=>[]},destinationsCombinations:{type:Array,default:()=>[]},availableAnatomyFacets:{type:Array,default:()=>[]},connectivityError:{type:Object,default:()=>{}}},data:function(){return{alertTop:0,alertLeft:0,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},facetList:[],clearErrorTimeout:null,connectivityListContainer:null}},watch:{availableAnatomyFacets:{handler:function(t){this.convertFacetsToList(t)},immediate:!0,deep:!0}},mounted:function(){this.connectivityListContainer=this.$refs.connectivityList},computed:{originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},groupedOrigins:function(){return this.groupCombinationsByMapId(this.originsCombinations)},groupedComponents:function(){return this.groupCombinationsByMapId(this.componentsCombinations)},groupedDestinations:function(){return this.groupCombinationsByMapId(this.destinationsCombinations)}},methods:{getCombinationSortLabel:function(t){return((t==null?void 0:t.sckanLabel)||(t==null?void 0:t.mapLabel)||"").toLowerCase()},groupCombinationsByMapId:function(t){const e=[],r=new Map;return[...t].sort((a,i)=>this.getCombinationSortLabel(a).localeCompare(this.getCombinationSortLabel(i))).forEach(a=>{if(!a.mapId||a.mapId.length===0)e.push({items:[a]});else{const i=JSON.stringify(a.mapId);if(!r.has(i)){const o={items:[]};r.set(i,o),e.push(o)}r.get(i).items.push(a)}}),e},onRowHovered:function(t,e,r=!1){this.clearErrorTimeout&&(clearTimeout(this.clearErrorTimeout),this.clearErrorTimeout=null);let n={hasError:!1,errorType:"",errorMessage:""};if(t)if(t.mapId&&t.mapId.length>0){const a=t.mapLabel.toLowerCase();this.$emit("connectivity-hovered",a),!r&&JSON.stringify(t.sckanId)!==JSON.stringify(t.mapId)&&(n={hasError:!0,errorType:"warning",errorMessage:`<strong>${t.sckanLabel}</strong> from SCKAN
56
+ has been mapped to <strong>${t.mapLabel}</strong> on the Map.`})}else t.sckanId&&t.sckanId.length>0&&(n={hasError:!0,errorType:"error",errorMessage:`<strong>${t.sckanLabel}</strong> from SCKAN
57
+ is not available on the Map.`});else this.$emit("connectivity-hovered",null);if(n.hasError?(this.connectivityError.errorType=n.errorType,this.connectivityError.errorMessage=n.errorMessage,this.connectivityError.hasError=!0):(this.connectivityError.hasError=!1,this.clearErrorTimeout=setTimeout(()=>{this.connectivityError.errorType="",this.connectivityError.errorMessage="",this.clearErrorTimeout=null},350)),e){const i=e.currentTarget.getBoundingClientRect(),o=this.$refs.connectivityList.getBoundingClientRect();this.alertTop=i.top-o.top,this.alertLeft=i.left-o.left+i.width/2}},onConnectivityClicked:function(t){const e=this.connectivityError.errorConnectivities,r=e?t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`,"gi"),"").trim():t;this.$emit("connectivity-clicked",r)},shouldShowMagnifyGlass:function(t){const e=this.connectivityError.errorConnectivities;return(e==null?void 0:e.toLowerCase())!==t.toLowerCase()},shouldShowExploreButton:function(t){if(!this.facetList.length)return!0;for(let e=0;e<t.length;e++)if(this.facetList.includes(t[e].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(t){t.forEach(e=>{e.children?this.convertFacetsToList(e.children):this.facetList.push(e.label.toLowerCase())})},openAll:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.componentsWithDatasets.map(t=>t.name.toLowerCase())})},openAxons:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.destinationsWithDatasets.map(t=>t.name.toLowerCase())})},openDendrites:function(){this.$emit("connectivity-action-click",{type:"Facets",labels:this.originsWithDatasets.map(t=>t.name.toLowerCase())})}}},Bo=t=>(s.pushScopeId("data-v-cca5cb7d"),t=t(),s.popScopeId(),t),VH={ref:"connectivityList",class:"connectivity-list"},qH=["innerHTML"],zH={key:0,class:"block"},HH={class:"attribute-title-container"},KH=Bo(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),GH={style:{"word-break":"keep-all"}},UH=Bo(()=>s.createElementVNode("i",null,"Origin",-1)),WH={key:1,class:"block"},jH=Bo(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("span",{class:"attribute-title"},"Components")],-1)),YH={key:2,class:"block"},ZH={class:"attribute-title-container"},XH=Bo(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),JH=Bo(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),QH={class:"block"};function eK(t,e,r,n,a,i){const o=mn,l=xe.Warning,u=Xe,c=Y2,d=Bt;return s.openBlock(),s.createElementBlock("div",VH,[s.createVNode(o,{width:"250","show-arrow":!1,trigger:"manual",teleported:!0,"append-to":t.connectivityListContainer,placement:"bottom-start",visible:r.connectivityError.hasError&&!!r.connectivityError.errorMessage,"popper-class":r.connectivityError.errorType==="warning"?"connectivity-warning-container":"connectivity-error-container"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"connectivity-alert",style:s.normalizeStyle({top:t.alertTop+"px",left:t.alertLeft+"px"})},null,4)]),default:s.withCtx(()=>[s.createElementVNode("span",{innerHTML:r.connectivityError.errorMessage},null,8,qH)]),_:1},8,["append-to","visible","popper-class"]),r.origins&&r.originsCombinations.length>0?(s.openBlock(),s.createElementBlock("div",zH,[s.createElementVNode("div",HH,[KH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!0,"append-to":t.connectivityListContainer,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",GH,[UH,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1},8,["append-to"])]),s.createVNode(c,{"table-key":"origin",groups:i.groupedOrigins,"connectivity-list-container":t.connectivityListContainer,onRowHovered:i.onRowHovered,onConnectivityClicked:i.onConnectivityClicked},null,8,["groups","connectivity-list-container","onRowHovered","onConnectivityClicked"]),s.withDirectives(s.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,r.originsWithDatasets&&r.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.originsWithDatasets)]])])):s.createCommentVNode("",!0),r.components&&r.componentsCombinations.length>0?(s.openBlock(),s.createElementBlock("div",WH,[jH,s.createVNode(c,{"table-key":"component",groups:i.groupedComponents,"connectivity-list-container":t.connectivityListContainer,onRowHovered:i.onRowHovered,onConnectivityClicked:i.onConnectivityClicked},null,8,["groups","connectivity-list-container","onRowHovered","onConnectivityClicked"])])):s.createCommentVNode("",!0),r.destinations&&r.destinationsCombinations.length>0?(s.openBlock(),s.createElementBlock("div",YH,[s.createElementVNode("div",ZH,[XH,s.createVNode(o,{width:"250",trigger:"hover",teleported:!0,"append-to":t.connectivityListContainer,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(l)]),_:1})]),default:s.withCtx(()=>[JH]),_:1},8,["append-to"])]),s.createVNode(c,{"table-key":"destination",groups:i.groupedDestinations,"connectivity-list-container":t.connectivityListContainer,onRowHovered:i.onRowHovered,onConnectivityClicked:i.onConnectivityClicked},null,8,["groups","connectivity-list-container","onRowHovered","onConnectivityClicked"]),s.withDirectives(s.createVNode(d,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,r.destinationsWithDatasets&&r.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.destinationsWithDatasets)]])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",QH,[s.createVNode(d,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[s.vShow,r.componentsWithDatasets&&r.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.componentsWithDatasets)]])],512)}const tK=qt($H,[["render",eK],["__scopeId","data-v-cca5cb7d"]]),rK=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},nK={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return rK(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},yg=t=>(s.pushScopeId("data-v-1ddab772"),t=t(),s.popScopeId(),t),aK={class:"dialog-container"},iK=yg(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),oK=yg(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),sK=yg(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),lK={class:"connection-label"};function cK(t,e,r,n,a,i){const o=Bt,l=os,u=Mi,c=mn,d=GP;return s.openBlock(),s.createElementBlock("div",aK,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(u,null,{default:s.withCtx(()=>[r.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[iK,s.createVNode(o,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(o,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[oK,s.createVNode(o,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),r.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(u,null,{default:s.withCtx(()=>[sK,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.connectionEntry,(f,h)=>(s.openBlock(),s.createBlock(l,{key:h},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(h),onClick:v=>i.handleTooltip(h)},{default:s.withCtx(()=>[s.createVNode(c,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",lK,s.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const uK=qt(nK,[["render",cK],["__scopeId","data-v-1ddab772"]]),Z2=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},dK=["xlink:href"],fK={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,r)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[s.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,dK)],2))}},hK=Z2(fK,[["__scopeId","data-v-e172d5ff"]]),X2=`<?xml version="1.0" encoding="UTF-8"?>
56
58
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
57
59
  <title>2horpanel</title>
58
60
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -67,7 +69,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
67
69
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
68
70
  </g>
69
71
  </g>
70
- </svg>`,Y2=`<?xml version="1.0" encoding="UTF-8"?>
72
+ </svg>`,J2=`<?xml version="1.0" encoding="UTF-8"?>
71
73
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
72
74
  <title>2vertpanel</title>
73
75
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -82,7 +84,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
82
84
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
83
85
  </g>
84
86
  </g>
85
- </svg>`,Z2=`<?xml version="1.0" encoding="UTF-8"?>
87
+ </svg>`,Q2=`<?xml version="1.0" encoding="UTF-8"?>
86
88
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
87
89
  <title>3panel</title>
88
90
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -98,7 +100,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
98
100
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
99
101
  </g>
100
102
  </g>
101
- </svg>`,X2=`<?xml version="1.0" encoding="UTF-8"?>
103
+ </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
102
104
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
103
105
  <title>4panel</title>
104
106
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -114,7 +116,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
114
116
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
115
117
  </g>
116
118
  </g>
117
- </svg>`,J2=`<?xml version="1.0" encoding="UTF-8"?>
119
+ </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
118
120
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
119
121
  <title>2horpanel</title>
120
122
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -132,7 +134,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
132
134
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
133
135
  </g>
134
136
  </g>
135
- </svg>`,Q2=`<?xml version="1.0" encoding="UTF-8"?>
137
+ </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
136
138
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
137
139
  <title>2horpanel</title>
138
140
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -149,7 +151,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
149
151
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
150
152
  </g>
151
153
  </g>
152
- </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
154
+ </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
153
155
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
154
156
  <title>4panel</title>
155
157
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -166,7 +168,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
166
168
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
167
169
  </g>
168
170
  </g>
169
- </svg>`,t_=`<?xml version="1.0" encoding="UTF-8"?>
171
+ </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
170
172
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
171
173
  <title>changeBckgd</title>
172
174
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -177,7 +179,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
177
179
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
178
180
  </g>
179
181
  </g>
180
- </svg>`,r_=`<?xml version="1.0" encoding="UTF-8"?>
182
+ </svg>`,i_=`<?xml version="1.0" encoding="UTF-8"?>
181
183
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
182
184
  <title>close no bk</title>
183
185
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -186,7 +188,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
186
188
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
187
189
  </g>
188
190
  </g>
189
- </svg>`,n_=`<?xml version="1.0" encoding="UTF-8"?>
191
+ </svg>`,o_=`<?xml version="1.0" encoding="UTF-8"?>
190
192
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
191
193
  <title>close</title>
192
194
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -200,7 +202,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
200
202
  </g>
201
203
  </g>
202
204
  </g>
203
- </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
205
+ </svg>`,s_=`<?xml version="1.0" encoding="UTF-8"?>
204
206
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
205
207
  <title>closeFullScreen</title>
206
208
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -212,7 +214,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
212
214
  <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 7.750000) scale(1, -1) rotate(-360.000000) translate(-17.250000, -7.750000) " points="15.5 9.5 15.5 6 19 6"></polyline>
213
215
  </g>
214
216
  </g>
215
- </svg>`,i_=`<?xml version="1.0" encoding="UTF-8"?>
217
+ </svg>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
216
218
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
217
219
  xmlns:xlink="http://www.w3.org/1999/xlink">
218
220
  <title>Comment</title>
@@ -221,7 +223,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
221
223
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
222
224
  d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" />
223
225
  </g>
224
- </svg>`,o_=`<?xml version="1.0" encoding="UTF-8"?>
226
+ </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
225
227
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
226
228
  xmlns:xlink="http://www.w3.org/1999/xlink">
227
229
  <title>Connection</title>
@@ -232,7 +234,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
232
234
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
233
235
  d="M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" />
234
236
  </g>
235
- </svg>`,s_=`<?xml version="1.0" encoding="UTF-8"?>
237
+ </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
236
238
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
237
239
  <title>dock</title>
238
240
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -252,35 +254,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
252
254
  </g>
253
255
  </g>
254
256
  </g>
255
- </svg>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
257
+ </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
256
258
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
257
259
  <title>drawLine</title>
258
260
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
259
261
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
260
262
  <path fill="#FFFFFF" transform="translate(2 2.0625)" d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z" />
261
263
  </g>
262
- </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
264
+ </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
263
265
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
264
266
  <title>drawPoint</title>
265
267
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
266
268
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
267
269
  <path fill="#FFFFFF" transform="translate(1.875 2.5)" d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z" />
268
270
  </g>
269
- </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
271
+ </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
270
272
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
271
273
  <title>drawPolygon</title>
272
274
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
273
275
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
274
276
  <path fill="#FFFFFF" transform="translate(1.875 1.625)" d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z" />
275
277
  </g>
276
- </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
278
+ </svg>`,p_=`<?xml version="1.0" encoding="UTF-8"?>
277
279
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
278
280
  <title>drawTrash</title>
279
281
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
280
282
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
281
283
  <path fill="#FFFFFF" transform="translate(2 1.5)" d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z" />
282
284
  </g>
283
- </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
285
+ </svg>`,v_=`<?xml version="1.0" encoding="UTF-8"?>
284
286
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
285
287
  <title>fitWindow</title>
286
288
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -299,7 +301,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
299
301
  </g>
300
302
  </g>
301
303
  </g>
302
- </svg>`,h_=`<?xml version="1.0" encoding="UTF-8"?>
304
+ </svg>`,g_=`<?xml version="1.0" encoding="UTF-8"?>
303
305
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
304
306
  <title>fullScreen</title>
305
307
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -313,7 +315,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
313
315
  </g>
314
316
  </g>
315
317
  </g>
316
- </svg>`,p_='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',v_=`<?xml version="1.0" encoding="UTF-8"?>
318
+ </svg>`,m_='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',y_=`<?xml version="1.0" encoding="UTF-8"?>
317
319
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
318
320
  <title>magnifyingGlass</title>
319
321
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -327,7 +329,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
327
329
  </g>
328
330
  </g>
329
331
  </g>
330
- </svg>`,g_=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,m_=`<?xml version="1.0" encoding="UTF-8"?>
332
+ </svg>`,b_=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,w_=`<?xml version="1.0" encoding="UTF-8"?>
331
333
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
332
334
  <title>openMap</title>
333
335
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -337,7 +339,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
337
339
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
338
340
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
339
341
  </g>
340
- </svg>`,y_=`<?xml version="1.0" encoding="UTF-8"?>
342
+ </svg>`,C_=`<?xml version="1.0" encoding="UTF-8"?>
341
343
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
342
344
  <title>Artboard Copy 6</title>
343
345
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -347,7 +349,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
347
349
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
348
350
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
349
351
  </g>
350
- </svg>`,b_=`<?xml version="1.0" encoding="UTF-8"?>
352
+ </svg>`,E_=`<?xml version="1.0" encoding="UTF-8"?>
351
353
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
352
354
  <title>permalink</title>
353
355
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -355,7 +357,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
355
357
  <line x1="12.5" y1="9" x2="12.5" y2="15" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></line>
356
358
  <path d="M17,13 L17,16.5 C17,18.9852814 14.9852814,21 12.5,21 C10.0147186,21 8,18.9852814 8,16.5 L8,13 L10,13 L10,16.5 C10,17.8807119 11.1192881,19 12.5,19 C13.8254834,19 14.9100387,17.9684641 14.9946823,16.6643757 L15,16.5 L15,13 L17,13 Z M12.5,3 C14.9852814,3 17,5.01471863 17,7.5 L17,11 L15,11 L15,7.5 C15,6.11928813 13.8807119,5 12.5,5 C11.1745166,5 10.0899613,6.03153594 10.0053177,7.33562431 L10,7.5 L10,11 L8,11 L8,7.5 C8,5.01471863 10.0147186,3 12.5,3 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></path>
357
359
  </g>
358
- </svg>`,w_=`<?xml version="1.0" encoding="UTF-8"?>
360
+ </svg>`,x_=`<?xml version="1.0" encoding="UTF-8"?>
359
361
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
360
362
  <title>play</title>
361
363
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -366,7 +368,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
366
368
  <polygon id="Triangle" fill="#FFFFFF" class="st0" transform="translate(13.000000, 11.500000) rotate(-270.000000) translate(-13.000000, -11.500000) " points="13 8 19 15 7 15"></polygon>
367
369
  </g>
368
370
  </g>
369
- </svg>`,C_=`<?xml version="1.0" encoding="UTF-8"?>
371
+ </svg>`,k_=`<?xml version="1.0" encoding="UTF-8"?>
370
372
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
371
373
  <title>resetZoom</title>
372
374
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -384,7 +386,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
384
386
  </g>
385
387
  </g>
386
388
  </g>
387
- </svg>`,E_=`<?xml version="1.0" encoding="UTF-8"?>
389
+ </svg>`,S_=`<?xml version="1.0" encoding="UTF-8"?>
388
390
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
389
391
  <title>singlepanel</title>
390
392
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -398,7 +400,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
398
400
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
399
401
  </g>
400
402
  </g>
401
- </svg>`,x_=`<?xml version="1.0" encoding="UTF-8"?>
403
+ </svg>`,__=`<?xml version="1.0" encoding="UTF-8"?>
402
404
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
403
405
  <title>tooltips</title>
404
406
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -410,7 +412,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
410
412
  </text>
411
413
  </g>
412
414
  </g>
413
- </svg>`,k_=`<?xml version="1.0" encoding="UTF-8"?>
415
+ </svg>`,T_=`<?xml version="1.0" encoding="UTF-8"?>
414
416
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
415
417
  <title>undock</title>
416
418
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -430,7 +432,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
430
432
  </g>
431
433
  </g>
432
434
  </g>
433
- </svg>`,S_=`<?xml version="1.0" encoding="UTF-8"?>
435
+ </svg>`,N_=`<?xml version="1.0" encoding="UTF-8"?>
434
436
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
435
437
  <title>zoomIn</title>
436
438
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -446,7 +448,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
446
448
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(10.500000, 9.500000) rotate(90.000000) translate(-10.500000, -9.500000) "></line>
447
449
  </g>
448
450
  </g>
449
- </svg>`,__=`<?xml version="1.0" encoding="UTF-8"?>
451
+ </svg>`,I_=`<?xml version="1.0" encoding="UTF-8"?>
450
452
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
451
453
  <title>zoomOut</title>
452
454
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -461,10 +463,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
461
463
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
462
464
  </g>
463
465
  </g>
464
- </svg>`,T_=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],o=n||[];let l=document.createElement("div");l.innerHTML=t,a.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&o.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},N_=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,r)=>"".replace.apply(e,r),t).trim(),OH=!0,AH=!0,RH=["fill"],mg=Object.assign({"/assets/icons/2horpanel.svg":W2,"/assets/icons/2vertpanel.svg":Y2,"/assets/icons/3panel.svg":Z2,"/assets/icons/4panel.svg":X2,"/assets/icons/5panel.svg":J2,"/assets/icons/6panel.svg":Q2,"/assets/icons/6panelVertical.svg":e_,"/assets/icons/changeBckgd.svg":t_,"/assets/icons/close-no-bk.svg":r_,"/assets/icons/close.svg":n_,"/assets/icons/closeFullScreen.svg":a_,"/assets/icons/comment.svg":i_,"/assets/icons/connection.svg":o_,"/assets/icons/dock.svg":s_,"/assets/icons/drawLine.svg":l_,"/assets/icons/drawPoint.svg":u_,"/assets/icons/drawPolygon.svg":c_,"/assets/icons/drawTrash.svg":d_,"/assets/icons/fitWindow.svg":f_,"/assets/icons/fullScreen.svg":h_,"/assets/icons/help.svg":p_,"/assets/icons/magnifyingGlass.svg":v_,"/assets/icons/noun-filter.svg":g_,"/assets/icons/openMap.svg":m_,"/assets/icons/pause.svg":y_,"/assets/icons/permalink.svg":b_,"/assets/icons/play.svg":w_,"/assets/icons/resetZoom.svg":C_,"/assets/icons/singlepanel.svg":E_,"/assets/icons/tooltips.svg":x_,"/assets/icons/undock.svg":k_,"/assets/icons/zoomIn.svg":S_,"/assets/icons/zoomOut.svg":__});Object.keys(mg).map(t=>{const e=T_(mg[t],OH,AH,RH),r=t.replace(/^.+\/(\w+).svg$/,"$1");return N_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
465
- `);const yg=Object.assign({"/assets/icons/2horpanel.svg":W2,"/assets/icons/2vertpanel.svg":Y2,"/assets/icons/3panel.svg":Z2,"/assets/icons/4panel.svg":X2,"/assets/icons/5panel.svg":J2,"/assets/icons/6panel.svg":Q2,"/assets/icons/6panelVertical.svg":e_,"/assets/icons/changeBckgd.svg":t_,"/assets/icons/close-no-bk.svg":r_,"/assets/icons/close.svg":n_,"/assets/icons/closeFullScreen.svg":a_,"/assets/icons/comment.svg":i_,"/assets/icons/connection.svg":o_,"/assets/icons/dock.svg":s_,"/assets/icons/drawLine.svg":l_,"/assets/icons/drawPoint.svg":u_,"/assets/icons/drawPolygon.svg":c_,"/assets/icons/drawTrash.svg":d_,"/assets/icons/fitWindow.svg":f_,"/assets/icons/fullScreen.svg":h_,"/assets/icons/help.svg":p_,"/assets/icons/magnifyingGlass.svg":v_,"/assets/icons/noun-filter.svg":g_,"/assets/icons/openMap.svg":m_,"/assets/icons/pause.svg":y_,"/assets/icons/permalink.svg":b_,"/assets/icons/play.svg":w_,"/assets/icons/resetZoom.svg":C_,"/assets/icons/singlepanel.svg":E_,"/assets/icons/tooltips.svg":x_,"/assets/icons/undock.svg":k_,"/assets/icons/zoomIn.svg":S_,"/assets/icons/zoomOut.svg":__}),LH=Object.keys(yg).map(t=>{const e=T_(yg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return N_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),FH={name:"MapSvgSpriteColor",svgContext:yg,svgSprite:LH.join(`
466
- `)},MH=["innerHTML"];function $H(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,MH)}const VH=j2(FH,[["render",$H]]),qH=(t,e)=>{let r,n,a,i,o,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",u=>{u.preventDefault(),r=e.offsetLeft,n=e.offsetTop,a=u.clientX,i=u.clientY,e.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),o=r-(a-u.clientX),l=n-(i-u.clientY),e.style.left=`${o}px`,e.style.top=`${l}px`}},zH={name:"DrawToolbar",components:{MapSvgIcon:PH,MapSvgSpriteColor:VH},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(r=>{r.name===t?r.active=!0:r.active=!1}),this.toolbarIcons.filter(r=>r.type!=="conn").filter(r=>r.type!==e).map(r=>{t?r.disabled=!0:r.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");qH(this.mapCanvas.containerHTML,t);let e,r;const n=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-a.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},HH={class:"toolbar-container"},KH={class:"toolbar-icons"};function GH(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=Ra,u=IH;return s.openBlock(),s.createElementBlock("div",HH,[s.createVNode(o),s.createElementVNode("div",KH,[i.showEditModeIcon?(s.openBlock(),s.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.createBlock(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.createBlock(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.createBlock(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.createBlock(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.createBlock(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),r.mapCanvas?s.withDirectives((s.openBlock(),s.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:r.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[s.vShow,t.connectionDisplay]]):s.createCommentVNode("",!0)])}const UH=Yt(zH,[["render",GH],["__scopeId","data-v-21e6f6bd"]]),jH={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),r=t.querySelector(".flatmap-popup-popper"),n=((i=r==null?void 0:r.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(n);e.forEach(o=>{const l=o.style.transform;this.extractMarkerPosition(l)===a&&o.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const r=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",r=document.querySelector(`[aria-describedby="${e}"]`);r&&r.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var r;const t=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,r=t.match(e);return r?r[r.length-1].slice(10,-1):""}}},bg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),WH=bg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),YH=bg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),ZH=bg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function XH(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[WH,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[YH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[ZH,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(o,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const JH=Yt(jH,[["render",XH],["__scopeId","data-v-3efb89fb"]]),QH={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},eK={class:"reference-button-container"};function tK(t,e,r,n,a,i){const o=Ht;return s.openBlock(),s.createElementBlock("div",eK,[s.createVNode(o,{class:"reference-icon-button",size:"small",onClick:e[0]||(e[0]=l=>t.$emit("show-related-connectivities",r.resource))},{default:s.withCtx(()=>[s.createTextVNode(" Show related connectivities ")]),_:1})])}const I_=Yt(QH,[["render",tK],["__scopeId","data-v-2f3dd1db"]]),rK="https://citation.doi.org",nK=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-author-date"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],wg="apa",aK=600,iK={name:"ExternalResourceCard",components:{CopyToClipboard:cs,RelatedConnectivitiesButton:I_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:nK,citationType:wg,crosscite_host:rK}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(wg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(wg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t);const e={event:"interaction_event",event_name:"portal_maps_show_related_connectivities",category:t,location:"map_connectivity_references"};this.$emit("trackEvent",e)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),r=t.filter(n=>!e.includes(n));this.pubMedReferences=r.map(n=>typeof n=="object"?this.extractPublicationIdFromURLString(n[0]):this.extractPublicationIdFromURLString(n)),this.pubMedReferences.forEach(n=>{if(n.type==="pmc"){const a=n.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const o=i.esearchresult.idlist||[];n.id=o[0],n.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(n=>{this.openLibReferences=n.filter(a=>a.type==="openlib"),this.isbnDBReferences=n.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],r=this.getPubMedDomains();return t.forEach(n=>{let a=0;r.forEach(i=>{n.includes(i)&&a++}),a||e.push(n)}),e},formatNonPubMedReferences:async function(t){const e=[],r=t.filter(u=>u.indexOf("isbn")!==-1),n=r.map(u=>"ISBN:"+u.split("/").pop()),a=n.join(","),i=n.slice(),o=u=>r.find(d=>d.includes(u)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,c=await this.fetchData(l);for(const u in c){const d=i.indexOf(u);i.splice(d,1);const f=c[u].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=u.split(":")[1],y=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:y})}return i.forEach(u=>{const d=u.split(":")[1],f=`https://isbndb.com/book/${d}`,h=o(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(r.id=e.slice(i+a.length),a==="doi.org/"?r.type="doi":a==="pmc/articles/"?r.type="pmc":r.type="pmid")}),r.id===""&&(t.includes("doi:")?(r.id=this.stripPMIDPrefix(t),r.type="doi"):t.includes("PMID:")&&(r.id=this.stripPMIDPrefix(t),r.type="pmid")),r.id.endsWith("/")&&(r.id=r.id.slice(0,-1)),r},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:r,type:n,doi:a}=t;if(!(t.citation&&t.citation[e])&&r)if(t.citation[e]="",t.citation.error=null,n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(o=>{const l=this.replaceLinkInText(o);t.citation[e]=l,this.updateCopyContents()}).catch(o=>{t.citation.error={type:e,ref:"doi"}})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const o=i.result[r],c=((o==null?void 0:o.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)t.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=o,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(r){for(let n=0;n<r.pubMedReferences.length;n++)r.generateCitationText(r.pubMedReferences[n],t),r.pubMedReferences.length>3&&n<r.pubMedReferences.length-1&&await Q9(aK)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},isCitationLoading:function(t){return t&&!t[this.citationType]&&!t.error},isCitationError:function(t){return t&&t.error&&t.error.type===this.citationType},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(n=>{r.push(n.citation[this.citationType])}),this.openLibReferences.forEach(n=>{r.push(this.formatCopyReference(n))}),this.isbnDBReferences.forEach(n=>{r.push(n.url)}),r.length){const a=`<ul>${r.map(o=>`<li>${o}</li>`).join(`
466
+ </svg>`,B_=(t,e,r,n)=>{const a=["title","desc","defs","style"],i=["width","height"],o=n||[];let l=document.createElement("div");l.innerHTML=t,a.map(c=>{const d=l.querySelector(c);d&&d.remove()}),i.map(c=>{l.querySelector("svg").removeAttribute(c)}),n&&o.map(c=>{Object.values(l.querySelectorAll(`[${c}]`)).map(d=>{d.removeAttribute(c)})});const u=l.innerHTML;return l=null,u},D_=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,r)=>"".replace.apply(e,r),t).trim(),pK=!0,vK=!0,gK=["fill"],bg=Object.assign({"/assets/icons/2horpanel.svg":X2,"/assets/icons/2vertpanel.svg":J2,"/assets/icons/3panel.svg":Q2,"/assets/icons/4panel.svg":e_,"/assets/icons/5panel.svg":t_,"/assets/icons/6panel.svg":r_,"/assets/icons/6panelVertical.svg":n_,"/assets/icons/changeBckgd.svg":a_,"/assets/icons/close-no-bk.svg":i_,"/assets/icons/close.svg":o_,"/assets/icons/closeFullScreen.svg":s_,"/assets/icons/comment.svg":l_,"/assets/icons/connection.svg":c_,"/assets/icons/dock.svg":u_,"/assets/icons/drawLine.svg":d_,"/assets/icons/drawPoint.svg":f_,"/assets/icons/drawPolygon.svg":h_,"/assets/icons/drawTrash.svg":p_,"/assets/icons/fitWindow.svg":v_,"/assets/icons/fullScreen.svg":g_,"/assets/icons/help.svg":m_,"/assets/icons/magnifyingGlass.svg":y_,"/assets/icons/noun-filter.svg":b_,"/assets/icons/openMap.svg":w_,"/assets/icons/pause.svg":C_,"/assets/icons/permalink.svg":E_,"/assets/icons/play.svg":x_,"/assets/icons/resetZoom.svg":k_,"/assets/icons/singlepanel.svg":S_,"/assets/icons/tooltips.svg":__,"/assets/icons/undock.svg":T_,"/assets/icons/zoomIn.svg":N_,"/assets/icons/zoomOut.svg":I_});Object.keys(bg).map(t=>{const e=B_(bg[t],pK,vK,gK),r=t.replace(/^.+\/(\w+).svg$/,"$1");return D_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
467
+ `);const wg=Object.assign({"/assets/icons/2horpanel.svg":X2,"/assets/icons/2vertpanel.svg":J2,"/assets/icons/3panel.svg":Q2,"/assets/icons/4panel.svg":e_,"/assets/icons/5panel.svg":t_,"/assets/icons/6panel.svg":r_,"/assets/icons/6panelVertical.svg":n_,"/assets/icons/changeBckgd.svg":a_,"/assets/icons/close-no-bk.svg":i_,"/assets/icons/close.svg":o_,"/assets/icons/closeFullScreen.svg":s_,"/assets/icons/comment.svg":l_,"/assets/icons/connection.svg":c_,"/assets/icons/dock.svg":u_,"/assets/icons/drawLine.svg":d_,"/assets/icons/drawPoint.svg":f_,"/assets/icons/drawPolygon.svg":h_,"/assets/icons/drawTrash.svg":p_,"/assets/icons/fitWindow.svg":v_,"/assets/icons/fullScreen.svg":g_,"/assets/icons/help.svg":m_,"/assets/icons/magnifyingGlass.svg":y_,"/assets/icons/noun-filter.svg":b_,"/assets/icons/openMap.svg":w_,"/assets/icons/pause.svg":C_,"/assets/icons/permalink.svg":E_,"/assets/icons/play.svg":x_,"/assets/icons/resetZoom.svg":k_,"/assets/icons/singlepanel.svg":S_,"/assets/icons/tooltips.svg":__,"/assets/icons/undock.svg":T_,"/assets/icons/zoomIn.svg":N_,"/assets/icons/zoomOut.svg":I_}),mK=Object.keys(wg).map(t=>{const e=B_(wg[t]),r=t.replace(/^.+\/(\w+).svg$/,"$1");return D_(e).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),yK={name:"MapSvgSpriteColor",svgContext:wg,svgSprite:mK.join(`
468
+ `)},bK=["innerHTML"];function wK(t,e,r,n,a,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,bK)}const CK=Z2(yK,[["render",wK]]),EK=(t,e)=>{let r,n,a,i,o,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",c=>{c.preventDefault(),r=e.offsetLeft,n=e.offsetTop,a=c.clientX,i=c.clientY,e.addEventListener("mousemove",u,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",u,!1)},!1)},!1);function u(c){c.preventDefault(),o=r-(a-c.clientX),l=n-(i-c.clientY),e.style.left=`${o}px`,e.style.top=`${l}px`}},xK={name:"DrawToolbar",components:{MapSvgIcon:hK,MapSvgSpriteColor:CK},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(r=>{r.name===t?r.active=!0:r.active=!1}),this.toolbarIcons.filter(r=>r.type!=="conn").filter(r=>r.type!==e).map(r=>{t?r.disabled=!0:r.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");EK(this.mapCanvas.containerHTML,t);let e,r;const n=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-a.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},kK={class:"toolbar-container"},SK={class:"toolbar-icons"};function _K(t,e,r,n,a,i){const o=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),u=mn,c=uK;return s.openBlock(),s.createElementBlock("div",kK,[s.createVNode(o),s.createElementVNode("div",SK,[i.showEditModeIcon?(s.openBlock(),s.createBlock(u,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.createBlock(u,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.createBlock(u,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.createBlock(u,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.createBlock(u,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.createBlock(u,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:r.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),r.mapCanvas?s.withDirectives((s.openBlock(),s.createBlock(c,{key:0,class:"connection-dialog",connectionEntry:r.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[s.vShow,t.connectionDisplay]]):s.createCommentVNode("",!0)])}const TK=qt(xK,[["render",_K],["__scopeId","data-v-21e6f6bd"]]),NK={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),r=t.querySelector(".flatmap-popup-popper"),n=((i=r==null?void 0:r.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(n);e.forEach(o=>{const l=o.style.transform;this.extractMarkerPosition(l)===a&&o.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const r=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",r=document.querySelector(`[aria-describedby="${e}"]`);r&&r.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var r;const t=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,r=t.match(e);return r?r[r.length-1].slice(10,-1):""}}},Cg=t=>(s.pushScopeId("data-v-3efb89fb"),t=t(),s.popScopeId(),t),IK=Cg(()=>s.createElementVNode("h4",null,"Help Mode",-1)),BK=Cg(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),DK=Cg(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function AK(t,e,r,n,a,i){const o=Bt;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[IK,r.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[BK,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[DK,s.createElementVNode("div",null,[s.createVNode(o,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(o,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const OK=qt(NK,[["render",AK],["__scopeId","data-v-3efb89fb"]]),PK={name:"RelatedConnectivitiesButton",props:{resource:{type:String,required:!0}}},RK={class:"reference-button-container"};function LK(t,e,r,n,a,i){const o=Bt;return s.openBlock(),s.createElementBlock("div",RK,[s.createVNode(o,{class:"reference-icon-button",size:"small",onClick:e[0]||(e[0]=l=>t.$emit("show-related-connectivities",r.resource))},{default:s.withCtx(()=>[s.createTextVNode(" Show related connectivities ")]),_:1})])}const A_=qt(PK,[["render",LK],["__scopeId","data-v-2f3dd1db"]]),MK="https://citation.doi.org",FK=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-author-date"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Eg="apa",$K=600,VK={name:"ExternalResourceCard",components:{CopyToClipboard:fs,RelatedConnectivitiesButton:A_},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:FK,citationType:Eg,crosscite_host:MK}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(Eg)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Eg)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t);const e={event:"interaction_event",event_name:"portal_maps_show_related_connectivities",category:t,location:"map_connectivity_references"};this.$emit("trackEvent",e)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),r=t.filter(n=>!e.includes(n));this.pubMedReferences=r.map(n=>typeof n=="object"?this.extractPublicationIdFromURLString(n[0]):this.extractPublicationIdFromURLString(n)),this.pubMedReferences.forEach(n=>{if(n.type==="pmc"){const a=n.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const o=i.esearchresult.idlist||[];n.id=o[0],n.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(n=>{this.openLibReferences=n.filter(a=>a.type==="openlib"),this.isbnDBReferences=n.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],r=this.getPubMedDomains();return t.forEach(n=>{let a=0;r.forEach(i=>{n.includes(i)&&a++}),a||e.push(n)}),e},formatNonPubMedReferences:async function(t){const e=[],r=t.filter(c=>c.indexOf("isbn")!==-1),n=r.map(c=>"ISBN:"+c.split("/").pop()),a=n.join(","),i=n.slice(),o=c=>r.find(d=>d.includes(c)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,u=await this.fetchData(l);for(const c in u){const d=i.indexOf(c);i.splice(d,1);const f=u[c].info_url,h=f.split("/"),v=h.indexOf("books"),p=h[v+1],g=c.split(":")[1],y=o(g);e.push({id:g,type:"openlib",url:f,bookId:p,resource:y})}return i.forEach(c=>{const d=c.split(":")[1],f=`https://isbndb.com/book/${d}`,h=o(d);e.push({id:d,url:f,type:"isbndb",resource:h})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(r.id=e.slice(i+a.length),a==="doi.org/"?r.type="doi":a==="pmc/articles/"?r.type="pmc":r.type="pmid")}),r.id===""&&(t.includes("doi:")?(r.id=this.stripPMIDPrefix(t),r.type="doi"):t.includes("PMID:")&&(r.id=this.stripPMIDPrefix(t),r.type="pmid")),r.id.endsWith("/")&&(r.id=r.id.slice(0,-1)),r},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:r,type:n,doi:a}=t;if(!(t.citation&&t.citation[e])&&r)if(t.citation[e]="",t.citation.error=null,n==="doi"||a){const i=n==="doi"?r:a;this.getCitationTextByDOI(i).then(o=>{const l=this.replaceLinkInText(o);t.citation[e]=l,this.updateCopyContents()}).catch(o=>{t.citation.error={type:e,ref:"doi"}})}else n==="pmid"&&this.getDOIFromPubMedID(r).then(i=>{if(i!=null&&i.result){const o=i.result[r],u=((o==null?void 0:o.articleids)||[]).find(d=>d.idtype==="doi"),c=u==null?void 0:u.value;if(c)t.doi=c,this.getCitationTextByDOI(c).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:h}=o,v=h?h.map(g=>g.name):[],p=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${r}`});t.citation[e]=p,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(r){for(let n=0;n<r.pubMedReferences.length;n++)r.generateCitationText(r.pubMedReferences[n],t),r.pubMedReferences.length>3&&n<r.pubMedReferences.length-1&&await rH($K)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},isCitationLoading:function(t){return t&&!t[this.citationType]&&!t.error},isCitationError:function(t){return t&&t.error&&t.error.type===this.citationType},updateCopyContents:function(){const t=this.citationOptions.find(n=>n.value===this.citationType);let e="";const r=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(n=>{r.push(n.citation[this.citationType])}),this.openLibReferences.forEach(n=>{r.push(this.formatCopyReference(n))}),this.isbnDBReferences.forEach(n=>{r.push(n.url)}),r.length){const a=`<ul>${r.map(o=>`<li>${o}</li>`).join(`
467
469
  `)}</ul>`,i="<div><strong>References</strong></div>";this.referecesListContent=i+`
468
- `+a}this.$emit("references-loaded",{style:e,list:r})},replaceLinkInText:function(t){const e="https://";let r=t.split(e)[1];if(r){r=r.split(" ")[0],r=r.trim(),r.endsWith(".")&&(r=r.substring(0,r.length-1));const n=e+r,a=`<a href="${n}" target="_blank">${n}</a>`;return t.replace(n,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(o=>{this.getBookAuthor(o.key).then(l=>{const{name:c}=l;c&&(t.authors.push(c),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:r,date:n,authors:a,url:i}=t;return r&&e.push(r),n&&e.push(`(${n})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const r=await fetch(t);if(!r.ok)throw new Error(`Response status: ${r.status}`);return e==="text"?await r.text():await r.json()}catch(r){throw new Error(r)}},onCopied:function(t,e){let r="Reference List",n="",a=this.citationType;e?(r=e.resource,n=e.type==="doi"?e.id:""):r=[...this.pubMedReferences,...this.openLibReferences,...this.isbnDBReferences].map(c=>c.type==="doi"?c.id:c.resource).join(", ");const i={event:"interaction_event",event_name:"portal_maps_copy_citation",category:r,doi:n,citation_type:a,location:"map_connectivity_references"};this.$emit("trackEvent",i)}}},va=t=>(s.pushScopeId("data-v-e4259096"),t=t(),s.popScopeId(),t),oK={class:"resource-container"},sK={class:"attribute-title-container"},lK=va(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),uK={class:"copy-button"},cK={key:0,class:"citation-tabs"},dK={class:"citation-list"},fK=va(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),hK=va(()=>s.createElementVNode("br",null,null,-1)),pK=va(()=>s.createElementVNode("br",null,null,-1)),vK=["href"],gK=va(()=>s.createElementVNode("br",null,null,-1)),mK=va(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),yK=va(()=>s.createElementVNode("br",null,null,-1)),bK=["onClick"],wK=["innerHTML"],CK=["innerHTML"],EK=["href"];function xK(t,e,r,n,a,i){const o=cs,l=Ht,c=I_;return s.openBlock(),s.createElementBlock("div",oK,[s.createElementVNode("div",sK,[lK,s.createElementVNode("div",uK,[s.createVNode(o,{onCopied:e[0]||(e[0]=u=>i.onCopied(u,"")),label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",cK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.citationOptions,u=>(s.openBlock(),s.createBlock(l,{link:"",key:u.value,type:t.citationType===u.value?"primary":"",onClick:d=>i.onCitationFormatChange(u.value)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(u.label),1)]),_:2},1032,["type","onClick"]))),128))])):s.createCommentVNode("",!0),s.createElementVNode("ul",dK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.pubMedReferences,u=>{var d,f,h,v;return s.openBlock(),s.createElementBlock("li",{key:u.id,class:s.normalizeClass({loading:i.isCitationLoading(u.citation),error:i.isCitationError(u.citation)})},[u.citation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[((d=u.citation.error)==null?void 0:d.ref)==="doi"&&((f=u.citation.error)==null?void 0:f.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[fK,hK,s.createTextVNode(" Sorry, something went wrong."),pK,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,vK),s.createTextVNode(") encountered an internal error and was unable to complete your request."),gK,s.createTextVNode(" Please come back later. ")],64)):((h=u.citation.error)==null?void 0:h.ref)==="pubmed"&&((v=u.citation.error)==null?void 0:v.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[mK,yK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(u)},"Reload",8,bK)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:u.citation[t.citationType]},null,8,wK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:p=>i.onCopied(p,u),content:u.citation[t.citationType]},null,8,["onCopied","content"])],64))],64)):s.createCommentVNode("",!0)],2)}),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.openLibReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("div",{innerHTML:i.formatCopyReference(u)},null,8,CK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:i.formatCopyReference(u)},null,8,["onCopied","content"])]))),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.isbnDBReferences,u=>(s.openBlock(),s.createElementBlock("li",{key:u.id},[s.createElementVNode("a",{href:u.url,target:"_blank"},s.toDisplayString(u.url),9,EK),s.createVNode(c,{resource:u.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,u),content:u.url},null,8,["onCopied","content"])]))),128))])])}const Cg=Yt(iK,[["render",xK],["__scopeId","data-v-e4259096"]]);function kK(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(a){a(r)}),(n=t.get("*"))&&n.slice().map(function(a){a(e,r)})}}}const B_=new kK,SK={name:"ProvenancePopup",components:{ElIconArrowUp:Ne.ArrowUp,ElIconArrowDown:Ne.ArrowDown,ElIconWarning:Ne.Warning,ConnectivityList:vg,ExternalResourceCard:Cg},props:{tooltipEntry:{type:Array,default:[]}},data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},entryIndex:0,availableAnatomyFacets:[],connectivityError:{}}},computed:{entry:function(){return this.tooltipEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.tooltipEntry[this.entryIndex-1])==null?void 0:t.title},nextLabel:function(){var t;return this.entryIndex===this.tooltipEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.tooltipEntry[this.entryIndex+1])==null?void 0:t.title},provSpeciesDescription:function(){let t="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]}},watch:{tooltipEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0)}}},mounted:function(){this.loadAvailableAnatomyFacets()},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.tooltipEntry.length-1&&(this.entryIndex=this.entryIndex+1)},titleCase:function(t){return J9(t)},capitalise:function(t){return U2(t)},onConnectivityActionClick:function(t){B_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},_K=t=>(s.pushScopeId("data-v-dc8d1ad3"),t=t(),s.popScopeId(),t),TK={key:0,class:"main"},NK={key:0,class:"toggle-button"},IK={key:1,class:"block"},BK={class:"title"},DK={key:0,class:"subtitle"},PK={key:2,class:"block"},OK={class:"title"},AK={key:3,class:"attribute-title-container"},RK=_K(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),LK={style:{"word-break":"keep-all"}},FK={class:"content-container scrollbar"};function MK(t,e,r,n,a,i){const o=Ht,l=Ra,c=Ne.Warning,u=it,d=Ne.ArrowUp,f=Ne.ArrowDown,h=vg,v=Cg,p=Pu;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",TK,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",NK,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.tooltipEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),i.entry.title?(s.openBlock(),s.createElementBlock("div",IK,[s.createElementVNode("div",BK,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",DK,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",PK,[s.createElementVNode("div",OK,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",AK,[RK,s.createVNode(l,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(u,{class:"info"},{default:s.withCtx(()=>[s.createVNode(c)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",LK,s.toDisplayString(i.entry.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=g=>t.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=g=>t.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(u,null,{default:s.withCtx(()=>[s.createVNode(f)]),_:1})],512),[[s.vShow,!t.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",FK,[(s.openBlock(),s.createBlock(h,{key:i.entry.featureId[0],entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,connectivityError:t.connectivityError,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityActionClick"])),i.resources.length?(s.openBlock(),s.createBlock(v,{key:0,resources:i.resources},null,8,["resources"])):s.createCommentVNode("",!0)],512),[[s.vShow,t.showDetails]])]),_:1})])),[[p,t.loading]]):s.createCommentVNode("",!0)}const $K=Yt(SK,[["render",MK],["__scopeId","data-v-dc8d1ad3"]]),VK={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){B_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},qK={class:"tooltip-container",id:"tooltip-container"};function zK(t,e,r,n,a,i){const o=x0,l=$K;return s.openBlock(),s.createElementBlock("div",qK,[r.annotationDisplay?(s.openBlock(),s.createBlock(o,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const HK=Yt(VK,[["render",zK],["__scopeId","data-v-d1e37cc2"]]),KK={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const r=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",r):this.$emit("checkChanged",{key:t.key,value:r})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,r){const a=r.target.closest(".el-tree-node__content"),i=a.clientWidth,o=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-o}const u=c>i;this.tooltipVisible=u&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>r.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},GK={class:"selections-container"},UK={class:"title-text"},jK={class:"tree-container",ref:"treeContainer"},WK={class:"tooltip-text"},YK=["onClick","onMouseover","onMouseenter"],ZK=["onClick","onMouseover","onMouseenter"],XK={class:"lastChildInItem"},JK={key:0,class:"node-options"};function QK(t,e,r,n,a,i){const o=Fi,l=Ai,c=is,u=Ra,d=HR,f=UL,h=Pu;return s.openBlock(),s.createElementBlock("div",GK,[r.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",UK,s.toDisplayString(r.title),1)]),_:1}),r.enableFilter?(s.openBlock(),s.createBlock(o,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+r.title},null,8,["modelValue","placeholder"])])]),_:1})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",jK,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[s.createVNode(u,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:s.withCtx(()=>[s.createElementVNode("div",WK,s.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:r.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:s.normalizeClass([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:v,data:p})=>[r.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},s.toDisplayString(v.label),5)],42,YK)):r.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:r.active.includes(p.id),hoverItem:r.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":r.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small",onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",XK,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",JK," (Texture) ")):s.createCommentVNode("",!0)])],42,ZK)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const eG=Yt(KK,[["render",QK],["__scopeId","data-v-e1dbd1e9"]]);async function tG(t,e){try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`API Error: ${r.status} ${r.statusText}`);return await r.json()}catch(r){throw console.error("Request failed:",r),r}}async function nn(t){const{flatmapAPI:e,knowledgeSource:r,queryId:n,parameters:a,orderId:i}=t,o=`${e}competency/query`,l=Array.isArray(a)?[...a]:[];l.push({column:"source_id",value:r});let c;if(typeof n=="number")c=n.toString();else if(typeof n=="string")c=n;else throw new TypeError("queryId must be a string or a number convertible to string.");const u={query_id:c,parameters:l};return i&&(u.order=[i]),tG(o,u)}async function rG(t,e,r){const n=Array.isArray(r)?r:[r],a=n.filter(h=>h.startsWith("ilxtr:")),i=n.filter(h=>!h.startsWith("ilxtr:")),o=[];a.length>0&&o.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:23,parameters:[{column:"path_id",value:a}]})),i.length>0&&o.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:i}]}));const l=await Promise.all(o);let c=[...a];l.forEach(h=>{var p,g;const v=((g=(p=h==null?void 0:h.results)==null?void 0:p.values)==null?void 0:g.map(y=>y[1]))||[];c.push(...v)});const u=[...new Set(c)];let d=[];return u.length&&(d=await xg(t,e,u)),[...new Set([...u,...d])]}async function nG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function aG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function iG(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:2,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}function Eg(t){const e=[];for(const r of t){const n=JSON.parse(r);Array.isArray(n)&&n.length>=2&&Array.isArray(n[1])&&n[1].length===0&&e.push(n[0])}return e}async function xg(t,e,r){var a;const n=await nn({flatmapAPI:t,knowledgeSource:e,queryId:26,parameters:[{column:"path_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[2]);return[...new Set(i)]}return[]}async function oG({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var w,C,x,k;const i=Eg(r),o=Eg(n),l=Eg(a),c=[{column:"source_feature_id",value:i},{column:"via_feature_id",value:l},{column:"dest_feature_id",value:o}],u=[{column:"source_node_id",value:r},{column:"via_node_id",value:a},{column:"dest_node_id",value:n}],d=c.some(E=>Array.isArray(E.value)&&E.value.length>0),f=[nn({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:u})];d&&f.push(nn({flatmapAPI:t,knowledgeSource:e,queryId:25,parameters:c}));const h=await Promise.all(f);let v=[],p;if(d){const E=h[0];p=h[1],v=((C=(w=E==null?void 0:E.results)==null?void 0:w.values)==null?void 0:C.map(_=>_[1]))||[]}else p=h[0];const g=((k=(x=p==null?void 0:p.results)==null?void 0:x.values)==null?void 0:k.map(E=>E[1]))||[],y=[...new Set([...v,...g])];let m=[];return y.length&&(m=await xg(t,e,y)),[...new Set([...y,...m])]}const kg=[];async function sG(t,e){const r=e.filter(i=>kg.some(o=>o.taxon===i)),n=kg.filter(i=>r.includes(i.taxon)),a=e.filter(i=>!r.includes(i));if(a.length){const i=await t.queryLabels(a);if(i.length)return i.forEach(o=>{let{entity:l,label:c}=o;c==="Mammalia"&&(c="Mammalia not otherwise specified");const u={taxon:l,label:c};n.push(u),kg.push(u)}),n}else return n}async function lG(t,e,r){const n=`${t}knowledge/query/`,a={sql:e,params:r};try{const i=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Cannot access ${n}`);return await i.json()}catch{return{values:[]}}}async function D_(t,e){return e.length?await(await lG(t,`select entity, knowledge from knowledge
470
+ `+a}this.$emit("references-loaded",{style:e,list:r})},replaceLinkInText:function(t){const e="https://";let r=t.split(e)[1];if(r){r=r.split(" ")[0],r=r.trim(),r.endsWith(".")&&(r=r.substring(0,r.length-1));const n=e+r,a=`<a href="${n}" target="_blank">${n}</a>`;return t.replace(n,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(r=>{const{title:n,authors:a,publish_date:i}=r;n&&(t.title=n),i&&(t.date=i),a&&(t.authors=[],a.forEach(o=>{this.getBookAuthor(o.key).then(l=>{const{name:u}=l;u&&(t.authors.push(u),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:r,date:n,authors:a,url:i}=t;return r&&e.push(r),n&&e.push(`(${n})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const r=await fetch(t);if(!r.ok)throw new Error(`Response status: ${r.status}`);return e==="text"?await r.text():await r.json()}catch(r){throw new Error(r)}},onCopied:function(t,e){let r="Reference List",n="",a=this.citationType;e?(r=e.resource,n=e.type==="doi"?e.id:""):r=[...this.pubMedReferences,...this.openLibReferences,...this.isbnDBReferences].map(u=>u.type==="doi"?u.id:u.resource).join(", ");const i={event:"interaction_event",event_name:"portal_maps_copy_citation",category:r,doi:n,citation_type:a,location:"map_connectivity_references"};this.$emit("trackEvent",i)}}},ga=t=>(s.pushScopeId("data-v-e4259096"),t=t(),s.popScopeId(),t),qK={class:"resource-container"},zK={class:"attribute-title-container"},HK=ga(()=>s.createElementVNode("div",{class:"attribute-title"},"References",-1)),KK={class:"copy-button"},GK={key:0,class:"citation-tabs"},UK={class:"citation-list"},WK=ga(()=>s.createElementVNode("span",null,"Internal Server Error",-1)),jK=ga(()=>s.createElementVNode("br",null,null,-1)),YK=ga(()=>s.createElementVNode("br",null,null,-1)),ZK=["href"],XK=ga(()=>s.createElementVNode("br",null,null,-1)),JK=ga(()=>s.createElementVNode("span",null,"Sorry, something went wrong.",-1)),QK=ga(()=>s.createElementVNode("br",null,null,-1)),eG=["onClick"],tG=["innerHTML"],rG=["innerHTML"],nG=["href"];function aG(t,e,r,n,a,i){const o=fs,l=Bt,u=A_;return s.openBlock(),s.createElementBlock("div",qK,[s.createElementVNode("div",zK,[HK,s.createElementVNode("div",KK,[s.createVNode(o,{onCopied:e[0]||(e[0]=c=>i.onCopied(c,"")),label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(s.openBlock(),s.createElementBlock("div",GK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.citationOptions,c=>(s.openBlock(),s.createBlock(l,{link:"",key:c.value,type:t.citationType===c.value?"primary":"",onClick:d=>i.onCitationFormatChange(c.value)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(c.label),1)]),_:2},1032,["type","onClick"]))),128))])):s.createCommentVNode("",!0),s.createElementVNode("ul",UK,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.pubMedReferences,c=>{var d,f,h,v;return s.openBlock(),s.createElementBlock("li",{key:c.id,class:s.normalizeClass({loading:i.isCitationLoading(c.citation),error:i.isCitationError(c.citation)})},[c.citation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[((d=c.citation.error)==null?void 0:d.ref)==="doi"&&((f=c.citation.error)==null?void 0:f.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[WK,jK,s.createTextVNode(" Sorry, something went wrong."),YK,s.createTextVNode(" The dataset citation generator ("),s.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},s.toDisplayString(t.crosscite_host),9,ZK),s.createTextVNode(") encountered an internal error and was unable to complete your request."),XK,s.createTextVNode(" Please come back later. ")],64)):((h=c.citation.error)==null?void 0:h.ref)==="pubmed"&&((v=c.citation.error)==null?void 0:v.type)===t.citationType?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[JK,QK,s.createTextVNode(" Please try again. "),s.createElementVNode("span",{class:"reload-button",onClick:p=>i.reloadCitation(c)},"Reload",8,eG)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("span",{innerHTML:c.citation[t.citationType]},null,8,tG),s.createVNode(u,{resource:c.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:p=>i.onCopied(p,c),content:c.citation[t.citationType]},null,8,["onCopied","content"])],64))],64)):s.createCommentVNode("",!0)],2)}),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.openLibReferences,c=>(s.openBlock(),s.createElementBlock("li",{key:c.id},[s.createElementVNode("div",{innerHTML:i.formatCopyReference(c)},null,8,rG),s.createVNode(u,{resource:c.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,c),content:i.formatCopyReference(c)},null,8,["onCopied","content"])]))),128)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.isbnDBReferences,c=>(s.openBlock(),s.createElementBlock("li",{key:c.id},[s.createElementVNode("a",{href:c.url,target:"_blank"},s.toDisplayString(c.url),9,nG),s.createVNode(u,{resource:c.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),s.createVNode(o,{onCopied:d=>i.onCopied(d,c),content:c.url},null,8,["onCopied","content"])]))),128))])])}const xg=qt(VK,[["render",aG],["__scopeId","data-v-e4259096"]]);function iG(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(a){a(r)}),(n=t.get("*"))&&n.slice().map(function(a){a(e,r)})}}}const O_=new iG,oG={name:"ProvenancePopup",components:{ElIconArrowUp:xe.ArrowUp,ElIconArrowDown:xe.ArrowDown,ElIconWarning:xe.Warning,ConnectivityList:mg,ExternalResourceCard:xg},props:{tooltipEntry:{type:Array,default:[]}},data:function(){return{loading:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},entryIndex:0,availableAnatomyFacets:[],connectivityError:{}}},computed:{entry:function(){return this.tooltipEntry[this.entryIndex]},previousLabel:function(){var t;return this.entryIndex===0?"This is the first item. Click 'Next' to see more information.":(t=this.tooltipEntry[this.entryIndex-1])==null?void 0:t.title},nextLabel:function(){var t;return this.entryIndex===this.tooltipEntry.length-1?"This is the last item. Click 'Previous' to see more information.":(t=this.tooltipEntry[this.entryIndex+1])==null?void 0:t.title},provSpeciesDescription:function(){let t="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]}},watch:{tooltipEntry:{deep:!0,immediate:!0,handler:function(t,e){t!==e&&(this.entryIndex=0)}}},mounted:function(){this.loadAvailableAnatomyFacets()},methods:{previous:function(){this.entryIndex!==0&&(this.entryIndex=this.entryIndex-1)},next:function(){this.entryIndex!==this.tooltipEntry.length-1&&(this.entryIndex=this.entryIndex+1)},titleCase:function(t){return tH(t)},capitalise:function(t){return gg(t)},onConnectivityActionClick:function(t){O_.emit("onActionClick",t)},loadAvailableAnatomyFacets:function(){const t=localStorage.getItem("available-anatomy-facets");t&&(this.availableAnatomyFacets=JSON.parse(t))}}},sG=t=>(s.pushScopeId("data-v-dc8d1ad3"),t=t(),s.popScopeId(),t),lG={key:0,class:"main"},cG={key:0,class:"toggle-button"},uG={key:1,class:"block"},dG={class:"title"},fG={key:0,class:"subtitle"},hG={key:2,class:"block"},pG={class:"title"},vG={key:3,class:"attribute-title-container"},gG=sG(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),mG={style:{"word-break":"keep-all"}},yG={class:"content-container scrollbar"};function bG(t,e,r,n,a,i){const o=Bt,l=mn,u=xe.Warning,c=Xe,d=xe.ArrowUp,f=xe.ArrowDown,h=mg,v=xg,p=Oc;return i.entry?s.withDirectives((s.openBlock(),s.createElementBlock("div",lG,[r.tooltipEntry.length>1?(s.openBlock(),s.createElementBlock("div",cG,[s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.previous,disabled:this.entryIndex===0},{default:s.withCtx(()=>[s.createTextVNode(" Previous ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.previousLabel),1)]),_:1}),s.createVNode(l,{width:"auto",trigger:"hover",teleported:!1},{reference:s.withCtx(()=>[s.createVNode(o,{class:"button",onClick:i.next,disabled:this.entryIndex===this.tooltipEntry.length-1},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick","disabled"])]),default:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(i.nextLabel),1)]),_:1})])):s.createCommentVNode("",!0),i.entry.title?(s.openBlock(),s.createElementBlock("div",uG,[s.createElementVNode("div",dG,s.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.provenanceTaxonomyLabel&&i.entry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",fG,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",hG,[s.createElementVNode("div",pG,s.toDisplayString(i.entry.featureId),1)])),i.entry.featuresAlert?(s.openBlock(),s.createElementBlock("div",vG,[gG,s.createVNode(l,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(c,{class:"info"},{default:s.withCtx(()=>[s.createVNode(u)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",mG,s.toDisplayString(i.entry.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=g=>t.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,t.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=g=>t.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(f)]),_:1})],512),[[s.vShow,!t.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",yG,[(s.openBlock(),s.createBlock(h,{key:i.entry.featureId[0],entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:t.availableAnatomyFacets,connectivityError:t.connectivityError,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityActionClick"])),i.resources.length?(s.openBlock(),s.createBlock(v,{key:0,resources:i.resources},null,8,["resources"])):s.createCommentVNode("",!0)],512),[[s.vShow,t.showDetails]])]),_:1})])),[[p,t.loading]]):s.createCommentVNode("",!0)}const wG=qt(oG,[["render",bG],["__scopeId","data-v-dc8d1ad3"]]),CG={name:"Tooltip",props:{tooltipEntry:{type:Array},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Array}},mounted:function(){O_.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},EG={class:"tooltip-container",id:"tooltip-container"};function xG(t,e,r,n,a,i){const o=S0,l=wG;return s.openBlock(),s.createElementBlock("div",EG,[r.annotationDisplay?(s.openBlock(),s.createBlock(o,{key:0,annotationEntry:r.annotationEntry,onAnnotation:e[0]||(e[0]=u=>t.$emit("annotation",u))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:r.tooltipEntry},null,8,["tooltipEntry"]))])}const kG=qt(CG,[["render",xG],["__scopeId","data-v-d1e37cc2"]]),SG={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const r=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",r):this.$emit("checkChanged",{key:t.key,value:r})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,r){const a=r.target.closest(".el-tree-node__content"),i=a.clientWidth,o=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let u=0;if(l){const d=l.getBoundingClientRect();u=d.x+d.width-o}const c=u>i;this.tooltipVisible=c&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>r.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},_G={class:"selections-container"},TG={class:"title-text"},NG={class:"tree-container",ref:"treeContainer"},IG={class:"tooltip-text"},BG=["onClick","onMouseover","onMouseenter"],DG=["onClick","onMouseover","onMouseenter"],AG={class:"lastChildInItem"},OG={key:0,class:"node-options"};function PG(t,e,r,n,a,i){const o=Mi,l=Pi,u=os,c=mn,d=UR,f=YL,h=Oc;return s.openBlock(),s.createElementBlock("div",_G,[r.title?(s.openBlock(),s.createBlock(u,{key:0},{default:s.withCtx(()=>[s.createVNode(o,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",TG,s.toDisplayString(r.title),1)]),_:1}),r.enableFilter?(s.openBlock(),s.createBlock(o,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+r.title},null,8,["modelValue","placeholder"])])]),_:1})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",NG,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[s.createVNode(c,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:s.withCtx(()=>[s.createElementVNode("div",IG,s.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:r.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:s.normalizeClass([r.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:v,data:p})=>[r.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(p),hoverItem:i.nodeIsHover(p)}]),onClick:g=>i.changeActiveByNode(p),onMouseover:g=>i.changeHoverByNode(p,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(p)),class:"lastChildInItem"},s.toDisplayString(v.label),5)],42,BG)):r.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:r.active.includes(p.id),hoverItem:r.hover.includes(p.id)}]),onClick:g=>i.changeActiveByNode(p,!0),onMouseover:g=>i.changeHoverByNode(p,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[p.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":r.showColourPicker}),modelValue:p.activeColour,"onUpdate:modelValue":g=>p.activeColour=g,size:"small",onChange:g=>i.setColour(p,g)},null,8,["class","modelValue","onUpdate:modelValue","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",AG,[s.createElementVNode("span",null,s.toDisplayString(v.label),1),p.isTextureSlides?(s.openBlock(),s.createElementBlock("span",OG," (Texture) ")):s.createCommentVNode("",!0)])],42,DG)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[h,!r.isReady]])],512)])}const RG=qt(SG,[["render",PG],["__scopeId","data-v-e1dbd1e9"]]);async function LG(t,e){try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`API Error: ${r.status} ${r.statusText}`);return await r.json()}catch(r){throw console.error("Request failed:",r),r}}async function MG(t,e,r){var a;const n=await Lr({flatmapAPI:t,knowledgeSource:e,queryId:27,parameters:[{column:"path_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>({sckanId:o[0],mapUUID:o[4],pathId:o[1],sckanNodeId:o[2]?JSON.parse(o[2]):[],sckanNodeLabel:o[3]||"",mapNodeId:o[5]?JSON.parse(o[5]):[],mapNodeLabel:o[6]||""}));return nH(i)}return[]}async function Lr(t){const{flatmapAPI:e,knowledgeSource:r,queryId:n,parameters:a,orderId:i}=t,o=`${e}competency/query`,l=Array.isArray(a)?[...a]:[];l.push({column:"source_id",value:r});let u;if(typeof n=="number")u=n.toString();else if(typeof n=="string")u=n;else throw new TypeError("queryId must be a string or a number convertible to string.");const c={query_id:u,parameters:l};return i&&(c.order=[i]),LG(o,c)}async function FG(t,e,r){const n=Array.isArray(r)?r:[r],a=n.filter(h=>h.startsWith("ilxtr:")),i=n.filter(h=>!h.startsWith("ilxtr:")),o=[];a.length>0&&o.push(Lr({flatmapAPI:t,knowledgeSource:e,queryId:23,parameters:[{column:"path_id",value:a}]})),i.length>0&&o.push(Lr({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:i}]}));const l=await Promise.all(o);let u=[...a];l.forEach(h=>{var p,g;const v=((g=(p=h==null?void 0:h.results)==null?void 0:p.values)==null?void 0:g.map(y=>y[1]))||[];u.push(...v)});const c=[...new Set(u)];let d=[];return c.length&&(d=await Sg(t,e,c)),[...new Set([...c,...d])]}async function $G(t,e,r){var a;const n=await Lr({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function VG(t,e,r){var a;const n=await Lr({flatmapAPI:t,knowledgeSource:e,queryId:1,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}async function qG(t,e,r){var a;const n=await Lr({flatmapAPI:t,knowledgeSource:e,queryId:2,parameters:[{column:"feature_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[1]);return[...new Set(i)]}return[]}function kg(t){const e=[];for(const r of t){const n=JSON.parse(r);Array.isArray(n)&&n.length>=2&&Array.isArray(n[1])&&n[1].length===0&&e.push(n[0])}return e}async function Sg(t,e,r){var a;const n=await Lr({flatmapAPI:t,knowledgeSource:e,queryId:26,parameters:[{column:"path_id",value:r}]});if((a=n==null?void 0:n.results)!=null&&a.values){const i=n.results.values.map(o=>o[2]);return[...new Set(i)]}return[]}async function zG({flatmapAPI:t,knowledgeSource:e,origins:r,destinations:n,vias:a}){var w,C,x,k;const i=kg(r),o=kg(n),l=kg(a),u=[{column:"source_feature_id",value:i},{column:"via_feature_id",value:l},{column:"dest_feature_id",value:o}],c=[{column:"source_node_id",value:r},{column:"via_node_id",value:a},{column:"dest_node_id",value:n}],d=u.some(E=>Array.isArray(E.value)&&E.value.length>0),f=[Lr({flatmapAPI:t,knowledgeSource:e,queryId:24,parameters:c})];d&&f.push(Lr({flatmapAPI:t,knowledgeSource:e,queryId:25,parameters:u}));const h=await Promise.all(f);let v=[],p;if(d){const E=h[0];p=h[1],v=((C=(w=E==null?void 0:E.results)==null?void 0:w.values)==null?void 0:C.map(_=>_[1]))||[]}else p=h[0];const g=((k=(x=p==null?void 0:p.results)==null?void 0:x.values)==null?void 0:k.map(E=>E[1]))||[],y=[...new Set([...v,...g])];let m=[];return y.length&&(m=await Sg(t,e,y)),[...new Set([...y,...m])]}const _g=[];async function HG(t,e){const r=e.filter(i=>_g.some(o=>o.taxon===i)),n=_g.filter(i=>r.includes(i.taxon)),a=e.filter(i=>!r.includes(i));if(a.length){const i=await t.queryLabels(a);if(i.length)return i.forEach(o=>{let{entity:l,label:u}=o;u==="Mammalia"&&(u="Mammalia not otherwise specified");const c={taxon:l,label:u};n.push(c),_g.push(c)}),n}else return n}async function KG(t,e,r){const n=`${t}knowledge/query/`,a={sql:e,params:r};try{const i=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Cannot access ${n}`);return await i.json()}catch{return{values:[]}}}async function P_(t,e){return e.length?await(await KG(t,`select entity, knowledge from knowledge
469
471
  where entity in (?${", ?".repeat(e.length-1)})
470
- order by source desc`,[...e])).values:[]}function uG(t){var r;const e=(r=t["node-phenotypes"])==null?void 0:r["ilxtr:hasSomaLocatedIn"];return Array.isArray(t.connectivity)&&t.connectivity.length>0&&Array.isArray(e)&&e.length>0}function cG(t){var a,i;const e=(a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"],r=(i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"],n=Array.isArray(e)&&e.length>0||Array.isArray(r)&&r.length>0;return Array.isArray(t.connectivity)&&t.connectivity.length>0&&n}function dG(t){var n,a,i;if(!Array.isArray(t.connectivity)||t.connectivity.length===0)return!1;const e=new Set((((n=t["node-phenotypes"])==null?void 0:n["ilxtr:hasSomaLocatedIn"])||[]).map(o=>o[0])),r=new Set([...(((a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"])||[]).map(o=>o[0]),...(((i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"])||[]).map(o=>o[0])]);return t.connectivity.some(o=>{const[l,c]=o,u=l[0],d=c[0];return!e.has(u)&&!r.has(d)})}function Sg(t){if(!Array.isArray(t.connectivity))return[];const e=new Set;return t.connectivity.forEach(r=>{Array.isArray(r)&&r.length&&r.forEach(n=>{if(Array.isArray(n)&&typeof n[0]=="string"){const a=JSON.stringify(n);e.add(a)}})}),Array.from(e)}function Lr(t,e){var n;const r=(n=t["node-phenotypes"])==null?void 0:n[e];return Array.isArray(r)?r:[]}async function _g(t,e,r){const n=Array.from(new Map(r.map(f=>[JSON.stringify(f),f])).values()),a=n.flat(1/0),i=[...new Set(a)],l=(await D_(t,i)).reduce((f,h)=>{const v=h[0],p=JSON.parse(h[1]);return f.push({id:v,label:p.label,source:p.source}),f},[]);l.sort((f,h)=>f.id===h.id?f.source===e&&h.source!==e?-1:f.source!==e&&h.source===e?1:0:f.id.localeCompare(h.id));const c=[];return[...n.map(f=>{const h=f.flat(),v=[];for(let p=0;p<h.length;p++){const g=l.find(y=>y.id===h[p]);g&&(v.push(g.label),p>0&&c.push({key:[h[p],[]],label:g.label}))}return{key:f,label:v.join(", ")}}),...c].filter((f,h,v)=>h===v.findIndex(p=>p.label===f.label))}async function P_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));Lr(a,"ilxtr:hasSomaLocatedIn").forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}async function O_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));[...Lr(a,"ilxtr:hasAxonPresynapticElementIn"),...Lr(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}async function A_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Sg(a));[...Lr(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(a,"ilxtr:hasAxonLocatedIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await _g(t,e,n)}function R_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:Lr(r,"ilxtr:hasSomaLocatedIn").some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function L_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonPresynapticElementIn"),...Lr(r,"ilxtr:hasAxonSensorySubcellularElementIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function F_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Lr(r,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Lr(r,"ilxtr:hasAxonLocatedIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}async function fG({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=R_(a,e)),r.length&&(a=L_(a,r)),n.length&&(a=F_(a,n)),a}async function hG(t,e,r,n){let a=[];const i=[];if(e){if(e&&typeof e.featureFilterRanges=="function"){const v=e.featureFilterRanges();for(const[p,g]of Object.entries(v)){let y={key:`flatmap.connectivity.${p}`,label:"",children:[]},m=[];if(p==="kind"){y.label="Pathways";for(const b of g){const w=n.find(C=>C.type===b);w&&m.push({key:`${y.key}.${b}`,label:w.label,colour:w.colour,colourStyle:"line",dashed:w.dashed})}}else if(p==="taxons"){y.label="Studied in";const b=await sG(e,e.taxonIdentifiers);if(b.length)for(const w of g){const C=b.find(x=>x.taxon===w);C&&m.push({key:`${y.key}.${w}`,label:`${C.label} `})}}else if(p==="alert"){y.label="Alert";for(const b of["with","without"])m.push({key:`${y.key}.${b}`,label:`${b} alerts`})}y.children=m.sort((b,w)=>b.label.localeCompare(w.label)),y.label&&y.children.length&&a.push(y)}}const o=e.pathways.paths,l=[];for(const v of r){const p=v.id;if(p){const g=o[p];if(g&&g.connectivity&&g["node-phenotypes"]){const y=g.connectivity,m=g["node-phenotypes"],b={};for(let w in v["node-phenotypes"])m[w]&&(b[w]=[...m[w]]);l.push({...v,connectivity:[...y],"node-phenotypes":b})}}}const c=e.knowledgeSource,u=await P_(t,c,l),d=await A_(t,c,l),f=await O_(t,c,l),h=(v,p)=>{const g=JSON.stringify(p.key);return{key:`flatmap.connectivity.source.${v}.${g}`,label:p.label||g}};for(const v of["origin","via","destination","all"]){let p=[];if(v==="origin")p=u.map(g=>h(v,g));else if(v==="via")p=d.map(g=>h(v,g));else if(v==="destination")p=f.map(g=>h(v,g));else{const g=[...u.map(m=>h(v,m)),...d.map(m=>h(v,m)),...f.map(m=>h(v,m))],y=new Set;p=g.filter(m=>y.has(m.key)?!1:(y.add(m.key),!0))}p=p.sort((g,y)=>{const m=C=>/^[a-zA-Z]/.test(C),b=m(g.label),w=m(y.label);return b&&!w?-1:!b&&w?1:g.label.localeCompare(y.label)}),p.length&&i.push({key:`flatmap.connectivity.source.${v}`,label:v,children:p})}i.length&&a.push(...i)}return a}Te.AnnotationPopup=x0,Te.ConnectivityGraph=X9,Te.ConnectivityList=vg,Te.CopyToClipboard=cs,Te.CreateTooltipContent=NF,Te.DrawToolbar=UH,Te.ExternalResourceCard=Cg,Te.HelpModeDialog=JH,Te.Tooltip=HK,Te.TreeControls=eG,Te.competencyQuery=nn,Te.extractDestinationItems=O_,Te.extractOriginItems=P_,Te.extractViaItems=A_,Te.fetchLabels=D_,Te.filterDestinations=cG,Te.filterOrigins=uG,Te.filterViaLocations=dG,Te.findPathsByDestinationItem=L_,Te.findPathsByOriginItem=R_,Te.findPathsByViaItem=F_,Te.getFlatmapFilterOptions=hG,Te.queryAllConnectedPaths=rG,Te.queryForwardBackwardConnections=xg,Te.queryPathsByDestination=iG,Te.queryPathsByOrigin=nG,Te.queryPathsByRoute=oG,Te.queryPathsByRouteFromKnowledge=fG,Te.queryPathsByViaLocation=aG,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})});
472
+ order by source desc`,[...e])).values:[]}function GG(t){var r;const e=(r=t["node-phenotypes"])==null?void 0:r["ilxtr:hasSomaLocatedIn"];return Array.isArray(t.connectivity)&&t.connectivity.length>0&&Array.isArray(e)&&e.length>0}function UG(t){var a,i;const e=(a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"],r=(i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"],n=Array.isArray(e)&&e.length>0||Array.isArray(r)&&r.length>0;return Array.isArray(t.connectivity)&&t.connectivity.length>0&&n}function WG(t){var n,a,i;if(!Array.isArray(t.connectivity)||t.connectivity.length===0)return!1;const e=new Set((((n=t["node-phenotypes"])==null?void 0:n["ilxtr:hasSomaLocatedIn"])||[]).map(o=>o[0])),r=new Set([...(((a=t["node-phenotypes"])==null?void 0:a["ilxtr:hasAxonPresynapticElementIn"])||[]).map(o=>o[0]),...(((i=t["node-phenotypes"])==null?void 0:i["ilxtr:hasAxonSensorySubcellularElementIn"])||[]).map(o=>o[0])]);return t.connectivity.some(o=>{const[l,u]=o,c=l[0],d=u[0];return!e.has(c)&&!r.has(d)})}function Tg(t){if(!Array.isArray(t.connectivity))return[];const e=new Set;return t.connectivity.forEach(r=>{Array.isArray(r)&&r.length&&r.forEach(n=>{if(Array.isArray(n)&&typeof n[0]=="string"){const a=JSON.stringify(n);e.add(a)}})}),Array.from(e)}function Mr(t,e){var n;const r=(n=t["node-phenotypes"])==null?void 0:n[e];return Array.isArray(r)?r:[]}async function Ng(t,e,r){const n=Array.from(new Map(r.map(f=>[JSON.stringify(f),f])).values()),a=n.flat(1/0),i=[...new Set(a)],l=(await P_(t,i)).reduce((f,h)=>{const v=h[0],p=JSON.parse(h[1]);return f.push({id:v,label:p.label,source:p.source}),f},[]);l.sort((f,h)=>f.id===h.id?f.source===e&&h.source!==e?-1:f.source!==e&&h.source===e?1:0:f.id.localeCompare(h.id));const u=[];return[...n.map(f=>{const h=f.flat(),v=[];for(let p=0;p<h.length;p++){const g=l.find(y=>y.id===h[p]);g&&(v.push(g.label),p>0&&u.push({key:[h[p],[]],label:g.label}))}return{key:f,label:v.join(", ")}}),...u].filter((f,h,v)=>h===v.findIndex(p=>p.label===f.label))}async function R_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Tg(a));Mr(a,"ilxtr:hasSomaLocatedIn").forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Ng(t,e,n)}async function L_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Tg(a));[...Mr(a,"ilxtr:hasAxonPresynapticElementIn"),...Mr(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Ng(t,e,n)}async function M_(t,e,r){const n=[];return r.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(Tg(a));[...Mr(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Mr(a,"ilxtr:hasAxonLocatedIn")].forEach(o=>{const l=JSON.stringify(o);i.has(l)&&n.push(o)})}),await Ng(t,e,n)}function F_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:Mr(r,"ilxtr:hasSomaLocatedIn").some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function $_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Mr(r,"ilxtr:hasAxonPresynapticElementIn"),...Mr(r,"ilxtr:hasAxonSensorySubcellularElementIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}function V_(t,e){return t.filter(r=>!Array.isArray(r.connectivity)||r.connectivity.length===0?!1:[...Mr(r,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Mr(r,"ilxtr:hasAxonLocatedIn")].some(a=>e.map(i=>JSON.stringify(i)).includes(JSON.stringify(a))))}async function jG({knowledge:t,origins:e,destinations:r,vias:n}){let a=t;return e.length&&(a=F_(a,e)),r.length&&(a=$_(a,r)),n.length&&(a=V_(a,n)),a}async function YG(t,e,r,n){let a=[];const i=[];if(e){if(e&&typeof e.featureFilterRanges=="function"){const v=e.featureFilterRanges();for(const[p,g]of Object.entries(v)){let y={key:`flatmap.connectivity.${p}`,label:"",children:[]},m=[];if(p==="kind"){y.label="Pathways";for(const b of g){const w=n.find(C=>C.type===b);w&&m.push({key:`${y.key}.${b}`,label:w.label,colour:w.colour,colourStyle:"line",dashed:w.dashed})}}else if(p==="taxons"){y.label="Studied in";const b=await HG(e,e.taxonIdentifiers);if(b.length)for(const w of g){const C=b.find(x=>x.taxon===w);C&&m.push({key:`${y.key}.${w}`,label:`${C.label} `})}}else if(p==="alert"){y.label="Alert";for(const b of["with","without"])m.push({key:`${y.key}.${b}`,label:`${b} alerts`})}y.children=m.sort((b,w)=>b.label.localeCompare(w.label)),y.label&&y.children.length&&a.push(y)}}const o=e.pathways.paths,l=[];for(const v of r){const p=v.id;if(p){const g=o[p];if(g&&g.connectivity&&g["node-phenotypes"]){const y=g.connectivity,m=g["node-phenotypes"],b={};for(let w in v["node-phenotypes"])m[w]&&(b[w]=[...m[w]]);l.push({...v,connectivity:[...y],"node-phenotypes":b})}}}const u=e.knowledgeSource,c=await R_(t,u,l),d=await M_(t,u,l),f=await L_(t,u,l),h=(v,p)=>{const g=JSON.stringify(p.key);return{key:`flatmap.connectivity.source.${v}.${g}`,label:p.label||g}};for(const v of["origin","via","destination","all"]){let p=[];if(v==="origin")p=c.map(g=>h(v,g));else if(v==="via")p=d.map(g=>h(v,g));else if(v==="destination")p=f.map(g=>h(v,g));else{const g=[...c.map(m=>h(v,m)),...d.map(m=>h(v,m)),...f.map(m=>h(v,m))],y=new Set;p=g.filter(m=>y.has(m.key)?!1:(y.add(m.key),!0))}p=p.sort((g,y)=>{const m=C=>/^[a-zA-Z]/.test(C),b=m(g.label),w=m(y.label);return b&&!w?-1:!b&&w?1:g.label.localeCompare(y.label)}),p.length&&i.push({key:`flatmap.connectivity.source.${v}`,label:v,children:p})}i.length&&a.push(...i)}return a}_e.AnnotationPopup=S0,_e.ConnectivityGraph=eH,_e.ConnectivityList=mg,_e.ConnectivityReconciliationList=tK,_e.CopyToClipboard=fs,_e.CreateTooltipContent=DM,_e.DrawToolbar=TK,_e.ExternalResourceCard=xg,_e.HelpModeDialog=OK,_e.Tooltip=kG,_e.TreeControls=RG,_e.competencyQuery=Lr,_e.extractDestinationItems=L_,_e.extractOriginItems=R_,_e.extractViaItems=M_,_e.fetchLabels=P_,_e.filterDestinations=UG,_e.filterOrigins=GG,_e.filterViaLocations=WG,_e.findPathsByDestinationItem=$_,_e.findPathsByOriginItem=F_,_e.findPathsByViaItem=V_,_e.getFlatmapFilterOptions=YG,_e.queryAllConnectedPaths=FG,_e.queryForwardBackwardConnections=Sg,_e.queryPathsByDestination=qG,_e.queryPathsByOrigin=$G,_e.queryPathsByRoute=zG,_e.queryPathsByRouteFromKnowledge=jG,_e.queryPathsByViaLocation=VG,_e.querySingleConnectivityList=MG,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});